HomeDashboard/.venv/lib/python3.12/site-packages/nicegui/elements/plotly/dist/index.js
2026-01-03 14:54:18 +01:00

78 lines
4.4 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,r={exports:{}};var n,i,a,o=t((e||(e=1,n=r,i="undefined"!=typeof self?self:r.exports,a=()=>{var t=(()=>{var t=Object.create,e=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,h=(t,e)=>()=>(t&&(e=t(t=0)),e),f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),p=(t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})},d=(t,r,i,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let s of a(r))!l.call(t,s)&&s!==i&&e(t,s,{get:()=>r[s],enumerable:!(o=n(r,s))||o.enumerable});return t},m=t=>d(e({},"__esModule",{value:!0}),t),g=f(t=>{t.version="3.1.1"}),y=f((t,e)=>{var r,n;r="Promise",(n="undefined"!=typeof window?window:t)[r]=n[r]||function(){var t,e,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function a(t,n){r.add(t,n),e||(e=i(r.drain))}function o(t){var e,r=typeof t;return null!=t&&("object"==r||"function"==r)&&(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t<this.chain.length;t++)l(this,1===this.state?this.chain[t].success:this.chain[t].failure,this.chain[t]);this.chain.length=0}function l(t,e,r){var n,i;try{!1===e?r.reject(t.msg):(n=!0===e?t.msg:e.call(void 0,t.msg))===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=o(n))?i.call(n,r.resolve,r.reject):r.resolve(n)}catch(t){r.reject(t)}}function u(t){var e,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(e=o(t))?a(function(){var n=new f(r);try{e.call(t,function(){u.apply(n,arguments)},function(){c.apply(n,arguments)})}catch(t){c.call(n,t)}}):(r.msg=t,r.state=1,r.chain.length>0&&a(s,r))}catch(t){c.call(new f(r),t)}}}function c(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&a(s,e))}function h(t,e,r,n){for(var i=0;i<e.length;i++)(function(i){t.resolve(e[i]).then(function(t){r(i,t)},n)})(i)}function f(t){this.def=t,this.triggered=!1}function p(t){this.promise=t,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function d(t){if("function"!=typeof t)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var e=new p(this);this.then=function(t,r){var n={success:"function"!=typeof t||t,failure:"function"==typeof r&&r};return n.promise=new this.constructor(function(t,e){if("function"!=typeof t||"function"!=typeof e)throw TypeError("Not a function");n.resolve=t,n.reject=e}),e.chain.push(n),0!==e.state&&a(s,e),n.promise},this.catch=function(t){return this.then(void 0,t)};try{t.call(void 0,function(t){u.call(e,t)},function(t){c.call(e,t)})}catch(t){c.call(e,t)}}r=function(){var t,r,n;function i(t,e){this.fn=t,this.self=e,this.next=void 0}return{add:function(e,a){n=new i(e,a),r?r.next=n:t=n,r=n,n=void 0},drain:function(){var n=t;for(t=r=e=void 0;n;)n.fn.call(n.self),n=n.next}}}();var m=t({},"constructor",d,!1);return d.prototype=m,t(m,"__NPO__",0,!1),t(d,"resolve",function(t){var e=this;return t&&"object"==typeof t&&1===t.__NPO__?t:new e(function(e,r){if("function"!=typeof e||"function"!=typeof r)throw TypeError("Not a function");e(t)})}),t(d,"reject",function(t){return new this(function(e,r){if("function"!=typeof e||"function"!=typeof r)throw TypeError("Not a function");r(t)})}),t(d,"all",function(t){var e=this;return"[object Array]"!=n.call(t)?e.reject(TypeError("Not an array")):0===t.length?e.resolve([]):new e(function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");var i=t.length,a=Array(i),o=0;h(e,t,function(t,e){a[t]=e,++o===i&&r(a)},n)})}),t(d,"race",function(t){var e=this;return"[object Array]"!=n.call(t)?e.reject(TypeError("Not an array")):new e(function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");h(e,t,function(t,e){r(e)},n)})}),d}(),void 0!==e&&e.exports&&(e.exports=n[r])}),v=f((t,e)=>{(function(){var t={version:"3.8.2"},r=[].slice,n=function(t){return r.call(t)},i=self.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,h=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){h.call(this,t,e+"",r)}}function f(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=f,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)d(r=+t[a])&&(n+=r);else for(;++a<i;)d(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)d(r=p(t[a]))?n+=r:--o;else for(;++a<i;)d(r=p(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)d(n=p(e[o]))&&i.push(n);else for(;++o<a;)d(n=p(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(f),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)d(r=p(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)d(r=p(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e&&Math.sqrt(e)};var g=m(f);function y(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return f(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,y),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}function b(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function w(t){return"\0"===(t+="")[0]?t.slice(1):t}function T(t){return b(t)in this._}function k(t){return(t=b(t))in this._&&delete this._[t]}function A(){var t=[];for(var e in this._)t.push(w(e));return t}function M(){var t=0;for(var e in this._)++t;return t}function S(){for(var t in this._)return!1;return!0}function E(){this._=Object.create(null)}function C(t){return t}function I(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function L(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=P.length;r<n;++r){var i=P[r]+e;if(i in t)return i}}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r===1/0)throw new Error("infinite range");var n,i=[],a=function(t){for(var e=1;t*e%1;)e*=10;return e}(v(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new _;if(t instanceof _)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r},x(_,{has:T,get:function(t){return this._[b(t)]},set:function(t,e){return this._[b(t)]=e},remove:k,keys:A,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:w(e),value:this._[e]});return t},size:M,empty:S,forEach:function(t){for(var e in this._)t.call(this,w(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,u,c,h,f=-1,p=a.length,d=i[s++],m=new _;++f<p;)(h=m.get(l=d(u=a[f])))?h.push(u):m.set(l,[u]);return t?(u=t(),c=function(e,r){u.set(e,o(t,r,s))}):(u={},c=function(e,r){u[e]=o(t,r,s)}),m.forEach(c),u}function s(t,e){if(e>=i.length)return t;var r=[],n=a[e++];return t.forEach(function(t,n){r.push({key:t,values:s(n,e)})}),n?r.sort(function(t,e){return n(t.key,e.key)}):r}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return s(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new E;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},x(E,{has:T,add:function(t){return this._[b(t+="")]=!0,t},remove:k,values:A,size:M,empty:S,forEach:function(t){for(var e in this._)t.call(this,w(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=I(t,e,e[r]);return t};var P=["webkit","ms","moz","Moz","o","O"];function z(){}function O(){}function D(t){var e=[],r=new _;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function R(){t.event.preventDefault()}function F(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new O,n=0,i=arguments.length;++n<i;)r[arguments[n]]=D(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new O,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=D(t);return t},O.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(N,"\\$&")};var N=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return j(t,G),t}var V=function(t,e){return e.querySelector(t)},q=function(t,e){return e.querySelectorAll(t)},H=function(t,e){var r=t.matches||t[L(t,"matchesSelector")];return(H=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},q=Sizzle,H=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var G=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return V(t,this)}}function W(t){return"function"==typeof t?t:function(){return q(t,this)}}G.select=function(t){var e,r,n,i,a=[];t=Z(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return U(a)},G.selectAll=function(t){var e,r,i=[];t=W(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,u=s.length;++l<u;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return U(i)};var Y="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function J(t){return t.trim().replace(/\s+/g," ")}function K(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function Q(t){return(t+"").trim().split(/^|\s+/)}function tt(t,e){var r=(t=Q(t).map(et)).length;return"function"==typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function et(t){var e=K(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(i)||r.setAttribute("class",J(i+" "+t))):r.setAttribute("class",J(i.replace(e," ")))}}function rt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function nt(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function it(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Y&&t.documentElement.namespaceURI===Y?t.createElement(e):t.createElementNS(r,e)}}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ot(t){return{__data__:t}}function st(t){return function(){return H(this,t)}}function lt(t){return arguments.length||(t=f),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function ct(t){return j(t,ht),t}t.ns={prefix:X,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),X.hasOwnProperty(r)?{space:X[r],local:t}:t}},G.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each($(r,e[r]));return this}return this.each($(e,r))},G.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=Q(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute("class");++i<n;)if(!K(t[i]).test(e))return!1;return!0}for(e in t)this.each(tt(e,t[e]));return this}return this.each(tt(t,e))},G.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(rt(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=""}return this.each(rt(t,e,r))},G.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(nt(e,t[e]));return this}return this.each(nt(t,e))},G.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},G.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},G.append=function(t){return t=it(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},G.insert=function(t,e){return t=it(t),e=Z(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},G.remove=function(){return this.each(at)},G.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,c=r.length,h=Math.min(o,c),f=new Array(c),p=new Array(c),d=new Array(o);if(e){var m,g=new _,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(g.has(m=e.call(i,i.__data__,n))?d[n]=i:g.set(m,i),y[n]=m);for(n=-1;++n<c;)(i=g.get(m=e.call(r,a=r[n],n)))?!0!==i&&(f[n]=i,i.__data__=a):p[n]=ot(a),g.set(m,!0);for(n=-1;++n<o;)n in y&&!0!==g.get(y[n])&&(d[n]=t[n])}else{for(n=-1;++n<h;)i=t[n],a=r[n],i?(i.__data__=a,f[n]=i):p[n]=ot(a);for(;n<c;++n)p[n]=ot(r[n]);for(;n<o;++n)d[n]=t[n]}p.update=f,p.parentNode=f.parentNode=d.parentNode=t.parentNode,s.push(p),l.push(f),u.push(d)}var s=ct([]),l=U([]),u=U([]);if("function"==typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return u},l},G.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},G.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=st(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return U(i)},G.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(t){t=lt.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},G.each=function(t){return ut(this,function(e,r,n){t.call(e,e.__data__,r,n)})},G.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},G.empty=function(){return!this.node()},G.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},G.size=function(){var t=0;return ut(this,function(){++t}),t};var ht=[];function ft(e,r,i){var a="__on"+e,o=e.indexOf("."),s=dt;o>0&&(e=e.slice(0,o));var l=pt.get(e);function u(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ct,t.selection.enter.prototype=ht,ht.append=G.append,ht.empty=G.empty,ht.node=G.node,ht.call=G.call,ht.size=G.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return U(o)},ht.insert=function(t,e){return arguments.length<2&&(e=function(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}(this)),G.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[V(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),U([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(q(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,U([e])},G.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(ft(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(ft(t,e,r))};var pt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function dt(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function mt(t,e){var r=dt(t,e);return function(t){var e=this,n=t.relatedTarget;(!n||n!==e&&!(8&n.compareDocumentPosition(e)))&&r.call(e,t)}}i&&pt.forEach(function(t){"on"+t in i&&pt.remove(t)});var gt,yt=0;function vt(e){var r=".dragsuppress-"+ ++yt,n="click"+r,i=t.select(o(e)).on("touchmove"+r,R).on("dragstart"+r,R).on("selectstart"+r,R);if(null==gt&&(gt=!("onselectstart"in e)&&L(e.style,"userSelect")),gt){var s=a(e).style,l=s[gt];s[gt]="none"}return function(t){if(i.on(r,null),gt&&(s[gt]=l),t){var e=function(){i.on(n,null)};i.on(n,function(){R(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,F())};var xt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _t(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(xt<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();xt=!(s.f||s.e),n.remove()}}return xt?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function bt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=F().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return _t(t,n)},t.behavior.drag=function(){var e=B(a,"drag","dragstart","dragend"),r=null,n=s(z,t.mouse,o,"mousemove","mouseup"),i=s(bt,t.touch,C,"touchmove","touchend");function a(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function s(n,i,a,o,s){return function(){var l,u=this,c=t.event.target.correspondingElement||t.event.target,h=u.parentNode,f=e.of(u,arguments),p=0,d=n(),m=".drag"+(null==d?"":"-"+d),g=t.select(a(c)).on(o+m,function(){var t,e,r=i(h,d);r&&(t=r[0]-v[0],e=r[1]-v[1],p|=t|e,v=r,f({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))}).on(s+m,function(){i(h,d)&&(g.on(o+m,null).on(s+m,null),y(p),f({type:"dragend"}))}),y=vt(c),v=i(h,d);l=r?[(l=r.apply(u,arguments)).x-v[0],l.y-v[1]]:[0,0],f({type:"dragstart"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=F().touches),e?n(e).map(function(e){var r=_t(t,e);return r.identifier=e.identifier,r}):[]};var wt=1e-6,Tt=Math.PI,kt=2*Tt,At=kt-wt,Mt=Tt/2,St=Tt/180,Et=180/Tt;function Ct(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function It(t){return t>1?Mt:t<-1?-Mt:Math.asin(t)}function Lt(t){return((t=Math.exp(t))+1/t)/2}var Pt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,h=l-a,f=c*c+h*h;if(f<1e-12)n=Math.log(u/o)/Pt,r=function(t){return[i+t*c,a+t*h,o*Math.exp(Pt*t*n)]};else{var p=Math.sqrt(f),d=(u*u-o*o+4*f)/(2*o*2*p),m=(u*u-o*o-4*f)/(2*u*2*p),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/Pt,r=function(t){var e=t*n,r=Lt(g),s=o/(2*p)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(Pt*e+g)-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+s*c,a+s*h,o*r/Lt(Pt*e+g)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,u,c,h,f={x:0,y:0,k:1},p=[960,500],d=Dt,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",x="mouseup.zoom",_="touchstart.zoom",b=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(y,L).on(Ot+".zoom",z).on("dblclick.zoom",O).on(_,P)}function T(t){return[(t[0]-f.x)/f.k,(t[1]-f.y)/f.k]}function k(t){f.k=Math.max(d[0],Math.min(d[1],t))}function A(t,e){e=function(t){return[t[0]*f.k+f.x,t[1]*f.k+f.y]}(e),f.x+=t[0]-e[0],f.y+=t[1]-e[1]}function M(e,n,i,a){e.__chart__={x:f.x,y:f.y,k:f.k},k(Math.pow(2,a)),A(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){u&&u.domain(l.range().map(function(t){return(t-f.x)/f.k}).map(l.invert)),h&&h.domain(c.range().map(function(t){return(t-f.y)/f.k}).map(c.invert))}function E(t){g++||t({type:"zoomstart"})}function C(t){S(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function I(t){--g||(t({type:"zoomend"}),r=null)}function L(){var e=this,r=b.of(e,arguments),n=0,i=t.select(o(e)).on(v,function(){n=1,A(t.mouse(e),a),C(r)}).on(x,function(){i.on(v,null).on(x,null),s(n),I(r)}),a=T(t.mouse(e)),s=vt(e);Wi.call(e),E(r)}function P(){var e,r=this,n=b.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],h=t.select(r),p=vt(r);function d(){var n=t.touches(r);return e=f.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=T(t))}),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(u,v),c.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o<h;++o)i[n[o].identifier]=null;var p=d(),m=Date.now();if(1===p.length){if(m-s<500){var y=p[0];M(r,y,i[y.identifier],Math.floor(Math.log(f.k)/Math.LN2)+1),R()}s=m}else if(p.length>1){y=p[0];var x=p[1],_=y[0]-x[0],b=y[1]-x[1];a=_*_+b*b}}function g(){var o,l,u,c,h=t.touches(r);Wi.call(r);for(var f=0,p=h.length;f<p;++f,c=null)if(u=h[f],c=i[u.identifier]){if(l)break;o=u,l=c}if(c){var d=(d=u[0]-o[0])*d+(d=u[1]-o[1])*d,m=a&&Math.sqrt(d/a);o=[(o[0]+u[0])/2,(o[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],k(m*e)}s=null,A(o,l),C(n)}function v(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void d()}t.selectAll(c).on(o,null),h.on(y,L).on(_,P),p(),I(n)}m(),E(n),h.on(y,null).on(_,m)}function z(){var i=b.of(this,arguments);a?clearTimeout(a):(Wi.call(this),e=T(r=n||t.mouse(this)),E(i)),a=setTimeout(function(){a=null,I(i)},50),R(),k(Math.pow(2,.002*zt())*f.k),A(r,e),C(i)}function O(){var e=t.mouse(this),r=Math.log(f.k)/Math.LN2;M(this,e,T(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Ot||(Ot="onwheel"in i?(zt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(zt=function(){return t.event.wheelDelta},"mousewheel"):(zt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each(function(){var e=b.of(this,arguments),n=f;$i?t.select(this).transition().each("start.zoom",function(){f=this.__chart__||{x:0,y:0,k:1},E(e)}).tween("zoom:zoom",function(){var i=p[0],a=p[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-f.x)/f.k,(s-f.y)/f.k,i/f.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=f={x:o-r[0]*n,y:s-r[1]*n,k:n},C(e)}}).each("interrupt.zoom",function(){I(e)}).each("end.zoom",function(){I(e)}):(this.__chart__=f,E(e),C(e),I(e))})},w.translate=function(t){return arguments.length?(f={x:+t[0],y:+t[1],k:f.k},S(),w):[f.x,f.y]},w.scale=function(t){return arguments.length?(f={x:f.x,y:f.y,k:null},k(+t),S(),w):f.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?Dt:[+t[0],+t[1]],w):d},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(u=t,l=t.copy(),f={x:0,y:0,k:1},w):u},w.y=function(t){return arguments.length?(h=t,c=t.copy(),f={x:0,y:0,k:1},w):h},t.rebind(w,b,"on")};var zt,Ot,Dt=[0,1/0];function Rt(){}function Ft(t,e,r){return this instanceof Ft?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Ft?new Ft(t.h,t.s,t.l):ae(""+t,oe,Ft):new Ft(t,e,r)}t.color=Rt,Rt.prototype.toString=function(){return this.rgb()+""},t.hsl=Ft;var Bt=Ft.prototype=new Rt;function Nt(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new te(a(t+120),a(t),a(t-120))}function jt(e,r,n){return this instanceof jt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof jt?new jt(e.h,e.c,e.l):$t(e instanceof qt?e.l:(e=se((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new jt(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,t*this.l)},Bt.rgb=function(){return Nt(this.h,this.s,this.l)},t.hcl=jt;var Ut=jt.prototype=new Rt;function Vt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new qt(r,Math.cos(t*=St)*e,Math.sin(t)*e)}function qt(t,e,r){return this instanceof qt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof qt?new qt(t.l,t.a,t.b):t instanceof jt?Vt(t.h,t.c,t.l):se((t=te(t)).r,t.g,t.b):new qt(t,e,r)}Ut.brighter=function(t){return new jt(this.h,this.c,Math.min(100,this.l+Ht*(arguments.length?t:1)))},Ut.darker=function(t){return new jt(this.h,this.c,Math.max(0,this.l-Ht*(arguments.length?t:1)))},Ut.rgb=function(){return Vt(this.h,this.c,this.l).rgb()},t.lab=qt;var Ht=18,Gt=.95047,Zt=1,Wt=1.08883,Yt=qt.prototype=new Rt;function Xt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new te(Qt(3.2404542*(i=Jt(i)*Gt)-1.5371385*(n=Jt(n)*Zt)-.4985314*(a=Jt(a)*Wt)),Qt(-.969266*i+1.8760108*n+.041556*a),Qt(.0556434*i-.2040259*n+1.0572252*a))}function $t(t,e,r){return t>0?new jt(Math.atan2(r,e)*Et,Math.sqrt(e*e+r*r),t):new jt(NaN,NaN,t)}function Jt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Kt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Qt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function te(t,e,r){return this instanceof te?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof te?new te(t.r,t.g,t.b):ae(""+t,te,Nt):new te(t,e,r)}function ee(t){return new te(t>>16,t>>8&255,255&t)}function re(t){return ee(t)+""}Yt.brighter=function(t){return new qt(Math.min(100,this.l+Ht*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new qt(Math.max(0,this.l-Ht*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Xt(this.l,this.a,this.b)},t.rgb=te;var ne=te.prototype=new Rt;function ie(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ae(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(ue(i[0]),ue(i[1]),ue(i[2]))}return(a=ce.get(t))?e(a.r,a.g,a.b):(null!=t&&"#"===t.charAt(0)&&!isNaN(a=parseInt(t.slice(1),16))&&(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function oe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new Ft(n,i,l)}function se(t,e,r){var n=Kt((.4124564*(t=le(t))+.3575761*(e=le(e))+.1804375*(r=le(r)))/Gt),i=Kt((.2126729*t+.7151522*e+.072175*r)/Zt);return qt(116*i-16,500*(n-i),200*(i-Kt((.0193339*t+.119192*e+.9503041*r)/Wt)))}function le(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ue(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ne.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new te(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new te(i,i,i)},ne.darker=function(t){return new te((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},ne.hsl=function(){return oe(this.r,this.g,this.b)},ne.toString=function(){return"#"+ie(this.r)+ie(this.g)+ie(this.b)};var ce=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function he(t){return"function"==typeof t?t:function(){return t}}function fe(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),pe(e,r,t,n)}}function pe(e,r,i,a){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function h(){var t,e=u.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(u)||e>=200&&e<300||304===e){try{t=i.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=h:u.onreadystatechange=function(){u.readyState>3&&h()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),u.open(t,e,!0),null!=r&&!("accept"in l)&&(l.accept=r+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ce.forEach(function(t,e){ce.set(t,ee(e))}),t.functor=he,t.xhr=fe(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=pe(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i<n;++i)r[t[i]]=e[i];return r};r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,u=0,c=0;function h(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return u=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++u):10===s&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=t.charCodeAt(u++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(u)&&(++u,++c);else if(s!==n)continue;return t.slice(e,u-c)}return t.slice(e)}for(;(r=h())!==o;){for(var f=[];r!==a&&r!==o;)f.push(r),r=h();e&&null==(f=e(f,c++))||s.push(f)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new E,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(l).join(t)].concat(e.map(function(e){return n.map(function(t){return l(e[t])}).join(t)})).join("\n")},i.formatRows=function(t){return t.map(s).join("\n")},i},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var de,me,ge,ye,ve=this[L(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function xe(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return me?me.n=i:de=i,me=i,ge||(ye=clearTimeout(ye),ge=1,ve(_e)),i}function _e(){var t=be(),e=we()-t;e>24?(isFinite(e)&&(clearTimeout(ye),ye=setTimeout(_e,e)),ge=0):(ge=1,ve(_e))}function be(){for(var t=Date.now(),e=de;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function we(){for(var t,e=de,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:de=e.n;return me=t,r}function Te(t){return t[0]}function ke(t){return t[1]}function Ae(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&Ct(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Me(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){xe.apply(this,arguments)},t.timer.flush=function(){be(),we()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=Te,r=ke;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=he(e),a=he(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(Me),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var u=Ae(s),c=Ae(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],p=[];for(n=u.length-1;n>=0;--n)p.push(t[s[u[n]][2]]);for(n=+h;n<c.length-f;++n)p.push(t[s[c[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return j(t,Se),t};var Se=t.geom.polygon.prototype=[];function Ee(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Ce(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function Ie(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}Se.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},Se.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},Se.clip=function(t){for(var e,r,n,i,a,o,s=Ie(t),l=-1,u=this.length-Ie(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)Ee(o=e[r],c,i)?(Ee(a,c,i)||t.push(Ce(a,o,c,i)),t.push(o)):Ee(a,c,i)&&t.push(Ce(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var Le,Pe,ze,Oe,De,Re=[],Fe=[];function Be(){nr(this),this.edge=this.site=this.circle=null}function Ne(t){var e=Re.pop()||new Be;return e.site=t,e}function je(t){Xe(t),ze.remove(t),Re.push(t),nr(t)}function Ue(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];je(t);for(var l=a;l.circle&&v(r-l.circle.x)<wt&&v(n-l.circle.cy)<wt;)a=l.P,s.unshift(l),je(l),l=a;s.unshift(l),Xe(l);for(var u=o;u.circle&&v(r-u.circle.x)<wt&&v(n-u.circle.cy)<wt;)o=u.N,s.push(u),je(u),u=o;s.push(u),Xe(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],tr(u.edge,l.site,u.site,i);l=s[0],(u=s[h-1]).edge=Ke(l.site,u.site,null,i),Ye(l),Ye(u)}function Ve(t){for(var e,r,n,i,a=t.x,o=t.y,s=ze._;s;)if((n=qe(s,o)-a)>wt)s=s.L;else{if(!((i=a-He(s,o))>wt)){n>-wt?(e=s.P,r=s):i>-wt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ne(t);if(ze.insert(e,l),e||r){if(e===r)return Xe(e),r=Ne(e.site),ze.insert(l,r),l.edge=r.edge=Ke(e.site,l.site),Ye(e),void Ye(r);if(!r)return void(l.edge=Ke(e.site,l.site));Xe(e),Xe(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,p=t.y-h,d=r.site,m=d.x-c,g=d.y-h,y=2*(f*g-p*m),v=f*f+p*p,x=m*m+g*g,_={x:(g*v-p*x)/y+c,y:(f*x-m*v)/y+h};tr(r.edge,u,d,_),l.edge=Ke(u,t,null,_),r.edge=Ke(t,d,null,_),Ye(e),Ye(r)}}function qe(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function He(t,e){var r=t.N;if(r)return qe(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ge(t){this.site=t,this.edges=[]}function Ze(t,e){return e.angle-t.angle}function We(){nr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,h=2*(l*(g=a.y-s)-u*c);if(!(h>=-1e-12)){var f=l*l+u*u,p=c*c+g*g,d=(g*f-u*p)/h,m=(l*p-c*f)/h,g=m+s,y=Fe.pop()||new We;y.arc=t,y.site=i,y.x=d+o,y.y=g+Math.sqrt(d*d+m*m),y.cy=g,t.circle=y;for(var v=null,x=De._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){v=x.P;break}x=x.L}else{if(!x.R){v=x;break}x=x.R}De.insert(v,y),v||(Oe=y)}}}}function Xe(t){var e=t.circle;e&&(e.P||(Oe=e.N),De.remove(e),Fe.push(e),nr(e),t.circle=null)}function $e(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,f=c.x,p=c.y,d=h.x,m=h.y,g=(f+d)/2,y=(p+m)/2;if(m===p){if(g<o||g>=s)return;if(f>d){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y<l)return}else a={x:g,y:u};r={x:g,y:l}}}else if(i=y-(n=(f-d)/(m-p))*g,n<-1||n>1)if(f>d){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(p<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Je(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ke(t,e,r,n){var i=new Je(t,e);return Le.push(i),r&&tr(i,t,e,r),n&&tr(i,e,t,n),Pe[t.i].edges.push(new er(i,t,e)),Pe[e.i].edges.push(new er(i,e,t)),i}function Qe(t,e,r){var n=new Je(t,null);return n.a=e,n.b=r,Le.push(n),n}function tr(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function er(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function rr(){this._=null}function nr(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ir(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ar(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function or(t){for(;t.L;)t=t.L;return t}function sr(t,e){var r,n,i,a=t.sort(lr).pop();for(Le=[],Pe=new Array(t.length),ze=new rr,De=new rr;;)if(i=Oe,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))(a.x!==r||a.y!==n)&&(Pe[a.i]=new Ge(a),Ve(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Ue(i.arc)}e&&(function(t){for(var e,r=Le,n=function(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=0,h=1,f=s.x-l,p=s.y-u;if(a=t-l,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<h&&(h=a)}else if(f>0){if(a>h)return;a>c&&(c=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<h&&(h=a)}if(a=e-u,p||!(a>0)){if(a/=p,p<0){if(a<c)return;a<h&&(h=a)}else if(p>0){if(a>h)return;a>c&&(c=a)}if(a=n-u,p||!(a<0)){if(a/=p,p<0){if(a>h)return;a>c&&(c=a)}else if(p>0){if(a<c)return;a<h&&(h=a)}return c>0&&(i.a={x:l+c*f,y:u+c*p}),h<1&&(i.b={x:l+h*f,y:u+h*p}),i}}}}}}(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!$e(e=r[i],t)||!n(e)||v(e.a.x-e.b.x)<wt&&v(e.a.y-e.b.y)<wt)&&(e.a=e.b=null,r.splice(i,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],p=t[0][1],d=t[1][1],m=Pe,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(c=s[o].end()).x,i=c.y,e=(u=s[++o%l].start()).x,r=u.y,(v(n-e)>wt||v(i-r)>wt)&&(s.splice(o,0,new er(Qe(a.site,c,v(n-h)<wt&&d-i>wt?{x:h,y:v(e-h)<wt?r:d}:v(i-d)<wt&&f-n>wt?{x:v(r-d)<wt?e:f,y:d}:v(n-f)<wt&&i-p>wt?{x:f,y:v(e-f)<wt?r:p}:v(i-p)<wt&&n-h>wt?{x:v(r-p)<wt?e:h,y:p}:null),a.site,null)),++l)}(e));var o={cells:Pe,edges:Le};return ze=De=Le=Pe=null,o}function lr(t,e){return e.y-t.y||e.x-t.x}Ge.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(!(t=e[r].edge).b||!t.a)&&e.splice(r,1);return e.sort(Ze),e.length},er.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},rr.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=or(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(ir(this,r),r=(t=r).U),r.C=!1,n.C=!0,ar(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(ar(this,r),r=(t=r).U),r.C=!1,n.C=!0,ir(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?or(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,ir(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,ar(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,ir(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,ar(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,ir(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,ar(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=Te,r=ke,n=e,i=r,a=ur;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return sr(s(t),a).cells.forEach(function(a,s){var l=a.edges,u=a.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/wt)*wt,y:Math.round(i(t,e)/wt)*wt,i:e}})}return o.links=function(t){return sr(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return sr(s(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(Ze),s=-1,l=o.length,u=o[l-1].edge,c=u.l===a?u.r:u.l;++s<l;)i=c,c=(u=o[s].edge).l===a?u.r:u.l,n<i.i&&n<c.i&&cr(a,i,c)<0&&e.push([t[n],t[i.i],t[c.i]])}),e},o.x=function(t){return arguments.length?(n=he(e=t),o):e},o.y=function(t){return arguments.length?(i=he(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?ur:t,o):a===ur?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===ur?null:a&&a[1]},o};var ur=[[-1e6,-1e6],[1e6,1e6]];function cr(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function hr(t){return t.x}function fr(t){return t.y}function pr(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&pr(t,l[0],r,n,o,s),l[1]&&pr(t,l[1],o,n,i,s),l[2]&&pr(t,l[2],r,s,o,a),l[3]&&pr(t,l[3],o,s,i,a)}}function dr(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return"#"+ie(Math.round(n+o*t))+ie(Math.round(i+s*t))+ie(Math.round(a+l*t))}}function mr(t,e){var r,n={},i={};for(r in t)r in e?n[r]=_r(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function gr(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function yr(t,e){var r,n,i,a=vr.lastIndex=xr.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=vr.exec(t))&&(n=xr.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:gr(r,n)})),a=xr.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=Te,s=ke;if(a=arguments.length)return o=hr,s=fr,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,u,c,h,f,p,d,m,g,y=he(o),x=he(s);if(null!=e)p=e,d=r,m=n,g=i;else if(m=g=-(p=d=1/0),u=[],c=[],f=t.length,a)for(h=0;h<f;++h)(l=t[h]).x<p&&(p=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(h=0;h<f;++h){var _=+y(l=t[h],h),b=+x(l,h);_<p&&(p=_),b<d&&(d=b),_>m&&(m=_),b>g&&(g=b),u.push(_),c.push(b)}var w=m-p,T=g-d;function k(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(v(l-r)+v(u-n)<.01)A(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,A(t,c,l,u,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,h=n>=u,f=h<<1|c;t.leaf=!1,c?i=l:o=l,h?a=u:s=u,k(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?g=d+w:m=p+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(M,t,+y(t,++h),+x(t,h),p,d,m,g)},visit:function(t){pr(t,M,p,d,m,g)},find:function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,h,f,p){if(!(c>a||h>o||f<n||p<i)){if(d=u.point){var d,m=e-u.x,g=r-u.y,y=m*m+g*g;if(y<l){var v=Math.sqrt(l=y);n=e-v,i=r-v,a=e+v,o=r+v,s=d}}for(var x=u.nodes,_=.5*(c+f),b=.5*(h+p),w=(r>=b)<<1|e>=_,T=w+4;w<T;++w)if(u=x[3&w])switch(3&w){case 0:t(u,c,h,_,b);break;case 1:t(u,_,h,f,b);break;case 2:t(u,c,b,_,p);break;case 3:t(u,_,b,f,p)}}}(t,n,i,a,o),s}(M,t[0],t[1],p,d,m,g)}};if(h=-1,null==e){for(;++h<f;)k(M,t[h],u[h],c[h],p,d,m,g);--h}else t.forEach(M.add);return u=c=t=l=null,M}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=dr,t.interpolateObject=mr,t.interpolateNumber=gr,t.interpolateString=yr;var vr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xr=new RegExp(vr.source,"g");function _r(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function br(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(_r(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=_r,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?ce.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?dr:yr:e instanceof Rt?dr:Array.isArray(e)?br:"object"===r&&isNaN(e)?mr:gr)(t,e)}],t.interpolateArray=br;var wr=function(){return C},Tr=t.map({linear:wr,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return Sr},cubic:function(){return Er},sin:function(){return Ir},exp:function(){return Lr},circle:function(){return Pr},elastic:function(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/kt*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*kt/e)}},back:function(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}},bounce:function(){return zr}}),kr=t.map({in:C,out:Ar,"in-out":Mr,"out-in":function(t){return Mr(Ar(t))}});function Ar(t){return function(e){return 1-t(1-e)}}function Mr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Sr(t){return t*t}function Er(t){return t*t*t}function Cr(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Ir(t){return 1-Math.cos(t*Mt)}function Lr(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function zr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Or(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Dr(t){var e=[t.a,t.b],r=[t.c,t.d],n=Fr(e),i=Rr(e,r),a=Fr(function(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}(r,e,-i))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Et,this.translate=[t.e,t.f],this.scale=[n,a],this.skew=a?Math.atan2(i,a)*Et:0}function Rr(t,e){return t[0]*e[0]+t[1]*e[1]}function Fr(t){var e=Math.sqrt(Rr(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):"in";return n=Tr.get(n)||wr,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}((i=kr.get(i)||C)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Vt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Nt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Xt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=Or,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Dr(e?e.matrix:Br)})(e)},Dr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Br={a:1,b:0,c:0,d:1,e:0,f:0};function Nr(t){return t.length?t.pop()+",":""}function jr(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:gr(t[0],e[0])},{i:i-2,x:gr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Nr(r)+"rotate(",null,")")-2,x:gr(t,e)})):e&&r.push(Nr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(Nr(r)+"skewX(",null,")")-2,x:gr(t,e)}):e&&r.push(Nr(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Nr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:gr(t[0],e[0])},{i:i-2,x:gr(t[1],e[1])})}else(1!==e[0]||1!==e[1])&&r.push(Nr(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join("")}}function Ur(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Vr(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function qr(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;for(var r=Hr(t),n=Hr(e),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function Hr(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Gr(t){t.fixed|=2}function Zr(t){t.fixed&=-7}function Wr(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Yr(t){t.fixed&=-5}function Xr(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var a,o=t.nodes,s=o.length,l=-1;++l<s;)null!=(a=o[l])&&(Xr(a,e,r),t.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*r[t.point.index];t.charge+=t.pointCharge=u,n+=u*t.point.x,i+=u*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}t.interpolateTransform=jr,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(qr(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},u=0;function c(){var l,c,f,p,d,m={},g=[],y=t.range(i),v=[];for(e=[],r=[],l=0,p=-1;++p<i;){for(c=0,d=-1;++d<i;)c+=n[p][d];g.push(c),v.push(t.range(i)),l+=c}for(a&&y.sort(function(t,e){return a(g[t],g[e])}),o&&v.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),l=(kt-u*i)/l,c=0,p=-1;++p<i;){for(f=c,d=-1;++d<i;){var x=y[p],_=v[x][d],b=n[x][_],w=c,T=c+=b*l;m[x+"-"+_]={index:x,subindex:_,startAngle:w,endAngle:T,value:b}}r[x]={index:x,startAngle:f,endAngle:c,value:g[x]},c+=u}for(p=-1;++p<i;)for(d=p-1;++d<i;){var k=m[p+"-"+d],A=m[d+"-"+p];(k.value||A.value)&&e.push(k.value<A.value?{source:A,target:k}:{source:k,target:A})}s&&h()}function h(){e.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(u=t,e=r=null,l):u},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&h(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return r||c(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch("start","tick","end"),u=[1,1],c=.9,h=$r,f=Jr,p=-30,d=Kr,m=.1,g=.64,y=[],v=[];function x(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/g<l){if(l<d){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}e.point&&l&&l<d&&(u=e.pointCharge/l,t.px-=a*u,t.py-=o*u)}return!e.charge}}function _(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,h,f,d,g,_,b,w,T=y.length,k=v.length;for(s=0;s<k;++s)f=(h=v[s]).source,(g=(b=(d=h.target).x-f.x)*b+(w=d.y-f.y)*w)&&(b*=g=n*a[s]*((g=Math.sqrt(g))-i[s])/g,w*=g,d.x-=b*(_=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=w*_,f.x+=b*(_=1-_),f.y+=w*_);if((_=n*m)&&(b=u[0]/2,w=u[1]/2,s=-1,_))for(;++s<T;)(h=y[s]).x+=(b-h.x)*_,h.y+=(w-h.y)*_;if(p)for(Xr(r=t.geom.quadtree(y),n,o),s=-1;++s<T;)(h=y[s]).fixed||r.visit(x(h));for(s=-1;++s<T;)(h=y[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*c,h.y-=(h.py-(h.py=h.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(y=t,s):y},s.links=function(t){return arguments.length?(v=t,s):v},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(d=t*t,s):Math.sqrt(d)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=xe(s.tick)),s):n},s.start=function(){var t,e,r,n=y.length,l=v.length,c=u[0],d=u[1];for(t=0;t<n;++t)(r=y[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=v[t]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=y[t],isNaN(r.x)&&(r.x=m("x",c)),isNaN(r.y)&&(r.y=m("y",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(t=0;t<l;++t)i[t]=+h.call(this,v[t],t);else for(t=0;t<l;++t)i[t]=h;if(a=[],"function"==typeof f)for(t=0;t<l;++t)a[t]=+f.call(this,v[t],t);else for(t=0;t<l;++t)a[t]=f;if(o=[],"function"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,y[t],t);else for(t=0;t<n;++t)o[t]=p;function m(r,i){if(!e){for(e=new Array(n),u=0;u<n;++u)e[u]=[];for(u=0;u<l;++u){var a=v[u];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],u=-1,c=s.length;++u<c;)if(!isNaN(o=s[u][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(C).on("dragstart.force",Gr).on("drag.force",_).on("dragend.force",Zr)),!arguments.length)return r;this.on("mouseover.force",Wr).on("mouseout.force",Yr).call(r)},t.rebind(s,l,"on")};var $r=20,Jr=1,Kr=1/0;function Qr(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=on,e}function tn(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function en(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function rn(t){return t.children}function nn(t){return t.value}function an(t,e){return e.value-t.value}function on(e){return t.merge(e.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}t.layout.hierarchy=function(){var t=an,e=rn,r=nn;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=e.call(n,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return en(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(tn(t,function(t){t.children&&(t.value=0)}),en(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,e,r,i){var a=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(r=t.value?r/t.value:0;++u<o;)n(s=a[u],e,l=s.value*r,i),e+=l}}function i(t){var e=t.children,r=0;if(e&&(n=e.length))for(var n,a=-1;++a<n;)r=Math.max(r,i(e[a]));return 1+r}function a(t,a){var o=e.call(this,t,a);return n(o[0],0,r[0],r[1]/i(o[0])),o}return a.size=function(t){return arguments.length?(r=t,a):r},Qr(a,e)},t.layout.pie=function(){var e=Number,r=sn,n=0,i=kt,a=0;function o(s){var l,u=s.length,c=s.map(function(t,r){return+e.call(o,t,r)}),h=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof i?i.apply(this,arguments):i)-h,p=Math.min(Math.abs(f)/u,+("function"==typeof a?a.apply(this,arguments):a)),d=p*(f<0?-1:1),m=t.sum(c),g=m?(f-u*d)/m:0,y=t.range(u),v=[];return null!=r&&y.sort(r===sn?function(t,e){return c[e]-c[t]}:function(t,e){return r(s[t],s[e])}),y.forEach(function(t){v[t]={data:s[t],value:l=c[t],startAngle:h,endAngle:h+=l*g+d,padAngle:p}}),v}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var sn={};function ln(t){return t.x}function un(t){return t.y}function cn(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=C,r=pn,n=dn,i=cn,a=ln,o=un;function s(l,u){if(!(p=l.length))return l;var c=l.map(function(t,r){return e.call(s,t,r)}),h=c.map(function(t){return t.map(function(t,e){return[a.call(s,t,e),o.call(s,t,e)]})}),f=r.call(s,h,u);c=t.permute(c,f),h=t.permute(h,f);var p,d,m,g,y=n.call(s,h,u),v=c[0].length;for(m=0;m<v;++m)for(i.call(s,c[0][m],g=y[m],h[0][m][1]),d=1;d<p;++d)i.call(s,c[d][m],g+=h[d-1][m][1],h[d][m][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"==typeof t?t:hn.get(t)||pn,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:fn.get(t)||dn,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var hn=t.map({"inside-out":function(e){var r,n,i=e.length,a=e.map(mn),o=e.map(gn),s=t.range(i).sort(function(t,e){return a[t]-a[e]}),l=0,u=0,c=[],h=[];for(r=0;r<i;++r)n=s[r],l<u?(l+=o[n],c.push(n)):(u+=o[n],h.push(n));return h.reverse().concat(c)},reverse:function(e){return t.range(e.length).reverse()},default:pn}),fn=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,h=t[0],f=h.length,p=[];for(p[0]=l=u=0,r=1;r<f;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}p[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<f;++r)p[r]-=u;return p},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:dn});function pn(e){return t.range(e.length)}function dn(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function mn(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function gn(t){return t.reduce(yn,0)}function yn(t,e){return t+e[1]}function vn(t,e){return xn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function xn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function _n(e){return[t.min(e),t.max(e)]}function bn(t,e){return t.value-e.value}function wn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Tn(t,e){t._pack_next=e,e._pack_prev=t}function kn(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function An(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,h=1/0,f=-1/0;if(e.forEach(Mn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(Cn(r,n,i=e[2]),x(i),wn(r,i),r._pack_prev=i,wn(i,n),n=r._pack_next,a=3;a<l;a++){Cn(r,n,i=e[a]);var p=0,d=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(kn(o,i)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!kn(s,i);s=s._pack_prev,m++);p?(d<m||d==m&&n.r<r.r?Tn(r,n=o):Tn(r=s,n),a--):(wn(r,i),n=i,x(i))}var g=(u+c)/2,y=(h+f)/2,v=0;for(a=0;a<l;a++)(i=e[a]).x-=g,i.y-=y,v=Math.max(v,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=v,e.forEach(Sn)}function x(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),h=Math.min(t.y-t.r,h),f=Math.max(t.y+t.r,f)}}function Mn(t){t._pack_next=t._pack_prev=t}function Sn(t){delete t._pack_next,delete t._pack_prev}function En(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a<o;)En(i[a],e,r,n)}function Cn(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function In(t,e){return t.parent==e.parent?1:2}function Ln(t){var e=t.children;return e.length?e[0]:t.t}function Pn(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function zn(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function On(t,e,r){return t.a.parent===e.parent?t.a:r}function Dn(t){var e=t.children;return e&&e.length?Dn(e[0]):t}function Rn(t){var e,r=t.children;return r&&(e=r.length)?Rn(r[e-1]):t}function Fn(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Bn(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Nn(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function jn(t){return t.rangeExtent?t.rangeExtent():Nn(t.range())}function Un(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function Vn(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function qn(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:Hn}t.layout.histogram=function(){var e=!0,r=Number,n=_n,i=vn;function a(a,o){for(var s,l,u=[],c=a.map(r,this),h=n.call(this,c,o),f=i.call(this,h,c,o),p=(o=-1,c.length),d=f.length-1,m=e?1:1/p;++o<d;)(s=u[o]=[]).dx=f[o+1]-(s.x=f[o]),s.y=0;if(d>0)for(o=-1;++o<p;)(l=c[o])>=h[0]&&l<=h[1]&&((s=u[t.bisect(f,l,1,d)-1]).y+=m,s.push(a[o]));return u}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=he(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return xn(e,t)}:he(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(bn),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,en(s,function(t){t.r=+c(t.value)}),en(s,An),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;en(s,function(t){t.r+=h}),en(s,An),en(s,function(t){t.r-=h})}return En(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Qr(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=In,n=[1,1],i=null;function a(t,a){var u=e.call(this,t,a),c=u[0],h=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(c);if(en(h,o),h.parent.m=-h.z,tn(h,s),i)tn(c,l);else{var f=c,p=c,d=c;tn(c,function(t){t.x<f.x&&(f=t),t.x>p.x&&(p=t),t.depth>d.depth&&(d=t)});var m=r(f,p)/2-f.x,g=n[0]/(p.x+r(p,f)/2+m),y=n[1]/(d.depth||1);tn(c,function(t){t.x=(t.x+m)*g,t.y=t.depth*y})}return u}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],u=a.m,c=o.m,h=s.m,f=l.m;s=Pn(s),a=Ln(a),s&&a;)l=Ln(l),(o=Pn(o)).a=t,(i=s.z+h-a.z-u+r(s._,a._))>0&&(zn(On(s,t,n),t,i),u+=i,c+=i),h+=s.m,u+=a.m,f+=l.m,c+=o.m;s&&!Pn(o)&&(o.t=s,o.m+=h-c),a&&!Ln(l)&&(l.t=a,l.m+=u-f,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Qr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=In,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;en(u,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)});var h=Dn(u),f=Rn(u),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return en(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Qr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Fn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function h(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],u=e.slice(),f=1/0,m="slice"===l?a.dx:"dice"===l?a.dy:"slice-dice"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(c(u,a.dx*a.dy/t.value),s.area=0;(i=u.length)>0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=f?(u.pop(),f=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(h)}}function f(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(f)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((i||c>r.dy)&&(c=r.dy);++o<s;)(a=t[o]).x=l,a.y=u,a.dy=c,l+=a.dx=Math.min(r.x+r.dx-l,c?n(a.area/c):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++o<s;)(a=t[o]).x=l,a.y=u,a.dx=c,u+=a.dy=Math.min(r.y+r.dy-u,c?n(a.area/c):0);a.z=!1,a.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function m(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),c([a],a.dx*a.dy/a.value),(e?f:h)(a),s&&(e=n),n}return m.size=function(t){return arguments.length?(i=t,m):i},m.padding=function(t){return arguments.length?(o=null==(a=t)?Fn:"function"==(e=typeof t)?function(e){var r=t.call(m,e,e.depth);return null==r?Fn(e):Bn(e,"number"==typeof r?[r,r,r,r]:r)}:("number"===e&&(t=[t,t,t,t]),function(e){return Bn(e,t)}),m):a;var e},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(t){return arguments.length?(s=t,e=null,m):s},m.ratio=function(t){return arguments.length?(u=t,m):u},m.mode=function(t){return arguments.length?(l=t+"",m):l},Qr(m,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var Hn={floor:C,ceil:C};function Gn(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function Zn(t,e,r,n){var i,a;function o(){var o=Math.min(t.length,e.length)>2?Gn:Un,l=n?Vr:Ur;return i=o(t,e,l,r),a=o(e,t,l,_r),s}function s(t){return i(t)}return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},s.range=function(t){return arguments.length?(e=t,o()):e},s.rangeRound=function(t){return s.range(t).interpolate(Or)},s.clamp=function(t){return arguments.length?(n=t,o()):n},s.interpolate=function(t){return arguments.length?(r=t,o()):r},s.ticks=function(e){return $n(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Yn(t,e),o()},s.copy=function(){return Zn(t,e,r,n)},o()}function Wn(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function Yn(t,e){return Vn(t,qn(Xn(t,e)[2])),Vn(t,qn(Xn(t,e)[2])),t}function Xn(t,e){null==e&&(e=10);var r=Nn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function $n(e,r){return t.range.apply(t,Xn(e,r))}function Jn(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Vn(n.map(i),r?Math:Kn);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Nn(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(c-u)){if(r){for(;u<c;u++)for(var f=1;f<h;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(f=h-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},o.copy=function(){return Jn(t.copy(),e,r,n)},Wn(o,t)}t.scale.linear=function(){return Zn([0,1],[0,1],_r,!1)},t.scale.log=function(){return Jn(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Kn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Qn(t,e,r){var n=ti(e),i=ti(1/e);function a(e){return t(n(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),a):r},a.ticks=function(t){return $n(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain(Yn(r,t))},a.exponent=function(o){return arguments.length?(n=ti(e=o),i=ti(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return Qn(t.copy(),e,r)},Wn(a,t)}function ti(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ei(e,r){var n,i,a;function o(t){return i[((n.get(t)||("range"===r.t?n.set(t,e.push(t)):NaN))-1)%i.length]}function s(r,n){return t.range(e.length).map(function(t){return r+n*t})}return o.domain=function(t){if(!arguments.length)return e;e=[],n=new _;for(var i,a=-1,s=t.length;++a<s;)n.has(i=t[a])||n.set(i,e.push(i));return o[r.t].apply(o,r.a)},o.range=function(t){return arguments.length?(i=t,a=0,r={t:"range",a:arguments},o):i},o.rangePoints=function(t,n){arguments.length<2&&(n=0);var l=t[0],u=t[1],c=e.length<2?(l=(l+u)/2,0):(u-l)/(e.length-1+n);return i=s(l+c*n/2,c),a=0,r={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(t,n){arguments.length<2&&(n=0);var l=t[0],u=t[1],c=e.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(e.length-1+n)|0;return i=s(l+Math.round(c*n/2+(u-l-(e.length-1+n)*c)/2),c),a=0,r={t:"rangeRoundPoints",a:arguments},o},o.rangeBands=function(t,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var u=t[1]<t[0],c=t[u-0],h=(t[1-u]-c)/(e.length-n+2*l);return i=s(c+h*l,h),u&&i.reverse(),a=h*(1-n),r={t:"rangeBands",a:arguments},o},o.rangeRoundBands=function(t,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var u=t[1]<t[0],c=t[u-0],h=t[1-u],f=Math.floor((h-c)/(e.length-n+2*l));return i=s(c+Math.round((h-c-(e.length-n)*f)/2),f),u&&i.reverse(),a=Math.round(f*(1-n)),r={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return a},o.rangeExtent=function(){return Nn(r.a[0])},o.copy=function(){return ei(e,r)},o.domain(e)}t.scale.pow=function(){return Qn(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return ei([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(ri)},t.scale.category20=function(){return t.scale.ordinal().range(ni)},t.scale.category20b=function(){return t.scale.ordinal().range(ii)},t.scale.category20c=function(){return t.scale.ordinal().range(ai)};var ri=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(re),ni=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(re),ii=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(re),ai=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(re);function oi(e,r){var n;function i(){var i=0,o=r.length;for(n=[];++i<o;)n[i-1]=t.quantile(e,i/o);return a}function a(e){if(!isNaN(e=+e))return r[t.bisect(n,e)]}return a.domain=function(t){return arguments.length?(e=t.map(p).filter(d).sort(f),i()):e},a.range=function(t){return arguments.length?(r=t,i()):r},a.quantiles=function(){return n},a.invertExtent=function(t){return(t=r.indexOf(t))<0?[NaN,NaN]:[t>0?n[t-1]:e[0],t<n.length?n[t]:e[e.length-1]]},a.copy=function(){return oi(e,r)},i()}function si(t,e,r){var n,i;function a(e){return r[Math.max(0,Math.min(i,Math.floor(n*(e-t))))]}function o(){return n=r.length/(e-t),i=r.length-1,a}return a.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],o()):[t,e]},a.range=function(t){return arguments.length?(r=t,o()):r},a.invertExtent=function(e){return[e=(e=r.indexOf(e))<0?NaN:e/n+t,e+1/n]},a.copy=function(){return si(t,e,r)},o()}function li(e,r){function n(n){if(n<=n)return r[t.bisect(e,n)]}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=t,n):r},n.invertExtent=function(t){return t=r.indexOf(t),[e[t-1],e[t]]},n.copy=function(){return li(e,r)},n}function ui(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return $n(t,e)},e.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},e.copy=function(){return ui(t)},e}function ci(){return 0}t.scale.quantile=function(){return oi([],[])},t.scale.quantize=function(){return si(0,1,[0,1])},t.scale.threshold=function(){return li([.5],[0,1])},t.scale.identity=function(){return ui([0,1])},t.svg={},t.svg.arc=function(){var t=fi,e=pi,r=ci,n=hi,i=di,a=mi,o=gi;function s(){var s=Math.max(0,+t.apply(this,arguments)),u=Math.max(0,+e.apply(this,arguments)),c=i.apply(this,arguments)-Mt,h=a.apply(this,arguments)-Mt,f=Math.abs(h-c),p=c>h?0:1;if(u<s&&(d=u,u=s,s=d),f>=At)return l(u,p)+(s?l(s,1-p):"")+"Z";var d,m,g,y,v,x,_,b,w,T,k,A,M=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===hi?Math.sqrt(s*s+u*u):+n.apply(this,arguments),p||(S*=-1),u&&(S=It(g/u*Math.sin(y))),s&&(M=It(g/s*Math.sin(y)))),u){v=u*Math.cos(c+S),x=u*Math.sin(c+S),_=u*Math.cos(h-S),b=u*Math.sin(h-S);var C=Math.abs(h-c-2*S)<=Tt?0:1;if(S&&yi(v,x,_,b)===p^C){var I=(c+h)/2;v=u*Math.cos(I),x=u*Math.sin(I),_=b=null}}else v=x=0;if(s){w=s*Math.cos(h-M),T=s*Math.sin(h-M),k=s*Math.cos(c+M),A=s*Math.sin(c+M);var L=Math.abs(c-h+2*M)<=Tt?0:1;if(M&&yi(w,T,k,A)===1-p^L){var P=(c+h)/2;w=s*Math.cos(P),T=s*Math.sin(P),k=A=null}}else w=T=0;if(f>wt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){m=s<u^p?0:1;var z=d,O=d;if(f<Tt){var D=null==k?[w,T]:null==_?[v,x]:Ce([v,x],[k,A],[_,b],[w,T]),R=v-D[0],F=x-D[1],B=_-D[0],N=b-D[1],j=1/Math.sin(Math.acos((R*B+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+N*N)))/2),U=Math.sqrt(D[0]*D[0]+D[1]*D[1]);O=Math.min(d,(s-U)/(j-1)),z=Math.min(d,(u-U)/(j+1))}if(null!=_){var V=vi(null==k?[w,T]:[k,A],[v,x],u,z,p),q=vi([_,b],[w,T],u,z,p);d===z?E.push("M",V[0],"A",z,",",z," 0 0,",m," ",V[1],"A",u,",",u," 0 ",1-p^yi(V[1][0],V[1][1],q[1][0],q[1][1]),",",p," ",q[1],"A",z,",",z," 0 0,",m," ",q[0]):E.push("M",V[0],"A",z,",",z," 0 1,",m," ",q[0])}else E.push("M",v,",",x);if(null!=k){var H=vi([v,x],[k,A],s,-O,p),G=vi([w,T],null==_?[v,x]:[_,b],s,-O,p);d===O?E.push("L",G[0],"A",O,",",O," 0 0,",m," ",G[1],"A",s,",",s," 0 ",p^yi(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-p," ",H[1],"A",O,",",O," 0 0,",m," ",H[0]):E.push("L",G[0],"A",O,",",O," 0 0,",m," ",H[0])}else E.push("L",w,",",T)}else E.push("M",v,",",x),null!=_&&E.push("A",u,",",u," 0 ",C,",",p," ",_,",",b),E.push("L",w,",",T),null!=k&&E.push("A",s,",",s," 0 ",L,",",1-p," ",k,",",A);return E.push("Z"),E.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=he(e),s):t},s.outerRadius=function(t){return arguments.length?(e=he(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=he(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==hi?hi:he(t),s):n},s.startAngle=function(t){return arguments.length?(i=he(t),s):i},s.endAngle=function(t){return arguments.length?(a=he(t),s):a},s.padAngle=function(t){return arguments.length?(o=he(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Mt;return[Math.cos(n)*r,Math.sin(n)*r]},s};var hi="auto";function fi(t){return t.innerRadius}function pi(t){return t.outerRadius}function di(t){return t.startAngle}function mi(t){return t.endAngle}function gi(t){return t&&t.padAngle}function yi(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function vi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,h=t[1]+u,f=e[0]+l,p=e[1]+u,d=(c+f)/2,m=(h+p)/2,g=f-c,y=p-h,v=g*g+y*y,x=r-n,_=c*p-f*h,b=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-_*_)),w=(_*y-g*b)/v,T=(-_*g-y*b)/v,k=(_*y+g*b)/v,A=(-_*g+y*b)/v,M=w-d,S=T-m,E=k-d,C=A-m;return M*M+S*S>E*E+C*C&&(w=k,T=A),[[w-l,T-u],[w*r/x,T*r/x]]}function xi(){return!0}function _i(t){var e=Te,r=ke,n=xi,i=wi,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,h=a.length,f=he(e),p=he(r);function d(){l.push("M",i(t(u),o))}for(;++c<h;)n.call(this,s=a[c],c)?u.push([+f.call(this,s,c),+p.call(this,s,c)]):u.length&&(d(),u=[]);return u.length&&d(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a="function"==typeof t?i=t:(i=bi.get(t)||wi).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return _i(C)};var bi=t.map({linear:wi,"linear-closed":Ti,step:function(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ai,basis:Ei,"basis-open":function(t){if(t.length<4)return wi(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ci(Pi,a)+","+Ci(Pi,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),zi(r,a,o);return r.join("")},"basis-closed":function(t){for(var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);for(e=[Ci(Pi,o),",",Ci(Pi,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),zi(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Ei(t)},cardinal:function(t,e){return t.length<3?wi(t):t[0]+Mi(t,Si(t,e))},"cardinal-open":function(t,e){return t.length<4?wi(t):t[1]+Mi(t.slice(1,-1),Si(t,e))},"cardinal-closed":function(t,e){return t.length<3?Ti(t):t[0]+Mi((t.push(t[0]),t),Si([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?wi(t):t[0]+Mi(t,function(t){for(var e,r,n,i,a=[],o=function(t){for(var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=Oi(i,a);++e<r;)n[e]=(o+(o=Oi(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;++s<l;)e=Oi(t[s],t[s+1]),v(e)<wt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function wi(t){return t.length>1?t.join("L"):t+"Z"}function Ti(t){return t.join("L")+"Z"}function ki(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("V",(n=t[e])[1],"H",n[0]);return i.join("")}function Ai(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n=t[e])[0],"V",n[1]);return i.join("")}function Mi(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return wi(t);var r=t.length!=e.length,n="",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(a[0]-2*o[0]/3)+","+(a[1]-2*o[1]/3)+","+a[0]+","+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;u<e.length;u++,l++)a=t[l],s=e[u],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var c=t[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+c[0]+","+c[1]}return n}function Si(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Ei(t){if(t.length<3)return wi(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",Ci(Pi,o),",",Ci(Pi,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),zi(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Ci(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}bi.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ii=[0,2/3,1/3,0],Li=[0,1/3,2/3,0],Pi=[0,1/6,2/3,1/6];function zi(t,e,r){t.push("C",Ci(Ii,e),",",Ci(Ii,r),",",Ci(Li,e),",",Ci(Li,r),",",Ci(Pi,e),",",Ci(Pi,r))}function Oi(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Di(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-Mt,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Ri(t){var e=Te,r=Te,n=0,i=ke,a=xi,o=wi,s=o.key,l=o,u="L",c=.7;function h(s){var h,f,p,d=[],m=[],g=[],y=-1,v=s.length,x=he(e),_=he(n),b=e===r?function(){return f}:he(r),w=n===i?function(){return p}:he(i);function T(){d.push("M",o(t(g),c),u,l(t(m.reverse()),c),"Z")}for(;++y<v;)a.call(this,h=s[y],y)?(m.push([f=+x.call(this,h,y),p=+_.call(this,h,y)]),g.push([+b.call(this,h,y),+w.call(this,h,y)])):m.length&&(T(),m=[],g=[]);return m.length&&T(),d.length?d.join(""):null}return h.x=function(t){return arguments.length?(e=r=t,h):r},h.x0=function(t){return arguments.length?(e=t,h):e},h.x1=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(n=i=t,h):i},h.y0=function(t){return arguments.length?(n=t,h):n},h.y1=function(t){return arguments.length?(i=t,h):i},h.defined=function(t){return arguments.length?(a=t,h):a},h.interpolate=function(t){return arguments.length?(s="function"==typeof t?o=t:(o=bi.get(t)||wi).key,l=o.reverse||o,u=o.closed?"M":"L",h):s},h.tension=function(t){return arguments.length?(c=t,h):c},h}function Fi(t){return t.source}function Bi(t){return t.target}function Ni(t){return t.radius}function ji(t){return[t.x,t.y]}function Ui(){return 64}function Vi(){return"circle"}function qi(t){var e=Math.sqrt(t/Tt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=_i(Di);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ki.reverse=Ai,Ai.reverse=ki,t.svg.area=function(){return Ri(C)},t.svg.area.radial=function(){var t=Ri(Di);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Fi,e=Bi,r=Ni,n=di,i=mi;function a(r,n){var i=o(this,t,r,n),a=o(this,e,r,n);return"M"+i.p0+s(i.r,i.p1,i.a1-i.a0)+(function(t,e){return t.a0==e.a0&&t.a1==e.a1}(i,a)?l(i.r,i.p1,i.r,i.p0):l(i.r,i.p1,a.r,a.p0)+s(a.r,a.p1,a.a1-a.a0)+l(a.r,a.p1,i.r,i.p0))+"Z"}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),u=n.call(t,s,o)-Mt,c=i.call(t,s,o)-Mt;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Tt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=he(t),a):r},a.source=function(e){return arguments.length?(t=he(e),a):t},a.target=function(t){return arguments.length?(e=he(t),a):e},a.startAngle=function(t){return arguments.length?(n=he(t),a):n},a.endAngle=function(t){return arguments.length?(i=he(t),a):i},a},t.svg.diagonal=function(){var t=Fi,e=Bi,r=ji;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=he(e),n):t},n.target=function(t){return arguments.length?(e=he(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=ji,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Mt;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=Vi,e=Ui;function r(r,n){return(Hi.get(t.call(this,r,n))||qi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=he(e),r):t},r.size=function(t){return arguments.length?(e=he(t),r):e},r};var Hi=t.map({circle:qi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Zi)),r=e*Zi;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Gi),r=e*Gi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Gi),r=e*Gi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Hi.keys();var Gi=Math.sqrt(3),Zi=Math.tan(30*St);G.transition=function(t){for(var e,r,n=$i||++Qi,i=ra(t),a=[],o=Ji||{time:Date.now(),ease:Cr,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&na(r,c,i,n,o),e.push(r)}return Xi(a,i,n)},G.interrupt=function(t){return this.each(null==t?Wi:Yi(ra(t)))};var Wi=Yi(ra());function Yi(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Xi(t,e,r){return j(t,Ki),t.namespace=e,t.id=r,t}var $i,Ji,Ki=[],Qi=0;function ta(t,e,r,n){var i=t.id,a=t.namespace;return ut(t,"function"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function ea(t){return null==t&&(t=""),function(){this.textContent=t}}function ra(t){return null==t?"__transition__":"__transition_"+t+"__"}function na(t,e,r,n,i){var a,o,s,l,u,c=t[r]||(t[r]={active:0,count:0}),h=c[n];function f(r){var i=c.active,f=c[i];for(var d in f&&(f.timer.c=null,f.timer.t=NaN,--c.count,delete c[i],f.event&&f.event.interrupt.call(t,t.__data__,f.index)),c)if(+d<n){var m=c[d];m.timer.c=null,m.timer.t=NaN,--c.count,delete c[d]}o.c=p,xe(function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1},0,a),c.active=n,h.event&&h.event.start.call(t,t.__data__,e),u=[],h.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&u.push(n)}),l=h.ease,s=h.duration}function p(i){for(var a=i/s,o=l(a),f=u.length;f>0;)u[--f].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}h||(a=i.time,o=xe(function(t){var e=h.delay;if(o.t=e+a,e<=t)return f(t-e);o.c=f},0,a),h=c[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}Ki.call=G.call,Ki.empty=G.empty,Ki.node=G.node,Ki.size=G.size,t.transition=function(e,r){return e&&e.transition?$i?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=Ki,Ki.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=Z(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),na(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return Xi(o,a,i)},Ki.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=W(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,p=h.length;++f<p;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var d=-1,m=r.length;++d<m;)(i=r[d])&&na(i,d,s,o,a),e.push(i)}return Xi(l,s,o)},Ki.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=st(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return Xi(n,this.namespace,this.id)},Ki.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Ki.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?jr:_r,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return ta(this,"attr."+e,r,i.local?function(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}:function(t){return null==t?a:(t+="",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})})},Ki.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},Ki.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function i(){this.style.removeProperty(t)}return ta(this,"style."+t,e,function(e){return null==e?i:(e+="",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=_r(i,e),function(e){this.style.setProperty(t,n(e),r)})})})},Ki.styleTween=function(t,e,r){return arguments.length<3&&(r=""),this.tween("style."+t,function(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}})},Ki.text=function(t){return ta(this,"text",t,ea)},Ki.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ki.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ut(this,function(t){t[n][r].ease=e}))},Ki.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(this,"function"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},Ki.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(this,"function"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},Ki.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=Ji,o=$i;try{$i=n,ut(this,function(t,r,a){Ji=t[i][n],e.call(t,t.__data__,r,a)})}finally{Ji=a,$i=o}}else ut(this,function(a){var o=a[i][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)});return this},Ki.transition=function(){for(var t,e,r,n=this.id,i=++Qi,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var u,c=0,h=(u=this[s]).length;c<h;c++)(e=u[c])&&na(e,c,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return Xi(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=ia,a=6,o=6,s=3,l=[10],u=null;function c(n){n.each(function(){var n,c=t.select(this),h=this.__chart__||r,f=this.__chart__=r.copy(),p=null==u?f.ticks?f.ticks.apply(f,l):f.domain():u,d=null==e?f.tickFormat?f.tickFormat.apply(f,l):C:e,m=c.selectAll(".tick").data(p,f),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",wt),y=t.transition(m.exit()).style("opacity",wt).remove(),v=t.transition(m.order()).style("opacity",1),x=Math.max(a,0)+s,_=jn(f),b=c.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),t.transition(b));g.append("line"),g.append("text");var T,k,A,M,S=g.select("line"),E=v.select("line"),I=m.select("text").text(d),L=g.select("text"),P=v.select("text"),z="top"===i||"left"===i?-1:1;if("bottom"===i||"top"===i?(n=oa,T="x",A="y",k="x2",M="y2",I.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+_[0]+","+z*o+"V0H"+_[1]+"V"+z*o)):(n=sa,T="y",A="x",k="y2",M="x2",I.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*o+","+_[0]+"H0V"+_[1]+"H"+z*o)),S.attr(M,z*a),L.attr(A,z*x),E.attr(k,0).attr(M,z*a),P.attr(T,0).attr(A,z*x),f.rangeBand){var O=f,D=O.rangeBand()/2;h=f=function(t){return O(t)+D}}else h.rangeBand?h=f:y.call(n,f,h);g.call(n,h,f),v.call(n,f,f)})}return c.scale=function(t){return arguments.length?(r=t,c):r},c.orient=function(t){return arguments.length?(i=t in aa?t+"":ia,c):i},c.ticks=function(){return arguments.length?(l=n(arguments),c):l},c.tickValues=function(t){return arguments.length?(u=t,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],c):a},c.innerTickSize=function(t){return arguments.length?(a=+t,c):a},c.outerTickSize=function(t){return arguments.length?(o=+t,c):o},c.tickPadding=function(t){return arguments.length?(s=+t,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var ia="bottom",aa={top:1,right:1,bottom:1,left:1};function oa(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function sa(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}t.svg.brush=function(){var e,r,n=B(f,"brushstart","brush","brushend"),i=null,a=null,s=[0,0],l=[0,0],u=!0,c=!0,h=ua[0];function f(e){e.each(function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",g).on("touchstart.brush",g),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(h,C);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return la[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",f.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=jn(i),l.attr("x",o[0]).attr("width",o[1]-o[0]),d(s)),a&&(o=jn(a),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),p(s)})}function p(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"})}function d(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=t.select(t.event.target),x=n.of(y,arguments),_=t.select(y),b=v.datum(),w=!/^(n|s)$/.test(b)&&i,T=!/^(e|w)$/.test(b)&&a,k=v.classed("extent"),A=vt(y),M=t.mouse(y),S=t.select(o(y)).on("keydown.brush",function(){32==t.event.keyCode&&(k||(h=null,M[0]-=s[1],M[1]-=l[1],k=2),R())}).on("keyup.brush",function(){32==t.event.keyCode&&2==k&&(M[0]+=s[1],M[1]+=l[1],k=0,R())});if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",P):S.on("mousemove.brush",I).on("mouseup.brush",P),_.interrupt().selectAll("*").interrupt(),k)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(b){var E=+/w$/.test(b),C=+/^n/.test(b);g=[s[1-E]-M[0],l[1-C]-M[1]],M[0]=s[E],M[1]=l[C]}else t.event.altKey&&(h=M.slice());function I(){var e=t.mouse(y),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),k||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]<h[0])],M[1]=l[+(e[1]<h[1])]):h=null),w&&L(e,i,0)&&(d(_),r=!0),T&&L(e,a,1)&&(m(_),r=!0),r&&(p(_),x({type:"brush",mode:k?"move":"resize"}))}function L(t,n,i){var a,o,f=jn(n),p=f[0],d=f[1],m=M[i],g=i?l:s,y=g[1]-g[0];if(k&&(p-=m,d-=y+m),a=(i?c:u)?Math.max(p,Math.min(d,t[i])):t[i],k?o=(a+=m)+y:(h&&(m=Math.max(p,Math.min(d,2*h[i]-a))),m<a?(o=a,a=m):o=m),g[0]!=a||g[1]!=o)return i?r=null:e=null,g[0]=a,g[1]=o,!0}function P(){I(),_.style("pointer-events","all").selectAll(".resize").style("display",f.empty()?"none":null),t.select("body").style("cursor",null),S.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),x({type:"brushend"})}_.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",v.style("cursor")),x({type:"brushstart"}),I()}return f.event=function(i){i.each(function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,$i?t.select(this).transition().each("start.brush",function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:"brushstart"})}).tween("brush:brush",function(){var t=br(s,a.x),n=br(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=a.i,r=a.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})}):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))})},f.x=function(t){return arguments.length?(h=ua[!(i=t)<<1|!a],f):i},f.y=function(t){return arguments.length?(h=ua[!i<<1|!(a=t)],f):a},f.clamp=function(t){return arguments.length?(i&&a?(u=!!t[0],c=!!t[1]):i?u=!!t:a&&(c=!!t),f):i&&a?[u,c]:i?u:a?c:null},f.extent=function(t){var n,o,u,c,h;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(h=n,n=o,o=h),(n!=s[0]||o!=s[1])&&(s=[n,o])),a&&(u=t[0],c=t[1],i&&(u=u[1],c=c[1]),r=[u,c],a.invert&&(u=a(u),c=a(c)),c<u&&(h=u,u=c,c=h),(u!=l[0]||c!=l[1])&&(l=[u,c])),f):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(h=n,n=o,o=h))),a&&(r?(u=r[0],c=r[1]):(u=l[0],c=l[1],a.invert&&(u=a.invert(u),c=a.invert(c)),c<u&&(h=u,u=c,c=h))),i&&a?[[n,u],[o,c]]:i?[n,o]:a&&[u,c])},f.clear=function(){return f.empty()||(s=[0,0],l=[0,0],e=r=null),f},f.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(f,n,"on")};var la={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ua=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];function ca(t){return JSON.parse(t.responseText)}function ha(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}t.text=fe(function(t){return t.responseText}),t.json=function(t,e){return pe(t,"application/json",ca,e)},t.html=function(t,e){return pe(t,"text/html",ha,e)},t.xml=fe(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}).apply(self)}),x=f((t,e)=>{var r,n;r=t,n=function(t){var e=new Date,r=new Date;function n(t,i,a,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e<r-t?e:r},s.offset=function(t,e){return i(t=new Date(+t),null==e?1:Math.floor(e)),t},s.range=function(e,r,n){var a,o=[];if(e=s.ceil(e),n=null==n?1:Math.floor(n),!(e<r&&n>0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a<e&&e<r);return o},s.filter=function(e){return n(function(r){if(r>=r)for(;t(r),!e(r);)r.setTime(r-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););})},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t===0}:function(e){return s.count(0,e)%t===0}):s:null}),s}var i=n(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n(function(e){e.setTime(Math.floor(e/t)*t)},function(e,r){e.setTime(+e+r*t)},function(e,r){return(r-e)/t}):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,u=864e5,c=6048e5,h=n(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*o)},function(t,e){return(e-t)/o},function(t){return t.getUTCSeconds()}),f=h.range,p=n(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o)},function(t,e){t.setTime(+t+e*s)},function(t,e){return(e-t)/s},function(t){return t.getMinutes()}),d=p.range,m=n(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o-t.getMinutes()*s)},function(t,e){t.setTime(+t+e*l)},function(t,e){return(e-t)/l},function(t){return t.getHours()}),g=m.range,y=n(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/u},function(t){return t.getDate()-1}),v=y.range;function x(t){return n(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/c})}var _=x(0),b=x(1),w=x(2),T=x(3),k=x(4),A=x(5),M=x(6),S=_.range,E=b.range,C=w.range,I=T.range,L=k.range,P=A.range,z=M.range,O=n(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),D=O.range,R=n(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});R.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,r){e.setFullYear(e.getFullYear()+r*t)}):null};var F=R.range,B=n(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*s)},function(t,e){return(e-t)/s},function(t){return t.getUTCMinutes()}),N=B.range,j=n(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*l)},function(t,e){return(e-t)/l},function(t){return t.getUTCHours()}),U=j.range,V=n(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/u},function(t){return t.getUTCDate()-1}),q=V.range;function H(t){return n(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/c})}var G=H(0),Z=H(1),W=H(2),Y=H(3),X=H(4),$=H(5),J=H(6),K=G.range,Q=Z.range,tt=W.range,et=Y.range,rt=X.range,nt=$.range,it=J.range,at=n(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),ot=at.range,st=n(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});st.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)}):null};var lt=st.range;t.timeDay=y,t.timeDays=v,t.timeFriday=A,t.timeFridays=P,t.timeHour=m,t.timeHours=g,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=p,t.timeMinutes=d,t.timeMonday=b,t.timeMondays=E,t.timeMonth=O,t.timeMonths=D,t.timeSaturday=M,t.timeSaturdays=z,t.timeSecond=h,t.timeSeconds=f,t.timeSunday=_,t.timeSundays=S,t.timeThursday=k,t.timeThursdays=L,t.timeTuesday=w,t.timeTuesdays=C,t.timeWednesday=T,t.timeWednesdays=I,t.timeWeek=_,t.timeWeeks=S,t.timeYear=R,t.timeYears=F,t.utcDay=V,t.utcDays=q,t.utcFriday=$,t.utcFridays=nt,t.utcHour=j,t.utcHours=U,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=B,t.utcMinutes=N,t.utcMonday=Z,t.utcMondays=Q,t.utcMonth=at,t.utcMonths=ot,t.utcSaturday=J,t.utcSaturdays=it,t.utcSecond=h,t.utcSeconds=f,t.utcSunday=G,t.utcSundays=K,t.utcThursday=X,t.utcThursdays=rt,t.utcTuesday=W,t.utcTuesdays=tt,t.utcWednesday=Y,t.utcWednesdays=et,t.utcWeek=G,t.utcWeeks=K,t.utcYear=st,t.utcYears=lt,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}),_=f((t,e)=>{var r,n;r=t,n=function(t,e){function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function a(t){var a=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,h=t.shortDays,f=t.months,vt=t.shortMonths,xt=p(u),_t=d(u),bt=p(c),wt=d(c),Tt=p(h),kt=d(h),At=p(f),Mt=d(f),St=p(vt),Et=d(vt),Ct={a:function(t){return h[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return f[t.getMonth()]},c:null,d:D,e:D,f:j,H:R,I:F,j:B,L:N,m:U,M:V,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:yt,S:q,u:H,U:G,V:Z,w:W,W:Y,x:null,X:null,y:X,Y:$,Z:J,"%":mt},It={a:function(t){return h[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return f[t.getUTCMonth()]},c:null,d:K,e:K,f:nt,H:Q,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:yt,S:ot,u:st,U:lt,V:ut,w:ct,W:ht,x:null,X:null,y:ft,Y:pt,Z:dt,"%":mt},Lt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Ot(t,a,e,r)},d:A,e:A,f:L,H:S,I:S,j:M,L:I,m:k,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=_t[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:O,S:C,u:g,U:y,V:v,w:m,W:x,x:function(t,e,r){return Ot(t,o,e,r)},X:function(t,e,r){return Ot(t,l,e,r)},y:b,Y:_,Z:w,"%":P};function Pt(t,e){return function(r){var n,i,a,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l<c;)37===t.charCodeAt(l)&&(o.push(t.slice(u,l)),null!=(i=s[n=t.charAt(++l)])?n=t.charAt(++l):i="e"===n?" ":"0",(a=e[n])&&(n=a(r,i)),o.push(n),u=l+1);return o.push(t.slice(u,l)),o.join("")}}function zt(t,a){return function(o){var s,l,u=i(1900,void 0,1);if(Ot(u,t,o+="",0)!=o.length)return null;if("Q"in u)return new Date(u.Q);if("s"in u)return new Date(1e3*u.s+("L"in u?u.L:0));if(a&&!("Z"in u)&&(u.Z=0),"p"in u&&(u.H=u.H%12+12*u.p),void 0===u.m&&(u.m="q"in u?u.q:0),"V"in u){if(u.V<1||u.V>53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(i(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(i(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(i(u.y,0,1)).getUTCDay():r(i(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function Ot(t,e,r,n){for(var i,a,o=0,l=e.length,u=r.length;o<l;){if(n>=u)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Lt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ct.x=Pt(o,Ct),Ct.X=Pt(l,Ct),Ct.c=Pt(a,Ct),It.x=Pt(o,It),It.X=Pt(l,It),It.c=Pt(a,It),{format:function(t){var e=Pt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Pt(t+="",It);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function h(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function f(t){return t.replace(c,"\\$&")}function p(t){return new RegExp("^(?:"+t.map(f).join("|")+")","i")}function d(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function m(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function g(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function y(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function v(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function x(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function _(t,e,r){var n=l.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function b(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function P(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function D(t,e){return h(t.getDate(),e,2)}function R(t,e){return h(t.getHours(),e,2)}function F(t,e){return h(t.getHours()%12||12,e,2)}function B(t,r){return h(1+e.timeDay.count(e.timeYear(t),t),r,3)}function N(t,e){return h(t.getMilliseconds(),e,3)}function j(t,e){return N(t,e)+"000"}function U(t,e){return h(t.getMonth()+1,e,2)}function V(t,e){return h(t.getMinutes(),e,2)}function q(t,e){return h(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return h(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Z(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),h(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function Y(t,r){return h(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function X(t,e){return h(t.getFullYear()%100,e,2)}function $(t,e){return h(t.getFullYear()%1e4,e,4)}function J(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+h(e/60|0,"0",2)+h(e%60,"0",2)}function K(t,e){return h(t.getUTCDate(),e,2)}function Q(t,e){return h(t.getUTCHours(),e,2)}function tt(t,e){return h(t.getUTCHours()%12||12,e,2)}function et(t,r){return h(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return h(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return h(t.getUTCMonth()+1,e,2)}function at(t,e){return h(t.getUTCMinutes(),e,2)}function ot(t,e){return h(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return h(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),h(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function ht(t,r){return h(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ft(t,e){return h(t.getUTCFullYear()%100,e,2)}function pt(t,e){return h(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function yt(t){return Math.floor(+t/1e3)}function vt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xt="%Y-%m-%dT%H:%M:%S.%LZ",_t=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(xt),bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(xt);t.isoFormat=_t,t.isoParse=bt,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,x()):n((r=r||self).d3=r.d3||{},r.d3)}),b=f((t,e)=>{var r,n;r=t,n=function(t){function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var c,h=Array.prototype.map,f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function p(t){var e=void 0===t.grouping||void 0===t.thousands?u:function(t,e){return function(r,n){for(var i=r.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}(h.call(t.grouping,Number),t.thousands+""),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",c=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(h.call(t.numerals,String)),p=void 0===t.percent?"%":t.percent+"",d=void 0===t.minus?"-":t.minus+"",m=void 0===t.nan?"NaN":t.nan+"";function g(t){var r=(t=a(t)).fill,u=t.align,h=t.sign,g=t.symbol,y=t.zero,v=t.width,x=t.comma,_=t.precision,b=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===_&&(_=12),b=!0,w="g"),(y||"0"===r&&"="===u)&&(y=!0,r="0",u="=");var T="$"===g?i:"#"===g&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===g?o:/[%p]/.test(w)?p:"",A=l[w],M=/[defgprs%]/.test(w);function S(t){var i,a,o,l=T,p=k;if("c"===w)p=A(t)+p,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:A(Math.abs(t),_),b&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n<r;++n)switch(t[n]){case".":i=e=n;break;case"0":0===i&&(i=n),e=n;break;default:if(!+t[n])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==h&&(g=!1),l=(g?"("===h?h:d:"-"===h||"("===h?"":h)+l,p=("s"===w?f[8+n/3]:"")+p+(g&&"("===h?")":""),M)for(i=-1,a=t.length;++i<a;)if(48>(o=t.charCodeAt(i))||o>57){p=(46===o?s+t.slice(i+1):t.slice(i))+p,t=t.slice(0,i);break}}x&&!y&&(t=e(t,1/0));var S=l.length+t.length+p.length,E=S<v?new Array(v-S+1).join(r):"";switch(x&&y&&(t=e(E+t,E.length?v-p.length:1/0),E=""),u){case"<":t=l+t+p+E;break;case"=":t=l+E+t+p;break;case"^":t=E.slice(0,S=E.length>>1)+l+t+p+E.slice(S);break;default:t=E+l+t+p}return c(t)}return _=void 0===_?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return t+""},S}return{format:g,formatPrefix:function(t,e){var n=g(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=f[8+i/3];return function(t){return n(o*t)+s}}}}function d(e){return c=p(e),t.format=c.format,t.formatPrefix=c.formatPrefix,c}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=p,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r="undefined"!=typeof globalThis?globalThis:r||self).d3=r.d3||{})}),w=f((t,e)=>{e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}}),T=f((t,e)=>{var r=w();e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0===(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}}),k=f((t,e)=>{e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:""}}),A=f((t,e)=>{var r,n;r=t,n=function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[e.charCodeAt(n)]=n;t.decode=function(t){var e,n,i,a,o,s=.75*t.length,l=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),h=new Uint8Array(c);for(e=0;e<l;e+=4)n=r[t.charCodeAt(e)],i=r[t.charCodeAt(e+1)],a=r[t.charCodeAt(e+2)],o=r[t.charCodeAt(e+3)],h[u++]=n<<2|i>>4,h[u++]=(15&i)<<4|a>>2,h[u++]=(3&a)<<6|63&o;return c},t.encode=function(t){var r,n=new Uint8Array(t),i=n.length,a="";for(r=0;r<i;r+=3)a+=e[n[r]>>2],a+=e[(3&n[r])<<4|n[r+1]>>4],a+=e[(15&n[r+1])<<2|n[r+2]>>6],a+=e[63&n[r+2]];return i%3==2?a=a.substring(0,a.length-1)+"=":i%3==1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r="undefined"!=typeof globalThis?globalThis:r||self)["base64-arraybuffer"]={})}),M=f((t,e)=>{e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}}),S=f(t=>{var e=A().decode,r=M(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}t.isTypedArray=o,t.isArrayOrTypedArray=s,t.isArray1D=function(t){return!s(t[0])},t.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t};var l={u1c:"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"==typeof Int8Array?void 0:Int8Array,u1:"undefined"==typeof Uint8Array?void 0:Uint8Array,i2:"undefined"==typeof Int16Array?void 0:Int16Array,u2:"undefined"==typeof Uint16Array?void 0:Uint16Array,i4:"undefined"==typeof Int32Array?void 0:Int32Array,u4:"undefined"==typeof Uint32Array?void 0:Uint32Array,f4:"undefined"==typeof Float32Array?void 0:Float32Array,f8:"undefined"==typeof Float64Array?void 0:Float64Array};function u(t){return t.constructor===ArrayBuffer}function c(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;i<t.length;i++)n=e(n,t[i].length);return n}return t.length}return 0}l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8,t.isArrayBuffer=u,t.decodeTypedArraySpec=function(t){var r=[],n=function(t){return{bdata:t.bdata,dtype:t.dtype,shape:t.shape}}(t),i=n.dtype,a=l[i];if(!a)throw new Error('Error in dtype: "'+i+'"');var o=a.BYTES_PER_ELEMENT,s=n.bdata;u(s)||(s=e(s));var c=void 0===n.shape?[s.byteLength/o]:(""+n.shape).split(",");c.reverse();var h,f,p=c.length,d=+c[0],m=o*d,g=0;if(1===p)r=new a(s);else if(2===p)for(h=+c[1],f=0;f<h;f++)r[f]=new a(s,g,d),g+=m;else{if(3!==p)throw new Error("ndim: "+p+'is not supported with the shape:"'+n.shape+'"');h=+c[1];for(var y=+c[2],v=0;v<y;v++)for(r[v]=[],f=0;f<h;f++)r[v][f]=new a(s,g,d),g+=m}return r.bdata=n.bdata,r.dtype=n.dtype,r.shape=c.reverse().join(","),t._inputArray=r,r},t.isTypedArraySpec=function(t){return r(t)&&t.hasOwnProperty("dtype")&&"string"==typeof t.dtype&&t.hasOwnProperty("bdata")&&("string"==typeof t.bdata||u(t.bdata))&&(void 0===t.shape||t.hasOwnProperty("shape")&&("string"==typeof t.shape||"number"==typeof t.shape))},t.concat=function(){var t,e,r,i,a,o,s,l,u=[],c=!0,h=0;for(r=0;r<arguments.length;r++)(o=(i=arguments[r]).length)&&(e?u.push(i):(e=i,a=o),n(i)?t=!1:(c=!1,h?t!==i.constructor&&(t=!1):t=i.constructor),h+=o);if(!h)return[];if(!u.length)return e;if(c)return e.concat.apply(e,u);if(t){for((s=new t(h)).set(e),r=0;r<u.length;r++)i=u[r],s.set(i,a),a+=i.length;return s}for(s=new Array(h),l=0;l<e.length;l++)s[l]=e[l];for(r=0;r<u.length;r++){for(i=u[r],l=0;l<i.length;l++)s[a+l]=i[l];a+=l}return s},t.maxRowLength=function(t){return c(t,Math.max,0)},t.minRowLength=function(t){return c(t,Math.min,1/0)}}),E=f((t,e)=>{var r=T(),n=S().isArrayOrTypedArray;function i(t,e){return function(r){var a,o,s,l,u,c=t;for(l=0;l<e.length-1;l++){if(-1===(a=e[l])){for(o=!0,s=[],u=0;u<c.length;u++)s[u]=i(c[u],e.slice(l+1))(r),s[u]!==s[0]&&(o=!1);return o?s[0]:s}if("number"==typeof a&&!n(c)||"object"!=typeof(c=c[a])||null===c)return}if("object"==typeof c&&null!==c&&(s=c[e[l]],r||null!==s))return s}}e.exports=function(t,e){if(r(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";var n,a,o,l,u=e.split(".");for(l=0;l<u.length;l++)if("__"===String(u[l]).slice(0,2))throw"bad property string";for(l=0;l<u.length;){if(n=String(u[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(n[1])u[l]=n[1];else{if(0!==l)throw"bad property string";u.splice(0,1)}for(a=n[2].substr(1,n[2].length-2).split("]["),o=0;o<a.length;o++)l++,u.splice(l,0,Number(a[o]))}l++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,u):{set:s(t,u,e),get:i(t,u),astr:e,parts:u,obj:t}};var a=/(^|\.)args\[/;function o(t,e){return void 0===t||null===t&&!e.match(a)}function s(t,e,r){return function(i){var a,s,h=t,f="",p=o(i,r);for(s=0;s<e.length-1;s++){if("number"==typeof(a=e[s])&&!n(h))throw"array index but container is not an array";if(-1===a){if(p=!u(h,e.slice(s+1),i,r))break;return}if(!c(h,a,e[s+1],p))break;if("object"!=typeof(h=h[a])||null===h)throw"container is not an object";f=l(f,a)}if(p){if(s===e.length-1&&(delete h[e[s]],Array.isArray(h)&&+e[s]===h.length-1))for(;h.length&&void 0===h[h.length-1];)h.pop()}else h[e[s]]=i}}function l(t,e){var n=e;return r(e)?n="["+e+"]":t&&(n="."+e),t+n}function u(t,e,r,i){var a,l=n(r),u=!0,h=r,f=i.replace("-1",0),p=!l&&o(r,f),d=e[0];for(a=0;a<t.length;a++)f=i.replace("-1",a),l&&(p=o(h=r[a%r.length],f)),p&&(u=!1),c(t,a,d,p)&&s(t[a],e,i.replace("-1",a))(h);return u}function c(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}}),C=f((t,e)=>{var r=E(),n=/^\w*$/;e.exports=function(t,e,i,a){i=i||"name",a=a||"value";var o,s,l,u={};e&&e.length?(l=r(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o<s.length;o++)c[s[o][i]]=o;var h=n.test(a),f={set:function(t,e){var n=null===e?4:0;if(!s){if(!l||4===n)return;s=[],l.set(s)}var o=c[t];if(void 0===o){if(4===n)return;n|=3,o=s.length,c[t]=o}else e!==(h?s[o][a]:r(s[o],a).get())&&(n|=2);var p=s[o]=s[o]||{};return p[i]=t,h?p[a]=e:r(p,a).set(e),null!==e&&(n&=-5),u[o]=u[o]|n,f},get:function(t){if(s){var e=c[t];if(void 0!==e)return h?s[e][a]:r(s[e],a).get()}},rename:function(t,e){var r=c[t];return void 0===r||(u[r]=1|u[r],c[e]=r,delete c[t],s[r][i]=e),f},remove:function(t){var e=c[t];if(void 0===e)return f;var n=s[e];if(Object.keys(n).length>2)return u[e]=2|u[e],f.set(t,null);if(h){for(o=e;o<s.length;o++)u[o]=3|u[o];for(o=e;o<s.length;o++)c[s[o][i]]--;s.splice(e,1),delete c[t]}else r(n,a).set(null),u[e]=6|u[e];return f},constructUpdate:function(){for(var t,n,o={},l=Object.keys(u),c=0;c<l.length;c++)n=l[c],t=e+"["+n+"]",s[n]?(1&u[n]&&(o[t+"."+i]=s[n][i]),2&u[n]&&(o[t+"."+a]=h?4&u[n]?null:s[n][a]:4&u[n]?null:r(s[n],a).get())):o[t]=null;return o}};return f}}),I=f((t,e)=>{var r=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,n=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var i=t.match(r);if(i)t=i[1];else{if(!t.match(n))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}}),L=f((t,e)=>{var r=T();e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}}),P=f((t,e)=>{var r=S().isArrayOrTypedArray,n=M();e.exports=function t(e,i){for(var a in i){var o=i[a],s=e[a];if(s!==o)if("_"===a.charAt(0)||"function"==typeof o){if(a in e)continue;e[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),u=0;u<l;u++)s[u]!==o[u]&&n(o[u])&&n(s[u])&&t(s[u],o[u])}else n(o)&&n(s)&&(t(s,o),Object.keys(s).length||delete e[a])}}}),z=f((t,e)=>{e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}}),O=f((t,e)=>{!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var i={r:0,g:0,b:0},a=1,l=null,u=null,c=null,h=!1,f=!1;return"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=j.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=j.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=j.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=j.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=j.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=j.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=j.hex8.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:i?"name":"hex8"}:(e=j.hex6.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:i?"name":"hex"}:(e=j.hex4.exec(t))?{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"}:!!(e=j.hex3.exec(t))&&{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),format:i?"name":"hex"}}(e)),"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(i=function(t,e,r){return{r:255*I(t,255),g:255*I(e,255),b:255*I(r,255)}}(e.r,e.g,e.b),h=!0,f="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=O(e.s),u=O(e.v),i=function(e,r,n){e=6*I(e,360),r=I(r,100),n=I(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6,c=[n,s,o,o,l,n][u],h=[l,n,n,s,o,o][u],f=[o,o,l,n,n,s][u];return{r:255*c,g:255*h,b:255*f}}(e.h,l,u),h=!0,f="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=O(e.s),c=O(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=I(t,360),e=I(e,100),r=I(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),h=!0,f="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=C(a),{ok:h,format:e.format||f,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,l:u}}function h(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=a,c=a-l;if(i=0===a?0:c/a,a==l)n=0;else{switch(a){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,v:u}}function f(t,e,r,n){var i=[z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function p(t,e,r,n){return[z(D(n)),z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16))].join("")}function d(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s-=e/100,r.s=L(r.s),u(r)}function m(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s+=e/100,r.s=L(r.s),u(r)}function g(t){return u(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l+=e/100,r.l=L(r.l),u(r)}function v(t,e){e=0===e?0:e||10;var r=u(t).toRgb();return r.r=s(0,o(255,r.r-a(-e/100*255))),r.g=s(0,o(255,r.g-a(-e/100*255))),r.b=s(0,o(255,r.b-a(-e/100*255))),u(r)}function x(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l-=e/100,r.l=L(r.l),u(r)}function _(t,e){var r=u(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,u(r)}function b(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function w(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+120)%360,s:e.s,l:e.l}),u({h:(r+240)%360,s:e.s,l:e.l})]}function T(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+90)%360,s:e.s,l:e.l}),u({h:(r+180)%360,s:e.s,l:e.l}),u({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+72)%360,s:e.s,l:e.l}),u({h:(r+216)%360,s:e.s,l:e.l})]}function A(t,e,r){e=e||6,r=r||30;var n=u(t).toHsl(),i=360/r,a=[u(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16)),z(D(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*I(this._r,255))+"%",g:a(100*I(this._g,255))+"%",b:a(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%)":"rgba("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:O(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,n=function(t){var e,r;return e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(r),n.level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;c<e.length;c++)(n=u.readability(t,e[c]))>l&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function L(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function O(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)}),D=f(t=>{var e=M(),r=Array.isArray;function n(t,i,a,o){var s,l,u,c,h,f,p,d=t[0],m=t.length;if(2===m&&r(d)&&r(t[1])&&0===d.length){if(p=function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],d),p)return d;d.splice(0,d.length)}for(var g=1;g<m;g++)for(l in s=t[g])u=d[l],c=s[l],o&&r(c)?d[l]=c:i&&c&&(e(c)||(h=r(c)))?(h?(h=!1,f=u&&r(u)?u:[]):f=u&&e(u)?u:{},d[l]=n([f,c],i,a,o)):(void 0!==c||a)&&(d[l]=c);return d}t.extendFlat=function(){return n(arguments,!1,!1,!1)},t.extendDeep=function(){return n(arguments,!0,!1,!1)},t.extendDeepAll=function(){return n(arguments,!0,!0,!1)},t.extendDeepNoArrays=function(){return n(arguments,!0,!1,!0)}}),R=f((t,e)=>{e.exports=function(t){var e=t.variantValues,r=t.editType,n=t.colorEditType;void 0===n&&(n=r);var i={editType:r,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};t.noNumericWeightValues&&(i.valType="enumerated",i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var a={family:{valType:"string",noBlank:!0,strict:!0,editType:r},size:{valType:"number",min:1,editType:r},color:{valType:"color",editType:n},weight:i,style:{editType:r,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:t.noFontVariant?void 0:{editType:r,valType:"enumerated",values:e||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:t.noFontTextcase?void 0:{editType:r,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:t.noFontLineposition?void 0:{editType:r,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:t.noFontShadow?void 0:{editType:r,valType:"string",dflt:t.autoShadowDflt?"auto":"none"},editType:r};return t.autoSize&&(a.size.dflt="auto"),t.autoColor&&(a.color.dflt="auto"),t.arrayOk&&(a.family.arrayOk=!0,a.weight.arrayOk=!0,a.style.arrayOk=!0,t.noFontVariant||(a.variant.arrayOk=!0),t.noFontTextcase||(a.textcase.arrayOk=!0),t.noFontLineposition||(a.lineposition.arrayOk=!0),t.noFontShadow||(a.shadow.arrayOk=!0),a.size.arrayOk=!0,a.color.arrayOk=!0),a}}),F=f((t,e)=>{e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),B=f((t,e)=>{var r=F(),n=R(),i=n({editType:"none"});i.family.dflt=r.HOVERFONT,i.size.dflt=r.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:n({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),N=f((t,e)=>{var r=R(),n=B().hoverlabel,i=D().extendFlat;e.exports={hoverlabel:{bgcolor:i({},n.bgcolor,{arrayOk:!0}),bordercolor:i({},n.bordercolor,{arrayOk:!0}),font:r({arrayOk:!0,editType:"none"}),align:i({},n.align,{arrayOk:!0}),namelength:i({},n.namelength,{arrayOk:!0}),showarrow:i({},n.showarrow),editType:"none"}}}),j=f((t,e)=>{var r=R(),n=N();e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:r({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),U=f((t,e)=>{var r=O(),n={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=n.RdBu;function a(t){var e=0;if(!Array.isArray(t)||t.length<2||!t[0]||!t[t.length-1]||0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var n=0;n<t.length;n++){var i=t[n];if(2!==i.length||+i[0]<e||!r(i[1]).isValid())return!1;e=+i[0]}return!0}e.exports={scales:n,defaultScale:i,get:function(t,e){if(e||(e=i),!t)return e;function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e},isValid:function(t){return void 0!==n[t]||a(t)}}}),V=f(t=>{t.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],t.defaultLine="#444",t.lightLine="#eee",t.background="#fff",t.borderLine="#BEC8D9",t.lightFraction=1e3/11}),q=f((t,e)=>{var r=O(),n=T(),i=S().isTypedArray,a=e.exports={},o=V();a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function u(t){if(n(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var i=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===i.length;if(!a&&3!==i.length)return t;for(var o=0;o<i.length;o++){if(!(i[o].length&&(i[o]=Number(i[o]),i[o]>=0)))return t;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return t}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(r(t))},a.opacity=function(t){return t?r(t).getAlpha():0},a.addOpacity=function(t,e){var n=r(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},a.combine=function(t,e){var n=r(t).toRgb();if(1===n.a)return r(t).toRgbString();var i=r(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(t,e,n){var i=r(t).toRgb(),a=r(e).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(t,e,n){var i=r(t);return 1!==i.getAlpha()&&(i=r(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:n?i.darken(n):s).toString()},a.stroke=function(t,e){var n=r(e);t.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(t,e){var n=r(e);t.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,o,s=Object.keys(t);for(e=0;e<s.length;e++)if(o=t[n=s[e]],"color"===n.substr(n.length-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=u(o[r]);else t[n]=u(o);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=u(o[r][1]));else if(Array.isArray(o)){var l=o[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<o.length;r++)a.clean(o[r])}else o&&"object"==typeof o&&!i(o)&&a.clean(o)}}}),H=f((t,e)=>{e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),G=f(t=>{t.counter=function(t,e,r,n){var i=(e||"")+(r?"":"$"),a=!1===n?"":"^";return"xy"===t?new RegExp(a+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(a+t+"([2-9]|[1-9][0-9]+)?"+i)}}),Z=f(t=>{var e=T(),r=O(),n=D().extendFlat,i=j(),a=U(),o=q(),s=H().DESELECTDIM,l=E(),u=G().counter,c=z().modHalf,h=S().isArrayOrTypedArray,f=S().isTypedArraySpec,p=S().decodeTypedArraySpec;function d(e,r){var n=t.valObjectMeta[r.valType];if(r.arrayOk&&h(e))return!0;if(n.validateFunction)return n.validateFunction(e,r);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(e,o,i,r),a!==i}t.valObjectMeta={data_array:{coerceFunction:function(t,e,r){e.set(h(t)?t:f(t)?p(t):r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var i=String(r[n]);if("/"===i.charAt(0)&&"/"===i.charAt(i.length-1)){if(new RegExp(i.substr(1,i.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,r,n,i){f(t)&&(t=p(t)),!e(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?r.set(n):r.set(+t)}},integer:{coerceFunction:function(t,r,n,i){-1===(i.extras||[]).indexOf(t)?(f(t)&&(t=p(t)),t%1||!e(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?r.set(n):r.set(+t)):r.set(t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,n){f(t)&&(t=p(t)),r(t).isValid()?e.set(t):e.set(n)}},colorlist:{coerceFunction:function(t,e,n){Array.isArray(t)&&t.length&&t.every(function(t){return r(t).isValid()})?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,r){e.set(a.get(t,r))}},angle:{coerceFunction:function(t,r,n){f(t)&&(t=p(t)),"auto"===t?r.set("auto"):e(t)?r.set(c(+t,360)):r.set(n)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):e.set(r)}else e.set(r);else e.set(t)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(f(t)?p(t):t)}},info_array:{coerceFunction:function(e,r,n,i){function a(e,r,n){var i,a={set:function(t){i=t}};return void 0===n&&(n=r.dflt),t.valObjectMeta[r.valType].coerceFunction(e,a,n,r),i}if(f(e)&&(e=p(e)),h(e)){var o,s,l,u,c,d,m=2===i.dimensions||"1-2"===i.dimensions&&Array.isArray(e)&&h(e[0]),g=i.items,y=[],v=Array.isArray(g),x=v&&m&&h(g[0]),_=m&&v&&!x,b=v&&!_?g.length:e.length;if(n=Array.isArray(n)?n:[],m)for(o=0;o<b;o++)for(y[o]=[],l=h(e[o])?e[o]:[],c=_?g.length:v?g[o].length:l.length,s=0;s<c;s++)u=_?g[s]:v?g[o][s]:g,void 0!==(d=a(l[s],u,(n[o]||[])[s]))&&(y[o][s]=d);else for(o=0;o<b;o++)void 0!==(d=a(e[o],v?g[o]:g,n[o]))&&(y[o]=d);r.set(y)}else r.set(n)},validateFunction:function(t,e){if(!h(t))return!1;var r=e.items,n=Array.isArray(r),i=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(i){if(!h(t[a])||!e.freeLength&&t[a].length!==r[a].length)return!1;for(var o=0;o<t[a].length;o++)if(!d(t[a][o],n?r[a][o]:r))return!1}else if(!d(t[a],n?r[a]:r))return!1;return!0}}},t.coerce=function(e,r,n,i,a){var o=l(n,i).get(),s=l(e,i),u=l(r,i),c=s.get(),m=r._template;if(void 0===c&&m&&(c=l(m,i).get(),m=0),void 0===a&&(a=o.dflt),o.arrayOk){if(h(c))return u.set(c),c;if(f(c))return c=p(c),u.set(c),c}var g=t.valObjectMeta[o.valType].coerceFunction;g(c,u,a,o);var y=u.get();return m&&y===a&&!d(c,o)&&(g(c=l(m,i).get(),u,a,o),y=u.get()),y},t.coerce2=function(e,r,n,i,a){var o=l(e,i),s=t.coerce(e,r,n,i,a);return null!=o.get()&&s},t.coerceFont=function(t,e,r,i){i||(i={}),r=n({},r);var a={family:t(e+".family",(r=n(r,i.overrideDflt||{})).family),size:t(e+".size",r.size),color:t(e+".color",r.color),weight:t(e+".weight",r.weight),style:t(e+".style",r.style)};if(i.noFontVariant||(a.variant=t(e+".variant",r.variant)),i.noFontLineposition||(a.lineposition=t(e+".lineposition",r.lineposition)),i.noFontTextcase||(a.textcase=t(e+".textcase",r.textcase)),!i.noFontShadow){var o=r.shadow;"none"===o&&i.autoShadowDflt&&(o="auto"),a.shadow=t(e+".shadow",o)}return a},t.coercePattern=function(t,e,r,n){var i,a=t(e+".shape");if(a||(i=t(e+".path")),a||i){a&&t(e+".solidity"),t(e+".size");var s="overlay"===t(e+".fillmode");if(!n){var l=t(e+".bgcolor",s?r:void 0);t(e+".fgcolor",s?o.contrast(l):r)}t(e+".fgopacity",s?.5:1)}},t.coerceHoverinfo=function(e,r,n){var a,o=r._module.attributes,s=o.hoverinfo?o:i,l=s.hoverinfo;if(1===n._dataLength){var u="all"===l.dflt?l.flags.slice():l.dflt.split("+");u.splice(u.indexOf("name"),1),a=u.join("+")}return t.coerce(e,r,s,"hoverinfo",a)},t.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,i=t.marker.opacity;void 0!==i&&(!h(i)&&!t.selected&&!t.unselected&&(r=i,n=s*i),e("selected.marker.opacity",r),e("unselected.marker.opacity",n))}},t.validate=d}),W=f((t,e)=>{var r={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},n={};!function t(e,r){for(var n in e){var i=e[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),t(i,r[n]))}}(r,n),e.exports={configAttributes:r,dfltConfig:n}}),Y=f((t,e)=>{var r=v(),n=T(),i=[];e.exports=function(t,e){if(-1===i.indexOf(t)){i.push(t);var a=1e3;n(e)?a=e:"long"===e&&(a=3e3);var o=r.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var n=r.select(this);n.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){n.transition().call(s)});for(var i=n.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&i.append("br"),i.append("span").text(o[l]);"stick"===e?n.transition().duration(350).style("opacity",1):n.transition().duration(700).style("opacity",1).transition().delay(a).call(s)})}function s(t){t.duration(700).style("opacity",0).each("end",function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),r.select(this).remove()})}}}),X=f((t,e)=>{var r=W().dfltConfig,n=Y(),i=e.exports={};i.log=function(){var t;if(r.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(r.notifyOnLogging>1){var i=[];for(t=0;t<arguments.length;t++)i.push(arguments[t]);n(i.join("<br>"),"long")}},i.warn=function(){var t;if(r.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(r.notifyOnLogging>0){var i=[];for(t=0;t<arguments.length;t++)i.push(arguments[t]);n(i.join("<br>"),"stick")}},i.error=function(){var t;if(r.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.error.apply(console,e)}if(r.notifyOnLogging>0){var i=[];for(t=0;t<arguments.length;t++)i.push(arguments[t]);n(i.join("<br>"),"stick")}}}),$=f((t,e)=>{e.exports=function(){}}),J=f((t,e)=>{e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else(e||0===e)&&-1===t.indexOf(e)&&t.push(e);return t}}),K=f((t,e)=>{e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}),Q=f((t,e)=>{e.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}}),tt=f((t,e)=>{e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}}),et=f((t,e)=>{e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}),rt=f((t,e)=>{e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}}),nt=f((t,e)=>{e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,_=r*u-a*o,b=n*l-i*s,w=n*u-a*s,T=i*u-a*l,k=c*m-h*d,A=c*g-f*d,M=c*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(I=1/I,t[0]=(s*C-l*E+u*S)*I,t[1]=(i*E-n*C-a*S)*I,t[2]=(m*T-g*w+y*b)*I,t[3]=(f*w-h*T-p*b)*I,t[4]=(l*M-o*C-u*A)*I,t[5]=(r*C-i*M+a*A)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(c*T-f*_+p*x)*I,t[8]=(o*E-s*M+u*k)*I,t[9]=(n*M-r*E-a*k)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-c*w-p*v)*I,t[12]=(s*A-o*S-l*k)*I,t[13]=(r*S-n*A+i*k)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(c*b-h*x+f*v)*I,t):null}}),it=f((t,e)=>{e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15];return t[0]=s*(f*y-p*g)-h*(l*y-u*g)+m*(l*p-u*f),t[1]=-(n*(f*y-p*g)-h*(i*y-a*g)+m*(i*p-a*f)),t[2]=n*(l*y-u*g)-s*(i*y-a*g)+m*(i*u-a*l),t[3]=-(n*(l*p-u*f)-s*(i*p-a*f)+h*(i*u-a*l)),t[4]=-(o*(f*y-p*g)-c*(l*y-u*g)+d*(l*p-u*f)),t[5]=r*(f*y-p*g)-c*(i*y-a*g)+d*(i*p-a*f),t[6]=-(r*(l*y-u*g)-o*(i*y-a*g)+d*(i*u-a*l)),t[7]=r*(l*p-u*f)-o*(i*p-a*f)+c*(i*u-a*l),t[8]=o*(h*y-p*m)-c*(s*y-u*m)+d*(s*p-u*h),t[9]=-(r*(h*y-p*m)-c*(n*y-a*m)+d*(n*p-a*h)),t[10]=r*(s*y-u*m)-o*(n*y-a*m)+d*(n*u-a*s),t[11]=-(r*(s*p-u*h)-o*(n*p-a*h)+c*(n*u-a*s)),t[12]=-(o*(h*g-f*m)-c*(s*g-l*m)+d*(s*f-l*h)),t[13]=r*(h*g-f*m)-c*(n*g-i*m)+d*(n*f-i*h),t[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+d*(n*l-i*s)),t[15]=r*(s*f-l*h)-o*(n*f-i*h)+c*(n*l-i*s),t}}),at=f((t,e)=>{e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],p=t[12],d=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-f*m)-(e*s-n*a)*(c*g-f*d)+(e*l-i*a)*(c*m-h*d)+(r*s-n*o)*(u*g-f*p)-(r*l-i*o)*(u*m-h*p)+(n*l-i*s)*(u*d-c*p)}}),ot=f((t,e)=>{e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*h+w*m,t[1]=x*i+_*l+b*f+w*g,t[2]=x*a+_*u+b*p+w*y,t[3]=x*o+_*c+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],t[4]=x*n+_*s+b*h+w*m,t[5]=x*i+_*l+b*f+w*g,t[6]=x*a+_*u+b*p+w*y,t[7]=x*o+_*c+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],t[8]=x*n+_*s+b*h+w*m,t[9]=x*i+_*l+b*f+w*g,t[10]=x*a+_*u+b*p+w*y,t[11]=x*o+_*c+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],t[12]=x*n+_*s+b*h+w*m,t[13]=x*i+_*l+b*f+w*g,t[14]=x*a+_*u+b*p+w*y,t[15]=x*o+_*c+b*d+w*v,t}}),st=f((t,e)=>{e.exports=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,p,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+f*y+e[13],t[14]=a*m+u*g+p*y+e[14],t[15]=o*m+c*g+d*y+e[15]),t}}),lt=f((t,e)=>{e.exports=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}}),ut=f((t,e)=>{e.exports=function(t,e,r,n){var i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E=n[0],C=n[1],I=n[2],L=Math.sqrt(E*E+C*C+I*I);return Math.abs(L)<1e-6?null:(E*=L=1/L,C*=L,I*=L,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],f=e[5],p=e[6],d=e[7],m=e[8],g=e[9],y=e[10],v=e[11],x=E*E*o+a,_=C*E*o+I*i,b=I*E*o-C*i,w=E*C*o-I*i,T=C*C*o+a,k=I*C*o+E*i,A=E*I*o+C*i,M=C*I*o-E*i,S=I*I*o+a,t[0]=s*x+h*_+m*b,t[1]=l*x+f*_+g*b,t[2]=u*x+p*_+y*b,t[3]=c*x+d*_+v*b,t[4]=s*w+h*T+m*k,t[5]=l*w+f*T+g*k,t[6]=u*w+p*T+y*k,t[7]=c*w+d*T+v*k,t[8]=s*A+h*M+m*S,t[9]=l*A+f*M+g*S,t[10]=u*A+p*M+y*S,t[11]=c*A+d*M+v*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}}),ct=f((t,e)=>{e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}}),ht=f((t,e)=>{e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}}),ft=f((t,e)=>{e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}}),pt=f((t,e)=>{e.exports=function(t,e,r){var n,i,a,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);return Math.abs(u)<1e-6?null:(o*=u=1/u,s*=u,l*=u,n=Math.sin(e),i=Math.cos(e),a=1-i,t[0]=o*o*a+i,t[1]=s*o*a+l*n,t[2]=l*o*a-s*n,t[3]=0,t[4]=o*s*a-l*n,t[5]=s*s*a+i,t[6]=l*s*a+o*n,t[7]=0,t[8]=o*l*a+s*n,t[9]=s*l*a-o*n,t[10]=l*l*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}}),dt=f((t,e)=>{e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,p=i*l,d=i*u,m=a*u,g=o*s,y=o*l,v=o*u;return t[0]=1-(p+m),t[1]=h+v,t[2]=f-y,t[3]=0,t[4]=h-v,t[5]=1-(c+m),t[6]=d+g,t[7]=0,t[8]=f+y,t[9]=d-g,t[10]=1-(c+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}}),mt=f((t,e)=>{e.exports=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}),gt=f((t,e)=>{e.exports=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}}),yt=f((t,e)=>{e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}),vt=f((t,e)=>{e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}),xt=f((t,e)=>{e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}),_t=f((t,e)=>{e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,p=i*s,d=i*l,m=a*o,g=a*s,y=a*l;return t[0]=1-h-d,t[1]=c+y,t[2]=f-g,t[3]=0,t[4]=c-y,t[5]=1-u-d,t[6]=p+m,t[7]=0,t[8]=f+g,t[9]=p-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}),bt=f((t,e)=>{e.exports=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t}}),wt=f((t,e)=>{e.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}}),Tt=f((t,e)=>{e.exports=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}}),kt=f((t,e)=>{e.exports=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t}}),At=f((t,e)=>{var r=et();e.exports=function(t,e,n,i){var a,o,s,l,u,c,h,f,p,d,m=e[0],g=e[1],y=e[2],v=i[0],x=i[1],_=i[2],b=n[0],w=n[1],T=n[2];return Math.abs(m-b)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-T)<1e-6?r(t):(h=m-b,f=g-w,p=y-T,d=1/Math.sqrt(h*h+f*f+p*p),a=x*(p*=d)-_*(f*=d),o=_*(h*=d)-v*p,s=v*f-x*h,(d=Math.sqrt(a*a+o*o+s*s))?(a*=d=1/d,o*=d,s*=d):(a=0,o=0,s=0),l=f*s-p*o,u=p*a-h*s,c=h*o-f*a,(d=Math.sqrt(l*l+u*u+c*c))?(l*=d=1/d,u*=d,c*=d):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=p,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(l*m+u*g+c*y),t[14]=-(h*m+f*g+p*y),t[15]=1,t)}}),Mt=f((t,e)=>{e.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}}),St=f((t,e)=>{e.exports={create:K(),clone:Q(),copy:tt(),identity:et(),transpose:rt(),invert:nt(),adjoint:it(),determinant:at(),multiply:ot(),translate:st(),scale:lt(),rotate:ut(),rotateX:ct(),rotateY:ht(),rotateZ:ft(),fromRotation:pt(),fromRotationTranslation:dt(),fromScaling:mt(),fromTranslation:gt(),fromXRotation:yt(),fromYRotation:vt(),fromZRotation:xt(),fromQuat:_t(),frustum:bt(),perspective:wt(),perspectiveFromFieldOfView:Tt(),ortho:kt(),lookAt:At(),str:Mt()}}),Et=f(t=>{var e=St();t.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},t.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;e<i;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;e<n;e++)for(a[e]=new Array(i),r=0;r<i;r++)a[e][r]=t[r][e];return a},t.dot=function(e,r){if(!e.length||!r.length||e.length!==r.length)return null;var n,i,a=e.length;if(e[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=t.dot(e[i],r);else if(r[0].length){var o=t.transposeRagged(r);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=t.dot(e,o[i])}else for(n=0,i=0;i<a;i++)n+=e[i]*r[i];return n},t.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},t.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},t.rotationXYMatrix=function(e,r,n){return t.dot(t.dot(t.translationMatrix(r,n),t.rotationMatrix(e)),t.translationMatrix(-r,-n))},t.apply3DTransform=function(e){return function(){var r=arguments,n=1===arguments.length?r[0]:[r[0],r[1],r[2]||0];return t.dot(e,[n[0],n[1],n[2],1]).slice(0,3)}},t.apply2DTransform=function(e){return function(){var r=arguments;3===r.length&&(r=r[0]);var n=1===arguments.length?r[0]:[r[0],r[1]];return t.dot(e,[n[0],n[1],1]).slice(0,2)}},t.apply2DTransform2=function(e){var r=t.apply2DTransform(e);return function(t){return r(t.slice(0,2)).concat(r(t.slice(2,4)))}},t.convertCssMatrix=function(t){if(t){var e=t.length;if(16===e)return t;if(6===e)return[t[0],t[1],0,0,t[2],t[3],0,0,0,0,1,0,t[4],t[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},t.inverseTransformMatrix=function(t){var r=[];return e.invert(r,t),[[r[0],r[1],r[2],r[3]],[r[4],r[5],r[6],r[7]],[r[8],r[9],r[10],r[11]],[r[12],r[13],r[14],r[15]]]}}),Ct=f((t,e)=>{var r=v(),n=X(),i=Et(),a=St();function o(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function s(t,e,r){var i="plotly.js-style-"+t,a=document.getElementById(i);if(!a||!a.matches(".no-inline-styles")){a||((a=document.createElement("style")).setAttribute("id",i),a.appendChild(document.createTextNode("")),document.head.appendChild(a));var o=a.sheet;o?o.insertRule?o.insertRule(e+"{"+r+"}",0):o.addRule?o.addRule(e,r,0):n.warn("addStyleRule failed"):n.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function l(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(t){return+t})}function u(t){for(var e=[];c(t);)e.push(t),t=t.parentNode,"function"==typeof ShadowRoot&&t instanceof ShadowRoot&&(t=t.host);return e}function c(t){return t&&(t instanceof Element||t instanceof HTMLElement)}e.exports={getGraphDiv:function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=r.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:o,addStyleRule:function(t,e){s("global",t,e)},addRelatedStyleRule:s,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&o(r)},setStyleOnHover:function(t,e,r,n,i,a){var o=n.split(":"),s=i.split(":"),l="data-btn-style-event-added";a||(a=document),a.querySelectorAll(t).forEach(function(t){t.getAttribute(l)||(t.addEventListener("mouseenter",function(){var t=this.querySelector(r);t&&(t.style[o[0]]=o[1])}),t.addEventListener("mouseleave",function(){var t=this.querySelector(r);t&&(e&&this.matches(e)?t.style[o[0]]=o[1]:t.style[s[0]]=s[1])}),t.setAttribute(l,!0))})},getFullTransformMatrix:function(t){var e=u(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach(function(t){var e=l(t);if(e){var n=i.convertCssMatrix(e);r=a.multiply(r,r,n)}}),r},getElementTransformMatrix:l,getElementAndAncestors:u,equalDomRects:function(t,e){return t&&e&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}}}),It=f((t,e)=>{e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),Lt=f((t,e)=>{var r=D().extendFlat,n=M(),i={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},a={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},o=i.flags.slice().concat(["fullReplot"]),s=a.flags.slice().concat("layoutReplot");function l(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function u(t,e,i){var a=r({},t);for(var o in a){var s=a[o];n(s)&&(a[o]=c(s,e,0,o))}return"from-root"===i&&(a.editType=e),a}function c(t,e,n,i){if(t.valType){var a=r({},t);if(a.editType=e,Array.isArray(t.items)){a.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)a.items[o]=c(t.items[o],e)}return a}return u(t,e,"_"===i.charAt(0)?"nested":"from-root")}e.exports={traces:i,layout:a,traceFlags:function(){return l(o)},layoutFlags:function(){return l(s)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),i=0;i<n.length;i++)t[n[i]]=!0},overrideAll:u}}),Pt=f(t=>{t.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},t.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),zt=f((t,e)=>{e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),Ot=f(t=>{var e=zt(),r=e.FORMAT_LINK,n=e.DATE_FORMAT_LINK;function i(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],i=0;i<r.length;i++)n[i]="`"+r[i]+"`";e+="Finally, the template string has access to ",e=1===r.length?e+"variable "+n[0]:e+"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return e}t.templateFormatStringDescription=function(t){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(t&&t.supportOther?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),'Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".',r,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".',n,"for details on the date formatting syntax."].join(" ")},t.hovertemplateAttrs=function(t,e){t=t||{},i(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(r.arrayOk=!0),r},t.texttemplateAttrs=function(t,e){t=t||{},i(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"calc"};return!1!==t.arrayOk&&(r.arrayOk=!0),r},t.shapeTexttemplateAttrs=function(t,e){return e=e||{},(t=t||{}).newshape,i(e),{valType:"string",dflt:"",editType:t.editType||"arraydraw"}}}),Dt=f((t,e)=>{function r(t,e){return e?e.d2l(t):t}function n(t,e){return e?e.l2d(t):t}function i(t){return t.x0shift||0}function a(t){return t.x1shift||0}function o(t){return t.y0shift||0}function s(t){return t.y1shift||0}function l(t,e){return r(t.x1,e)+a(t)-r(t.x0,e)-i(t)}function u(t,e,n){return r(t.y1,n)+s(t)-r(t.y0,n)-o(t)}e.exports={x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},slope:function(t,e,r){return"line"!==t.type?void 0:u(t,0,r)/l(t,e)},dx:l,dy:u,width:function(t,e){return Math.abs(l(t,e))},height:function(t,e,r){return Math.abs(u(t,0,r))},length:function(t,e,r){return"line"!==t.type?void 0:Math.sqrt(Math.pow(l(t,e),2)+Math.pow(u(t,0,r),2))},xcenter:function(t,e){return n((r(t.x1,e)+a(t)+r(t.x0,e)+i(t))/2,e)},ycenter:function(t,e,i){return n((r(t.y1,i)+s(t)+r(t.y0,i)+o(t))/2,i)}}}),Rt=f((t,e)=>{var r=Lt().overrideAll,n=j(),i=R(),a=Pt().dash,o=D().extendFlat,s=Ot().shapeTexttemplateAttrs,l=Dt();e.exports=r({newshape:{visible:o({},n.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:o({},n.legend,{}),legendgroup:o({},n.legendgroup,{}),legendgrouptitle:{text:o({},n.legendgrouptitle.text,{}),font:i({})},legendrank:o({},n.legendrank,{}),legendwidth:o({},n.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:o({},a,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:o({},n.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:s({newshape:!0},{keys:Object.keys(l)}),font:i({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)"},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),Ft=f((t,e)=>{var r=Pt().dash,n=D().extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:n({},r,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Bt=f((t,e)=>{e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}}),Nt=f((t,e)=>{var r=R(),n=It(),i=V(),a=Rt(),o=Ft(),s=Bt(),l=D().extendFlat,u=r({editType:"calc"});u.family.dflt='"Open Sans", verdana, arial, sans-serif',u.size.dflt=12,u.color.dflt=i.defaultLine,e.exports={font:u,title:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:l(s({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:a.newshape,activeshape:a.activeshape,newselection:o.newselection,activeselection:o.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:l({},n.transition,{editType:"none"})}}),jt=f(()=>{!function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var t=document.createElement("style");t.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",t.textContent=".maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}",document.head.appendChild(t)}}()}),Ut=f(t=>{var e=X(),r=$(),n=J(),i=M(),a=Ct().addStyleRule,o=D(),s=j(),l=Nt(),u=o.extendFlat,c=o.extendDeepAll;function h(r){var n=r.name,i=r.categories,o=r.meta;if(t.modules[n])e.log("Type "+n+" already registered");else{t.subplotsRegistry[r.basePlotModule.name]||function(r){var n=r.name;if(t.subplotsRegistry[n])e.log("Plot type "+n+" already registered.");else for(var i in m(r),t.subplotsRegistry[n]=r,t.componentsRegistry)y(i,r.name)}(r.basePlotModule);for(var s={},l=0;l<i.length;l++)s[i[l]]=!0,t.allCategories[i[l]]=!0;for(var c in t.modules[n]={_module:r,categories:s},o&&Object.keys(o).length&&(t.modules[n].meta=o),t.allTypes.push(n),t.componentsRegistry)g(c,n);r.layoutAttributes&&u(t.traceLayoutAttributes,r.layoutAttributes);var h=r.basePlotModule,f=h.name;if("mapbox"===f){var p=h.constants.styleRules;for(var d in p)a(".js-plotly-plot .plotly .mapboxgl-"+d,p[d])}"map"===f&&jt(),("geo"===f||"mapbox"===f||"map"===f)&&void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}})}}function f(e){if("string"!=typeof e.name)throw new Error("Component module *name* must be a string.");var r=e.name;for(var i in t.componentsRegistry[r]=e,e.layoutAttributes&&(e.layoutAttributes._isLinkedToArray&&n(t.layoutArrayContainers,r),m(e)),t.modules)g(r,i);for(var a in t.subplotsRegistry)y(r,a);e.schema&&e.schema.layout&&c(l,e.schema.layout)}function p(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var r="Transform module "+t.name,n="function"==typeof t.transform,a="function"==typeof t.calcTransform;if(!n&&!a)throw new Error(r+" is missing a *transform* or *calcTransform* method.");n&&a&&e.log([r+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),i(t.attributes)||e.log(r+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&e.log(r+" registered without a *supplyDefaults* method.")}function d(e){var r=e.name,n=r.split("-")[0],i=e.dictionary,a=e.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,l=t.localeRegistry,u=l[r];if(u||(l[r]=u={}),n!==r){var c=l[n];c||(l[n]=c={}),o&&c.dictionary===u.dictionary&&(c.dictionary=i),s&&c.format===u.format&&(c.format=a)}o&&(u.dictionary=i),s&&(u.format=a)}function m(e){if(e.layoutAttributes){var r=e.layoutAttributes._arrayAttrRegexps;if(r)for(var i=0;i<r.length;i++)n(t.layoutArrayRegexes,r[i])}}function g(e,r){var n=t.componentsRegistry[e].schema;if(n&&n.traces){var i=n.traces[r];i&&c(t.modules[r]._module.attributes,i)}}function y(e,r){var n=t.componentsRegistry[e].schema;if(n&&n.subplots){var i=t.subplotsRegistry[r],a=i.layoutAttributes,o="subplot"===i.attr?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];a&&s&&c(a,s)}}function v(t){return"object"==typeof t&&(t=t.type),t}t.modules={},t.allCategories={},t.allTypes=[],t.subplotsRegistry={},t.componentsRegistry={},t.layoutArrayContainers=[],t.layoutArrayRegexes=[],t.traceLayoutAttributes={},t.localeRegistry={},t.apiMethodRegistry={},t.collectableSubplotTypes=null,t.register=function(e){if(t.collectableSubplotTypes=null,!e)throw new Error("No argument passed to Plotly.register.");e&&!Array.isArray(e)&&(e=[e]);for(var r=0;r<e.length;r++){var n=e[r];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":h(n);break;case"transform":p(n);break;case"component":f(n);break;case"locale":d(n);break;case"apiMethod":var i=n.name;t.apiMethodRegistry[i]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},t.getModule=function(e){var r=t.modules[v(e)];return!!r&&r._module},t.traceIs=function(r,n){if("various"===(r=v(r)))return!1;var i=t.modules[r];return i||(r&&e.log("Unrecognized trace type "+r+"."),i=t.modules[s.type.dflt]),!!i.categories[n]},t.getComponentMethod=function(e,n){var i=t.componentsRegistry[e];return i&&i[n]||r},t.call=function(){var e=arguments[0],r=[].slice.call(arguments,1);return t.apiMethodRegistry[e].apply(null,r)}}),Vt=f(t=>{var e,r,n=_().timeFormat,i=T(),a=X(),o=z().mod,s=k(),l=s.BADNUM,u=s.ONEDAY,c=s.ONEHOUR,h=s.ONEMIN,f=s.ONESEC,p=s.EPOCHJD,d=Ut(),m=_().utcFormat,g=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,y=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,v=(new Date).getFullYear()-70;function x(t){return t&&d.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function b(t,e){return String(t+Math.pow(10,e)).substr(1)}t.dateTick0=function(e,r){var n=function(t,e){return x(t)?e?d.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:d.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"}(e,!!r);if(r<2)return n;var i=t.dateTime2ms(n,e);return i+=u*(r-1),t.ms2DateTime(i,0,e)},t.dfltRange=function(t){return x(t)?d.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},t.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},t.dateTime2ms=function(n,i){if(t.isJSDate(n)){var a=n.getTimezoneOffset()*h,s=(n.getUTCMinutes()-n.getMinutes())*h+(n.getUTCSeconds()-n.getSeconds())*f+(n.getUTCMilliseconds()-n.getMilliseconds());if(s){var m=3*h;a=a-m/2+o(s-a+m/2,m)}return(n=Number(n)-a)>=e&&n<=r?n:l}if("string"!=typeof n&&"number"!=typeof n)return l;n=String(n);var _=x(i),b=n.charAt(0);_&&("G"===b||"g"===b)&&(n=n.substr(1),i="");var w=_&&"chinese"===i.substr(0,7),T=n.match(w?y:g);if(!T)return l;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(_){if(2===k.length)return l;var I;k=Number(k);try{var L=d.getComponentMethod("calendars","getCal")(i);if(w){var P="i"===A.charAt(A.length-1);A=parseInt(A,10),I=L.newDate(k,L.toMonthIndex(k,A,P),M)}else I=L.newDate(k,Number(A),M)}catch(t){return l}return I?(I.toJD()-p)*u+S*c+E*h+C*f:l}k=2===k.length?(Number(k)+2e3-v)%100+v:Number(k),A-=1;var z=new Date(Date.UTC(2e3,A,M,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==A||z.getUTCDate()!==M?l:z.getTime()+C*f},e=t.MIN_MS=t.dateTime2ms("-9999"),r=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(e,r){return t.dateTime2ms(e,r)!==l};var w=90*u,A=3*c,M=5*h;function S(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+b(e,2)+":"+b(r,2),(n||i)&&(t+=":"+b(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+b(i,a)}return t}t.ms2DateTime=function(t,n,i){if("number"!=typeof t||!(t>=e&&t<=r))return l;n||(n=0);var a,s,g,y,v,_,b=Math.floor(10*o(t+.05,1)),T=Math.round(t-b/10);if(x(i)){var k=Math.floor(T/u)+p,E=Math.floor(o(t,u));try{a=d.getComponentMethod("calendars","getCal")(i).fromJD(k).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(T))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;s=n<w?Math.floor(E/c):0,g=n<w?Math.floor(E%c/h):0,y=n<A?Math.floor(E%h/f):0,v=n<M?E%f*10+b:0}else _=new Date(T),a=m("%Y-%m-%d")(_),s=n<w?_.getUTCHours():0,g=n<w?_.getUTCMinutes():0,y=n<A?_.getUTCSeconds():0,v=n<M?10*_.getUTCMilliseconds()+b:0;return S(a,s,g,y,v)},t.ms2DateTimeLocal=function(t){if(!(t>=e+u&&t<=r-u))return l;var i=Math.floor(10*o(t+.05,1)),a=new Date(Math.round(t-i/10));return S(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},t.cleanDate=function(e,r,n){if(e===l)return r;if(t.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(!(e=t.ms2DateTimeLocal(+e))&&void 0!==r)return r}else if(!t.isDateTime(e,n))return a.error("unrecognized date",e),r;return e};var E=/%\d?f/g,C=/%h/g,I={1:"1",2:"1",3:"2",4:"2"};function L(t,e,r,n){t=t.replace(E,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var i=new Date(Math.floor(e+.05));if(t=t.replace(C,function(){return I[r("%q")(i)]}),x(n))try{t=d.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(t,e,r,n,a,s){if(a=x(a)&&a,!e)if("y"===r)e=s.year;else if("m"===r)e=s.month;else{if("d"!==r)return function(t,e){var r=o(t+.05,u),n=b(Math.floor(r/c),2)+":"+b(o(Math.floor(r/h),60),2);if("M"!==e){i(e)||(e=0);var a=(100+Math.min(o(t/f,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+L(s.dayMonthYear,t,n,a);e=s.dayMonth+"\n"+s.year}return L(e,t,n,a)};var O=3*u;t.incrementMonth=function(t,e,r){r=x(r)&&r;var n=o(t,u);if(t=Math.round(t-n),r)try{var i=Math.round(t/u)+p,s=d.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return e%12?s.add(l,e,"m"):s.add(l,e/12,"y"),(l.toJD()-p)*u+n}catch(e){a.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},t.findExactDates=function(t,e){for(var r,n,a=0,o=0,s=0,l=0,c=x(e)&&d.getComponentMethod("calendars","getCal")(e),h=0;h<t.length;h++)if(n=t[h],i(n)){if(!(n%u))if(c)try{1===(r=c.fromJD(n/u+p)).day()?1===r.month()?a++:o++:s++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;s+=o+=a;var f=t.length-l;return{exactYears:a/f,exactMonths:o/f,exactDays:s/f}}}),qt=f((t,e)=>{e.exports=function(t){return t}}),Ht=f(t=>{var e=T(),r=X(),n=qt(),i=k().BADNUM,a=1e-9;function o(t,e){return t<e}function s(t,e){return t<=e}function l(t,e){return t>e}function u(t,e){return t>=e}t.findBin=function(t,n,i){if(e(n.start))return i?Math.ceil((t-n.start)/n.size-a)-1:Math.floor((t-n.start)/n.size+a);var c,h,f=0,p=n.length,d=0,m=p>1?(n[p-1]-n[0])/(p-1):1;for(h=m>=0?i?o:s:i?u:l,t+=m*a*(i?-1:1)*(m>=0?1:-1);f<p&&d++<100;)h(n[c=Math.floor((f+p)/2)],t)?f=c+1:p=c;return d>90&&r.log("Long binary search..."),f-1},t.sorterAsc=function(t,e){return t-e},t.sorterDes=function(t,e){return e-t},t.distinctVals=function(e){var r,n=e.slice();for(n.sort(t.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],u=0;u<=r;u++){var c=n[u],h=c-a;void 0===a?(l.push(c),a=c):h>s&&(o=Math.min(o,h),l.push(c),a=c)}return{vals:l,minDiff:o}},t.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i<a&&o++<100;)e[n=u((i+a)/2)]<=t?i=n+s:a=n-l;return e[i]},t.sort=function(t,e){for(var r=0,n=0,i=1;i<t.length;i++){var a=e(t[i],t[i-1]);if(a<0?r=1:a>0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},t.findIndexOfMin=function(t,e){e=e||n;for(var r,i=1/0,a=0;a<t.length;a++){var o=e(t[a]);o<i&&(i=o,r=a)}return r}}),Gt=f((t,e)=>{e.exports=function(t){return Object.keys(t).sort()}}),Zt=f(t=>{var e=T(),r=S().isArrayOrTypedArray;t.aggNums=function(n,i,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),e(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=t.aggNums(n,i,a[s]);a=l}for(s=0;s<o;s++)e(i)?e(a[s])&&(i=n(+i,+a[s])):i=a[s];return i},t.len=function(e){return t.aggNums(function(t){return t+1},0,e)},t.mean=function(e,r){return r||(r=t.len(e)),t.aggNums(function(t,e){return t+e},0,e)/r},t.geometricMean=function(e,r){return r||(r=t.len(e)),Math.pow(t.aggNums(function(t,e){return t*e},1,e),1/r)},t.midRange=function(e){if(void 0!==e&&0!==e.length)return(t.aggNums(Math.max,null,e)+t.aggNums(Math.min,null,e))/2},t.variance=function(r,n,i){return n||(n=t.len(r)),e(i)||(i=t.mean(r,n)),t.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,r)/n},t.stdev=function(e,r,n){return Math.sqrt(t.variance(e,r,n))},t.median=function(e){var r=e.slice().sort();return t.interp(r,.5)},t.interp=function(t,r){if(!e(r))throw"n should be a finite number";if((r=r*t.length-.5)<0)return t[0];if(r>t.length-1)return t[t.length-1];var n=r%1;return n*t[Math.ceil(r)]+(1-n)*t[Math.floor(r)]}}),Wt=f((t,e)=>{var r=z(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(t){return Math.abs(t[1]-t[0])>o-1e-14}function l(t,e){return i(e-t,o)}function u(t,e){if(s(e))return!0;var r,i;e[0]<e[1]?(r=e[0],i=e[1]):(r=e[1],i=e[0]),(r=n(r,o))>(i=n(i,o))&&(i+=o);var a=n(t,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function c(t,e,r,n,i,l,u){i=i||0,l=l||0;var c,h,f,p,d,m=s([r,n]);function g(t,e){return[t*Math.cos(e)+i,l-t*Math.sin(e)]}m?(c=0,h=a,f=o):r<n?(c=r,f=n):(c=n,f=r),t<e?(p=t,d=e):(p=e,d=t);var y,v=Math.abs(f-c)<=a?0:1;function x(t,e,r){return"A"+[t,t]+" "+[0,v,r]+" "+g(t,e)}return m?y=null===p?"M"+g(d,c)+x(d,h,0)+x(d,f,0)+"Z":"M"+g(p,c)+x(p,h,0)+x(p,f,0)+"ZM"+g(d,c)+x(d,h,1)+x(d,f,1)+"Z":null===p?(y="M"+g(d,c)+x(d,f,0),u&&(y+="L0,0Z")):y="M"+g(p,c)+"L"+g(d,c)+x(d,f,0)+"L"+g(p,f)+x(p,c,1)+"Z",y}e.exports={deg2rad:function(t){return t/180*a},rad2deg:function(t){return t/a*180},angleDelta:l,angleDist:function(t,e){return Math.abs(l(t,e))},isFullCircle:s,isAngleInsideSector:u,isPtInsideSector:function(t,e,r,n){return!!u(e,n)&&(r[0]<r[1]?(i=r[0],a=r[1]):(i=r[1],a=r[0]),t>=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return c(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return c(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return c(t,e,r,n,i,a,1)}}}),Yt=f(t=>{t.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},t.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},t.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},t.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},t.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},t.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}}),Xt=f(t=>{var e,r,n,i=z().mod;function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,p=s-a,d=l*p-c*h;if(0===d)return null;var m=(u*p-c*f)/d,g=(u*h-l*f)/d;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function o(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}t.segmentsIntersect=a,t.segmentDistance=function(t,e,r,n,i,s,l,u){if(a(t,e,r,n,i,s,l,u))return 0;var c=r-t,h=n-e,f=l-i,p=u-s,d=c*c+h*h,m=f*f+p*p,g=Math.min(o(c,h,d,i-t,s-e),o(c,h,d,l-t,u-e),o(f,p,m,t-i,e-s),o(f,p,m,r-i,n-s));return Math.sqrt(g)},t.getTextLocation=function(t,a,o,s){if((t!==r||s!==n)&&(e={},r=t,n=s),e[o])return e[o];var l=t.getPointAtLength(i(o-s/2,a)),u=t.getPointAtLength(i(o+s/2,a)),c=Math.atan((u.y-l.y)/(u.x-l.x)),h=t.getPointAtLength(i(o,a)),f={x:(4*h.x+l.x+u.x)/6,y:(4*h.y+l.y+u.y)/6,theta:c};return e[o]=f,f},t.clearLocationCache=function(){r=null},t.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),h=c;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.x<a?a-r.x:r.x>o?r.x-o:0,h=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(u*u+h*h)}for(var p=f(u);p;){if((u+=p+r)>h)return;p=f(u)}for(p=f(h);p;){if(u>(h-=p+r))return;p=f(h)}return{min:u,max:h,len:h-u,total:c,isClosed:0===u&&h===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},t.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h<u;){if(i=(f+p)/2,o=(a=t.getPointAtLength(i))[r]-e,Math.abs(o)<l)return a;c*o>0?p=i:f=i,h++}return a}}),$t=f(t=>{var e={};function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}t.throttle=function(t,n,i){var a=e[t],o=Date.now();if(!a){for(var s in e)e[s].ts<o-6e4&&delete e[s];a=e[t]={ts:0,timer:null}}function l(){i(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}r(a),o>a.ts+n?l():a.timer=setTimeout(function(){l(),a.timer=null},n)},t.done=function(t){var r=e[t];return r&&r.timer?new Promise(function(t){var e=r.onDone;r.onDone=function(){e&&e(),t(),r.onDone=null}}):Promise.resolve()},t.clear=function(n){if(n)r(e[n]),delete e[n];else for(var i in e)t.clear(i)}}),Jt=f((t,e)=>{e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}}),Kt=f((t,e)=>{e.exports=a,e.exports.isMobile=a,e.exports.default=a;var r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,i=/android|ipad|playbook|silk/i;function a(t){t||(t={});let e=t.ua;if(!e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;let a=r.test(e)&&!n.test(e)||!!t.tablet&&i.test(e);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(a=!0),a}}),Qt=f((t,e)=>{var r=T(),n=Kt();e.exports=function(t){var e,i;if(t&&t.hasOwnProperty("userAgent")?e=t.userAgent:("undefined"!=typeof navigator&&(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),e=i),"string"!=typeof e)return!0;var a=n({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!a)for(var o=e.split(" "),s=1;s<o.length;s++)if(-1!==o[s].indexOf("Safari"))for(var l=s-1;l>-1;l--){var u=o[l];if("Version/"===u.substr(0,8)){var c=u.substr(8).split(".")[0];if(r(c)&&(c=+c),c>=13)return!0}}return a}}),te=f((t,e)=>{var r=v();e.exports=function(t,e,n){var i=t.selectAll("g."+n.replace(/\s/g,".")).data(e,function(t){return t[0].trace.uid});i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each(function(t){t[0][a]=r.select(this)}),i}}),ee=f((t,e)=>{var r=Ut();e.exports=function(t,e){for(var n=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=r.localeRegistry}var u=n.split("-")[0];if(u===n)break;n=u}return e}}),re=f((t,e)=>{e.exports=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r}}),ne=f((t,e)=>{function r(t){return!0===t.visible}function n(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}e.exports=function(t){for(var e=(s=t,Array.isArray(s)&&Array.isArray(s[0])&&s[0][0]&&s[0][0].trace?n:r),i=[],a=0;a<t.length;a++){var o=t[a];e(o)&&i.push(o)}var s;return i}}),ie=f((t,e)=>{e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}),ae=f((t,e)=>{var r=T(),n=k().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),r(t)?Number(t):n}}),oe=f((t,e)=>{var r=v(),n=_().utcFormat,i=b().format,a=T(),o=k(),s=o.FP_SAFE,l=-s,u=o.BADNUM,c=e.exports={};c.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};c.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,c.warn('encountered bad format: "'+e+'"'))},c.noFormat=function(t){return String(t)},c.numberFormat=function(t){var e;try{e=i(c.adjustFormat(t))}catch(e){return c.warnBadFormat(t),c.noFormat}return e},c.nestedProperty=E(),c.keyedContainer=C(),c.relativeAttr=I(),c.isPlainObject=M(),c.toLogRange=L(),c.relinkPrivateKeys=P();var f=S();c.isArrayBuffer=f.isArrayBuffer,c.isTypedArray=f.isTypedArray,c.isArrayOrTypedArray=f.isArrayOrTypedArray,c.isArray1D=f.isArray1D,c.ensureArray=f.ensureArray,c.concat=f.concat,c.maxRowLength=f.maxRowLength,c.minRowLength=f.minRowLength;var p=z();c.mod=p.mod,c.modHalf=p.modHalf;var d=Z();c.valObjectMeta=d.valObjectMeta,c.coerce=d.coerce,c.coerce2=d.coerce2,c.coerceFont=d.coerceFont,c.coercePattern=d.coercePattern,c.coerceHoverinfo=d.coerceHoverinfo,c.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,c.validate=d.validate;var m=Vt();c.dateTime2ms=m.dateTime2ms,c.isDateTime=m.isDateTime,c.ms2DateTime=m.ms2DateTime,c.ms2DateTimeLocal=m.ms2DateTimeLocal,c.cleanDate=m.cleanDate,c.isJSDate=m.isJSDate,c.formatDate=m.formatDate,c.incrementMonth=m.incrementMonth,c.dateTick0=m.dateTick0,c.dfltRange=m.dfltRange,c.findExactDates=m.findExactDates,c.MIN_MS=m.MIN_MS,c.MAX_MS=m.MAX_MS;var g=Ht();c.findBin=g.findBin,c.sorterAsc=g.sorterAsc,c.sorterDes=g.sorterDes,c.distinctVals=g.distinctVals,c.roundUp=g.roundUp,c.sort=g.sort,c.findIndexOfMin=g.findIndexOfMin,c.sortObjectKeys=Gt();var y=Zt();c.aggNums=y.aggNums,c.len=y.len,c.mean=y.mean,c.geometricMean=y.geometricMean,c.median=y.median,c.midRange=y.midRange,c.variance=y.variance,c.stdev=y.stdev,c.interp=y.interp;var x=Et();c.init2dArray=x.init2dArray,c.transposeRagged=x.transposeRagged,c.dot=x.dot,c.translationMatrix=x.translationMatrix,c.rotationMatrix=x.rotationMatrix,c.rotationXYMatrix=x.rotationXYMatrix,c.apply3DTransform=x.apply3DTransform,c.apply2DTransform=x.apply2DTransform,c.apply2DTransform2=x.apply2DTransform2,c.convertCssMatrix=x.convertCssMatrix,c.inverseTransformMatrix=x.inverseTransformMatrix;var w=Wt();c.deg2rad=w.deg2rad,c.rad2deg=w.rad2deg,c.angleDelta=w.angleDelta,c.angleDist=w.angleDist,c.isFullCircle=w.isFullCircle,c.isAngleInsideSector=w.isAngleInsideSector,c.isPtInsideSector=w.isPtInsideSector,c.pathArc=w.pathArc,c.pathSector=w.pathSector,c.pathAnnulus=w.pathAnnulus;var A=Yt();c.isLeftAnchor=A.isLeftAnchor,c.isCenterAnchor=A.isCenterAnchor,c.isRightAnchor=A.isRightAnchor,c.isTopAnchor=A.isTopAnchor,c.isMiddleAnchor=A.isMiddleAnchor,c.isBottomAnchor=A.isBottomAnchor;var O=Xt();c.segmentsIntersect=O.segmentsIntersect,c.segmentDistance=O.segmentDistance,c.getTextLocation=O.getTextLocation,c.clearLocationCache=O.clearLocationCache,c.getVisibleSegment=O.getVisibleSegment,c.findPointOnPath=O.findPointOnPath;var R=D();c.extendFlat=R.extendFlat,c.extendDeep=R.extendDeep,c.extendDeepAll=R.extendDeepAll,c.extendDeepNoArrays=R.extendDeepNoArrays;var F=X();c.log=F.log,c.warn=F.warn,c.error=F.error;var B=G();c.counterRegex=B.counter;var N=$t();c.throttle=N.throttle,c.throttleDone=N.done,c.clearThrottle=N.clear;var j=Ct();function U(t){var e={};for(var r in t)for(var n=t[r],i=0;i<n.length;i++)e[n[i]]=+r;return e}c.getGraphDiv=j.getGraphDiv,c.isPlotDiv=j.isPlotDiv,c.removeElement=j.removeElement,c.addStyleRule=j.addStyleRule,c.addRelatedStyleRule=j.addRelatedStyleRule,c.deleteRelatedStyleRule=j.deleteRelatedStyleRule,c.setStyleOnHover=j.setStyleOnHover,c.getFullTransformMatrix=j.getFullTransformMatrix,c.getElementTransformMatrix=j.getElementTransformMatrix,c.getElementAndAncestors=j.getElementAndAncestors,c.equalDomRects=j.equalDomRects,c.clearResponsive=Jt(),c.preserveDrawingBuffer=Qt(),c.makeTraceGroups=te(),c._=ee(),c.notifier=Y(),c.filterUnique=re(),c.filterVisible=ne(),c.pushUnique=J(),c.increment=ie(),c.cleanNumber=ae(),c.ensureNumber=function(t){return a(t)?(t=Number(t))>s||t<l?u:t:u},c.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&a(t)&&t>=0&&t%1==0},c.noop=$(),c.identity=qt(),c.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},c.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;i<e.length;i++){var a=e[i],o=c.nestedProperty(t,a.replace("?",r)),s=c.nestedProperty(t,a.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},c.raiseToTop=function(t){t.parentNode.appendChild(t)},c.cancelTransition=function(t){return t.transition().duration(0)},c.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},c.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},c.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s<a;s++)o[s]=e(t[s],r,n,i);return o},c.randstr=function t(e,r,n,i){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(a=2;s===1/0;a*=2)s=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var u=s-Math.floor(s);for(a=0;a<Math.floor(s);a++)l=Math.floor(Math.random()*n).toString(n)+l;u&&(o=Math.pow(n,u),l=Math.floor(Math.random()*o).toString(n)+l);var h=parseInt(l,n);return e&&e[l]||h!==1/0&&h>=Math.pow(2,r)?i>10?(c.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},c.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},c.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-e)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},c.syncOrAsync=function(t,e,r){var n;function i(){return c.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},c.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},c.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n<r.length;n++)null!=t[r[n]]?i=!0:a=!1;if(i&&!a)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},c.mergeArray=function(t,e,r,n){var i="function"==typeof n;if(c.isArrayOrTypedArray(t))for(var a=Math.min(t.length,e.length),o=0;o<a;o++){var s=t[o];e[o][r]=i?n(s):s}},c.mergeArrayCastPositive=function(t,e,r){return c.mergeArray(t,e,r,function(t){var e=+t;return isFinite(e)&&e>0?e:0})},c.fillArray=function(t,e,r,n){if(n=n||c.identity,c.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=n(t[i])},c.castOption=function(t,e,r,n){n=n||c.identity;var i=c.nestedProperty(t,r).get();return c.isArrayOrTypedArray(i)?Array.isArray(e)&&c.isArrayOrTypedArray(i[e[0]])?n(i[e[0]][e[1]]):n(i[e]):i},c.extractOption=function(t,e,r,n){if(r in t)return t[r];var i=c.nestedProperty(e,n).get();return Array.isArray(i)?void 0:i},c.tagSelected=function(t,e,r){var n,i=e.selectedpoints,a=e._indexToPoints;function o(e){return void 0!==e&&e<t.length}a&&(n=U(a));for(var s=0;s<i.length;s++){var l=i[s];if(c.isIndex(l)||c.isArrayOrTypedArray(l)&&c.isIndex(l[0])&&c.isIndex(l[1])){var u=n?n[l]:l,h=r?r[u]:u;o(h)&&(t[h].selected=1)}}},c.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=U(r),i=[],a=0;a<e.length;a++){var o=e[a];if(c.isIndex(o)){var s=n[o];c.isIndex(s)&&i.push(s)}}return i}return e},c.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=c.nestedProperty(t,r).get();return!!c.isArrayOrTypedArray(n)&&n}return!!c.isArrayOrTypedArray(r)&&r},c.minExtend=function t(e,r,n){var i={};"object"!=typeof r&&(r={});var a,o,s,l="pieLike"===n?-1:3,u=Object.keys(e);for(a=0;a<u.length;a++)s=e[o=u[a]],"_"!==o.charAt(0)&&"function"!=typeof s&&("module"===o?i[o]=s:Array.isArray(s)?i[o]="colorscale"===o||-1===l?s.slice():s.slice(0,l):c.isTypedArray(s)?i[o]=-1===l?s.subarray():s.subarray(0,l):i[o]=s&&"object"==typeof s?t(e[o],r[o],n):s);for(u=Object.keys(r),a=0;a<u.length;a++)("object"!=typeof(s=r[o=u[a]])||!(o in i)||"object"!=typeof i[o])&&(i[o]=s);return i},c.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},c.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1};var V=/Version\/[\d\.]+.*Safari/;c.isSafari=function(){return V.test(window.navigator.userAgent)};var q=/iPad|iPhone|iPod/;c.isIOS=function(){return q.test(window.navigator.userAgent)};var H=/Macintosh.+AppleWebKit.+Gecko\)$/;c.isMacWKWebView=()=>H.test(window.navigator.userAgent);var W=/Firefox\/(\d+)\.\d+/;c.getFirefoxVersion=function(){var t=W.exec(window.navigator.userAgent);if(t&&2===t.length){var e=parseInt(t[1]);if(!isNaN(e))return e}return null},c.isD3Selection=function(t){return t instanceof r.selection},c.ensureSingle=function(t,e,r,n){var i=t.select(e+(r?"."+r:""));if(i.size())return i;var a=t.append(e);return r&&a.classed(r,!0),n&&a.call(n),a},c.ensureSingleById=function(t,e,r,n){var i=t.select(e+"#"+r);if(i.size())return i;var a=t.append(e).attr("id",r);return n&&a.call(n),a},c.objectFromPath=function(t,e){for(var r,n=t.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var K=/^([^\[\.]+)\.(.+)?/,Q=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function tt(t){return"__"===t.slice(0,2)}c.expandObjectPaths=function(t){var e,r,n,i,a,o,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)if(t.hasOwnProperty(r))if(e=r.match(K)){if(i=t[r],tt(n=e[1]))continue;delete t[r],t[n]=c.extendDeepNoArrays(t[n]||{},c.objectFromPath(r,c.expandObjectPaths(i))[n])}else if(e=r.match(Q)){if(i=t[r],tt(n=e[1]))continue;if(a=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3])s=e[4],o=t[n][a]=t[n][a]||{},c.extendDeepNoArrays(o,c.objectFromPath(s,c.expandObjectPaths(i)));else{if(tt(n))continue;t[n][a]=c.expandObjectPaths(i)}}else{if(tt(r))continue;t[r]=c.expandObjectPaths(t[r])}return t},c.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},c.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var et=/^\w*$/;c.templateString=function(t,e){var r={};return t.replace(c.TEMPLATE_STRING_REGEX,function(t,n){var i;return et.test(n)?i=e[n]:(r[n]=r[n]||c.nestedProperty(e,n).get,i=r[n](!0)),void 0!==i?i:""})};var rt={max:10,count:0,name:"hovertemplate"};c.hovertemplateString=function(){return st.apply(rt,arguments)};var nt={max:10,count:0,name:"texttemplate"};c.texttemplateString=function(){return st.apply(nt,arguments)};var it=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,at={max:10,count:0,name:"texttemplate",parseMultDiv:!0};c.texttemplateStringForShapes=function(){return st.apply(at,arguments)};var ot=/^[:|\|]/;function st(t,e,r){var i=this,a=arguments;return e||(e={}),t.replace(c.TEMPLATE_STRING_REGEX,function(t,o,s){var l="_xother"===o||"_yother"===o,u="_xother_"===o||"_yother_"===o,h="xother_"===o||"yother_"===o,f="xother"===o||"yother"===o||l||h||u,p=o;(l||u)&&(p=p.substring(1)),(h||u)&&(p=p.substring(0,p.length-1));var d,m,g,y=null,v=null;if(i.parseMultDiv){var x=function(t){var e=t.match(it);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(p);p=x.key,y=x.op,v=x.number}if(f){if(void 0===(d=e[p]))return""}else for(g=3;g<a.length;g++)if(m=a[g]){if(m.hasOwnProperty(p)){d=m[p];break}if(et.test(p)||(d=c.nestedProperty(m,p).get(!0)),void 0!==d)break}if(void 0!==d&&("*"===y&&(d*=v),"/"===y&&(d/=v)),void 0===d&&i)return i.count<i.max&&(c.warn("Variable '"+p+"' in "+i.name+" could not be found!"),d=t),i.count===i.max&&c.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,t;if(s){var _;if(":"===s[0]&&(_=r?r.numberFormat:c.numberFormat,""!==d&&(d=_(s.replace(ot,""))(d))),"|"===s[0]){_=r?r.timeFormat:n;var b=c.dateTime2ms(d);d=c.formatDate(b,s.replace(ot,""),!1,_)}}else{var w=p+"Label";e.hasOwnProperty(w)&&(d=e[w])}return f&&(d="("+d+")",(l||u)&&(d=" "+d),(h||u)&&(d+=" ")),d})}c.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a<r;a++){var o=t.charCodeAt(a)||0,s=e.charCodeAt(a)||0,l=o>=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var lt=2e9;c.seedPseudoRandom=function(){lt=2e9},c.pseudoRandom=function(){var t=lt;return lt=(69069*lt+1)%4294967296,Math.abs(lt-t)<429496729?c.pseudoRandom():lt/4294967296},c.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=c.extractOption(t,e,"htx","hovertext");if(c.isValidTextValue(i))return n(i);var a=c.extractOption(t,e,"tx","text");return c.isValidTextValue(a)?n(a):void 0},c.isValidTextValue=function(t){return t||0===t},c.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n<e;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},c.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},c.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""},c.strRotate=function(t){return t?"rotate("+t+")":""},c.strScale=function(t){return 1!==t?"scale("+t+")":""},c.getTextTransform=function(t){var e=t.noCenter,r=t.textX,n=t.textY,i=t.targetX,a=t.targetY,o=t.anchorX||0,s=t.anchorY||0,l=t.rotate,u=t.scale;return u?u>1&&(u=1):u=0,c.strTranslate(i-u*(r+o),a-u*(n+s))+c.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},c.setTransormAndDisplay=function(t,e){t.attr("transform",c.getTextTransform(e)),t.style("display",e.scale?null:"none")},c.ensureUniformFontSize=function(t,e){var r=c.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},c.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},c.bigFont=function(t){return Math.round(1.2*t)};var ut=c.getFirefoxVersion(),ct=null!==ut&&ut<86;c.getPositionFromD3Event=function(){return ct?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}),se=f(()=>{var t,e,r=oe(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(e in n)t=e.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(t,n[e])}),le=f((t,e)=>{e.exports=!0}),ue=f((t,e)=>{var r,n=le();r="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,e.exports=r}),ce=f((t,e)=>{var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(t,e){return new Promise(function(r,n){function i(r){t.removeListener(e,a),n(r)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,a,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&g(t,"error",e,r)}(t,i,{once:!0})})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,a,o;if(l(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=u(t))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=o.length,function(t){console&&console.warn&&console.warn(t)}(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):m(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function g(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function i(a){n.once&&t.removeEventListener(e,i),r(a)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=m(l,u);for(r=0;r<u;++r)i(c[r],this,e)}return!0},o.prototype.addListener=function(t,e){return c(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return c(this,t,e,!0)},o.prototype.once=function(t,e){return l(e),this.on(t,f(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,f(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,a,o;if(l(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return p(this,t,!0)},o.prototype.rawListeners=function(t){return p(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}),he=f((t,e)=>{var r=ce().EventEmitter,n={init:function(t){if(t._ev instanceof r)return t;var e=new r,n=new r;return t._ev=e,t._internalEv=n,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=n.on.bind(n),t._internalOnce=n.once.bind(n),t._removeInternalListener=n.removeListener.bind(n),t._removeAllInternalListeners=n.removeAllListeners.bind(n),t.emit=function(t,r){e.emit(t,r),n.emit(t,r)},"function"==typeof t.addEventListener&&t.addEventListener("wheel",()=>{},{passive:!0}),t},triggerHandler:function(t,e,r){var n=t._ev;if(n){var i=n._events[e];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;a<i.length-1;a++)o(i[a]);return o(i[a])}}function o(t){return t.listener?(n.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(n,[r]))):t.apply(n,[r])}},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=n}),fe=f((t,e)=>{var r=oe(),n=W().dfltConfig,i={add:function(t,e,r,i,a){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(i),o.redo.args.push(a)),t.undoQueue.queue.length>n.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},plotDo:function(t,e,n){t.autoplay=!0,n=function(t,e){for(var n,i=[],a=0;a<e.length;a++)n=e[a],i[a]=n===t?n:"object"==typeof n?Array.isArray(n)?r.extendDeep([],n):r.extendDeepAll({},n):n;return i}(t,n),e.apply(null,n)}};e.exports=i}),pe=f((t,e)=>{e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),de=f(t=>{var e=Ut(),r=oe(),n=j(),i=Nt(),a=pe(),o=It(),s=W().configAttributes,l=Lt(),u=r.extendDeepAll,c=r.isPlainObject,h=r.isArrayOrTypedArray,f=r.nestedProperty,p=r.valObjectMeta,d="_isSubplotObj",m="_isLinkedToArray",g="_deprecated",y=[d,m,"_arrayAttrRegexps",g];function v(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(x(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!c(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!x(e[++r]))return!1}else if("info_array"===t.valType){var i=e[++r];if(!x(i))return!1;var a=t.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function x(t){return t===Math.round(t)&&t>=0}function _(){var t,r,n={};for(t in u(n,i),e.subplotsRegistry)if((r=e.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a<r.attr.length;a++)T(n,r,r.attr[a]);else T(n,r,"subplot"===r.attr?r.name:r.attr);for(t in e.componentsRegistry){var o=(r=e.componentsRegistry[t]).schema;if(o&&(o.subplots||o.layout)){var s=o.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete n.yaxis[l];delete n.xaxis.shift,delete n.xaxis.autoshift}else"colorscale"===r.name?u(n,r.layoutAttributes):r.layoutAttributes&&k(n,r.layoutAttributes,r.name)}return{layoutAttributes:w(n)}}function b(){var t={frames:u({},a)};return w(t),t.frames}function w(e){return function(e){function r(t){return{valType:"string",editType:"none"}}function n(e,n,i){t.isValObject(e)?(!0===e.arrayOk||"data_array"===e.valType)&&(i[n+"src"]=r()):c(e)&&(e.role="object")}t.crawl(e,n)}(e),function(e){function r(t,e,r){if(t){var n=t[m];n&&(delete t[m],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}t.crawl(e,r)}(e),function(t){function e(t){for(var r in t)if(c(t[r]))e(t[r]);else if(Array.isArray(t[r]))for(var n=0;n<t[r].length;n++)e(t[r][n]);else t[r]instanceof RegExp&&(t[r]=t[r].toString())}e(t)}(e),e}function T(t,e,r){var n=f(t,r),i=u({},e.layoutAttributes);i[d]=!0,n.set(i)}function k(t,e,r){var n=f(t,r);n.set(u(n.get()||{},e))}t.IS_SUBPLOT_OBJ=d,t.IS_LINKED_TO_ARRAY=m,t.DEPRECATED=g,t.UNDERSCORE_ATTRS=y,t.get=function(){var r={};return e.allTypes.forEach(function(i){r[i]=function(r){var i,a;i=e.modules[r]._module,a=i.basePlotModule;var o={type:null},s=u({},n),l=u({},i.attributes);t.crawl(l,function(t,e,r,n,i){f(s,i).set(void 0),void 0===t&&f(l,i).set(void 0)}),u(o,s),e.traceIs(r,"noOpacity")&&delete o.opacity,e.traceIs(r,"showLegend")||(delete o.showlegend,delete o.legendgroup),e.traceIs(r,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel),i.selectPoints||delete o.selectedpoints,u(o,l),a.attributes&&u(o,a.attributes),o.type=r;var c={meta:i.meta||{},categories:i.categories||{},animatable:!!i.animatable,type:r,attributes:w(o)};if(i.layoutAttributes){var h={};u(h,i.layoutAttributes),c.layoutAttributes=w(h)}return i.animatable||t.crawl(c,function(e){t.isValObject(e)&&"anim"in e&&delete e.anim}),c}(i)}),{defs:{valObjects:p,metaKeys:y.concat(["description","role","editType","impliedEdits"]),editType:{traces:l.traces,layout:l.layout},impliedEdits:{}},traces:r,layout:_(),frames:b(),animation:w(o),config:w(s)}},t.crawl=function(e,r,n,i){var a=n||0;i=i||"",Object.keys(e).forEach(function(n){var o=e[n];if(-1===y.indexOf(n)){var s=(i?i+".":"")+n;r(o,n,e,a,s),!t.isValObject(o)&&c(o)&&"impliedEdits"!==n&&t.crawl(o,r,a+1,s)}})},t.isValObject=function(t){return t&&void 0!==t.valType},t.findArrayAttributes=function(e){var r,i,a=[],o=[],s=[];function l(t,e,n,i){o=o.slice(0,i).concat([e]),s=s.slice(0,i).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&("colorbar"!==o[i-1]||"ticktext"!==e&&"tickvals"!==e)&&u(r,0,"")}function u(t,e,r){var n=t[o[e]],l=r+o[e];if(e===o.length-1)h(n)&&a.push(i+l);else if(s[e]){if(Array.isArray(n))for(var f=0;f<n.length;f++)c(n[f])&&u(n[f],e+1,l+"["+f+"].")}else c(n)&&u(n,e+1,l+".")}return r=e,i="",t.crawl(n,l),e._module&&e._module.attributes&&t.crawl(e._module.attributes,l),a},t.getTraceValObject=function(t,r){var i,a,o=r[0],s=t._module;if(s||(s=(e.modules[t.type||n.type.dflt]||{})._module),!s)return!1;if(!(a=(i=s.attributes)&&i[o])){var l=s.basePlotModule;l&&l.attributes&&(a=l.attributes[o])}return a||(a=n[o]),v(a,r,1)},t.getLayoutValObject=function(t,r){var n=function(t,r){var n,a,o,s,l=t._basePlotModules;if(l){var u;for(n=0;n<l.length;n++){if((o=l[n]).attrRegex&&o.attrRegex.test(r)){if(o.layoutAttrOverrides)return o.layoutAttrOverrides;!u&&o.layoutAttributes&&(u=o.layoutAttributes)}var c=o.baseLayoutAttrOverrides;if(c&&r in c)return c[r]}if(u)return u}var h=t._modules;if(h)for(n=0;n<h.length;n++)if((s=h[n].layoutAttributes)&&r in s)return s[r];for(a in e.componentsRegistry){if("colorscale"===(o=e.componentsRegistry[a]).name&&0===r.indexOf("coloraxis"))return o.layoutAttributes[r];if(!o.schema&&r===o.name)return o.layoutAttributes}return r in i&&i[r]}(t,r[0]);return v(n,r,1)}}),me=f(t=>{var e=oe(),r=j(),n="templateitemname",i={name:{valType:"string",editType:"none"}};function a(t){return t&&"string"==typeof t}function o(t){var r=t.length-1;return"s"!==t.charAt(r)&&e.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}i[n]={valType:"string",editType:"calc"},t.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=i.name,e[n]=i[n],e},t.traceTemplater=function(t){var n,i,a={};for(n in t)i=t[n],Array.isArray(i)&&i.length&&(a[n]=0);return{newTrace:function(o){var s={type:n=e.coerce(o,{},r,"type"),_template:null};if(n in a){i=t[n];var l=a[n]%i.length;a[n]++,s._template=i[l]}return s}}},t.newContainer=function(t,r,n){var i=t._template,a=i&&(i[r]||n&&i[n]);return e.isPlainObject(a)||(a=null),t[r]={_template:a}},t.arrayTemplater=function(t,e,r){var i=t._template,s=i&&i[o(e)],l=i&&i[e];(!Array.isArray(l)||!l.length)&&(l=[]);var u={};return{newItem:function(t){var e={name:t.name,_input:t},i=e[n]=t[n];if(!a(i))return e._template=s,e;for(var o=0;o<l.length;o++){var c=l[o];if(c.name===i)return u[i]=1,e._template=c,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<l.length;e++){var r=l[e],i=r.name;if(a(i)&&!u[i]){var o={_template:r,name:i,_input:{_templateitemname:i}};o[n]=r[n],t.push(o),u[i]=1}}return t}}},t.arrayDefaultKey=o,t.arrayEditor=function(t,r,i){var a=(e.nestedProperty(t,r).get()||[]).length,o=i._index,s=o>=a&&(i._input||{})._templateitemname;s&&(o=a);var l,u=r+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][n]=s)}function h(t,r){s?e.nestedProperty(l[u],t).set(r):l[u+"."+t]=r}function f(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:f,applyUpdate:function(r,n){r&&h(r,n);var i=f();for(var a in i)e.nestedProperty(t,a).set(i[a])}}}}),ge=f((t,e)=>{var r=G().counter;e.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),ye=f(t=>{var e=Ut(),r=ge();function n(t,e){if(e&&e.length)for(var r=0;r<e.length;r++)if(e[r][t])return!0;return!1}t.id2name=function(t){if("string"==typeof t&&t.match(r.AX_ID_PATTERN)){var e=t.split(" ")[0].substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},t.name2id=function(t){if(t.match(r.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},t.cleanId=function(t,e,n){var i=/( domain)$/.test(t);if("string"==typeof t&&t.match(r.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)&&(!i||n)){var a=t.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===a&&(a=""),t.charAt(0)+a+(i&&n?" domain":"")}},t.list=function(e,r,n){var i=e._fullLayout;if(!i)return[];var a,o=t.listIds(e,r),s=new Array(o.length);for(a=0;a<o.length;a++){var l=o[a];s[a]=i[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var u=i._subplots.gl3d||[];for(a=0;a<u.length;a++){var c=i[u[a]];r?s.push(c[r+"axis"]):s.push(c.xaxis,c.yaxis,c.zaxis)}}return s},t.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},t.getFromId=function(e,r,n){var i=e._fullLayout;return r=void 0===r||"string"!=typeof r?r:r.replace(" domain",""),"x"===n?r=r.replace(/y[0-9]*/,""):"y"===n&&(r=r.replace(/x[0-9]*/,"")),i[t.id2name(r)]},t.getFromTrace=function(r,n,i){var a=r._fullLayout,o=null;if(e.traceIs(n,"gl3d")){var s=n.scene;"scene"===s.substr(0,5)&&(o=a[s][i+"axis"])}else o=t.getFromId(r,n[i+"axis"]||i);return o},t.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},t.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},t.isLinked=function(t,e){return n(e,t._axisMatchGroups)||n(e,t._axisConstraintGroups)}}),ve=f((t,e)=>{e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearOutline:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}}}),xe=f((t,e)=>{e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),_e=f(t=>{var e=Ut();ge().SUBPLOT_PATTERN,t.getSubplotCalcData=function(t,r,n){var i=e.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s<t.length;s++){var l=t[s];l[0].trace[a]===n&&o.push(l)}return o},t.getModuleCalcData=function(t,r,n){var i,a=[],o=[];if(!(i="string"==typeof r?e.getModule(r).plot:"function"==typeof r?r:r.plot))return[a,t];for(var s=n,l=0;l<t.length;l++){var u=t[l],c=u[0].trace,h=void 0!==c.zorder;!0!==c.visible||0===c._length||(!c._module||c._module.plot!==i||h&&c.zorder!==s?o.push(u):a.push(u))}return[a,o]},t.getSubplotData=function(t,r,n){if(!e.subplotsRegistry[r])return[];for(var i,a=e.subplotsRegistry[r].attr,o=[],s=0;s<t.length;s++)(i=t[s])[a]===n&&o.push(i);return o}}),be=f(t=>{var e=Ut(),r=oe();function n(t,e,n){var i,a,o,s=!1;if("data"===e.type)i=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;i=t._fullLayout}return a=r.nestedProperty(i,e.prop).get(),(o=n[e.type]=n[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==a&&(s=!0),o[e.prop]=a,{changed:s,value:a}}function i(t,e){var n=[],i=e[0],a={};if("string"==typeof i)a[i]=e[1];else{if(!r.isPlainObject(i))return n;a=i}return o(a,function(t,e,r){n.push({type:"layout",prop:t,value:r})},"",0),n}function a(t,e){var n,i,a,s,l=[];if(i=e[0],a=e[1],n=e[2],s={},"string"==typeof i)s[i]=a;else{if(!r.isPlainObject(i))return l;s=i,void 0===n&&(n=a)}return void 0===n&&(n=null),o(s,function(e,r,i){var a,o;if(Array.isArray(i)){o=i.slice();var s=Math.min(o.length,t.data.length);n&&(s=Math.min(s,n.length)),a=[];for(var u=0;u<s;u++)a[u]=n?n[u]:u}else o=i,a=n?n.slice():null;if(null===a)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(a)){if(!Array.isArray(o)){var c=o;o=[];for(var h=0;h<a.length;h++)o[h]=c}o.length=Math.min(a.length,o.length)}l.push({type:"data",prop:e,traces:a,value:o})},"",0),l}function o(t,e,n,i){Object.keys(t).forEach(function(a){var s=t[a];if("_"!==a[0]){var l=n+(i>0?".":"")+a;r.isPlainObject(s)?o(s,e,l,i+1):e(l,a,s)}})}t.manageCommandObserver=function(e,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=t.hasSimpleAPICommandBindings(e,a,s.lookupTable);if(i&&i._commandObserver){if(u)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(u){n(e,u,s.cache),s.check=function(){if(l){var t=n(e,u,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<c.length;h++)e._internalOn(c[h],s.check);s.remove=function(){for(var t=0;t<c.length;t++)e._removeInternalListener(c[t],s.check)}}else r.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},i&&(i._commandObserver=s),s},t.hasSimpleAPICommandBindings=function(e,r,n){var i,a,o=r.length;for(i=0;i<o;i++){var s,l=r[i],u=l.method,c=l.args;if(Array.isArray(c)||(c=[]),!u)return!1;var h=t.computeAPICommandBindings(e,u,c);if(1!==h.length)return!1;if(a){if((s=h[0]).type!==a.type||s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var f=0;f<a.traces.length;f++)if(a.traces[f]!==s.traces[f])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();var p=(s=h[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=i)}return a},t.executeAPICommand=function(t,n,i){if("skip"===n)return Promise.resolve();var a=e.apiMethodRegistry[n],o=[t];Array.isArray(i)||(i=[]);for(var s=0;s<i.length;s++)o.push(i[s]);return a.apply(null,o).catch(function(t){return r.warn("API call to Plotly."+n+" rejected.",t),Promise.reject(t)})},t.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=a(t,r);break;case"relayout":n=i(0,r);break;case"update":n=a(t,[r[0],r[2]]).concat(i(0,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}}),we=f((t,e)=>{var r=v(),n=_().timeFormatLocale,i=b().formatLocale,a=T(),o=A(),s=Ut(),l=de(),u=me(),c=oe(),h=q(),f=k().BADNUM,p=ye(),d=ve().clearOutline,m=xe(),g=It(),y=pe(),x=_e().getModuleCalcData,w=c.relinkPrivateKeys,M=c._,S=e.exports={};c.extendFlat(S,s),S.attributes=j(),S.attributes.type.values=S.allTypes,S.fontAttrs=R(),S.layoutAttributes=Nt();var E=be();S.executeAPICommand=E.executeAPICommand,S.computeAPICommandBindings=E.computeAPICommandBindings,S.manageCommandObserver=E.manageCommandObserver,S.hasSimpleAPICommandBindings=E.hasSimpleAPICommandBindings,S.redrawText=function(t){return t=c.getGraphDiv(t),new Promise(function(e){setTimeout(function(){t._fullLayout&&(s.getComponentMethod("annotations","draw")(t),s.getComponentMethod("legend","draw")(t),s.getComponentMethod("colorbar","draw")(t),e(S.previousPromises(t)))},300)})},S.resize=function(t){t=c.getGraphDiv(t);var e,r=new Promise(function(r,n){(!t||c.isHidden(t))&&n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout(function(){if(!t.layout||t.layout.width&&t.layout.height||c.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,s.call("relayout",t,{autosize:!0}).then(function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))})}},100)});return e&&e(r),r},S.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},S.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,n=c.ensureSingle(e._paper,"text","js-plot-link-container",function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.defaultLine,"pointer-events":"all"}).each(function(){var t=r.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)})}),i=n.node(),a={y:e._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" »");if(t._context.sendData)r.on("click",function(){S.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},S.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var n=r.select(t).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=S.graphJson(t,!1,"keepdata"),i.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1}};var C=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],I=["year","month","dayMonth","dayMonthYear"];function L(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a<e.length;a++){var o=e[a];i[o]||(t[o]?i[o]=t[o]:r=!1)}r&&(n=!0)}for(var o=0;o<2;o++){for(var l=t._context.locales,u=0;u<2;u++){var c=(l[r]||{}).format;if(c&&(a(c),n))break;l=s.localeRegistry}var h=r.split("-")[0];if(n||h===r)break;r=h}return n||a(s.localeRegistry.en.format),i}function P(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),i=t._mainAxis._anchorAxis,a="",o="",s="";if(i&&(s=i._mainAxis._id,a=n?t._id+s:s+t._id),!a||!e._plots[a]){a="";for(var l=t._counterAxes,u=0;u<l.length;u++){var c=l[u],h=n?t._id+c:c+t._id;o||(o=h);var f=p.getFromId(r,c);if(s&&f.overlaying===s){a=h;break}}}return a||o}function z(t){return"string"==typeof t&&"px"===t.substr(t.length-2)&&parseFloat(t)}function O(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={}),t._reservedMargin||(t._reservedMargin={})}S.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=t._fullLayout={},u=t.layout||{},h=t._fullData||[],f=t._fullData=[],p=t.data||[],m=t.calcdata||[],g=t._context||{};t._transitionData||S.createTransitionData(t),l._dfltTitle={plot:M(t,"Click to enter Plot title"),subtitle:M(t,"Click to enter Plot subtitle"),x:M(t,"Click to enter X axis title"),y:M(t,"Click to enter Y axis title"),colorbar:M(t,"Click to enter Colorscale title"),annotation:M(t,"new text")},l._traceWord=M(t,"trace");var y=L(t,C);if(l._mapboxAccessToken=g.mapboxAccessToken,a._initialAutoSizeIsDone){var v=a.width,x=a.height;S.supplyLayoutGlobalDefaults(u,l,y),u.width||(l.width=v),u.height||(l.height=x),S.sanitizeMargins(l)}else{S.supplyLayoutGlobalDefaults(u,l,y);var _=!u.width||!u.height,b=l.autosize,T=g.autosizable;_&&(b||T)?S.plotAutoSize(t,u,l):_&&S.sanitizeMargins(l),!b&&_&&(u.width=l.width,u.height=l.height)}l._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:function(e){try{e=i(t).format(c.adjustFormat(e))}catch(t){return c.warnBadFormat(e),c.noFormat}return e},timeFormat:n(t).utcFormat}}(y,l.separators),l._extraFormat=L(t,I),l._initialAutoSizeIsDone=!0,l._dataLength=p.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var k=l._subplots=function(){var t,e,r=s.collectableSubplotTypes,n={};if(!r){r=[];var i=s.subplotsRegistry;for(var a in i){var o=i[a].attr;if(o&&(r.push(a),Array.isArray(o)))for(e=0;e<o.length;e++)c.pushUnique(r,o[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),A=l._splomAxes={x:{},y:{}},E=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(t,e){var r,n,i=e.length,a=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&a.push(o),n=o}var s=a.length,l=new Array(i),u={};function h(t,e){l[e]=t,u[t]=1}function f(t,e){if(t&&"string"==typeof t&&!u[t])return h(t,e),!0}for(r=0;r<i;r++){var p=e[r].uid;"number"==typeof p&&(p=String(p)),!f(p,r)&&(r<s&&f(a[r].uid,r)||h(c.randstr(u),r))}return l}(h,p),S.supplyDataDefaults(p,f,u,l);var P=Object.keys(A.x),z=Object.keys(A.y);if(P.length>1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o<P.length;o++)c.pushUnique(k.xaxis,P[o]);for(o=0;o<z.length;o++)c.pushUnique(k.yaxis,z[o]);for(var D in E)c.pushUnique(k.cartesian,D)}if(l._has=S._hasPlotType.bind(l),h.length===f.length)for(o=0;o<f.length;o++)w(f[o],h[o]);S.supplyLayoutModuleDefaults(u,l,f,t._transitionData);var R=l._visibleModules,F=[];for(o=0;o<R.length;o++){var B=R[o].crossTraceDefaults;B&&c.pushUnique(F,B)}for(o=0;o<F.length;o++)F[o](f,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&P.length>15&&z.length>15&&0===l.shapes.length&&0===l.images.length,S.linkSubplots(f,l,h,a),S.cleanPlot(f,l,h,a);var N=!(!a._has||!a._has("cartesian")),j=!(!l._has||!l._has("cartesian"));N&&!j?a._bgLayer.remove():j&&!N&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&d({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i<t.length;i++){var a=t[i];a.meta?n[a.index]=a._meta={meta:a.meta}:e.meta&&(a._meta={meta:e.meta}),e.meta&&(a._meta.layout={meta:e.meta})}n.length&&(r||(r=e._meta={}),r.data=n)}(f,l),w(l,a),s.getComponentMethod("colorscale","crossTraceDefaults")(f,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var U,V=l._tracePreGUI,q={};for(U in V)q[U]="old";for(o=0;o<f.length;o++)q[U=f[o]._fullInput.uid]||(V[U]={}),q[U]="new";for(U in q)"old"===q[U]&&delete V[U];O(l),s.getComponentMethod("rangeslider","makeData")(l),!r&&m.length===f.length&&S.supplyDefaultsUpdateCalc(m,f)}},S.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=(t[r]||[])[0];if(i&&i.trace){var a=i.trace;if(a._hasCalcTransform){var o,s,l,u=a._arrayAttrs;for(o=0;o<u.length;o++)s=u[o],l=c.nestedProperty(a,s).get().slice(),c.nestedProperty(n,s).set(l)}i.trace=n}}},S.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},S._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var i=n[e].name;if(i===t)return!0;var a=s.modules[i];if(a&&a.categories[t])return!0}return!1},S.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(t,e,r,n)}var l=n._has&&n._has("gl"),u=e._has&&e._has("gl");l&&!u&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var c=!!n._infolayer;t:for(i=0;i<r.length;i++){var h=r[i].uid;for(a=0;a<t.length;a++)if(h===t[a].uid)continue t;c&&n._infolayer.select(".cb"+h).remove()}},S.linkSubplots=function(t,e,r,n){var i,a,o=n._plots||{},l=e._plots={},u={_fullData:t,_fullLayout:e},h=e._subplots.cartesian||[];for(i=0;i<h.length;i++){var f,d=h[i],m=o[d],g=p.getFromId(u,d,"x"),y=p.getFromId(u,d,"y");for(m?f=l[d]=m:(f=l[d]={}).id=d,g._counterAxes.push(y._id),y._counterAxes.push(g._id),g._subplotsWith.push(d),y._subplotsWith.push(d),f.xaxis=g,f.yaxis=y,f._hasClipOnAxisFalse=!1,a=0;a<t.length;a++){var v=t[a];if(v.xaxis===f.xaxis._id&&v.yaxis===f.yaxis._id&&!1===v.cliponaxis){f._hasClipOnAxisFalse=!0;break}}}var x,_=p.list(u,null,!0);for(i=0;i<_.length;i++){var b=null;(x=_[i]).overlaying&&(b=p.getFromId(u,x.overlaying))&&b.overlaying&&(x.overlaying=!1,b=null),x._mainAxis=b||x,b&&(x.domain=b.domain.slice()),x._anchorAxis="free"===x.anchor?null:p.getFromId(u,x.anchor)}for(i=0;i<_.length;i++)if((x=_[i])._counterAxes.sort(p.idSort),x._subplotsWith.sort(c.subplotSort),x._mainSubplot=P(x,e),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||s.getComponentMethod("rangeslider","isVisible")(x))){var w=1,T=0;for(a=0;a<x._counterAxes.length;a++){var k=p.getFromId(u,x._counterAxes[a]);w=Math.min(w,k.domain[0]),T=Math.max(T,k.domain[1])}w<T&&(x._counterDomainMin=w,x._counterDomainMax=T)}},S.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],l.crawl(t._module.attributes,function(t,n,i,a){r[a]=n,r.length=a+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))})),n=0;n<e.length;n++)c.nestedProperty(t,"_input."+e[n]).get()||c.nestedProperty(t,e[n]).set(null)},S.supplyDataDefaults=function(t,e,r,n){var i,a,o,l=n._modules,h=n._visibleModules,f=n._basePlotModules,p=0;function d(t){e.push(t);var r=t._module;r&&(c.pushUnique(l,r),!0===t.visible&&c.pushUnique(h,r),c.pushUnique(f,t._module.basePlotModule),!1!==t._input.visible&&p++)}n._transformModules=[];var m={},g=[],y=(r.template||{}).data||{},v=u.traceTemplater(y);for(i=0;i<t.length;i++)o=t[i],(a=v.newTrace(o)).uid=n._traceUids[i],S.supplyTraceDefaults(o,a,p,n,i),a.index=i,a._input=o,a._fullInput=a,d(a),s.traceIs(a,"carpetAxis")&&(m[a.carpet]=a),s.traceIs(a,"carpetDependent")&&g.push(i);for(i=0;i<g.length;i++)if((a=e[g[i]]).visible){var x=m[a.carpet];if(a._carpet=x,!x||!x.visible){a.visible=!1;continue}a.xaxis=x.xaxis,a.yaxis=x.yaxis}},S.supplyAnimationDefaults=function(t){t=t||{};var e,r={};function n(e,n){return c.coerce(t||{},r,g,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=S.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=S.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=S.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=S.supplyAnimationTransitionDefaults(t.transition||{});return r},S.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return c.coerce(t||{},e,g.frame,r,n)}return r("duration"),r("redraw"),e},S.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return c.coerce(t||{},e,g.transition,r,n)}return r("duration"),r("easing"),e},S.supplyFrameDefaults=function(t){var e={};function r(r,n){return c.coerce(t,e,y,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},S.supplyTraceDefaults=function(t,e,r,n,i){var a,o=n.colorway||h.defaults,l=o[r%o.length];function u(r,n){return c.coerce(t,e,S.attributes,r,n)}var f=u("visible");u("type"),u("name",n._traceWord+" "+i),u("uirevision",n.uirevision);var p=S.getModule(e);if(e._module=p,p){var d=p.basePlotModule,m=d.attr,g=d.attributes;if(m&&g){var y=n._subplots,v="";if(Array.isArray(m))for(a=0;a<m.length;a++){var x=m[a],_=c.coerce(t,e,g,x);y[x]&&c.pushUnique(y[x],_),v+=_}else v=c.coerce(t,e,g,m);y[d.name]&&c.pushUnique(y[d.name],v)}}if(f&&(u("customdata"),u("ids"),u("meta"),s.traceIs(e,"showLegend")?(c.coerce(t,e,p.attributes.showlegend?p.attributes:S.attributes,"showlegend"),u("legend"),u("legendwidth"),u("legendgroup"),u("legendgrouptitle.text"),u("legendrank"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,p&&p.supplyDefaults(t,e,l,n),s.traceIs(e,"noOpacity")||u("opacity"),s.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),s.traceIs(e,"noHover")||(e.hovertemplate||c.coerceHoverinfo(t,e,n),"parcats"!==e.type&&s.getComponentMethod("fx","supplyDefaults")(t,e,l,n)),p&&p.selectPoints)){var b=u("selectedpoints");c.isTypedArray(b)&&(e.selectedpoints=Array.from(b))}return e},S.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return c.coerce(t,e,S.layoutAttributes,r,n)}var i=t.template;c.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data),n("autotypenumbers");var a=c.coerceFont(n,"font"),o=a.size;c.coerceFont(n,"title.font",a,{overrideDflt:{size:Math.round(1.4*o)}}),n("title.text",e._dfltTitle.plot),n("title.xref");var l=n("title.yref");n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l");var u=n("title.automargin");n("title.x"),n("title.xanchor"),n("title.y"),n("title.yanchor"),n("title.subtitle.text",e._dfltTitle.subtitle),c.coerceFont(n,"title.subtitle.font",a,{overrideDflt:{size:Math.round(.7*e.title.font.size)}}),u&&("paper"===l&&(0!==e.title.y&&(e.title.y=1),"auto"===e.title.yanchor&&(e.title.yanchor=0===e.title.y?"top":"bottom")),"container"===l&&("auto"===e.title.y&&(e.title.y=1),"auto"===e.title.yanchor&&(e.title.yanchor=e.title.y<.5?"bottom":"top"))),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("minreducedwidth"),n("minreducedheight"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&S.sanitizeMargins(e),s.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var h=n("uirevision");n("editrevision",h),n("selectionrevision",h),s.getComponentMethod("modebar","supplyLayoutDefaults")(t,e),s.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,n),s.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(t,e,n),n("meta"),c.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),s.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),s.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n),c.coerce(t,e,m,"scattermode")},S.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},s=o.frameMargins,l=c.isPlotDiv(t);if(l&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var u=l?window.getComputedStyle(t):{};if(n=z(u.width)||z(u.maxWidth)||r.width,i=z(u.height)||z(u.maxHeight)||r.height,a(s)&&s>0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var f=S.layoutAttributes.width.min,p=S.layoutAttributes.height.min;n<f&&(n=f),i<p&&(i=p);var d=!e.width&&Math.abs(r.width-n)>1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),S.sanitizeMargins(r)},S.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,u=e._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var f in u.length||u.push(h),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(c.subplotSort);for(a=0;a<u.length;a++)(o=u[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var p=e._modules;for(a=0;a<p.length;a++)(o=p[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var d=e._transformModules;for(a=0;a<d.length;a++)(o=d[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r,n);for(i in l)(o=l[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r)},S.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),c.clearThrottle(),c.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},S.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var i=r[e];i.style&&c.pushUnique(n,i.style)}for(e=0;e<n.length;e++)n[e](t)},S.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),o<0&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},S.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},S.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1},S.autoMargin=function(t,e,r){var n=t._fullLayout,i=n.width,a=n.height,o=n.margin,s=n.minreducedwidth,l=n.minreducedheight,u=c.constrain(i-o.l-o.r,2,s),h=c.constrain(a-o.t-o.b,2,l),f=Math.max(0,i-u),p=Math.max(0,a-h),d=n._pushmargin,m=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var g=r.pad;if(void 0===g&&(g=Math.min(12,o.l,o.r,o.t,o.b)),f){var y=(r.l+r.r)/f;y>1&&(r.l/=y,r.r/=y)}if(p){var v=(r.t+r.b)/p;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,w=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:x,size:r.l+g},r:{val:_,size:r.r+g},b:{val:w,size:r.b+g},t:{val:b,size:r.t+g}},m[e]=1}else delete d[e],delete m[e];if(!n._replotting)return S.doAutoMargin(t)}},S.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),O(e);var i=e._size,o=e.margin,l={t:0,b:0,l:0,r:0},u=c.extendFlat({},i),h=o.l,f=o.r,d=o.t,m=o.b,g=e._pushmargin,y=e._pushmarginIds,v=e.minreducedwidth,x=e.minreducedheight;if(!1!==o.autoexpand){for(var _ in g)y[_]||delete g[_];var b=t._fullLayout._reservedMargin;for(var w in b)for(var T in b[w]){var k=b[w][T];l[T]=Math.max(l[T],k)}for(var A in g.base={l:{val:0,size:h},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:m}},l){var M=0;for(var E in g)"base"!==E&&a(g[E][A].size)&&(M=g[E][A].size>M?g[E][A].size:M);var C=Math.max(0,o[A]-M);l[A]=Math.max(0,l[A]-C)}for(var I in g){var L=g[I].l||{},P=g[I].b||{},z=L.val,D=L.size,R=P.val,F=P.size,B=r-l.r-l.l,N=n-l.t-l.b;for(var j in g){if(a(D)&&g[j].r){var U=g[j].r.val,V=g[j].r.size;if(U>z){var q=(D*U+(V-B)*z)/(U-z),H=(V*(1-z)+(D-B)*(1-U))/(U-z);q+H>h+f&&(h=q,f=H)}}if(a(F)&&g[j].t){var G=g[j].t.val,Z=g[j].t.size;if(G>R){var W=(F*G+(Z-N)*R)/(G-R),Y=(Z*(1-R)+(F-N)*(1-G))/(G-R);W+Y>m+d&&(m=W,d=Y)}}}}}var X=c.constrain(r-o.l-o.r,2,v),$=c.constrain(n-o.t-o.b,2,x),J=Math.max(0,r-X),K=Math.max(0,n-$);if(J){var Q=(h+f)/J;Q>1&&(h/=Q,f/=Q)}if(K){var tt=(m+d)/K;tt>1&&(m/=tt,d/=tt)}if(i.l=Math.round(h)+l.l,i.r=Math.round(f)+l.r,i.t=Math.round(d)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(S.didMarginChange(u,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=p.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount<et)return s.call("_doPlot",t);e._size=u,c.warn("Too many auto-margin redraws.")}!function(t){var e=p.list(t,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function(t){for(var r=0;r<e.length;r++){var n=e[r][t];n&&n()}})}(t)};var D=["l","r","t","b","p","w","h"];function F(t,e,r){var n=!1,i=[S.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,S.rehover,S.reselect,function(){return t.emit("plotly_transitioning",[]),new Promise(function(i){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return s.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var a=0,o=0;function l(){return a++,function(){o++,!n&&o===a&&function(e){t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return s.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e))}(i)}}r.runFn(l),setTimeout(l())})}],a=c.syncOrAsync(i,t);return(!a||!a.then)&&(a=Promise.resolve()),a.then(function(){return t})}S.didMarginChange=function(t,e){for(var r=0;r<D.length;r++){var n=D[r],i=t[n],o=e[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},S.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&S.supplyDefaults(t);var s=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function h(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach(function(a){if(-1===["_","["].indexOf(a.charAt(0))){if("function"==typeof t[a])return void(e&&(i[a]="_function"));if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(t[a],e)}}),i}var a=Array.isArray(t),s=c.isTypedArray(t);if((a||s)&&t.dtype&&t.shape){var l=t.bdata;return h({dtype:t.dtype,shape:t.shape,bdata:c.isArrayBuffer(l)?o.encode(l):l},e)}return a?t.map(function(t){return h(t,e)}):s?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(s||[]).map(function(t){var r=h(t);return e&&delete r.fit,r})};if(!e&&(f.layout=h(l),i)){var p=l._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return u&&(f.frames=h(u)),a&&(f.config=h(t._context,!0)),"object"===n?f:JSON.stringify(f)},S.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(n=e[r],n.type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case"delete":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},S.computeFrame=function(t,e){var r,n,i,a,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===u.indexOf(s.name);)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=S.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)null!=(i=n[r])&&(-1===(a=c.traces.indexOf(i))&&(a=c.data.length,c.traces[a]=i),c.data[a]=S.extendTrace(c.data[a],s.data[r]))}return c},S.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(e[i.name]=i)}},S.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,u,h=c.extendDeepNoArrays({},e||{}),f=c.expandObjectPaths(h),p={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=c.nestedProperty(f,r[a])).get())?c.nestedProperty(p,r[a]).set(null):(n.set(null),c.nestedProperty(p,r[a]).set(i));if(t=c.extendDeepNoArrays(t||{},f),r&&r.length)for(a=0;a<r.length;a++)if(l=c.nestedProperty(p,r[a]).get()){for(u=(s=c.nestedProperty(t,r[a])).get(),Array.isArray(u)||(u=[],s.set(u)),o=0;o<l.length;o++){var d=l[o];u[o]=null===d?null:S.extendObjectWithContainers(u[o],d)}s.set(u)}return t},S.dataArrayContainers=["transforms","dimensions"],S.layoutArrayContainers=s.layoutArrayContainers,S.extendTrace=function(t,e){return S.extendObjectWithContainers(t,e,S.dataArrayContainers)},S.extendLayout=function(t,e){return S.extendObjectWithContainers(t,e,S.layoutArrayContainers)},S.transition=function(t,e,r,n,i,a){var o={redraw:i.redraw},s={},l=[];return o.prepareFn=function(){for(var i=Array.isArray(e)?e.length:0,a=n.slice(0,i),o=0;o<a.length;o++){var u=a[o],h=t._fullData[u]._module;if(h){if(h.animatable){var f=h.basePlotModule.name;s[f]||(s[f]=[]),s[f].push(u)}t.data[a[o]]=S.extendTrace(t.data[a[o]],e[o])}}var p=c.expandObjectPaths(c.extendDeepNoArrays({},r)),d=/^[xy]axis[0-9]*$/;for(var m in p)d.test(m)&&delete p[m].range;S.extendLayout(t.layout,p),delete t.calcdata,S.supplyDefaults(t),S.doCalcdata(t);var g=c.expandObjectPaths(r);if(g){var y=t._fullLayout._plots;for(var v in y){var x=y[v],_=x.xaxis,b=x.yaxis,w=_.range.slice(),T=b.range.slice(),k=null,A=null,M=null,E=null;Array.isArray(g[_._name+".range"])?k=g[_._name+".range"].slice():Array.isArray((g[_._name]||{}).range)&&(k=g[_._name].range.slice()),Array.isArray(g[b._name+".range"])?A=g[b._name+".range"].slice():Array.isArray((g[b._name]||{}).range)&&(A=g[b._name].range.slice()),w&&k&&(_.r2l(w[0])!==_.r2l(k[0])||_.r2l(w[1])!==_.r2l(k[1]))&&(M={xr0:w,xr1:k}),T&&A&&(b.r2l(T[0])!==b.r2l(A[0])||b.r2l(T[1])!==b.r2l(A[1]))&&(E={yr0:T,yr1:A}),(M||E)&&l.push(c.extendFlat({plotinfo:x},M,E))}}return Promise.resolve()},o.runFn=function(e){var n,i,o=t._fullLayout._basePlotModules,u=l.length;if(r)for(i=0;i<o.length;i++)o[i].transitionAxes&&o[i].transitionAxes(t,l,a,e);for(var h in u?((n=c.extendFlat({},a)).duration=0,delete s.cartesian):n=a,s){var f=s[h];t._fullData[f[0]]._module.basePlotModule.plot(t,f,n,e)}},F(t,a,o)},S.transitionFromReact=function(t,e,r,n){var i=t._fullLayout,a=i.transition,o={},s=[];return o.prepareFn=function(){var t=i._plots;for(var a in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var l=t[a],u=l.xaxis,h=l.yaxis,f=n[u._name].range.slice(),p=n[h._name].range.slice(),d=u.range.slice(),m=h.range.slice();u.setScale(),h.setScale();var g=null,y=null;(u.r2l(f[0])!==u.r2l(d[0])||u.r2l(f[1])!==u.r2l(d[1]))&&(g={xr0:f,xr1:d}),(h.r2l(p[0])!==h.r2l(m[0])||h.r2l(p[1])!==h.r2l(m[1]))&&(y={yr0:p,yr1:m}),(g||y)&&s.push(c.extendFlat({plotinfo:l},g,y))}return Promise.resolve()},o.runFn=function(r){for(var n,i,o,l=t._fullData,u=t._fullLayout._basePlotModules,h=[],f=0;f<l.length;f++)h.push(f);function p(){if(t._fullLayout)for(var e=0;e<u.length;e++)u[e].transitionAxes&&u[e].transitionAxes(t,s,n,r)}function d(){if(t._fullLayout)for(var e=0;e<u.length;e++)u[e].plot(t,o,i,r)}s.length&&e.anim?"traces first"===a.ordering?(n=c.extendFlat({},a,{duration:0}),o=h,i=a,setTimeout(p,a.duration),d()):(n=a,o=null,i=c.extendFlat({},a,{duration:0}),setTimeout(d,n.duration),p()):s.length?(n=a,p()):e.anim&&(o=h,i=a,d())},F(t,a,o)},S.doCalcdata=function(t,e){var r,n,i,a,o=p.list(t),u=t._fullData,h=t._fullLayout,d=new Array(u.length),m=(t.calcdata||[]).slice();for(t.calcdata=d,h._numBoxes=0,h._numViolins=0,h._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,h._piecolormap={},h._sunburstcolormap={},h._treemapcolormap={},h._iciclecolormap={},h._funnelareacolormap={},i=0;i<u.length;i++)if(Array.isArray(e)&&-1===e.indexOf(i)){d[i]=m[i];continue}for(i=0;i<u.length;i++)(r=u[i])._arrayAttrs=l.findArrayAttributes(r),r._extremes={};var g=h._subplots.polar||[];for(i=0;i<g.length;i++)o.push(h[g[i]].radialaxis,h[g[i]].angularaxis);for(var y in h._colorAxes){var v=h[y];!1!==v.cauto&&(delete v.cmin,delete v.cmax)}var x=!1;function _(e){if(r=u[e],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var i=n.calc(t,r);i[0]&&i[0].t&&i[0].t._scene&&delete i[0].t._scene.dirty}for(a=0;a<r.transforms.length;a++){var o=r.transforms[a];(n=transformsRegistry[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,x=!0,n.calcTransform(t,r,o))}}}function b(e,i){if(r=u[e],!!(n=r._module).isContainer===i){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var s=r.transforms||[];for(a=s.length-1;a>=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}(!Array.isArray(o)||!o[0])&&(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(N(o,u,h),i=0;i<u.length;i++)b(i,!0);for(i=0;i<u.length;i++)_(i);for(x&&N(o,u,h),i=0;i<u.length;i++)b(i,!0);for(i=0;i<u.length;i++)b(i,!1);U(t);var w=function(t,e){var r,n,i,a,o,l=[];function u(t,r,n){var i=r._id.charAt(0);if("histogram2dcontour"===t){var a=r._counterAxes[0],o=p.getFromId(e,a),s="x"===i||"x"===a&&"category"===o.type,l="y"===i||"y"===a&&"category"===o.type;return function(t,e){return 0===t||0===e||s&&t===n[e].length-1||l&&e===n.length-1?-1:("y"===i?e:t)-1}}return function(t,e){return"y"===i?e:t}}var h={min:function(t){return c.aggNums(Math.min,null,t)},max:function(t){return c.aggNums(Math.max,null,t)},sum:function(t){return c.aggNums(function(t,e){return t+e},null,t)},total:function(t){return c.aggNums(function(t,e){return t+e},null,t)},mean:function(t){return c.mean(t)},"geometric mean":function(t){return c.geometricMean(t)},median:function(t){return c.median(t)}};function f(t,e){return t[1]-e[1]}function d(t,e){return e[1]-t[1]}for(r=0;r<t.length;r++){var m=t[r];if("category"===m.type){var g=m.categoryorder.match(B);if(g){var y=g[1],v=g[2],x=m._id.charAt(0),_="x"===x,b=[];for(n=0;n<m._categories.length;n++)b.push([m._categories[n],[]]);for(n=0;n<m._traceIndices.length;n++){var w=m._traceIndices[n],T=e._fullData[w];if(!0===T.visible){var k=T.type;s.traceIs(T,"histogram")&&(delete T._xautoBinFinished,delete T._yautoBinFinished);var A="splom"===k,M="scattergl"===k,S=e.calcdata[w];for(i=0;i<S.length;i++){var E,C,I=S[i];if(A){var L=T._axesDim[m._id];if(!_){var P=T._diag[L][0];P&&(m=e._fullLayout[p.id2name(P)])}var z=I.trace.dimensions[L].values;for(a=0;a<z.length;a++)for(E=m._categoriesMap[z[a]],o=0;o<I.trace.dimensions.length;o++)if(o!==L){var O=I.trace.dimensions[o];b[E][1].push(O.values[a])}}else if(M){for(a=0;a<I.t.x.length;a++)_?(E=I.t.x[a],C=I.t.y[a]):(E=I.t.y[a],C=I.t.x[a]),b[E][1].push(C);I.t&&I.t._scene&&delete I.t._scene.dirty}else if(I.hasOwnProperty("z")){C=I.z;var D=u(T.type,m,C);for(a=0;a<C.length;a++)for(o=0;o<C[a].length;o++)(E=D(o,a))+1&&b[E][1].push(C[a][o])}else for(void 0===(E=I.p)&&(E=I[x]),void 0===(C=I.s)&&(C=I.v),void 0===C&&(C=_?I.y:I.x),Array.isArray(C)||(C=void 0===C?[]:[C]),a=0;a<C.length;a++)b[E][1].push(C[a])}}}m._categoriesValue=b;var R=[];for(n=0;n<b.length;n++)R.push([b[n][0],h[y](b[n][1])]);R.sort("descending"===v?d:f),m._categoriesAggregatedValue=R,m._initialCategories=R.map(function(t){return t[0]}),l=l.concat(m.sortByInitialCategories())}}}return l}(o,t);if(w.length){for(h._numBoxes=0,h._numViolins=0,i=0;i<w.length;i++)b(w[i],!0);for(i=0;i<w.length;i++)b(w[i],!1);U(t)}s.getComponentMethod("fx","calc")(t),s.getComponentMethod("errorbars","calc")(t)};var B=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function N(t,e,r){var n={};function i(t){t.clearCalc(),"multicategory"===t.type&&t.setupMultiCategory(e),n[t._id]=1}c.simpleMap(t,i);for(var a=r._axisMatchGroups||[],o=0;o<a.length;o++)for(var s in a[o])n[s]||i(r[p.id2name(s)])}function U(t){var e,r,n,i=t._fullLayout,a=i._visibleModules,o={};for(r=0;r<a.length;r++){var s=a[r],l=s.crossTraceCalc;if(l){var u=s.basePlotModule.name;o[u]?c.pushUnique(o[u],l):o[u]=[l]}}for(n in o){var h=o[n],f=i._subplots[n];if(Array.isArray(f))for(e=0;e<f.length;e++){var p=f[e],d="cartesian"===n?i._plots[p]:i[p];for(r=0;r<h.length;r++)h[r](t,d,p)}else for(r=0;r<h.length;r++)h[r](t)}}S.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},S.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},S.reselect=function(t){var e=t._fullLayout,r=(t.layout||{}).selections,n=e._previousSelections;e._previousSelections=r;var i=e._reselect||JSON.stringify(r)!==JSON.stringify(n);s.getComponentMethod("selections","reselect")(t,i)},S.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var u in a)if(!o[u]){var h=a[u][0];h[0].trace.visible=!1,o[u]=[h]}for(var f in o){var p=o[f];p[0][0].trace._module.plot(t,e,c.filterVisible(p),n)}e.traceHash=o},S.plotBasePlot=function(t,e,r,n,i){var a=s.getModule(t),o=x(e.calcdata,a)[0];a.plot(e,o,n,i)},S.cleanBasePlot=function(t,e,r,n,i){var a=i._has&&i._has(t),o=r._has&&r._has(t);a&&!o&&i["_"+t+"layer"].selectAll("g.trace").remove()}}),Te=f(t=>{t.xmlns="http://www.w3.org/2000/xmlns/",t.svg="http://www.w3.org/2000/svg",t.xlink="http://www.w3.org/1999/xlink",t.svgAttrs={xmlns:t.svg,"xmlns:xlink":t.xlink}}),ke=f((t,e)=>{e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}),Ae=f(t=>{var e=v(),r=oe(),n=r.strTranslate,i=Te(),a=ke().LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(d,v,M){var S=d.text(),I=!d.attr("data-notex")&&v&&v._context.typesetMath&&"undefined"!=typeof MathJax&&S.match(o),L=e.select(d.node().parentNode);if(!L.empty()){var P=d.attr("class")?d.attr("class").split(" ")[0]:"text";return P+="-math",L.selectAll("svg."+P).remove(),L.selectAll("g."+P+"-group").remove(),d.style("display",null).attr({"data-unformatted":S,"data-math":"N"}),I?(v&&v._promises||[]).push(new Promise(function(t){d.style("display","none");var i=parseInt(d.node().style.fontSize,10),a={fontSize:i};!function(t,n,i){var a=parseInt((MathJax.version||"").split(".")[0]);if(2===a||3===a){var o,c,h,f,p=function(){return c=r.extendDeepAll({},MathJax.Hub.config),h=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:u},displayAlign:"left"})},d=function(){c=r.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=u},m=function(){if("SVG"!==(o=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},g=function(){"svg"!==(o=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg")},y=function(){var i="math-output-"+r.randstr({},64);f=e.select("body").append("div").attr({id:i}).style({visibility:"hidden",position:"absolute","font-size":n.fontSize+"px"}).text(function(t){return t.replace(s,"\\lt ").replace(l,"\\gt ")}(t));var o=f.node();return 2===a?MathJax.Hub.Typeset(o):MathJax.typeset([o])},v=function(){var n=f.select(2===a?".MathJax_SVG":".MathJax"),o=!n.empty()&&f.select("svg").node();if(o){var s,l=o.getBoundingClientRect();s=2===a?e.select("body").select("#MathJax_SVG_glyphs"):n.select("defs"),i(n,s,l)}else r.log("There was an error in the tex syntax.",t),i();f.remove()},x=function(){if("SVG"!==o)return MathJax.Hub.setRenderer(o)},_=function(){"svg"!==o&&(MathJax.config.startup.output=o)},b=function(){return void 0!==h&&(MathJax.Hub.processSectionDelay=h),MathJax.Hub.Config(c)},w=function(){MathJax.config=c};2===a?MathJax.Hub.Queue(p,m,y,v,x,b):3===a&&(d(),g(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){y(),v(),_(),w()}))}else r.warn("No MathJax version:",MathJax.version)}(I[2],a,function(e,r,a){L.selectAll("svg."+P).remove(),L.selectAll("g."+P+"-group").remove();var o=e&&e.select("svg");if(!o||!o.node())return z(),void t();var s=L.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":S,"data-math":"Y"});s.node().appendChild(o.node()),r&&r.node()&&o.node().insertBefore(r.node().cloneNode(!0),o.node().firstChild);var l=a.width,u=a.height;o.attr({class:P,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=d.node().style.fill||"black",h=o.select("g");h.attr({fill:c,stroke:c});var f=h.node().getBoundingClientRect(),p=f.width,m=f.height;(p>l||m>u)&&(o.style("overflow","hidden"),p=(f=o.node().getBoundingClientRect()).width,m=f.height);var g=+d.attr("x"),y=+d.attr("y"),v=-(i||d.node().getBoundingClientRect().height)/4;if("y"===P[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-p/2,v-m/2)});else if("l"===P[0])y=v-m/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))g=0,y=v;else{var x=d.attr("text-anchor");g-=p*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y:y}),M&&M.call(d,s),t(s)})})):z(),d}function z(){L.empty()||(P=d.attr("class")+"-math",L.select("svg."+P).remove()),d.text("").style("white-space","pre");var n=function(t,n){n=n.replace(m," ");var o,s=!1,l=[],u=-1;function d(){u++;var r=document.createElementNS(i.svg,"tspan");e.select(r).attr({class:"line",dy:u*a+"em"}),t.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s<n.length;s++)v(n[s])}function v(t){var r,n=t.type,a={};if("a"===n){r="a";var s=t.target,u=t.href,c=t.popup;u&&(a={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":u},c&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+c+'");return false;'))}else r="tspan";t.style&&(a.style=t.style);var d=document.createElementNS(i.svg,r);if("sup"===n||"sub"===n){M(o,p),o.appendChild(d);var m=document.createElementNS(i.svg,"tspan");M(m,p),e.select(m).attr("dy",f[n]),a.dy=h[n],o.appendChild(d),o.appendChild(m)}else o.appendChild(d);e.select(d).attr(a),o=t.node=d,l.push(t)}function M(t,e){t.appendChild(document.createTextNode(e))}function S(t){if(1!==l.length){var e=l.pop();t!==e.type&&r.log("Start tag <"+e.type+"> doesnt match end tag <"+t+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag </"+t+">.",n)}var I=x.test(n);I?d():(o=t,l=[{node:t}]);for(var L=n.split(g),P=0;P<L.length;P++){var z=L[P],O=z.match(y),D=O&&O[2].toLowerCase(),R=c[D];if("br"===D)d();else if(void 0===R)M(o,E(z));else if(O[1])S(D);else{var F=O[4],B={type:D},N=k(F,_);if(N?(N=N.replace(A,"$1 fill:"),R&&(N+=";"+R)):R&&(N=R),N&&(B.style=N),"a"===D){s=!0;var j=k(F,b);if(j){var U=C(j);U&&(B.href=U,B.target=k(F,w)||"_blank",B.popup=k(F,T))}}v(B)}}return s}(d.node(),S);n&&d.style("pointer-events","all"),t.positionText(d),M&&M.call(d)}};var s=/(<|&lt;|&#60;)/g,l=/(>|&gt;|&#62;)/g,u=[["$","$"],["\\(","\\)"]],c={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},p="",d=["http:","https:","mailto:","",void 0,":"],m=t.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;t.BR_TAG_ALL=/<br(\s+.*)?>/gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var A=/(^|;)\s*color:/;t.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(g),a=[],o="",s=0,l=0;l<i.length;l++){var u=i[l],c=u.match(y),h=c&&c[2].toLowerCase();if(h)-1!==n.indexOf(h)&&(a.push(u),o=h);else{var f=u.length;if(s+f<r)a.push(u),s+=f;else if(s<r){var p=r-s;o&&("br"!==o||p<=3||f<=3)&&a.pop(),r>3?a.push(u.substr(0,p-3)+"..."):a.push(u.substr(0,p));break}o=""}}return a.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,function(t,e){var r;return r="#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e],r||t})}function C(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==d.indexOf(i)&&-1!==d.indexOf(a)?e:""}function I(t,e,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return u.bottom-i.height}:"middle"===l?function(){return u.top+(u.height-i.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-i.width}:"center"===s?function(){return u.left+(u.width-i.width)/2}:function(){return u.left},function(){i=this.node().getBoundingClientRect();var t=o()-c.left,e=a()-c.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}t.convertEntities=E,t.sanitizeHTML=function(t){t=t.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=t.split(g),o=0;o<a.length;o++){var s=a[o],l=s.match(y),u=l&&l[2].toLowerCase();if(u in c)if(l[1])i.length&&(n=i.pop());else{var h=l[4],f=k(h,_),p=f?{style:f}:{};if("a"===u){var d=k(h,b);if(d){var v=C(d);if(v){p.href=v;var x=k(h,w);x&&(p.target=x)}}}var T=document.createElement(u);n.appendChild(T),e.select(T).attr(p),n=T,i.push(T)}else n.appendChild(document.createTextNode(E(s)))}return r.innerHTML},t.lineCount=function(t){return t.selectAll("tspan.line").size()||1},t.positionText=function(t,r,n){return t.each(function(){var t=e.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",r),o=i("y",n);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})};var L="1px ";t.makeTextShadow=function(t){return L+L+L+t+", -"+L+"-"+L+L+t+", "+L+"-"+L+L+t+", -"+L+L+L+t},t.makeEditable=function(t,r){var n=r.gd,i=r.delegate,a=e.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){(function(){var i=e.select(n),o=i.select(".svg-container"),s=o.append("div"),u=t.node().style,c=parseFloat(u.fontSize||12),h=r.text;void 0===h&&(h=t.attr("data-unformatted")),s.classed("plugin-editable editable",!0).style({position:"absolute","font-family":u.fontFamily||"Arial","font-size":c,color:r.fill||u.fill||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(h).call(I(t,o,r)).on("blur",function(){n._editing=!1,t.text(this.textContent).style({opacity:1});var r,i=e.select(this).attr("class");(r=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&e.select(t.node().parentNode).select(r).style({opacity:0});var o=this.textContent;e.select(this).transition().duration(0).remove(),e.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;n._editing=!0,e.select(document).on("mouseup",function(){if(e.event.target===t)return!1;document.activeElement===s.node()&&s.node().blur()})}).on("keyup",function(){27===e.event.which?(n._editing=!1,t.style({opacity:1}),e.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),e.select(this).call(I(t,o,r)))}).on("keydown",function(){13===e.event.which&&this.blur()}).call(l)})(),t.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&e.select(t.node().parentNode).select(i).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return r.immediate?s():o.on("click",s),e.rebind(t,a,"on")}}),Me=f((t,e)=>{var r=v(),n=O(),i=T(),a=oe(),o=q(),s=U().isValid,l=["showscale","autocolorscale","colorscale","reversescale","colorbar"],u=["min","max","mid","auto"];function c(t){var e,r,n,i=t._colorAx,a=i||t,o={};for(r=0;r<l.length;r++)o[n=l[r]]=a[n];if(i)for(e="c",r=0;r<u.length;r++)o[n=u[r]]=a["c"+n];else{var s;for(r=0;r<u.length;r++)((s="c"+(n=u[r]))in a||(s="z"+n)in a)&&(o[n]=a[s]);e=s.charAt(0)}return o._sync=function(t,r){var n=-1!==u.indexOf(t)?e+t:t;a[n]=a["_"+n]=r},o}function h(t){for(var e=c(t),r=e.min,n=e.max,i=e.reversescale?f(e.colorscale):e.colorscale,a=i.length,o=new Array(a),s=new Array(a),l=0;l<a;l++){var u=i[l];o[l]=r+u[0]*(n-r),s[l]=u[1]}return{domain:o,range:s}}function f(t){for(var e=t.length,r=new Array(e),n=e-1,i=0;n>=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var a=t.domain,s=t.range,l=s.length,u=new Array(l),c=0;c<l;c++){var h=n(s[c]).toRgb();u[c]=[h.r,h.g,h.b,h.a]}var f,p=r.scale.linear().domain(a).range(u).clamp(!0),m=e.noNumericCheck,g=e.returnArray;return(f=m&&g?p:m?function(t){return d(p(t))}:g?function(t){return i(t)?p(t):n(t).isValid()?t:o.defaultLine}:function(t){return i(t)?d(p(t)):n(t).isValid()?t:o.defaultLine}).domain=p.domain,f.range=function(){return s},f}function d(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return n(e).toRgbString()}e.exports={hasColorscale:function(t,e,r){var n=e?a.nestedProperty(t,e).get()||{}:t,o=n[r||"color"];o&&o._inputArray&&(o=o._inputArray);var l=!1;if(a.isArrayOrTypedArray(o))for(var u=0;u<o.length;u++)if(i(o[u])){l=!0;break}return a.isPlainObject(n)&&(l||!0===n.showscale||i(n.cmin)&&i(n.cmax)||s(n.colorscale)||a.isPlainObject(n.colorbar))},extractOpts:c,extractScale:h,flipScale:f,makeColorScaleFunc:p,makeColorScaleFuncFromTrace:function(t,e){return p(h(t),e)}}}),Se=f((t,e)=>{var r=zt(),n=r.FORMAT_LINK,i=r.DATE_FORMAT_LINK;function a(t,e){return["Sets the "+t+" formatting rule"+(e?"for `"+e+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+n+"."].join(" ")}function o(t,e){return a(t,e)+[" And for dates see: "+i+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}e.exports={axisHoverFormat:function(t,e){return{valType:"string",dflt:"",editType:"none",description:(e?a:o)("hover text",t)+["By default the values are formatted using "+(e?"generic number format":"`"+t+"axis.hoverformat`")+"."].join(" ")}},descriptionOnlyNumbers:a,descriptionWithDates:o}}),Ee=f((t,e)=>{var r=R(),n=V(),i=Pt().dash,a=D().extendFlat,o=me().templatedArray;Ot().templateFormatStringDescription;var s=Se().descriptionWithDates,l=k().ONEDAY,u=ge(),c=u.HOUR_PATTERN,h=u.WEEKDAY_PATTERN,f={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},p=a({},f,{values:f.values.slice().concat(["sync"])});function d(t){return{valType:"integer",min:0,dflt:t?5:0,editType:"ticks"}}var m={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},g={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},y={valType:"data_array",editType:"ticks"},v={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function x(t){var e={valType:"number",min:0,editType:"ticks"};return t||(e.dflt=5),e}function _(t){var e={valType:"number",min:0,editType:"ticks"};return t||(e.dflt=1),e}var b={valType:"color",dflt:n.defaultLine,editType:"ticks"},w={valType:"color",dflt:n.lightLine,editType:"ticks"};function T(t){var e={valType:"number",min:0,editType:"ticks"};return t||(e.dflt=1),e}var A=a({},i,{editType:"ticks"}),M={valType:"boolean",editType:"ticks"};e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:n.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:r({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"calc"},rangebreaks:o("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[h,c,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:l},editType:"calc"}),tickmode:p,nticks:d(),tick0:m,dtick:g,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:y,ticktext:{valType:"data_array",editType:"ticks"},ticks:v,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:x(),tickwidth:_(),tickcolor:b,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:a({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:r({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:s("tick label")},tickformatstops:o("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:s("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:n.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:M,gridcolor:w,gridwidth:T(),griddash:A,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:n.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:n.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},minor:{tickmode:f,nticks:d("minor"),tick0:m,dtick:g,tickvals:y,ticks:v,ticklen:x("minor"),tickwidth:_("minor"),tickcolor:b,gridcolor:w,gridwidth:T("minor"),griddash:A,showgrid:M,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),Ce=f((t,e)=>{var r=Ee(),n=R(),i=D().extendFlat,a=Lt().overrideAll;e.exports=a({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:r.linecolor,outlinewidth:r.linewidth,bordercolor:r.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:i({},r.ticks,{dflt:""}),ticklabeloverflow:i({},r.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:n({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,title:{text:{valType:"string"},font:n({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),Ie=f((t,e)=>{var r=Ce(),n=G().counter,i=Gt(),a=U().scales;i(a),e.exports=function(t,e){t=t||"";var i=(e=e||{}).cLetter||"c";"onlyIfNumerical"in e&&e.onlyIfNumerical;var o,s="noScale"in e?e.noScale:"marker.line"===t,l="showScaleDflt"in e?e.showScaleDflt:"z"===i,u="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,c=e.editTypeOverride||"";"colorAttr"in e?(o=e.colorAttr,e.colorAttr):o={z:"z",c:"color"}[i];var h=i+"auto",f=i+"min",p=i+"max",d=i+"mid",m={};m[f]=m[p]=void 0;var g={};g[h]=!1;var y={};return"color"===o&&(y.color={valType:"color",arrayOk:!0,editType:c||"style"},e.anim&&(y.color.anim=!0)),y[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},y[f]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:g},y[p]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:g},y[d]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},y.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},y.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},y.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(y.showscale={valType:"boolean",dflt:l,editType:"calc"},y.colorbar=r),e.noColorAxis||(y.coloraxis={valType:"subplotid",regex:n("coloraxis"),dflt:null,editType:"calc"}),y}}),Le=f((t,e)=>{var r=D().extendFlat,n=Ie(),i=U().scales;e.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:i.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:i.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:i.RdBu,editType:"calc"}},coloraxis:r({_isSubplotObj:!0,editType:"calc"},n("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),Pe=f((t,e)=>{var r=oe();e.exports=function(t){return r.isPlainObject(t.colorbar)}}),ze=f(t=>{var e=T(),r=oe(),n=k(),i=n.ONEDAY,a=n.ONEWEEK;t.dtick=function(t,r){var n="log"===r,a="date"===r,o="category"===r,s=a?i:1;if(!t)return s;if(e(t))return(t=Number(t))<=0?s:o?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if("string"!=typeof t||!a&&!n)return s;var l=t.charAt(0),u=t.substr(1);return(u=e(u)?Number(u):0)<=0||!(a&&"M"===l&&u===Math.round(u)||n&&"L"===l||n&&"D"===l&&(1===u||2===u))?s:t},t.tick0=function(t,n,i,o){return"date"===n?r.cleanDate(t,r.dateTick0(i,o%a===0?1:0)):"D1"!==o&&"D2"!==o?e(t)?Number(t):0:void 0}}),Oe=f((t,e)=>{var r=ze(),n=oe().isArrayOrTypedArray,i=S().isTypedArraySpec,a=S().decodeTypedArraySpec;e.exports=function(t,e,o,s,l){l||(l={});var u=l.isMinor,c=u?t.minor||{}:t,h=u?e.minor:e,f=u?"minor.":"";function p(t){var e=c[t];return i(e)&&(e=a(e)),void 0!==e?e:(h._template||{})[t]}var d=p("tick0"),m=p("dtick"),g=p("tickvals"),y=o(f+"tickmode",n(g)?"array":m?"linear":"auto");if("auto"===y||"sync"===y)o(f+"nticks");else if("linear"===y){var v=h.dtick=r.dtick(m,s);h.tick0=r.tick0(d,s,e.calendar,v)}else"multicategory"!==s&&(void 0===o(f+"tickvals")?h.tickmode="auto":u||o("ticktext"))}}),De=f((t,e)=>{var r=oe(),n=Ee();e.exports=function(t,e,i,a){var o=a.isMinor,s=o?t.minor||{}:t,l=o?e.minor:e,u=o?n.minor:n,c=o?"minor.":"",h=r.coerce2(s,l,u,"ticklen",o?.6*(e.ticklen||5):void 0),f=r.coerce2(s,l,u,"tickwidth",o?e.tickwidth||1:void 0),p=r.coerce2(s,l,u,"tickcolor",(o?e.tickcolor:void 0)||l.color);i(c+"ticks",!o&&a.outerTicks||h||f||p?"outside":"")||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)}}),Re=f((t,e)=>{e.exports=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}}),Fe=f((t,e)=>{var r=oe(),n=me();e.exports=function(t,e,i){var a,o,s=i.name,l=i.inclusionAttr||"visible",u=e[s],c=r.isArrayOrTypedArray(t[s])?t[s]:[],h=e[s]=[],f=n.arrayTemplater(e,s,l);for(a=0;a<c.length;a++){var p=c[a];r.isPlainObject(p)?o=f.newItem(p):(o=f.newItem({}))[l]=!1,o._index=a,!1!==o[l]&&i.handleItemDefaults(p,o,e,i),h.push(o)}var d=f.defaultItems();for(a=0;a<d.length;a++)(o=d[a])._index=h.length,i.handleItemDefaults({},o,e,i,{}),h.push(o);if(r.isArrayOrTypedArray(u)){var m=Math.min(u.length,h.length);for(a=0;a<m;a++)r.relinkPrivateKeys(h[a],u[a])}return h}}),Be=f((t,e)=>{var r=oe(),n=q().contrast,i=Ee(),a=Re(),o=Fe();function s(t,e){function n(n,a){return r.coerce(t,e,i.tickformatstops,n,a)}n("enabled")&&(n("dtickrange"),n("value"))}e.exports=function(t,e,l,u,c){c||(c={});var h=l("labelalias");r.isPlainObject(h)||delete e.labelalias;var f=a(t);if(l("showticklabels")){c.noTicklabelshift||l("ticklabelshift"),c.noTicklabelstandoff||l("ticklabelstandoff");var p=c.font||{},d=e.color,m=-1!==(e.ticklabelposition||"").indexOf("inside")?n(c.bgColor):d&&d!==i.color.dflt?d:p.color;if(r.coerceFont(l,"tickfont",p,{overrideDflt:{color:m}}),!c.noTicklabelstep&&"multicategory"!==u&&"log"!==u&&l("ticklabelstep"),!c.noAng){var g=l("tickangle");!c.noAutotickangles&&"auto"===g&&l("autotickangles")}if("category"!==u){var y=l("tickformat");o(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),e.tickformatstops.length||delete e.tickformatstops,!c.noExp&&!y&&"date"!==u&&(l("showexponent",f),l("exponentformat"),l("minexponent"),l("separatethousands"))}!c.noMinorloglabels&&"log"===u&&l("minorloglabels")}}}),Ne=f((t,e)=>{var r=Re();e.exports=function(t,e,n,i,a){a||(a={});var o=a.tickSuffixDflt,s=r(t);n("tickprefix")&&n("showtickprefix",s),n("ticksuffix",o)&&n("showticksuffix",s)}}),je=f((t,e)=>{var r=oe(),n=me(),i=Oe(),a=De(),o=Be(),s=Ne(),l=Ce();e.exports=function(t,e,u){var c=n.newContainer(e,"colorbar"),h=t.colorbar||{};function f(t,e){return r.coerce(h,c,l,t,e)}var p=u.margin||{t:0,b:0,l:0,r:0},d=u.width-p.l-p.r,m=u.height-p.t-p.b,g="v"===f("orientation"),y=f("thicknessmode");f("thickness","fraction"===y?30/(g?d:m):30);var v=f("lenmode");f("len","fraction"===v?1:g?m:d);var x,_,b,w="paper"===f("yref"),T="paper"===f("xref"),k="left";g?(b="middle",k=T?"left":"right",x=T?1.02:1,_=.5):(b=w?"bottom":"top",k="center",x=.5,_=w?1.02:1),r.coerce(h,c,{x:{valType:"number",min:T?-2:0,max:T?3:1,dflt:x}},"x"),r.coerce(h,c,{y:{valType:"number",min:w?-2:0,max:w?3:1,dflt:_}},"y"),f("xanchor",k),f("xpad"),f("yanchor",b),f("ypad"),r.noneOrAll(h,c,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var A=r.coerce(h,c,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:g?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");f("ticklabeloverflow",-1!==A.indexOf("inside")?"hide past domain":"hide past div"),i(h,c,f,"linear");var M=u.font,S={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:M};-1!==A.indexOf("inside")&&(S.bgColor="black"),s(h,c,f,"linear",S),o(h,c,f,"linear",S),a(h,c,f,"linear",S),f("title.text",u._dfltTitle.colorbar);var E=c.showticklabels?c.tickfont:M,C=r.extendFlat({},M,{family:E.family,size:r.bigFont(E.size)});r.coerceFont(f,"title.font",C),f("title.side",g?"top":"right")}}),Ue=f((t,e)=>{var r=T(),n=oe(),i=Pe(),a=je(),o=U().isValid,s=Ut().traceIs;function l(t,e){var r=e.slice(0,e.length-1);return e?n.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,u,c,h,f){var p=f.prefix,d=f.cLetter,m="_module"in u,g=l(e,p),y=l(u,p),v=l(u._template||{},p)||{},x=function(){return delete e.coloraxis,delete u.coloraxis,t(e,u,c,h,f)};if(m){var _=c._colorAxes||{},b=h(p+"coloraxis");if(b){var w=s(u,"contour")&&n.nestedProperty(u,"contours.coloring").get()||"heatmap",T=_[b];return void(T?(T[2].push(x),T[0]!==w&&(T[0]=!1,n.warn(["Ignoring coloraxis:",b,"setting","as it is linked to incompatible colorscales."].join(" ")))):_[b]=[w,u,[x]])}}var k=g[d+"min"],A=g[d+"max"],M=r(k)&&r(A)&&k<A;h(p+d+"auto",!M)?h(p+d+"mid"):(h(p+d+"min"),h(p+d+"max"));var S,E,C=g.colorscale,I=v.colorscale;void 0!==C&&(S=!o(C)),void 0!==I&&(S=!o(I)),h(p+"autocolorscale",S),h(p+"colorscale"),h(p+"reversescale"),"marker.line."!==p&&(p&&m&&(E=i(g)),h(p+"showscale",E)&&(p&&v&&(y._template=v),a(g,y,c)))}}),Ve=f((t,e)=>{var r=oe(),n=me(),i=Le(),a=Ue();e.exports=function(t,e){function o(n,a){return r.coerce(t,e,i,n,a)}o("colorscale.sequential"),o("colorscale.sequentialminus"),o("colorscale.diverging");var s,l,u=e._colorAxes;function c(t,e){return r.coerce(s,l,i.coloraxis,t,e)}for(var h in u){var f=u[h];if(f[0])s=t[h]||{},(l=n.newContainer(e,h,"coloraxis"))._name=h,a(s,l,e,c,{prefix:"",cLetter:"c"});else{for(var p=0;p<f[2].length;p++)f[2][p]();delete e._colorAxes[h]}}}}),qe=f((t,e)=>{var r=oe(),n=Me().hasColorscale,i=Me().extractOpts;e.exports=function(t,e){function a(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,n){var o=n.container?r.nestedProperty(t,n.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&a(o,n.min),(l||void 0===s.max)&&a(o,n.max),s.autocolorscale&&a(o,"colorscale")}}for(var s=0;s<t.length;s++){var l=t[s],u=l._module.colorbar;if(u)if(Array.isArray(u))for(var c=0;c<u.length;c++)o(l,u[c]);else o(l,u);n(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var h in e._colorAxes)o(e[h],{min:"cmin",max:"cmax"})}}),He=f((t,e)=>{var r=T(),n=oe(),i=Me().extractOpts;e.exports=function(t,e,a){var o,s=t._fullLayout,l=a.vals,u=a.containerStr,c=u?n.nestedProperty(e,u).get():e,h=i(c),f=!1!==h.auto,p=h.min,d=h.max,m=h.mid,g=function(){return n.aggNums(Math.min,null,l)},y=function(){return n.aggNums(Math.max,null,l)};void 0===p?p=g():f&&(p=c._colorAx&&r(p)?Math.min(p,g()):g()),void 0===d?d=y():f&&(d=c._colorAx&&r(d)?Math.max(d,y()):y()),f&&void 0!==m&&(d-m>m-p?p=m-(d-m):d-m<m-p&&(d=m+(m-p))),p===d&&(p-=.5,d+=.5),h._sync("min",p),h._sync("max",d),h.autocolorscale&&(o=p*d<0?s.colorscale.diverging:p>=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}),Ge=f((t,e)=>{var r=U(),n=Me();e.exports={moduleType:"component",name:"colorscale",attributes:Ie(),layoutAttributes:Le(),supplyLayoutDefaults:Ve(),handleDefaults:Ue(),crossTraceDefaults:qe(),calc:He(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}),Ze=f((t,e)=>{var r=oe(),n=S().isTypedArraySpec;e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){var e=t.marker;return r.isPlainObject(e)&&(r.isArrayOrTypedArray(e.size)||n(e.size))}}}),We=f((t,e)=>{var r=T();e.exports=function(t,e){e||(e=2);var n=t.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(t){return Math.sqrt(t/i)}:function(t){return t/i};return function(t){var n=o(t/e);return r(n)&&n>0?Math.max(n,a):0}}}),Ye=f(t=>{var e=oe();t.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},t.isTraceInSubplots=function(e,r){if("splom"===e.type){for(var n=e.xaxes||[],i=e.yaxes||[],a=0;a<n.length;a++)for(var o=0;o<i.length;o++)if(-1!==r.indexOf(n[a]+i[o]))return!0;return!1}return-1!==r.indexOf(t.getSubplot(e))},t.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},t.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},t.getDistanceFunction=function(e,r,n,i){return"closest"===e?i||t.quadrature(r,n):"x"===e.charAt(0)?r:n},t.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=1/0,i=t.length,a=0;a<i;a++)(n=e(t[a]))<=r.distance&&(r.index=a,r.distance=n);return r},t.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},t.quadrature=function(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}},t.makeEventData=function(e,r,n){var i="index"in e?e.index:e.pointNumber,a={data:r._input,fullData:r,curveNumber:r.index,pointNumber:i};if(r._indexToPoints){var o=r._indexToPoints[i];1===o.length?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return r._module.eventData?a=r._module.eventData(a,e,r,n,i):("xVal"in e?a.x=e.xVal:"x"in e&&(a.x=e.x),"yVal"in e?a.y=e.yVal:"y"in e&&(a.y=e.y),e.xa&&(a.xaxis=e.xa),e.ya&&(a.yaxis=e.ya),void 0!==e.zLabelVal&&(a.z=e.zLabelVal)),t.appendArrayPointValue(a,r,i),a},t.appendArrayPointValue=function(t,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],u=n(l);if(void 0===t[u]){var c=i(e.nestedProperty(r,l).get(),a);void 0!==c&&(t[u]=c)}}},t.appendArrayMultiPointValues=function(t,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],u=n(l);if(void 0===t[u]){for(var c=e.nestedProperty(r,l).get(),h=new Array(a.length),f=0;f<a.length;f++)h[f]=i(c,a[f]);t[u]=h}}};var r={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function n(t){return r[t]||t}function i(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}var a={x:!0,y:!0},o={"x unified":!0,"y unified":!0};t.isUnifiedHover=function(t){return"string"==typeof t&&!!o[t]},t.isXYhover=function(t){return"string"==typeof t&&!!a[t]}}),Xe=f((t,e)=>{e.exports=function(t){var e=[];return t.replace(n,function(t,n,a){var o=n.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),e.push(a);if(a.length<r[o])throw new Error("malformed path data");e.push([n].concat(a.splice(0,r[o])))}}),e};var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi}),$e=f((t,e)=>{var r,n,i,a,o=Xe(),s=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},l="M0,0Z",u=Math.sqrt(2),c=Math.sqrt(3),h=Math.PI,f=Math.cos,p=Math.sin;function d(t){return null===t}function m(t,e,s){if(!(t&&t%360!=0||e))return s;if(i===t&&a===e&&r===s)return n;function l(t,r){var n=f(t),i=p(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}i=t,a=e,r=s;for(var u=t/180*h,c=0,d=0,m=o(s),g="",y=0;y<m.length;y++){var v=m[y],x=v[0],_=c,b=d;if("M"===x||"L"===x)c=+v[1],d=+v[2];else if("m"===x||"l"===x)c+=+v[1],d+=+v[2];else if("H"===x)c=+v[1];else if("h"===x)c+=+v[1];else if("V"===x)d=+v[1];else if("v"===x)d+=+v[1];else if("A"===x){c=+v[1],d=+v[2];var w=l(u,[+v[6],+v[7]]);v[6]=w[0],v[7]=w[1],v[3]=+v[3]+t}("H"===x||"V"===x)&&(x="L"),("h"===x||"v"===x)&&(x="l"),("m"===x||"l"===x)&&(c-=_,d-=b);var T=l(u,[c,d]);("H"===x||"V"===x)&&(x="L"),("M"===x||"L"===x||"m"===x||"l"===x)&&(v[1]=T[0],v[2]=T[1]),v[0]=x,g+=v[0]+v.slice(1).join(",")}return n=g,g}e.exports={circle:{n:0,f:function(t,e,r){if(d(e))return l;var n=s(t,2),i="M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z";return r?m(e,r,i):i}},square:{n:1,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")}},diamond:{n:2,f:function(t,e,r){if(d(e))return l;var n=s(1.3*t,2);return m(e,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"Z")}},cross:{n:3,f:function(t,e,r){if(d(e))return l;var n=s(.4*t,2),i=s(1.2*t,2);return m(e,r,"M"+i+","+n+"H"+n+"V"+i+"H-"+n+"V"+n+"H-"+i+"V-"+n+"H-"+n+"V-"+i+"H"+n+"V-"+n+"H"+i+"Z")}},x:{n:4,f:function(t,e,r){if(d(e))return l;var n=s(.8*t/u,2),i="l"+n+","+n,a="l"+n+",-"+n,o="l-"+n+",-"+n,c="l-"+n+","+n;return m(e,r,"M0,"+n+i+a+o+a+o+c+o+c+i+c+i+"Z")}},"triangle-up":{n:5,f:function(t,e,r){if(d(e))return l;var n=s(2*t/c,2);return m(e,r,"M-"+n+","+s(t/2,2)+"H"+n+"L0,-"+s(t,2)+"Z")}},"triangle-down":{n:6,f:function(t,e,r){if(d(e))return l;var n=s(2*t/c,2);return m(e,r,"M-"+n+",-"+s(t/2,2)+"H"+n+"L0,"+s(t,2)+"Z")}},"triangle-left":{n:7,f:function(t,e,r){if(d(e))return l;var n=s(2*t/c,2);return m(e,r,"M"+s(t/2,2)+",-"+n+"V"+n+"L-"+s(t,2)+",0Z")}},"triangle-right":{n:8,f:function(t,e,r){if(d(e))return l;var n=s(2*t/c,2);return m(e,r,"M-"+s(t/2,2)+",-"+n+"V"+n+"L"+s(t,2)+",0Z")}},"triangle-ne":{n:9,f:function(t,e,r){if(d(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M-"+i+",-"+n+"H"+n+"V"+i+"Z")}},"triangle-se":{n:10,f:function(t,e,r){if(d(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M"+n+",-"+i+"V"+n+"H-"+i+"Z")}},"triangle-sw":{n:11,f:function(t,e,r){if(d(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M"+i+","+n+"H-"+n+"V-"+i+"Z")}},"triangle-nw":{n:12,f:function(t,e,r){if(d(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M-"+n+","+i+"V-"+n+"H"+i+"Z")}},pentagon:{n:13,f:function(t,e,r){if(d(e))return l;var n=s(.951*t,2),i=s(.588*t,2),a=s(-t,2),o=s(-.309*t,2);return m(e,r,"M"+n+","+o+"L"+i+","+s(.809*t,2)+"H-"+i+"L-"+n+","+o+"L0,"+a+"Z")}},hexagon:{n:14,f:function(t,e,r){if(d(e))return l;var n=s(t,2),i=s(t/2,2),a=s(t*c/2,2);return m(e,r,"M"+a+",-"+i+"V"+i+"L0,"+n+"L-"+a+","+i+"V-"+i+"L0,-"+n+"Z")}},hexagon2:{n:15,f:function(t,e,r){if(d(e))return l;var n=s(t,2),i=s(t/2,2),a=s(t*c/2,2);return m(e,r,"M-"+i+","+a+"H"+i+"L"+n+",0L"+i+",-"+a+"H-"+i+"L-"+n+",0Z")}},octagon:{n:16,f:function(t,e,r){if(d(e))return l;var n=s(.924*t,2),i=s(.383*t,2);return m(e,r,"M-"+i+",-"+n+"H"+i+"L"+n+",-"+i+"V"+i+"L"+i+","+n+"H-"+i+"L-"+n+","+i+"V-"+i+"Z")}},star:{n:17,f:function(t,e,r){if(d(e))return l;var n=1.4*t,i=s(.225*n,2),a=s(.951*n,2),o=s(.363*n,2),u=s(.588*n,2),c=s(-n,2),h=s(-.309*n,2),f=s(.118*n,2),p=s(.809*n,2);return m(e,r,"M"+i+","+h+"H"+a+"L"+o+","+f+"L"+u+","+p+"L0,"+s(.382*n,2)+"L-"+u+","+p+"L-"+o+","+f+"L-"+a+","+h+"H-"+i+"L0,"+c+"Z")}},hexagram:{n:18,f:function(t,e,r){if(d(e))return l;var n=s(.66*t,2),i=s(.38*t,2),a=s(.76*t,2);return m(e,r,"M-"+a+",0l-"+i+",-"+n+"h"+a+"l"+i+",-"+n+"l"+i+","+n+"h"+a+"l-"+i+","+n+"l"+i+","+n+"h-"+a+"l-"+i+","+n+"l-"+i+",-"+n+"h-"+a+"Z")}},"star-triangle-up":{n:19,f:function(t,e,r){if(d(e))return l;var n=s(t*c*.8,2),i=s(.8*t,2),a=s(1.6*t,2),o=s(4*t,2),u="A "+o+","+o+" 0 0 1 ";return m(e,r,"M-"+n+","+i+u+n+","+i+u+"0,-"+a+u+"-"+n+","+i+"Z")}},"star-triangle-down":{n:20,f:function(t,e,r){if(d(e))return l;var n=s(t*c*.8,2),i=s(.8*t,2),a=s(1.6*t,2),o=s(4*t,2),u="A "+o+","+o+" 0 0 1 ";return m(e,r,"M"+n+",-"+i+u+"-"+n+",-"+i+u+"0,"+a+u+n+",-"+i+"Z")}},"star-square":{n:21,f:function(t,e,r){if(d(e))return l;var n=s(1.1*t,2),i=s(2*t,2),a="A "+i+","+i+" 0 0 1 ";return m(e,r,"M-"+n+",-"+n+a+"-"+n+","+n+a+n+","+n+a+n+",-"+n+a+"-"+n+",-"+n+"Z")}},"star-diamond":{n:22,f:function(t,e,r){if(d(e))return l;var n=s(1.4*t,2),i=s(1.9*t,2),a="A "+i+","+i+" 0 0 1 ";return m(e,r,"M-"+n+",0"+a+"0,"+n+a+n+",0"+a+"0,-"+n+a+"-"+n+",0Z")}},"diamond-tall":{n:23,f:function(t,e,r){if(d(e))return l;var n=s(.7*t,2),i=s(1.4*t,2);return m(e,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},"diamond-wide":{n:24,f:function(t,e,r){if(d(e))return l;var n=s(1.4*t,2),i=s(.7*t,2);return m(e,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},hourglass:{n:25,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"H-"+n+"L"+n+",-"+n+"H-"+n+"Z")},noDot:!0},bowtie:{n:26,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"V-"+n+"L-"+n+","+n+"V-"+n+"Z")},noDot:!0},"circle-cross":{n:27,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t,e,r){if(d(e))return l;var n=s(t,2),i=s(t/u,2);return m(e,r,"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t,e,r){if(d(e))return l;var n=s(1.3*t,2);return m(e,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM0,-"+n+"V"+n+"M-"+n+",0H"+n)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t,e,r){if(d(e))return l;var n=s(1.3*t,2),i=s(.65*t,2);return m(e,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM-"+i+",-"+i+"L"+i+","+i+"M-"+i+","+i+"L"+i+",-"+i)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t,e,r){if(d(e))return l;var n=s(1.4*t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t,e,r){if(d(e))return l;var n=s(1.2*t,2),i=s(.85*t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t,e,r){if(d(e))return l;var n=s(t/2,2),i=s(t,2);return m(e,r,"M"+n+","+i+"V-"+i+"M"+(n-i)+",-"+i+"V"+i+"M"+i+","+n+"H-"+i+"M-"+i+","+(n-i)+"H"+i)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t,e,r){if(d(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M-"+n+","+a+"L0,0M"+n+","+a+"L0,0M0,-"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t,e,r){if(d(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M-"+n+",-"+a+"L0,0M"+n+",-"+a+"L0,0M0,"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t,e,r){if(d(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M"+a+","+n+"L0,0M"+a+",-"+n+"L0,0M-"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t,e,r){if(d(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M-"+a+","+n+"L0,0M-"+a+",-"+n+"L0,0M"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t,e,r){if(d(e))return l;var n=s(1.4*t,2);return m(e,r,"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t,e,r){if(d(e))return l;var n=s(1.4*t,2);return m(e,r,"M0,"+n+"V-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"L-"+n+",-"+n)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M0,0L-"+n+","+s(2*t,2)+"H"+n+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M0,0L-"+n+",-"+s(2*t,2)+"H"+n+"Z")},noDot:!0},"arrow-left":{n:47,f:function(t,e,r){if(d(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,0L"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-right":{n:48,f:function(t,e,r){if(d(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,0L-"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M-"+n+",0H"+n+"M0,0L-"+n+","+s(2*t,2)+"H"+n+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t,e,r){if(d(e))return l;var n=s(t,2);return m(e,r,"M-"+n+",0H"+n+"M0,0L-"+n+",-"+s(2*t,2)+"H"+n+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t,e,r){if(d(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,-"+i+"V"+i+"M0,0L"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t,e,r){if(d(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,-"+i+"V"+i+"M0,0L-"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(t,e,r){if(d(e))return l;var n=h/2.5,i=2*t*f(n),a=2*t*p(n);return m(e,r,"M0,0L"+-i+","+a+"L"+i+","+a+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(t,e,r){if(d(e))return l;var n=h/4,i=2*t*f(n),a=2*t*p(n);return m(e,r,"M0,0L"+-i+","+a+"A "+2*t+","+2*t+" 0 0 1 "+i+","+a+"Z")},backoff:.4,noDot:!0}}}),Je=f((t,e)=>{var r=v(),n=oe(),i=n.numberFormat,a=T(),o=O(),s=Ut(),l=q(),u=Ge(),c=n.strTranslate,h=Ae(),f=Te(),p=ke().LINE_SPACING,d=H().DESELECTDIM,m=Ze(),g=We(),y=Ye().appendArrayPointValue,x=e.exports={};function _(t){return"none"===t?void 0:t}x.font=function(t,e){var r=e.variant,n=e.style,i=e.weight,a=e.color,o=e.size,s=e.family,u=e.shadow,c=e.lineposition,f=e.textcase;s&&t.style("font-family",s),o+1&&t.style("font-size",o+"px"),a&&t.call(l.fill,a),i&&t.style("font-weight",i),n&&t.style("font-style",n),r&&t.style("font-variant",r),f&&t.style("text-transform",_(function(t){return b[t]}(f))),u&&t.style("text-shadow","auto"===u?h.makeTextShadow(l.contrast(a)):_(u)),c&&t.style("text-decoration-line",_(function(t){return t.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}(c)))};var b={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function w(t,e,r,n){var i=e.fillpattern,a=e.fillgradient,o=x.getPatternAttr,s=i&&(o(i.shape,0,"")||o(i.path,0,""));if(s){var u=o(i.bgcolor,0,null),c=o(i.fgcolor,0,null),h=i.fgopacity,f=o(i.size,0,8),p=o(i.solidity,0,.3),d=e.uid;x.pattern(t,"point",r,d,s,f,p,void 0,i.fillmode,u,c,h)}else if(a&&"none"!==a.type){var m,g,y=a.type,v="scatterfill-"+e.uid;n&&(v="legendfill-"+e.uid),n||void 0===a.start&&void 0===a.stop?("horizontal"===y&&(y+="reversed"),t.call(x.gradient,r,v,y,a.colorscale,"fill")):("horizontal"===y?(m={x:a.start,y:0},g={x:a.stop,y:0}):"vertical"===y&&(m={x:0,y:a.start},g={x:0,y:a.stop}),m.x=e._xA.c2p(void 0===m.x?e._extremes.x.min[0].val:m.x,!0),m.y=e._yA.c2p(void 0===m.y?e._extremes.y.min[0].val:m.y,!0),g.x=e._xA.c2p(void 0===g.x?e._extremes.x.max[0].val:g.x,!0),g.y=e._yA.c2p(void 0===g.y?e._extremes.y.max[0].val:g.y,!0),t.call(C,r,v,"linear",a.colorscale,"fill",m,g,!0,!1))}else e.fillcolor&&t.call(l.fill,e.fillcolor)}x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform",c(i,o)),!0)},x.translatePoints=function(t,e,n){t.each(function(t){var i=r.select(this);x.translatePoint(t,i,e,n)})},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var n=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,o=a.xcalendar,l=a.ycalendar,u=s.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each(function(t){x.hideOutsideRangePoint(t,r.select(this),n,i,o,l)})})}},x.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";l.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,n,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";r.select(this).call(l.stroke,n||a.color).call(x.dashLine,s,o)})},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},x.singleFillStyle=function(t,e){var n=r.select(t.node());w(t,((n.data()[0]||[])[0]||{}).trace||{},e,!1)},x.fillGroupStyle=function(t,e,n){t.style("stroke-width",0).each(function(t){var i=r.select(this);t[0].trace&&w(i,t[0].trace,e,n)})};var k=$e();x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(k).forEach(function(t){var e=k[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,x.symbolBackOffs[r]=e.backoff||0,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)});var A=x.symbolNames.length;function M(t,e,r,n){var i=t%100;return x.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(a(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=A||t>=400?0:Math.floor(Math.max(t,0))};var S=i("~f"),E={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function C(t,e,i,a,s,u,c,h,f,p){var d,m=s.length;"linear"===a?d={node:"linearGradient",attrs:{x1:c.x,y1:c.y,x2:h.x,y2:h.y,gradientUnits:f?"userSpaceOnUse":"objectBoundingBox"},reversed:p}:"radial"===a&&(d={node:"radialGradient",reversed:p});for(var g=new Array(m),y=0;y<m;y++)d.reversed?g[m-1-y]=[S(100*(1-s[y][0])),s[y][1]]:g[y]=[S(100*s[y][0]),s[y][1]];var v=e._fullLayout,x="g"+v._uid+"-"+i,_=v._defs.select(".gradients").selectAll("#"+x).data([a+g.join(";")],n.identity);_.exit().remove(),_.enter().append(d.node).each(function(){var t=r.select(this);d.attrs&&t.attr(d.attrs),t.attr("id",x);var e=t.selectAll("stop").data(g);e.exit().remove(),e.enter().append("stop"),e.each(function(t){var e=o(t[1]);r.select(this).attr({offset:t[0]+"%","stop-color":l.tinyRGB(e),"stop-opacity":e.getAlpha()})})}),t.style(u,W(x,e)).style(u+"-opacity",null),t.classed("gradient_filled",!0)}x.gradient=function(t,e,r,n,i,a){var o=E[n];return C(t,e,r,o.type,i,a,o.start,o.stop,!1,o.reversed)},x.pattern=function(t,e,i,a,s,u,c,h,f,p,d,m){var g="legend"===e;h&&("overlay"===f?(p=h,d=l.contrast(p)):(p=void 0,d=h));var y,v,x,_,b,w,T,k,A,M,S,E=i._fullLayout,C="p"+E._uid+"-"+a,I={},L=o(d),P=l.tinyRGB(L),z=m*L.getAlpha();switch(s){case"/":y=u*Math.sqrt(2),v=u*Math.sqrt(2),w="path",I={d:x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2,opacity:z,stroke:P,"stroke-width":(_=c*u)+"px"};break;case"\\":y=u*Math.sqrt(2),v=u*Math.sqrt(2),w="path",I={d:x="M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,opacity:z,stroke:P,"stroke-width":(_=c*u)+"px"};break;case"x":y=u*Math.sqrt(2),v=u*Math.sqrt(2),x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2+"M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,_=u-u*Math.sqrt(1-c),w="path",I={d:x,opacity:z,stroke:P,"stroke-width":_+"px"};break;case"|":w="path",w="path",I={d:x="M"+(y=u)/2+",0L"+y/2+","+(v=u),opacity:z,stroke:P,"stroke-width":(_=c*u)+"px"};break;case"-":w="path",w="path",I={d:x="M0,"+(v=u)/2+"L"+(y=u)+","+v/2,opacity:z,stroke:P,"stroke-width":(_=c*u)+"px"};break;case"+":w="path",x="M"+(y=u)/2+",0L"+y/2+","+(v=u)+"M0,"+v/2+"L"+y+","+v/2,_=u-u*Math.sqrt(1-c),w="path",I={d:x,opacity:z,stroke:P,"stroke-width":_+"px"};break;case".":y=u,v=u,c<Math.PI/4?b=Math.sqrt(c*u*u/Math.PI):(T=c,k=Math.PI/4,A=1,M=u/2,S=u/Math.sqrt(2),b=M+(S-M)*(T-k)/(A-k)),w="circle",I={cx:y/2,cy:v/2,r:b,opacity:z,fill:P};break;default:y=u,v=u,w="path",I={d:s,opacity:z,fill:P}}var O=[s||"noSh",p||"noBg",d||"noFg",u,c].join(";"),D=E._defs.select(".patterns").selectAll("#"+C).data([O],n.identity);D.exit().remove(),D.enter().append("pattern").each(function(){var t=r.select(this);if(t.attr({id:C,width:y+"px",height:v+"px",patternUnits:"userSpaceOnUse",patternTransform:g?"scale(0.8)":""}),p){var e=o(p),n=l.tinyRGB(e),i=e.getAlpha(),a=t.selectAll("rect").data([0]);a.exit().remove(),a.enter().append("rect").attr({width:y+"px",height:v+"px",fill:n,"fill-opacity":i})}var s=t.selectAll(w).data([0]);s.exit().remove(),s.enter().append(w).attr(I)}),t.style("fill",W(C,i)).style("fill-opacity",null),t.classed("pattern_filled",!0)},x.initGradients=function(t){var e=t._fullLayout;n.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),r.select(t).selectAll(".gradient_filled").classed("gradient_filled",!1)},x.initPatterns=function(t){var e=t._fullLayout;n.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),r.select(t).selectAll(".pattern_filled").classed("pattern_filled",!1)},x.getPatternAttr=function(t,e,r){return t&&n.isArrayOrTypedArray(t)?e<t.length?t[e]:r:t},x.pointStyle=function(t,e,n,i){if(t.size()){var a=x.makePointStyleFns(e);t.each(function(t){x.singlePointStyle(t,r.select(this),e,a,n,i)})}},x.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker,u=s.line;if(o&&o.i>=0&&void 0===t.i&&(t.i=o.i),e.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),i.ms2mrc){var c;c="various"===t.ms||"various"===s.size?3:i.ms2mrc(t.ms),t.mrc=c,i.selectedSizeFn&&(c=t.mrc=i.selectedSizeFn(t));var h=x.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var f=st(t,r),p=$(t,r);e.attr("d",M(h,c,f,p))}var d,m,g,y=!1;if(t.so)g=u.outlierwidth,m=u.outliercolor,d=s.outliercolor;else{var v=(u||{}).width;g=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=i.lineScale(t.mlc):n.isArrayOrTypedArray(u.color)?l.defaultLine:u.color,n.isArrayOrTypedArray(s.color)&&(d=l.defaultLine,y=!0),d="mc"in t?t.mcc=i.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(d=i.selectedColorFn(t))}if(t.om)e.call(l.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var _=s.gradient,b=t.mgt;b?y=!0:b=_&&_.type,n.isArrayOrTypedArray(b)&&(b=b[0],E[b]||(b=0));var w=s.pattern,T=x.getPatternAttr,k=w&&(T(w.shape,t.i,"")||T(w.path,t.i,""));if(b&&"none"!==b){var A=t.mgc;A?y=!0:A=_.color;var S=r.uid;y&&(S+="-"+t.i),x.gradient(e,a,S,b,[[0,A],[1,d]],"fill")}else if(k){var C=!1,I=w.fgcolor;!I&&o&&o.color&&(I=o.color,C=!0);var L=T(I,t.i,o&&o.color||null),P=T(w.bgcolor,t.i,null),z=w.fgopacity,O=T(w.size,t.i,8),D=T(w.solidity,t.i,.3);C=C||t.mcc||n.isArrayOrTypedArray(w.shape)||n.isArrayOrTypedArray(w.path)||n.isArrayOrTypedArray(w.bgcolor)||n.isArrayOrTypedArray(w.fgcolor)||n.isArrayOrTypedArray(w.size)||n.isArrayOrTypedArray(w.solidity);var R=r.uid;C&&(R+="-"+t.i),x.pattern(e,"point",a,R,k,O,D,t.mcc,w.fillmode,P,L,z)}else n.isArrayOrTypedArray(d)?l.fill(e,d[t.i]):l.fill(e,d);g&&l.stroke(e,m)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),s.traceIs(t,"symbols")&&(e.ms2mrc=m.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&n.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},i=t.unselected||{},a=t.marker||{},o=r.marker||{},l=i.marker||{},u=a.opacity,c=o.opacity,h=l.opacity,f=void 0!==c,p=void 0!==h;(n.isArrayOrTypedArray(u)||f||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?c:e:p?h:d*e});var m=a.color,g=o.color,y=l.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?g||e:y||e});var v=a.size,x=o.size,_=l.size,b=void 0!==x,w=void 0!==_;return s.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?x/2:e:w?_/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?u||e:c||(u?e:l.addOpacity(e,d))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];n.selectedOpacityFn&&a.push(function(t,e){t.style("opacity",n.selectedOpacityFn(e))}),n.selectedColorFn&&a.push(function(t,e){l.fill(t,n.selectedColorFn(e))}),n.selectedSizeFn&&a.push(function(t,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);t.attr("d",M(x.symbolNumber(a),o,st(r,e),$(r,e))),r.mrc2=o}),a.length&&t.each(function(t){for(var e=r.select(this),n=0;n<a.length;n++)a[n](e,t)})}},x.tryColorscale=function(t,e){var r=e?n.nestedProperty(t,e).get():t;if(r){var i=r.color;if((r.colorscale||r._colorAx)&&n.isArrayOrTypedArray(i))return u.makeColorScaleFuncFromTrace(r)}return n.identity};var I,L,P={start:1,end:-1,middle:0,bottom:1,top:-1};function z(t,e,n,i,a){var o=r.select(t.node().parentNode),s=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",u=i?i/.8+1:0,f=(h.lineCount(t)-1)*p+1,d=P[l]*u,m=.75*n+P[s]*u+(P[s]-1)*f*n/2;t.attr("text-anchor",l),a||o.attr("transform",c(d,m))}function D(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?r:0}function R(t,e,r){return r&&(t=V(t)),e?B(t[1]):F(t[0])}function F(t){var e=r.round(t,2);return I=e,e}function B(t){var e=r.round(t,2);return L=e,e}function N(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,h=(u*u*a-l*l*s)*n,f=3*u*(l+u),p=3*l*(l+u);return[[F(e[0]+(f&&c/f)),B(e[1]+(f&&h/f))],[F(e[0]-(p&&c/p)),B(e[1]-(p&&h/p))]]}x.textPointStyle=function(t,e,i){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=i._fullLayout;t.each(function(t){var o=r.select(this),u=s?n.extractOption(t,e,"txt","texttemplate"):n.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,f=c?c(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};u=n.texttemplateString(u,f,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=D(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:v}).text(u).call(h.convertToTspans,i).call(z,m,g,t.mrc)}else o.remove()})}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedTextStyleFns(e);t.each(function(t){var i=r.select(this),a=n.selectedTextColorFn(t),o=t.tp||e.textposition,u=D(t,e);l.fill(i,a);var c=s.traceIs(e,"bar-like");z(i,o,u,t.mrc2||t.mrc,c)})}},x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r<t.length-1;r++)i.push(N(t[r-1],t[r],t[r+1],e));for(n+="Q"+i[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+t[r];return n+="Q"+i[t.length-3][1]+" "+t[t.length-1]},x.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],i=t.length-1,a=[N(t[i],t[0],t[1],e)];for(r=1;r<i;r++)a.push(N(t[r-1],t[r],t[r+1],e));for(a.push(N(t[i-1],t[i],t[0],e)),r=1;r<=i;r++)n+="C"+a[r-1][1]+" "+a[r][0]+" "+t[r];return n+="C"+a[i][1]+" "+a[0][0]+" "+t[0]+"Z"};var j={hv:function(t,e,r){return"H"+F(e[0])+"V"+R(e,1,r)},vh:function(t,e,r){return"V"+B(e[1])+"H"+R(e,0,r)},hvh:function(t,e,r){return"H"+F((t[0]+e[0])/2)+"V"+B(e[1])+"H"+R(e,0,r)},vhv:function(t,e,r){return"V"+B((t[1]+e[1])/2)+"H"+F(e[0])+"V"+R(e,1,r)}},U=function(t,e,r){return"L"+R(e,0,r)+","+R(e,1,r)};function V(t,e){var r=t.backoff,i=t.trace,a=t.d,o=t.i;if(r&&i&&i.marker&&i.marker.angle%360==0&&i.line&&"spline"!==i.line.shape){var s=n.isArrayOrTypedArray(r),l=t,u=e?e[0]:I||0,c=e?e[1]:L||0,h=l[0],f=l[1],p=h-u,d=f-c,m=Math.atan2(d,p),g=s?r[o]:r;if("auto"===g){var y=l.i;"scatter"===i.type&&y--;var v=l.marker,_=v.symbol;n.isArrayOrTypedArray(_)&&(_=_[y]);var b=v.size;n.isArrayOrTypedArray(b)&&(b=b[y]),g=v?x.symbolBackOffs[x.symbolNumber(_)]*b:0,g+=x.getMarkerStandoff(a[y],i)||0}var w=h-g*Math.cos(m),T=f-g*Math.sin(m);(w<=h&&w>=u||w>=h&&w<=u)&&(T<=f&&T>=c||T>=f&&T<=c)&&(t=[w,T])}return t}x.steps=function(t){var e=j[t]||U;return function(t){for(var r="M"+F(t[0][0])+","+B(t[0][1]),n=t.length,i=1;i<n;i++)r+=e(t[i-1],t[i],i===n-1);return r}},x.applyBackoff=V,x.makeTester=function(){var t=n.ensureSingleById(r.select("body"),"svg","js-plotly-tester",function(t){t.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=n.ensureSingle(t,"path","js-reference-point",function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});x.tester=t,x.testref=e},x.savedBBoxes={};var G=0;function Z(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function W(t,e){if(!t)return null;var r=e._context,n=r._exportedPlot?"":r._baseUrl||"";return n?"url('"+n+"#"+t+"')":"url(#"+t+")"}x.bBox=function(t,e,i){var a,o,s;if(i||(i=Z(t)),i){if(a=x.savedBBoxes[i])return n.extendFlat({},a)}else if(1===t.childNodes.length){var l=t.childNodes[0];if(i=Z(l)){var u=+l.getAttribute("x")||0,c=+l.getAttribute("y")||0,f=l.getAttribute("transform");if(!f){var p=x.bBox(l,!1,i);return u&&(p.left+=u,p.right+=u),c&&(p.top+=c,p.bottom+=c),p}if(i+="~"+u+"~"+c+"~"+f,a=x.savedBBoxes[i])return n.extendFlat({},a)}}e?o=t:(s=x.tester.node(),o=t.cloneNode(!0),s.appendChild(o)),r.select(o).attr("transform",null).call(h.positionText,0,0);var d=o.getBoundingClientRect(),m=x.testref.node().getBoundingClientRect();e||s.removeChild(o);var g={height:d.height,width:d.width,left:d.left-m.left,top:d.top-m.top,right:d.right-m.left,bottom:d.bottom-m.top};return G>=1e4&&(x.savedBBoxes={},G=0),i&&(x.savedBBoxes[i]=g),G++,n.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",W(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=c(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var Y=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var X=/translate\([^)]*\)\s*$/;function $(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,n){t&&t.each(function(){var t,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(X);t=1===e&&1===n?[]:[c(o,s),"scale("+e+","+n+")",c(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}})},x.getMarkerStandoff=$;var J,K,Q,tt,et,rt,nt=Math.atan2,it=Math.cos,at=Math.sin;function ot(t,e){var r=e[0],n=e[1];return[r*it(t)-n*at(t),r*at(t)+n*it(t)]}function st(t,e){var r=t.ma;void 0===r&&(!(r=e.marker.angle)||n.isArrayOrTypedArray(r))&&(r=0);var i,o,s=e.marker.angleref;if("previous"===s||"north"===s){if(e._geo){var l=e._geo.project(t.lonlat);i=l[0],o=l[1]}else{var u=e._xA,c=e._yA;if(!u||!c)return 90;i=u.c2p(t.x),o=c.c2p(t.y)}if(e._geo){var h,f=t.lonlat[0],p=t.lonlat[1],d=e._geo.project([f,p+1e-5]),m=e._geo.project([f+1e-5,p]),g=nt(m[1]-o,m[0]-i),y=nt(d[1]-o,d[0]-i);if("north"===s)h=r/180*Math.PI;else if("previous"===s){var v=f/180*Math.PI,x=p/180*Math.PI,_=J/180*Math.PI,b=K/180*Math.PI,w=_-v,T=it(b)*at(w),k=at(b)*it(x)-it(b)*at(x)*it(w);h=-nt(T,k)-Math.PI,J=f,K=p}var A=ot(g,[it(h),0]),M=ot(y,[at(h),0]);r=nt(A[1]+M[1],A[0]+M[0])/Math.PI*180,"previous"===s&&(rt!==e.uid||t.i!==et+1)&&(r=null)}if("previous"===s&&!e._geo)if(rt===e.uid&&t.i===et+1&&a(i)&&a(o)){var S=i-Q,E=o-tt,C=e.line&&e.line.shape||"",I=C.slice(C.length-1);"h"===I&&(E=0),"v"===I&&(S=0),r+=nt(E,S)/Math.PI*180+90}else r=null}return Q=i,tt=o,et=t.i,rt=e.uid,r}x.getMarkerAngle=st}),Ke=f((t,e)=>{var r=v(),n=T(),i=we(),a=Ut(),o=oe(),s=o.strTranslate,l=Je(),u=q(),c=Ae(),h=H(),f=ke().OPPOSITE_SIDE,p=/ [XY][0-9]* /;e.exports={draw:function(t,e,d){var m,g=t._fullLayout,y=d.propContainer,v=d.propName,x=d.placeholder,_=d.traceIndex,b=d.avoid||{},w=d.attributes,T=d.transform,k=d.containerGroup,A=1,M=y.title,S=(M&&M.text?M.text:"").trim(),E=!1,C=M&&M.font?M.font:{},I=C.family,L=C.size,P=C.color,z=C.weight,O=C.style,D=C.variant,R=C.textcase,F=C.lineposition,B=C.shadow,N=!!d.subtitlePropName,j=d.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,H=1,G=U.font,Z=G.family,W=G.size,Y=G.color,X=G.weight,$=G.style,J=G.variant,K=G.textcase,Q=G.lineposition,tt=G.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":-1!==v.indexOf("colorbar")&&(m="colorbarTitleText");var et=t._context.edits[m];function rt(t,e){return void 0!==t&&void 0!==e&&t.replace(p," % ")===e.replace(p," % ")}""===S?A=0:rt(S,x)&&(et||(S=""),A=.2,E=!0),N&&(""===V?H=0:rt(V,j)&&(et||(V=""),H=.2,q=!0)),d._meta?S=o.templateString(S,d._meta):g._meta&&(S=o.templateString(S,g._meta));var nt,it=S||V||et;k||(k=o.ensureSingle(g._infolayer,"g","g-"+e),nt=g._hColorbarMoveTitle);var at=k.selectAll("text."+e).data(it?[0]:[]);at.enter().append("text"),at.text(S).attr("class",e),at.exit().remove();var ot=null,st=e+"-subtitle",lt=V||et;if(N&&lt&&((ot=k.selectAll("text."+st).data(lt?[0]:[])).enter().append("text"),ot.text(V).attr("class",st),ot.exit().remove()),!it)return k;function ut(t,e){o.syncOrAsync([ct,ht],{title:t,subtitle:e})}function ct(n){var a,h=n.title,f=n.subtitle;if(!T&&nt&&(T={}),T?(a="",T.rotate&&(a+="rotate("+[T.rotate,w.x,w.y]+")"),(T.offset||nt)&&(a+=s(0,(T.offset||0)-(nt||0)))):a=null,h.attr("transform",a),h.style("opacity",A*u.opacity(P)).call(l.font,{color:u.rgb(P),size:r.round(L,2),family:I,weight:z,style:O,variant:D,textcase:R,shadow:B,lineposition:F}).attr(w).call(c.convertToTspans,t,function(t){if(t){var e=r.select(t.node().parentNode).select("."+st);if(!e.empty()){var n=t.node().getBBox();if(n.height){var i=n.y+n.height+1.6*W;e.attr("y",i)}}}}),f){var p=k.select("."+e+"-math-group"),d=h.node().getBBox(),m=p.node()?p.node().getBBox():void 0,g=m?m.y+m.height+1.6*W:d.y+d.height+1.6*W,y=o.extendFlat({},w,{y:g});f.attr("transform",a),f.style("opacity",H*u.opacity(Y)).call(l.font,{color:u.rgb(Y),size:r.round(W,2),family:Z,weight:X,style:$,variant:J,textcase:K,shadow:tt,lineposition:Q}).attr(y).call(c.convertToTspans,t)}return i.previousPromises(t)}function ht(e){var i=e.title,a=r.select(i.node().parentNode);if(b&&b.selection&&b.side&&S){a.attr("transform",null);var u=f[b.side],c="left"===b.side||"top"===b.side?-1:1,h=n(b.pad)?b.pad:2,p=l.bBox(a.node()),d={t:0,b:0,l:0,r:0},m=t._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var _=m[v][x];d[x]=Math.max(d[x],_)}var w={left:d.l,top:d.t,right:g.width-d.r,bottom:g.height-d.b},T=b.maxShift||c*(w[b.side]-p[b.side]),k=0;if(T<0)k=T;else{var A=b.offsetLeft||0,M=b.offsetTop||0;p.left-=A,p.right-=A,p.top-=M,p.bottom-=M,b.selection.each(function(){var t=l.bBox(this);o.bBoxIntersect(p,t,h)&&(k=Math.max(k,c*(t[b.side]-p[u])+h))}),k=Math.min(T,k),y._titleScoot=Math.abs(k)}if(k>0||T<0){var E={left:[-k,0],right:[k,0],top:[0,-k],bottom:[0,k]}[b.side];a.attr("transform",s(E[0],E[1]))}}}function ft(t,e){t.text(e).on("mouseover.opacity",function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}if(at.call(ut,ot),et&&(S?at.on(".opacity",null):(ft(at,x),E=!0),at.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==_?a.call("_guiRestyle",t,v,e,_):a.call("_guiRelayout",t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ut)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)}),N)){if(N&&!S){var pt=at.node().getBBox(),dt=pt.y+pt.height+1.6*W;ot.attr("y",dt)}V?ot.on(".opacity",null):(ft(ot,j),q=!0),ot.call(c.makeEditable,{gd:t}).on("edit",function(e){a.call("_guiRelayout",t,"title.subtitle.text",e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ut)}).on("input",function(t){this.text(t||" ").call(c.positionText,ot.attr("x"),ot.attr("y"))})}return at.classed("js-placeholder",E),ot&&ot.classed("js-placeholder",q),k},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}),Qe=f((t,e)=>{var r=v(),n=_().utcFormat,i=oe(),a=i.numberFormat,o=T(),s=i.cleanNumber,l=i.ms2DateTime,u=i.dateTime2ms,c=i.ensureNumber,h=i.isArrayOrTypedArray,f=k(),p=f.FP_SAFE,d=f.BADNUM,m=f.LOG_CLIP,g=f.ONEWEEK,y=f.ONEDAY,x=f.ONEHOUR,b=f.ONEMIN,w=f.ONESEC,A=ye(),M=ge(),S=M.HOUR_PATTERN,E=M.WEEKDAY_PATTERN;function C(t){return Math.pow(10,t)}function I(t){return null!=t}e.exports=function(t,e){e=e||{};var f=t._id||"x",v=f.charAt(0);function _(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return d}function T(e,r,n,a){if((a||{}).msUTC&&o(e))return+e;var s=u(e,n||t.calendar);if(s===d){if(!o(e))return d;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),c=Math.round(e-l/10);s=u(new Date(c))+l/10}return s}function k(e,r,n){return l(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function P(e){if(I(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function O(t){var e=z(t);return void 0!==e?e:o(t)?+t:void 0}function D(t){return o(t)?+t:z(t)}function R(t,e,n){return r.round(n+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return o(e)?R(e,t._m,t._b):d},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===v;B=function(e){if(!o(e))return d;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,s=0,l=0;l<r;l++){var u=i*t._rangebreaks[l].min,c=i*t._rangebreaks[l].max;if(a<u)break;if(!(a>c)){s=a<(u+c)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?R(e,t._m2,h):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;i<r&&!(e<t._rangebreaks[i].pmin);i++)e>t._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?_:c,t.l2c="log"===t.type?C:c,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(_(t,e))}:B,t.p2c="log"===t.type?function(t){return C(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=N,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return _(s(t),e)},t.r2d=t.r2c=function(t){return C(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=_,t.l2d=C,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return C(N(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=N,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=T,t.c2d=t.c2r=t.l2d=t.l2r=k,t.d2p=t.r2p=function(e,r,n){return t.l2p(T(e,0,n))},t.p2d=t.p2r=function(t,e,r){return k(N(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=P,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=c,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(r){var n,a,o=t._traceIndices,s=t._matchGroup;if(s&&0===t._categories.length)for(var l in s)if(l!==f){var u=e[A.id2name(l)];o=o.concat(u._traceIndices)}var c=[[0,{}],[0,{}]],p=[];for(n=0;n<o.length;n++){var d=r[o[n]];if(v in d){var m=d[v],g=d._length||i.minRowLength(m);if(h(m[0])&&h(m[1]))for(a=0;a<g;a++){var y=m[0][a],x=m[1][a];I(y)&&I(x)&&(p.push([y,x]),y in c[0][1]||(c[0][1][y]=c[0][0]++),x in c[1][1]||(c[1][1][x]=c[1][0]++))}}}for(p.sort(function(t,e){var r=c[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var i=c[1][1];return i[t[1]]-i[e[1]]}),n=0;n<p.length;n++)P(p[n])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.limitRange=function(e){var r=t.minallowed,n=t.maxallowed;if(void 0!==r||void 0!==n){e||(e="range");var a=i.nestedProperty(t,e).get(),o=i.simpleMap(a,t.r2l),s=o[1]<o[0];s&&o.reverse();var l=i.simpleMap([r,n],t.r2l);if(void 0!==r&&o[0]<l[0]&&(a[s?1:0]=r),void 0!==n&&o[1]>l[1]&&(a[s?0:1]=n),a[0]===a[1]){var u=t.l2r(r),c=t.l2r(n);if(void 0!==r){var h=u+1;void 0!==n&&(h=Math.min(h,c)),a[s?1:0]=h}if(void 0!==n){var f=c+1;void 0!==r&&(f=Math.max(f,u)),a[s?0:1]=f}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e="range");var n,a,s=i.nestedProperty(t,e).get();if(a=(a="date"===t.type?i.dfltRange(t.calendar):"y"===v?M.DFLTRANGEY:"realaxis"===t._name?[0,1]:r.dfltRange||M.DFLTRANGEX).slice(),("tozero"===t.rangemode||"nonnegative"===t.rangemode)&&(a[0]=0),s&&2===s.length){var l=null===s[0],u=null===s[1];for("date"===t.type&&!t.autorange&&(s[0]=i.cleanDate(s[0],d,t.calendar),s[1]=i.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(s[n],t.calendar)){t[e]=a;break}if(t.r2l(s[0])===t.r2l(s[1])){var c=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(c-1e3),s[1]=t.l2r(c+1e3);break}}else{if(!o(s[n])){if(l||u||!o(s[1-n])){t[e]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-p?s[n]=-p:s[n]>p&&(s[n]=p),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=A.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),h="y"===v;if(h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._lBreaks+=Math.abs(l.max-l.min);var f=h;u>c&&(f=!f),f&&t._rangebreaks.reverse();var p=f?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(h?c:u)),s=0;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._B.push(t._B[t._B.length-1]-p*t._m2*(l.max-l.min));for(s=0;s<t._rangebreaks.length;s++)(l=t._rangebreaks[s]).pmin=B(l.min),l.pmax=B(l.max)}if(!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.maskBreaks=function(e){var r,n,a,o,l,u=t.rangebreaks||[];u._cachedPatterns||(u._cachedPatterns=u.map(function(e){return e.enabled&&e.bounds?i.simpleMap(e.bounds,e.pattern?s:t.d2c):null})),u._cachedValues||(u._cachedValues=u.map(function(e){return e.enabled&&e.values?i.simpleMap(e.values,t.d2c).sort(i.sorterAsc):null}));for(var c=0;c<u.length;c++){var h=u[c];if(h.enabled)if(h.bounds){var f=h.pattern;switch(n=(r=u._cachedPatterns[c])[0],a=r[1],f){case E:o=(l=new Date(e)).getUTCDay(),n>a&&(a+=7,o<n&&(o+=7));break;case S:o=(l=new Date(e)).getUTCHours()+(l.getUTCMinutes()/60+l.getUTCSeconds()/3600+l.getUTCMilliseconds()/36e5),n>a&&(a+=24,o<n&&(o+=24));break;case"":o=e}if(o>=n&&o<a)return d}else for(var p=u._cachedValues[c],m=0;m<p.length;m++)if(a=(n=p[m])+h.dvalue,e>=n&&e<a)return d}return e},t.locateBreaks=function(e,r){var n,a,o,l,u=[];if(!t.rangebreaks)return u;var c=t.rangebreaks.slice().sort(function(t,e){return t.pattern===E&&e.pattern===S?-1:e.pattern===E&&t.pattern===S?1:0}),h=function(t,n){if((t=i.constrain(t,e,r))!==(n=i.constrain(n,e,r))){for(var a=!0,o=0;o<u.length;o++){var s=u[o];t<s.max&&n>=s.min&&(t<s.min&&(s.min=t),n>s.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;n<c.length;n++){var f=c[n];if(f.enabled)if(f.bounds){var p=e,d=r;f.pattern&&(p=Math.floor(p)),o=(a=i.simpleMap(f.bounds,f.pattern?s:t.r2l))[0],l=a[1];var m,v,_=new Date(p);switch(f.pattern){case E:v=g,m=(l-o+(l<o?7:0))*y,p+=o*y-(_.getUTCDay()*y+_.getUTCHours()*x+_.getUTCMinutes()*b+_.getUTCSeconds()*w+_.getUTCMilliseconds());break;case S:v=y,m=(l-o+(l<o?24:0))*x,p+=o*x-(_.getUTCHours()*x+_.getUTCMinutes()*b+_.getUTCSeconds()*w+_.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),m=v=(d=Math.max(a[0],a[1]))-p}for(var T=p;T<d;T+=v)h(T,T+m)}else for(var k=i.simpleMap(f.values,t.d2c),A=0;A<k.length;A++)h(o=k[A],l=o+f.dvalue)}return u.sort(function(t,e){return t.min-e.min}),u},t.makeCalcdata=function(e,r,n){var a,o,s,l,u=t.type,c="date"===u&&e[r+"calendar"];if(r in e){if(a=e[r],l=e._length||i.minRowLength(a),i.isTypedArray(a)&&("linear"===u||"log"===u)){if(l===a.length)return a;if(a.subarray)return a.subarray(0,l)}if("multicategory"===u)return function(t,e){for(var r=new Array(e),n=0;n<e;n++){var i=(t[0]||[])[n],a=(t[1]||[])[n];r[n]=z([i,a])}return r}(a,l);for(o=new Array(l),s=0;s<l;s++)o[s]=t.d2c(a[s],0,c,n)}else{var h=r+"0"in e?t.d2c(e[r+"0"],0,c):0,f=e["d"+r]?Number(e["d"+r]):1;for(a=e[{x:"y",y:"x"}[r]],l=e._length||a.length,o=new Array(l),s=0;s<l;s++)o[s]=h+s*f}if(t.rangebreaks)for(s=0;s<l;s++)o[s]=t.maskBreaks(o[s]);return o},t.isValidRange=function(e,r){return Array.isArray(e)&&2===e.length&&(r&&null===e[0]||o(t.r2l(e[0])))&&(r&&null===e[1]||o(t.r2l(e[1])))},t.getAutorangeDflt=function(e,r){var n=!t.isValidRange(e,"nullOk");return n&&r&&r.reverseDflt?n="reversed":e&&(null===e[0]&&null===e[1]?n=!0:null===e[0]&&null!==e[1]?n="min":null!==e[0]&&null===e[1]&&(n="max")),n},t.isReversed=function(){var e=t.autorange;return"reversed"===e||"min reversed"===e||"max reversed"===e},t.isPtWithinRange=function(e,r){var n=t.c2l(e[v],null,r),i=t.r2l(t.range[0]),a=t.r2l(t.range[1]);return i<a?i<=n&&n<=a:a<=n&&n<=i},t._emptyCategories=function(){t._categories=[],t._categoriesMap={}},t.clearCalc=function(){var r=t._matchGroup;if(r){var n=null,i=null;for(var a in r){var o=e[A.id2name(a)];if(o._categories){n=o._categories,i=o._categoriesMap;break}}n&&i?(t._categories=n,t._categoriesMap=i):t._emptyCategories()}else t._emptyCategories();if(t._initialCategories)for(var s=0;s<t._initialCategories.length;s++)P(t._initialCategories[s])},t.sortByInitialCategories=function(){var r=[];if(t._emptyCategories(),t._initialCategories)for(var n=0;n<t._initialCategories.length;n++)P(t._initialCategories[n]);r=r.concat(t._traceIndices);var i=t._matchGroup;for(var a in i)if(f!==a){var o=e[A.id2name(a)];o._categories=t._categories,o._categoriesMap=t._categoriesMap,r=r.concat(o._traceIndices)}return r};var U=e._d3locale;"date"===t.type&&(t._dateFormat=U?U.timeFormat:n,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=U?U.numberFormat:a,delete t._minDtick,delete t._forceTick0}}),tr=f((t,e)=>{var r=T(),n=oe(),i=k().BADNUM,a=n.isArrayOrTypedArray,o=n.isDateTime,s=n.cleanNumber,l=Math.round;function u(t,e){return e?r(t):"number"==typeof t}function c(t){return Math.max(1,(t-1)/1e3)}e.exports=function(t,e,n){var h,f=t,p=n.noMultiCategory;if(a(f)&&!f.length)return"-";if(!p&&a((h=f)[0])&&a(h[1]))return"multicategory";if(p&&Array.isArray(f[0])){for(var d=[],m=0;m<f.length;m++)if(a(f[m]))for(var g=0;g<f[m].length;g++)d.push(f[m][g]);f=d}if(function(t,e){for(var n=t.length,i=c(n),a=0,s=0,u={},h=0;h<n;h+=i){var f=t[l(h)],p=String(f);u[p]||(u[p]=1,o(f,e)&&a++,r(f)&&s++)}return a>2*s}(f,e))return"date";var y="strict"!==n.autotypenumbers;return function(t,e){for(var r=t.length,n=c(r),a=0,o=0,u={},h=0;h<r;h+=n){var f=t[l(h)],p=String(f);if(!u[p]){u[p]=1;var d=typeof f;"boolean"===d?o++:(e?s(f)!==i:"number"===d)?a++:"string"===d&&o++}}return o>2*a}(f,y)?"category":function(t,e){for(var r=t.length,n=0;n<r;n++)if(u(t[n],e))return!0;return!1}(f,y)?"linear":"-"}}),er=f((t,e)=>{var r=v(),n=T(),i=oe(),a=k().FP_SAFE,o=Ut(),s=Je(),l=ye(),u=l.getFromId,c=l.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),u=m(t,e),c=u.min,h=u.max;if(0===c.length||0===h.length)return i.simpleMap(e.range,e.r2l);var d=c[0].val,g=h[0].val;for(r=1;r<c.length&&d===g;r++)d=Math.min(d,c[r].val);for(r=1;r<h.length&&d===g;r++)g=Math.max(g,h[r].val);var y=e.autorange,v="reversed"===y||"min reversed"===y||"max reversed"===y;if(!v&&e.range){var x=i.simpleMap(e.range,e.r2l);v=x[1]<x[0]}"reversed"===e.autorange&&(e.autorange=!0);var _,b,w,T,k,A,S=e.rangemode,E="tozero"===S,C="nonnegative"===S,I=e._length,L=I/10,P=0;for(r=0;r<c.length;r++)for(_=c[r],n=0;n<h.length;n++)(A=(b=h[n]).val-_.val-f(e,_.val,b.val))>0&&((k=I-s(_)-l(b))>L?A/k>P&&(w=_,T=b,P=A/k):A/I>P&&(w={val:_.val,nopad:1},T={val:b.val,nopad:1},P=A/I));if(d===g){var z=d-1,O=d+1;if(E)if(0===d)a=[0,1];else{var D=(d>0?h:c).reduce(function(t,e){return Math.max(t,l(e))},0),R=d/(1-Math.min(.5,D/I));a=d>0?[0,R]:[R,0]}else a=C?[Math.max(0,z),Math.max(1,O)]:[z,O]}else E?(w.val>=0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:0,nopad:1})):C&&(w.val-P*s(w)<0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:1,nopad:1})),P=(T.val-w.val-f(e,_.val,b.val))/(I-s(w)-l(T)),a=[w.val-P*s(w),T.val+P*l(T)];return a=M(a,e),e.limitRange&&e.limitRange(),v&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a<i.length;a++){var o=i[a];n+=o.max-o.min}return n}function p(t,e,n){var a=.05*e._length,o=e._anchorAxis||{};if(-1!==(e.ticklabelposition||"").indexOf("inside")||-1!==(o.ticklabelposition||"").indexOf("inside")){var l=e.isReversed();if(!l){var u=i.simpleMap(e.range,e.r2l);l=u[1]<u[0]}l&&(n=!n)}var h=0;return c(t,e._id)||(h=function(t,e,n){var a=0,o="x"===e._id.charAt(0);for(var l in t._plots){var u=t._plots[l];if(e._id===u.xaxis._id||e._id===u.yaxis._id){var c=(o?u.yaxis:u.xaxis)||{};if(-1!==(c.ticklabelposition||"").indexOf("inside")&&(!n&&("left"===c.side||"bottom"===c.side)||n&&("top"===c.side||"right"===c.side))){if(c._vals){var h=i.deg2rad(c._tickAngles[c._id+"tick"]||0),f=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));if(!c._vals[0].bb){var m=c._id+"tick";c._selections[m].each(function(t){var e=r.select(this);e.select(".text-math-group").empty()&&(t.bb=s.bBox(e.node()))})}for(var g=0;g<c._vals.length;g++){var y=c._vals[g].bb;if(y){var v=2*d+y.width,x=2*d+y.height;a=Math.max(a,o?Math.max(v*f,x*p):Math.max(x*f,v*p))}}}"inside"===c.ticks&&"inside"===c.ticklabelposition&&(a+=c.ticklen||0)}}}return a}(t,e,n)),a=Math.max(h,a),"domain"===e.constrain&&e._inputDomain&&(a*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(t){return t.nopad?0:t.pad+(t.extrapad?a:h)}}e.exports={applyAutorangeOptions:M,getAutoRange:h,makePadFn:p,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():h(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var n=e._input,a={};a[e._attr+".range"]=e.range,a[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a),n.range=e.range.slice(),n.autorange=e.autorange}var s=e._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=h(t,e)),s._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var i,o,s,l,u,c,h,f,p,d=[],m=[],v=e.length,x=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(i=0;i<v;i++)(o=e[i])<f&&o>0&&(f=o),o>p&&o<a&&(p=o);else for(i=0;i<v;i++)(o=e[i])<f&&o>-a&&(f=o),o>p&&o<a&&(p=o);e=[f,p],v=2}var I={tozero:b,extrapad:x};function L(r){s=e[r],n(s)&&(c=M(r),h=S(r),k?(l=t.c2l(s)-C(r),u=t.c2l(s)+E(r)):(f=s-C(r),p=s+E(r),w&&f<p/10&&(f=p/10),l=t.c2l(f),u=t.c2l(p)),b&&(l=Math.min(0,l),u=Math.max(0,u)),_(l)&&g(d,l,h,I),_(u)&&y(m,u,c,I))}var P=Math.min(6,v);for(i=0;i<P;i++)L(i);for(i=v-1;i>=P;i--)L(i);return{min:d,max:m,opts:r}},concatExtremes:m};var d=3;function m(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],h=[];function f(t,e){for(n=0;n<e.length;n++){var r=t[e[n]],s=(r._extremes||{})[o];if(!0===r.visible&&s){for(i=0;i<s.min.length;i++)a=s.min[i],g(c,a.val,a.pad,{extrapad:a.extrapad});for(i=0;i<s.max.length;i++)a=s.max[i],y(h,a.val,a.pad,{extrapad:a.extrapad})}}}if(f(s,e._traceIndices),f(l.annotations||[],e._annIndices||[]),f(l.shapes||[],e._shapeIndices||[]),e._matchGroup&&!r)for(var p in e._matchGroup)if(p!==e._id){var d=u(t,p),v=m(t,d,!0),x=e._length/d._length;for(i=0;i<v.min.length;i++)a=v.min[i],g(c,a.val,a.pad*x,{extrapad:a.extrapad});for(i=0;i<v.max.length;i++)a=v.max[i],y(h,a.val,a.pad*x,{extrapad:a.extrapad})}return{min:c,max:h}}function g(t,e,r,n){x(t,e,r,n,b)}function y(t,e,r,n){x(t,e,r,n,w)}function x(t,e,r,n,i){for(var a=n.tozero,o=n.extrapad,s=!0,l=0;l<t.length&&s;l++){var u=t[l];if(i(u.val,e)&&u.pad>=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function _(t){return n(t)&&Math.abs(t)<a}function b(t,e){return t<=e}function w(t,e){return t>=e}function A(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))<(r=t.d2l(r))}function M(t,e){if(!e||!e.autorangeoptions)return t;var r=t[0],n=t[1],a=e.autorangeoptions.include;if(void 0!==a){var o=e.d2l(r),s=e.d2l(n);i.isArrayOrTypedArray(a)||(a=[a]);for(var l=0;l<a.length;l++){var u=e.d2l(a[l]);o>=u&&(o=u,r=u),s<=u&&(s=u,n=u)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&A(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&A(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&A(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&A(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}}),rr=f((t,e)=>{var r=v(),n=T(),i=we(),a=Ut(),o=oe(),s=o.strTranslate,l=Ae(),u=Ke(),c=q(),h=Je(),f=Ee(),p=ze(),d=k(),m=d.ONEMAXYEAR,g=d.ONEAVGYEAR,y=d.ONEMINYEAR,x=d.ONEMAXQUARTER,_=d.ONEAVGQUARTER,b=d.ONEMINQUARTER,w=d.ONEMAXMONTH,A=d.ONEAVGMONTH,M=d.ONEMINMONTH,S=d.ONEWEEK,E=d.ONEDAY,C=E/2,I=d.ONEHOUR,L=d.ONEMIN,P=d.ONESEC,z=d.ONEMILLI,O=d.ONEMICROSEC,D=d.MINUS_SIGN,R=d.BADNUM,F={K:"zeroline"},B={K:"gridline",L:"path"},N={K:"minor-gridline",L:"path"},j={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},H=ke(),G=H.MID_SHIFT,Z=H.CAP_SHIFT,W=H.LINE_SPACING,Y=H.OPPOSITE_SIDE,X=e.exports={};X.setConvert=Qe();var $=tr(),J=ye(),K=J.idSort,Q=J.isLinked;X.id2name=J.id2name,X.name2id=J.name2id,X.cleanId=J.cleanId,X.list=J.list,X.listIds=J.listIds,X.getFromId=J.getFromId,X.getFromTrace=J.getFromTrace;var tt=er();function et(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}X.getAutoRange=tt.getAutoRange,X.findExtremes=tt.findExtremes,X.coerceRef=function(t,e,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],u=n+"ref",c={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map(function(t){return t+" domain"})),c[u]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},o.coerce(t,e,c,u)},X.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},X.coercePosition=function(t,e,r,n,i,a){var s,l;if("range"!==X.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var u=X.getFromId(e,n);l=r(i,a=u.fraction2r(a)),s=u.cleanPos}t[i]=s(l)},X.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?o.ensureNumber:X.getFromId(e,r).cleanPos)(t)},X.redrawComponents=function(t,e){e=e||X.listIds(t);var r=t._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),u={},c=0;c<e.length;c++)for(var h=r[X.id2name(e[c])][o],f=0;f<h.length;f++){var p=h[f];if(!u[p]&&(l(t,p),u[p]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0),n("selections","drawOne","_selectionIndices")};var rt=X.getDataConversions=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(o.isArrayOrTypedArray(a)){if(i={type:$(n,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},X.setConvert(i),"category"===i.type)for(var s=0;s<n.length;s++)i.d2c(n[s])}else i=X.getFromTrace(t,e,a);return i?{d2c:i.d2c,c2d:i.c2d}:"ids"===a?{d2c:it,c2d:it}:{d2c:nt,c2d:nt}};function nt(t){return+t}function it(t){return String(t)}function at(t,e){return Math.abs((t/e+.5)%1-.5)<.001}function ot(t,e){return Math.abs(t/e-1)<.001}function st(t){return+t.substring(1)}function lt(t,e){return t.rangebreaks&&(e=e.filter(function(e){return t.maskBreaks(e.x)!==R})),e}function ut(t){var e=t._mainAxis,r=[];if(e._vals)for(var n=0;n<e._vals.length;n++)if(!e._vals[n].noTick){var i=e.l2p(e._vals[n].x),a=t.p2l(i),o=X.tickText(t,a);e._vals[n].minor&&(o.minor=!0,o.text=""),r.push(o)}return r=lt(t,r)}function ct(t,e){var r=et(o.simpleMap(t.range,t.r2l)),n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var s=[],l=0;l<=1;l++)if((void 0===e||!(e&&l||!1===e&&!l))&&(!l||t.minor)){var u=l?t.minor.tickvals:t.tickvals,c=l?[]:t.ticktext;if(u){o.isArrayOrTypedArray(c)||(c=[]);for(var h=0;h<u.length;h++){var f=a(u[h]);if(f>n&&f<i){var p=X.tickText(t,f,!1,String(c[h]));l&&(p.minor=!0,p.text=""),s.push(p)}}}}return s=lt(t,s)}X.getDataToCoordFunc=function(t,e,r,n){return rt(t,e,r,n).d2c},X.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},X.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},X.saveRangeInitial=function(t,e){for(var r=X.list(t,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial0&&void 0===a._rangeInitial1,s=o||a.range[0]!==a._rangeInitial0||a.range[1]!==a._rangeInitial1,l=a.autorange;(o&&!0!==l||e&&s)&&(a._rangeInitial0="min"===l||"max reversed"===l?void 0:a.range[0],a._rangeInitial1="max"===l||"min reversed"===l?void 0:a.range[1],a._autorangeInitial=l,n=!0)}return n},X.saveShowSpikeInitial=function(t,e){for(var r=X.list(t,"",!0),n=!1,i="on",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||o.showspikes!==o._showspikes;(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"===i&&!o.showspikes&&(i="off")}return t._fullLayout._cartesianSpikesEnabled=i,n},X.autoBin=function(t,e,r,i,a,s){var l,u=o.aggNums(Math.min,null,t),c=o.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:u-.5,end:c+.5,size:Math.max(1,Math.round(s)||1),_dataSpan:c-u};if(a||(a=e.calendar),l="log"===e.type?{type:"linear",range:[u,c]}:{type:e.type,range:o.simpleMap([u,c],e.c2r,0,a),calendar:a},X.setConvert(l),s=s&&p.dtick(s,l.type))l.dtick=s,l.tick0=p.tick0(void 0,l.type,a);else{var h;if(r)h=(c-u)/r;else{var f=o.distinctVals(t),d=Math.pow(10,Math.floor(Math.log(f.minDiff)/Math.LN10)),m=d*o.roundUp(f.minDiff/d,[.9,1.9,4.9,9.9],!0);h=Math.max(m,2*o.stdev(t)/Math.pow(t.length,i?.25:.4)),n(h)||(h=1)}X.autoTicks(l,h)}var g,y=l.dtick,v=X.tickIncrement(X.tickFirst(l),y,"reverse",a);if("number"==typeof y)v=function(t,e,r,i,a){var o=0,s=0,l=0,u=0;function c(e){return(1+100*(e-t)/r.dtick)%100<2}for(var h=0;h<e.length;h++)e[h]%1==0?l++:n(e[h])||u++,c(e[h])&&o++,c(e[h]+r.dtick/2)&&s++;var f=e.length-u;if(l===f&&"date"!==r.type)r.dtick<1?t=i-.5*r.dtick:(t-=.5)+r.dtick<i&&(t+=r.dtick);else if(s<.1*f&&(o>.3*f||c(i)||c(a))){var p=r.dtick/2;t+=t+p<i?p:-p}return t}(v,t,l,u,c),g=v+(1+Math.floor((c-v)/y))*y;else for("M"===l.dtick.charAt(0)&&(v=function(t,e,r,n,i){var a=o.findExactDates(e,i),s=.8;if(a.exactDays>s){var l=Number(r.substr(1));a.exactYears>s&&l%12==0?t=X.tickIncrement(t,"M6","reverse")+1.5*E:a.exactMonths>s?t=X.tickIncrement(t,"M1","reverse")+15.5*E:t-=C;var u=X.tickIncrement(t,r);if(u<=n)return u}return t}(v,t,y,u,a)),g=v;g<=c;)g=X.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:c-u}},X.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var i,a=e.dtick&&n(e._tmin);if(a){var s=X.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,.99*s+.01*e._tmin]}else{var l=o.simpleMap(e.range,e.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(t.range=o.simpleMap(i,e.l2r),t._isMinor=!0,X.prepTicks(t,r),a){var u=n(e.dtick),c=n(t.dtick),h=u?e.dtick:+e.dtick.substring(1),f=c?t.dtick:+t.dtick.substring(1);u&&c?at(h,f)?h===2*S&&f===2*E&&(t.dtick=S):h===2*S&&f===3*E?t.dtick=S:h!==S||(e._input.minor||{}).nticks?ot(h/f,2.5)?t.dtick=h/2:t.dtick=h:t.dtick=E:"M"===String(e.dtick).charAt(0)?c?t.dtick="M1":at(h,f)?h>=12&&2===f&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?at(h,f)||(t.dtick=ot(h/f,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},X.prepTicks=function(t,e){var r=o.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var i,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(i=t.tickfont?o.bigFont(t.tickfont.size||12):15,a=t._length/i):(i="y"===t._id.charAt(0)?40:80,a=o.constrain(t._length/i,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,X.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(n(t.dtick)||"M"!==t.dtick.charAt(0))}var i=r(),a=X.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=I,o&&!i&&t.dtick<I&&(t.dtick=I)):/%p/.test(a)?(e=C,o&&!i&&t.dtick<C&&(t.dtick=C)):/%[Aadejuwx]/.test(a)?(e=E,o&&!i&&t.dtick<E&&(t.dtick=E)):/%[UVW]/.test(a)?(e=S,o&&!i&&t.dtick<S&&(t.dtick=S)):/%[Bbm]/.test(a)?(e=A,o&&(i?st(t.dtick)<1:t.dtick<M)&&(t.dtick="M1")):/%[q]/.test(a)?(e=_,o&&(i?st(t.dtick)<3:t.dtick<b)&&(t.dtick="M3")):/%[Yy]/.test(a)&&(e=g,o&&(i?st(t.dtick)<12:t.dtick<y)&&(t.dtick="M12")))}(i=r())&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0),t._definedDelta=e}(t),t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),xt(t)},X.calcTicks=function(t,e){for(var r=t.type,i=t.calendar,a=t.ticklabelstep,s="period"===t.ticklabelmode,l=t.range[0]>t.range[1],u=!t.ticklabelindex||o.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],c=o.simpleMap(t.range,t.r2l,void 0,void 0,e),h=c[1]<c[0],f=Math.min(c[0],c[1]),p=Math.max(c[0],c[1]),d=Math.max(1e3,t._length||0),v=[],T=[],k=[],D=[],F=[],B=t.minor&&(t.minor.ticks||t.minor.showgrid),N=1;N>=(B?0:1);N--){var j=!N;N?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var U=N?t:o.extendFlat({},t,t.minor);if(j?X.prepMinorTicks(U,t,e):X.prepTicks(U,e),"array"!==U.tickmode)if("sync"!==U.tickmode){var V=et(c),q=V[0],H=V[1],G=n(U.dtick),Z="log"===r&&!(G||"L"===U.dtick.charAt(0)),W=X.tickFirst(U,e);if(N){if(t._tmin=W,W<q!==h)break;("category"===r||"multicategory"===r)&&(H=h?Math.max(-.5,H):Math.min(t._categories.length-.5,H))}var Y,$,J=null,K=W;N&&(G?$=t.dtick:"date"===r?"string"==typeof t.dtick&&"M"===t.dtick.charAt(0)&&($=A*t.dtick.substring(1)):$=t._roughDTick,Y=Math.round((t.r2l(K)-t.r2l(t.tick0))/$)-1);var Q=U.dtick;for(U.rangebreaks&&U._tick0Init!==U.tick0&&(K=Nt(K,t),h||(K=X.tickIncrement(K,Q,!h,i))),N&&s&&(K=X.tickIncrement(K,Q,!h,i),Y--);h?K>=H:K<=H;K=X.tickIncrement(K,Q,h,i)){if(N&&Y++,U.rangebreaks&&!h){if(K<q)continue;if(U.maskBreaks(K)===R&&Nt(K,U)>=p)break}if(k.length>d||K===J)break;J=K;var tt={value:K};N?(Z&&K!==(0|K)&&(tt.simpleLabel=!0),a>1&&Y%a&&(tt.skipLabel=!0),k.push(tt)):(tt.minor=!0,D.push(tt))}}else k=[],v=ut(t);else N?(k=[],v=ct(t,!j)):(D=[],T=ct(t,!j))}var rt;if(!D||D.length<2?u=!1:function(t,e){return/%f/.test(e)?t>=O:/%L/.test(e)?t>=z:/%[SX]/.test(e)?t>=P:/%M/.test(e)?t>=L:/%[HI]/.test(e)?t>=I:/%p/.test(e)?t>=C:/%[Aadejuwx]/.test(e)?t>=E:/%[UVW]/.test(e)?t>=S:/%[Bbm]/.test(e)?t>=M:/%[q]/.test(e)?t>=b:!/%[Yy]/.test(e)||t>=y}((D[1].value-D[0].value)*(l?-1:1),t.tickformat)||(u=!1),u){var nt=k.concat(D);s&&k.length&&(nt=nt.slice(1)),(nt=nt.sort(function(t,e){return t.value-e.value}).filter(function(t,e,r){return 0===e||t.value!==r[e-1].value})).map(function(t,e){return void 0!==t.minor||t.skipLabel?null:e}).filter(function(t){return null!==t}).forEach(function(t){u.map(function(e){var r=t+e;r>=0&&r<nt.length&&o.pushUnique(F,nt[r])})})}else F=k;if(B&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var it=k.map(function(t){return t.value}),at=[],ot=0;ot<D.length;ot++){var st=D[ot],lt=st.value;if(-1===it.indexOf(lt)){for(var ht=!1,ft=0;!ht&&ft<k.length;ft++)1e7+k[ft].value===1e7+lt&&(ht=!0);ht||at.push(st)}}D=at}if(s&&function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n].value,a=n,o=n+1;n<t.length-1?(a=n,o=n+1):n>0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,u=t[o].value,c=Math.abs(u-l),h=r||c,f=0;h>=y?f=c>=y&&c<=m?c:g:r===_&&h>=b?f=c>=b&&c<=x?c:_:h>=M?f=c>=M&&c<=w?c:A:r===S&&h>=S?f=S:h>=E?f=E:r===C&&h>=C?f=C:r===I&&h>=I&&(f=I),f>=c&&(f=c,s=!0);var p=i+f;if(e.rangebreaks&&f>0){for(var d=0,v=0;v<84;v++){var T=(v+.5)/84;e.maskBreaks(i*(1-T)+T*p)!==R&&d++}(f*=d/84)||(t[n].drop=!0),s&&c>S&&(f=c)}(f>0||0===n)&&(t[n].periodX=i+f/2)}}(F,t,t._definedDelta),t.rangebreaks){var pt="y"===t._id.charAt(0),dt=1;"auto"===t.tickmode&&(dt=t.tickfont?t.tickfont.size:12);var mt=NaN;for(rt=k.length-1;rt>-1;rt--)if(k[rt].drop)k.splice(rt,1);else{k[rt].value=Nt(k[rt].value,t);var gt=t.c2p(k[rt].value);(pt?mt>gt-dt:mt<gt+dt)?k.splice(h?rt+1:rt,1):mt=gt}}Bt(t)&&360===Math.abs(c[1]-c[0])&&k.pop(),t._tmax=(k[k.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;var yt,vt,xt=function(e){e.text="",t._prevDateHead=yt};function _t(t,e){var r=X.tickText(t,e.value,!1,e.simpleLabel),n=e.periodX;return void 0!==n&&(r.periodX=n,(n>p||n<f)&&(n>p&&(r.periodX=p),n<f&&(r.periodX=f),xt(r))),r}for(k=k.concat(D),rt=0;rt<k.length;rt++){var bt=k[rt].minor,wt=k[rt].value;bt?((vt=u&&-1!==F.indexOf(k[rt])?_t(t,k[rt]):{x:wt}).minor=!0,T.push(vt)):(yt=t._prevDateHead,vt=_t(t,k[rt]),(k[rt].skipLabel||u&&-1===F.indexOf(k[rt]))&&xt(vt),v.push(vt))}return v=v.concat(T),t._inCalcTicks=!1,s&&v.length&&(v[0].noTick=!0),v};var ht=[2,5,10],ft=[1,2,3,6,12],pt=[1,2,5,10,15,30],dt=[1,2,3,7,14],mt=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],gt=[-.301,0,.301,.699,1],yt=[15,30,45,90,180];function vt(t,e,r){return e*o.roundUp(t/e,r)}function xt(t){var e=t.dtick;if(t._tickexponent=0,!n(e)&&"string"!=typeof e&&(e=1),("category"===t.type||"multicategory"===t.type)&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),i=t.l2r(r).replace(/(^-|i)/g,""),a=i.length;if("M"===String(e).charAt(0))a>10||"01-01"!==i.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=L&&a<=16||e>=I)t._tickround="M";else if(e>=P&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(n(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);n(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(wt(t.exponentformat)&&!Tt(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function _t(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}X.autoTicks=function(t,e,r){var i;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=o.dateTick0(t.calendar,0);var s=2*e;if(s>g)e/=g,i=a(10),t.dtick="M"+12*vt(e,i,ht);else if(s>A)e/=A,t.dtick="M"+vt(e,1,ft);else if(s>E){if(t.dtick=vt(e,E,t._hasDayOfWeekBreaks?[1,2,7,14]:dt),!r){var l=X.getTickFormat(t),u="period"===t.ticklabelmode;u&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=o.dateTick0(t.calendar,2):t.tick0=o.dateTick0(t.calendar,1),u&&(t._dowTick0=t.tick0)}}else s>I?t.dtick=vt(e,I,ft):s>L?t.dtick=vt(e,L,pt):s>P?t.dtick=vt(e,P,pt):(i=a(10),t.dtick=vt(e,i,ht))}else if("log"===t.type){t.tick0=0;var c=o.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var h=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/h,i=a(10),t.dtick="L"+vt(e,i,ht)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Bt(t)?(t.tick0=0,i=1,t.dtick=vt(e,i,yt)):(t.tick0=0,i=a(10),t.dtick=vt(e,i,ht));if(0===t.dtick&&(t.dtick=1),!n(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},X.tickIncrement=function(t,e,i,a){var s=i?-1:1;if(n(e))return o.increment(t,s*e);var l=e.charAt(0),u=s*Number(e.substr(1));if("M"===l)return o.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?gt:mt,h=t+.01*s,f=o.roundUp(o.mod(h,1),c,i);return Math.floor(h)+Math.log(r.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},X.tickFirst=function(t,e){var i=t.r2l||Number,a=o.simpleMap(t.range,i,void 0,void 0,e),s=a[1]<a[0],l=s?Math.floor:Math.ceil,u=et(a)[0],c=t.dtick,h=i(t.tick0);if(n(c)){var f=l((u-h)/c)*c+h;return("category"===t.type||"multicategory"===t.type)&&(f=o.constrain(f,0,t._categories.length-1)),f}var p=c.charAt(0),d=Number(c.substr(1));if("M"===p){for(var m,g,y,v=0,x=h;v<10;){if(((m=X.tickIncrement(x,c,s,t.calendar))-u)*(x-u)<=0)return s?Math.min(x,m):Math.max(x,m);g=(u-(x+m)/2)/(m-x),y=p+(Math.abs(Math.round(g))||1)*d,x=X.tickIncrement(x,y,g<0?!s:s,t.calendar),v++}return o.error("tickFirst did not converge",t),x}if("L"===p)return Math.log(l((Math.pow(10,u)-h)/d)*d+h)/Math.LN10;if("D"===p){var _="D2"===c?gt:mt,b=o.roundUp(o.mod(u,1),_,s);return Math.floor(u)+Math.log(r.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(c)},X.tickText=function(t,e,r,i){var a,s=_t(t,e),l="array"===t.tickmode,u=r||l,c=t.type,h="category"===c?t.d2l_noadd:t.d2l,f=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};if(l&&o.isArrayOrTypedArray(t.ticktext)){var p=o.simpleMap(t.range,t.r2l),d=(Math.abs(p[1]-p[0])-(t._lBreaks||0))/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-h(t.tickvals[a]))<d);a++);if(a<t.ticktext.length)return s.text=String(t.ticktext[a]),s.xbnd=[f(s.x-.5),f(s.x+t.dtick-.5)],s}function m(n){if(void 0===n)return!0;if(r)return"none"===n;var i={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==i}var g=r?"never":"none"!==t.exponentformat&&m(t.showexponent)?"hide":"";if("date"===c?function(t,e,r,i){var a=t._tickround,s=r&&t.hoverformat||X.getTickFormat(t);(i=!s&&i)&&(a=n(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var l,u=o.formatDate(e.x,s,a,t._dateFormat,t.calendar,t._extraFormat),c=u.indexOf("\n");if(-1!==c&&(l=u.substr(c+1),u=u.substr(0,c)),i&&(void 0===l||"00:00:00"!==u&&"00:00"!==u?8===u.length&&(u=u.replace(/:00$/,"")):(u=l,l="")),l)if(r)"d"===a?u+=", "+l:u=l+(u?", "+u:"");else if(t._inCalcTicks&&t._prevDateHead===l){var h=jt(t),f=t._trueSide||t.side;(!h&&"top"===f||h&&"bottom"===f)&&(u+="<br> ")}else t._prevDateHead=l,u+="<br>"+l;e.text=u}(t,s,r,u):"log"===c?function(t,e,r,i,a){var s=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==c&&(s="L3",c="L"),u||"L"===c)e.text=kt(Math.pow(10,l),t,a,i);else if(n(s)||"D"===c&&("complete"===t.minorloglabels||o.mod(l+.01,1)<.1)){"complete"===t.minorloglabels&&!(o.mod(l+.01,1)<.1)&&(e.fontSize*=.75);var h=Math.pow(10,l).toExponential(0).split("e"),f=+h[1],p=Math.abs(f),d=t.exponentformat;"power"===d||wt(d)&&Tt(f)?(e.text=h[0],p>0&&(e.text+="x10"),"1x10"===e.text&&(e.text="10"),0!==f&&1!==f&&(e.text+="<sup>"+(f>0?"":D)+p+"</sup>"),e.fontSize*=1.25):("e"===d||"E"===d)&&p>2?e.text=h[0]+d+(f>0?"+":D)+p:(e.text=kt(Math.pow(10,l),t,"","fakehover"),"D1"===s&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(s);e.text="none"===t.minorloglabels?"":String(Math.round(Math.pow(10,o.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var m=String(e.text).charAt(0);("0"===m||"1"===m)&&("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,s,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,s):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,s,r):Bt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=kt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var s=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}function r(t,n){return e(n,0)?t:r(n,t%n)}function n(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}var i=n(t),a=t*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(s[1]>=100)e.text=kt(o.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===s[1]?1===s[0]?e.text="π":e.text=s[0]+"π":e.text=["<sup>",s[0],"</sup>","","<sub>",s[1],"</sub>","π"].join(""),l&&(e.text=D+e.text)}}}}(t,s,r,u,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=kt(e.x,t,i,n)}(t,s,0,u,g),i||(t.tickprefix&&!m(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!m(t.showticksuffix)&&(s.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(s.text)){var y=t.labelalias[s.text];"string"==typeof y&&(s.text=y)}return("boundaries"===t.tickson||t.showdividers)&&(s.xbnd=[f(s.x-.5),f(s.x+t.dtick-.5)]),s},X.hoverLabelText=function(t,e,r){r&&(t=o.extendFlat({},t,{hoverformat:r}));var n=o.isArrayOrTypedArray(e)?e[0]:e,i=o.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return X.hoverLabelText(t,n,r)+" - "+X.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,s=X.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":D+s:s};var bt=["f","p","n","μ","m","","k","M","G","T"];function wt(t){return"SI"===t||"B"===t}function Tt(t){return t>14||t<-15}function kt(t,e,r,i){var a=t<0,s=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=X.getTickFormat(e),h=e.separatethousands;if(i){var f={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:n(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};xt(f),s=(Number(f._tickround)||0)+4,u=f._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,D);var p,d=Math.pow(10,-s)/2;if("none"===l&&(u=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,u&&(t*=Math.pow(10,-u),s+=u),0===s)t=String(Math.floor(t));else if(s<0){t=(t=String(Math.round(t))).substr(0,t.length+s);for(var m=s;m<0;m++)t+="0"}else{var g=(t=String(t)).indexOf(".")+1;g&&(t=t.substr(0,g+s).replace(/\.?0+$/,""))}t=o.numSeparate(t,e._separators,h)}return u&&"hide"!==l&&(wt(l)&&Tt(u)&&(l="power"),p=u<0?D+-u:"power"!==l?"+"+u:String(u),"e"===l||"E"===l?t+=l+p:"power"===l?t+="×10<sup>"+p+"</sup>":"B"===l&&9===u?t+="B":wt(l)&&(t+=bt[u/3+5])),a?D+t:t}function At(t,e){if(t){var r=Object.keys(V).reduce(function(t,r){return-1!==e.indexOf(r)&&V[r].forEach(function(e){t[e]=1}),t},{});Object.keys(t).forEach(function(e){r[e]||(1===e.length?t[e]=0:delete t[e])})}}function Mt(t,e){for(var r=[],n={},i=0;i<e.length;i++){var a=e[i];n[a.text2]?n[a.text2].push(a.x):n[a.text2]=[a.x]}for(var s in n)r.push(_t(t,o.interp(n[s],.5),s));return r}function St(t){return void 0!==t.periodX?t.periodX:t.x}function Et(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function Ct(t){var e=t.title.font.size,r=(t.title.text.match(l.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?e*(Z+r*W):r?e*(r+1)*W:e}function It(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function Lt(t){var e=r.select(t),n=e.select(".text-math-group");return n.empty()?e.select("text"):n}function Pt(t){return t._id+".automargin"}function zt(t){return Pt(t)+".mirror"}function Ot(t){return t._id+".rangeslider"}function Dt(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function Rt(t,e,r){var n,i,a=[],s=[],l=t.layout;for(n=0;n<e.length;n++)a.push(X.getFromId(t,e[n]));for(n=0;n<r.length;n++)s.push(X.getFromId(t,r[n]));var u=Object.keys(f),c=["anchor","domain","overlaying","position","side","tickangle","editType"],h=["linear","log"];for(n=0;n<u.length;n++){var p=u[n],d=a[0][p],m=s[0][p],g=!0,y=!1,v=!1;if("_"!==p.charAt(0)&&"function"!=typeof d&&-1===c.indexOf(p)){for(i=1;i<a.length&&g;i++){var x=a[i][p];"type"===p&&-1!==h.indexOf(d)&&-1!==h.indexOf(x)&&d!==x?y=!0:x!==d&&(g=!1)}for(i=1;i<s.length&&g;i++){var _=s[i][p];"type"===p&&-1!==h.indexOf(m)&&-1!==h.indexOf(_)&&m!==_?v=!0:s[i][p]!==m&&(g=!1)}g&&(y&&(l[a[0]._name].type="linear"),v&&(l[s[0]._name].type="linear"),Ft(l,p,a,s,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];-1!==e.indexOf(b.xref)&&-1!==r.indexOf(b.yref)&&o.swapAttrs(l.annotations[n],["?"])}}function Ft(t,e,r,n,i){var a,s=o.nestedProperty,l=s(t[r[0]._name],e).get(),u=s(t[n[0]._name],e).get();for("title"===e&&(l&&l.text===i.x&&(l.text=i.y),u&&u.text===i.y&&(u.text=i.x)),a=0;a<r.length;a++)s(t,r[a]._name+"."+e).set(u);for(a=0;a<n.length;a++)s(t,n[a]._name+"."+e).set(l)}function Bt(t){return"angularaxis"===t._id}function Nt(t,e){for(var r=e._rangebreaks.length,n=0;n<r;n++){var i=e._rangebreaks[n];if(t>=i.min&&t<i.max)return i.max}return t}function jt(t){return-1!==(t.ticklabelposition||"").indexOf("inside")}function Vt(t,e){jt(t._anchorAxis||{})&&t._hideCounterAxisInsideTickLabels&&t._hideCounterAxisInsideTickLabels(e)}function qt(t,e,r,n){var i,a="free"===t.anchor||void 0!==t.overlaying&&!1!==t.overlaying?t.overlaying:t._id;i=n?"right"===t.side?e:-e:e,a in r||(r[a]={}),t.side in r[a]||(r[a][t.side]=0),r[a][t.side]+=i}X.getTickFormat=function(t){var e,r,n;function i(t){return"string"!=typeof t?t:Number(t.replace("M",""))*A}function a(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function o(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function s(t,e){var r=null===e[0],n=null===e[1],i=a(t,e[0])>=0,o=a(t,e[1])<=0;return(r||i)&&(n||o)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&o(t.dtick,n.dtickrange,i)){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&s(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},X.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=e?X.findSubplotsWithAxis(n,e):n;return i.sort(function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]}),i},X.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},X.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var n,i,a={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},s=X.list(t,"x",!0),l=X.list(t,"y",!0),u=[];for(n=0;n<s.length;n++)for(u.push({x:s[n],y:o}),i=0;i<l.length;i++)0===n&&u.push({x:a,y:l[i]}),u.push({x:s[n],y:l[i]});var c=e._clips.selectAll(".axesclip").data(u,function(t){return t.x._id+t.y._id});c.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+e._uid+t.x._id+t.y._id}).append("rect"),c.exit().remove(),c.each(function(t){r.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})}},X.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each(function(t){var e=t[0],r=n._plots[e];if(r){var i=r.xaxis,a=r.yaxis;r.xaxislayer.selectAll("."+i._id+"tick").remove(),r.yaxislayer.selectAll("."+a._id+"tick").remove(),r.xaxislayer.selectAll("."+i._id+"tick2").remove(),r.yaxislayer.selectAll("."+a._id+"tick2").remove(),r.xaxislayer.selectAll("."+i._id+"divider").remove(),r.yaxislayer.selectAll("."+a._id+"divider").remove(),r.minorGridlayer&&r.minorGridlayer.selectAll("path").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),r.zerolinelayerAbove&&r.zerolinelayerAbove.selectAll("path").remove(),n._infolayer.select(".g-"+i._id+"title").remove(),n._infolayer.select(".g-"+a._id+"title").remove()}});var i=e&&"redraw"!==e?e:X.listIds(t),a=X.list(t).filter(function(t){return t.autoshift}).map(function(t){return t.overlaying});i.map(function(e){var r=X.getFromId(t,e);if("sync"===r.tickmode&&r.overlaying){var n=i.findIndex(function(t){return t===r.overlaying});n>=0&&i.unshift(i.splice(n,1).shift())}});var s={false:{left:0,right:0}};return o.syncOrAsync(i.map(function(e){return function(){if(e){var n=X.getFromId(t,e);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=X.drawOne(t,n,r);return n._shiftPusher&&qt(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}}))},X.drawOne=function(t,e,r){var n,s,f,p=(r=r||{}).axShifts||{},d=r.overlayingShiftedAx||[];e.setScale();var m=t._fullLayout,g=e._id,y=g.charAt(0),v=X.counterLetter(g),x=m._plots[e._mainSubplot],_="above traces"===e.zerolinelayer;if(x){if(e._shiftPusher=e.autoshift||-1!==d.indexOf(e._id)||-1!==d.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var b=e.linewidth/2||0;"inside"===e.ticks&&(b+=e.ticklen),qt(e,b,p,!0),qt(e,e.shift||0,p,!1)}(!0!==r.skipTitle||void 0===e._shift)&&(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,p));var w=x[y+"axislayer"],T=e._mainLinePosition,k=T+=e._shift,A=e._mainMirrorPosition,M=e._vals=X.calcTicks(e),S=[e.mirror,k,A].join("_");for(n=0;n<M.length;n++)M[n].axInfo=S;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var E={};if(e.visible){var C,I,L=X.makeTransTickFn(e),P=X.makeTransTickLabelFn(e),z="inside"===e.ticks,O="outside"===e.ticks;if("boundaries"===e.tickson){var D=function(t,e){var r,n=[],i=function(t,e){var r=t.xbnd[e];null!==r&&n.push(o.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)i(e[r],0);i(e[r-1],1)}return n}(0,M);I=X.clipEnds(e,D),C=z?I:D}else I=X.clipEnds(e,M),C=z&&"period"!==e.ticklabelmode?I:M;var R=e._gridVals=I,F=function(t,e){var r,n,i=[],a=e.length&&e[e.length-1].x<e[0].x,s=function(t,e){var r=t.xbnd[e];null!==r&&i.push(o.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var l=e[r];l.text2!==n&&s(l,a?1:0),n=l.text2}s(e[r-1],a?0:1)}return i}(e,M);if(!m._hasOnlyLargeSploms){var B=e._subplotsWith,N={};for(n=0;n<B.length;n++){s=B[n];var j=(f=m._plots[s])[v+"axis"],U=j._mainAxis._id;if(!N[U]){N[U]=1;var V="x"===y?"M0,"+j._offset+"v"+j._length:"M"+j._offset+",0h"+j._length;X.drawGrid(t,e,{vals:R,counterAxis:j,layer:f.gridlayer.select("."+g),minorLayer:f.minorGridlayer.select("."+g),path:V,transFn:L}),X.drawZeroLine(t,e,{counterAxis:j,layer:_?f.zerolinelayerAbove:f.zerolinelayer,path:V,transFn:L})}}}var q,H=X.getTickSigns(e),$=X.getTickSigns(e,"minor");if(e.ticks||e.minor&&e.minor.ticks){var J,K,Q,tt,et=X.makeTickPath(e,k,H[2]),rt=X.makeTickPath(e,k,$[2],{minor:!0});if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(J=X.makeTickPath(e,A,H[3]),K=X.makeTickPath(e,A,$[3],{minor:!0}),Q=et+J,tt=rt+K):(J="",K="",Q=et,tt=rt),e.showdividers&&O&&"boundaries"===e.tickson){var nt={};for(n=0;n<F.length;n++)nt[F[n].x]=1;q=function(t){return nt[t.x]?J:Q}}else q=function(t){return t.minor?tt:Q}}if(X.drawTicks(t,e,{vals:C,layer:w,path:q,transFn:L}),"allticks"===e.mirror){var it=Object.keys(e._linepositions||{});for(n=0;n<it.length;n++){s=it[n],f=m._plots[s];var at=e._linepositions[s]||[],ot=at[0],st=at[1],lt=at[2],ut=X.makeTickPath(e,ot,lt?H[0]:$[0],{minor:lt})+X.makeTickPath(e,st,lt?H[1]:$[1],{minor:lt});X.drawTicks(t,e,{vals:C,layer:f[y+"axislayer"],path:ut,transFn:L})}}var ct=[];if(ct.push(function(){return X.drawLabels(t,e,{vals:M,layer:w,plotinfo:f,transFn:P,labelFns:X.makeLabelFns(e,k)})}),"multicategory"===e.type){var ht={x:2,y:10}[y];ct.push(function(){var r={x:"height",y:"width"}[y],n=pt()[r]+ht+(e._tickAngles[g+"tick"]?e.tickfont.size*W:0);return X.drawLabels(t,e,{vals:Mt(e,M),layer:w,cls:g+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:L,labelFns:X.makeLabelFns(e,k+n*H[4])})}),ct.push(function(){return e._depth=H[4]*(pt("tick2")[e.side]-k),function(t,e,r){var n=e._id+"divider",i=r.vals,a=r.layer.selectAll("path."+n).data(i,Et);a.exit().remove(),a.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(c.stroke,e.dividercolor).style("stroke-width",h.crispRound(t,e.dividerwidth,1)+"px"),a.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:F,layer:w,path:X.makeTickPath(e,k,H[4],{len:e._depth}),transFn:L})})}else e.title.hasOwnProperty("standoff")&&ct.push(function(){e._depth=H[4]*(pt()[e.side]-k)});var ft=a.getComponentMethod("rangeslider","isVisible")(e);return!r.skipTitle&&!(ft&&"bottom"===e.side)&&ct.push(function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size,s=(e.title.text.match(l.BR_TAG_ALL)||[]).length;if(e.title.hasOwnProperty("standoff"))"bottom"===e.side||"right"===e.side?r=e._depth+e.title.standoff+o*Z:("top"===e.side||"left"===e.side)&&(r=e._depth+e.title.standoff+o*(G+s*W));else{var c=jt(e);if("multicategory"===e.type)r=e._depth;else{var f=1.5*o;c&&(f=.5*o,"outside"===e.ticks&&(f+=e.ticklen)),r=10+f+(e.linewidth?e.linewidth-1:0)}c||(r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var p,d,m,g,y=X.getPxPosition(t,e);if("x"===a?(d=e._offset+e._length/2,m="top"===e.side?y-r:y+r):(m=e._offset+e._length/2,d="right"===e.side?y+r:y-r,p={rotate:"-90",offset:0}),"multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(g={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var x=h.getTranslate(v.node().parentNode);g.offsetLeft=x.x,g.offsetTop=x.y}e.title.hasOwnProperty("standoff")&&(g.pad=0)}return e._titleStandoff=r,u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:g,transform:p,attributes:{x:d,y:m,"text-anchor":"middle"}})}(t,e)}),ct.push(function(){var r,n,o,s,l=e.side.charAt(0),u=Y[e.side].charAt(0),c=X.getPxPosition(t,e),h=O?e.ticklen:0;(e.automargin||ft||e._shiftPusher)&&("multicategory"===e.type?r=pt("tick2"):(r=pt(),"x"===y&&"b"===l&&(e._depth=Math.max(r.width>0?r.bottom-c:0,h))));var f=0,p=0;if(e._shiftPusher&&(f=Math.max(h,r.height>0?"l"===l?c-r.left:r.right-c:0),e.title.text!==m._dfltTitle[y]&&(p=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(p+=Ct(e))),e._fullDepth=Math.max(f,p)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1],g="number"==typeof e._shift?e._shift:0;if("x"===y){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,h),d.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var _=e._offset-r.left;_>0&&(n.xl=0,n.l=_)}}else if("l"===l?(e._depth=Math.max(r.height>0?c-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-c:0,h),n[l]=e._depth+g,d.reverse()),r.height>0){var b=r.bottom-(e._offset+e._length);b>0&&(n.yb=0,n.b=b);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==m._dfltTitle[y]&&(n[l]+=Ct(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(o[u]+=h),!0===e.mirror||"ticks"===e.mirror?o[v]=e._anchorAxis.domain[d[1]]:("all"===e.mirror||"allticks"===e.mirror)&&(o[v]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}ft&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(At(n,e.automargin),At(o,e.automargin)),i.autoMargin(t,Pt(e),n),i.autoMargin(t,zt(e),o),i.autoMargin(t,Ot(e),s)}),o.syncOrAsync(ct)}}function pt(t){var r=g+(t||"tick");return E[r]||(E[r]=function(t,e,r){var n,i,a,o;if(t._selections[e].size())n=1/0,i=-1/0,a=1/0,o=-1/0,t._selections[e].each(function(){var t=Lt(this);if("none"!==t.node().style.display){var e=h.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),a=Math.min(a,e.left),o=Math.max(o,e.right)}});else{var s=X.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(e,r,k)),E[r]}},X.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map(function(t){return-t})),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},X.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return s(t._offset+t.l2p(e.x),0)}:function(e){return s(0,t._offset+t.l2p(e.x))}},X.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=t.tickson||"",n=function(t){return-1!==e.indexOf(t)},i=n("top"),a=n("left"),o=n("right"),s=n("bottom"),l=n("inside"),u="boundaries"!==r&&(s||a||i||o);if(!u&&!l)return[0,0];var c=t.side,h=u?(t.tickwidth||0)/2:0,f=3,p=t.tickfont?t.tickfont.size:12;return(s||i)&&(h+=p*Z,f+=(t.linewidth||0)/2),(a||o)&&(h+=(t.linewidth||0)/2,f+=3),l&&"top"===c&&(f-=p*(1-Z)),(a||i)&&(h=-h),("bottom"===c||"right"===c)&&(f=-f),[u?h:0,l?f:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],a=e[1],o=t.range[0]>t.range[1],l=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside"),u=!l;if(r&&(r*=o?-1:1),n){var c=t.side;n*=l&&("top"===c||"left"===c)||u&&("bottom"===c||"right"===c)?1:-1}return"x"===t._id.charAt(0)?function(e){return s(i+t._offset+t.l2p(St(e))+r,a+n)}:function(e){return s(a+n,i+t._offset+t.l2p(St(e))+r)}},X.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},X.makeLabelFns=function(t,e,r){var i=t.ticklabelposition||"",a=t.tickson||"",s=function(t){return-1!==i.indexOf(t)},l=s("top"),u=s("left"),c=s("right"),h=s("bottom"),f="boundaries"!==a&&(h||u||l||c),p=s("inside"),d="inside"===i&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==a,m=0,g=0,y=d?t.ticklen:0;if(p?y*=-1:f&&(y=0),d&&(m+=y,r)){var v=o.deg2rad(r);m=y*Math.cos(v)+1,g=y*Math.sin(v)}t.showticklabels&&(d||t.showline)&&(m+=.2*t.tickfont.size);var x,_,b,w,T,k={labelStandoff:m+=(t.linewidth||1)/2*(p?-1:1),labelShift:g},A=0,M=t.side,S=t._id.charAt(0),E=t.tickangle;if("x"===S)w=(T=!p&&"bottom"===M||p&&"top"===M)?1:-1,p&&(w*=-1),x=g*w,_=e+m*w,b=T?1:-.2,90===Math.abs(E)&&(p?b+=G:b=-90===E&&"bottom"===M?Z:90===E&&"top"===M?G:.5,A=G/2*(E/90)),k.xFn=function(t){return t.dx+x+A*t.fontSize},k.yFn=function(t){return t.dy+_+t.fontSize*b},k.anchorFn=function(t,e){if(f){if(u)return"end";if(c)return"start"}return n(e)&&0!==e&&180!==e?e*w<0!==p?"end":"start":"middle"},k.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===S){if(w=(T=!p&&"left"===M||p&&"right"===M)?1:-1,p&&(w*=-1),x=m,_=g*w,b=0,!p&&90===Math.abs(E)&&(b=-90===E&&"left"===M||90===E&&"right"===M?Z:.5),p){var C=n(E)?+E:0;if(0!==C){var I=o.deg2rad(C);A=Math.abs(Math.sin(I))*Z*w,b=0}}k.xFn=function(t){return t.dx+e-(x+t.fontSize*b)*w+A*t.fontSize},k.yFn=function(t){return t.dy+_+t.fontSize*G},k.anchorFn=function(t,e){return n(e)&&90===Math.abs(e)?"middle":T?"end":"start"},k.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return k},X.drawTicks=function(t,e,n){n=n||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?n.vals.filter(function(t){return t.minor&&!t.noTick}):[]).concat(e.ticks?n.vals.filter(function(t){return!t.minor&&!t.noTick}):[]),o=n.layer.selectAll("path."+i).data(a,Et);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each(function(t){return c.stroke(r.select(this),t.minor?e.minor.tickcolor:e.tickcolor)}).style("stroke-width",function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"}).attr("d",n.path).style("display",null),Vt(e,[j]),o.attr("transform",n.transFn)},X.drawGrid=function(t,e,n){if(n=n||{},"sync"!==e.tickmode){var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?n.vals.filter(function(t){return t.minor}):[],s=e.showgrid?n.vals.filter(function(t){return!t.minor}):[],l=n.counterAxis;if(l&&X.shouldShowZeroLine(t,e,l))for(var u="array"===e.tickmode,f=0;f<s.length;f++){var p=s[f].x;if(u?!p:Math.abs(p)<e.dtick/100){if(s=s.slice(0,f).concat(s.slice(f+1)),!u)break;f--}}e._gw=h.crispRound(t,e.gridwidth,1);for(var d=a?h.crispRound(t,e.minor.gridwidth,1):0,m=n.layer,g=n.minorLayer,y=1;y>=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Et);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each(function(t){return c.stroke(r.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")}).style("stroke-dasharray",function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)}).style("stroke-width",function(t){return(t.minor?d:e._gw)+"px"}).style("display",null),"function"==typeof n.path&&x.attr("d",n.path)}}Vt(e,[B,N])}},X.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=X.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each(function(){r.layer.selectAll("path").sort(function(t,e){return K(t.id,e.id)})}),a.attr("transform",r.transFn).attr("d",r.path).call(c.stroke,e.zerolinecolor||c.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Vt(e,[F])},X.drawLabels=function(t,e,i){i=i||{};var a=t._fullLayout,u=e._id,c="above traces"===e.zerolinelayer,f=i.cls||u+"tick",p=i.vals.filter(function(t){return t.text}),d=i.labelFns,m=i.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],y=i.layer.selectAll("g."+f).data(e.showticklabels?p:[],Et),v=[];function x(t,a){t.each(function(t){var o=r.select(this),u=o.select(".text-math-group"),c=d.anchorFn(t,a),f=i.transFn.call(o.node(),t)+(n(a)&&0!=+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),p=l.lineCount(o),m=W*t.fontSize,g=d.heightFn(t,n(a)?+a:0,(p-1)*m);if(g&&(f+=s(0,g)),u.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":c}),y.style("display",null),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(u.node()).width*{end:-.5,start:.5}[c];u.attr("transform",f+s(v,0))}})}y.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each(function(e){var n=r.select(this),i=t._promises.length;n.call(l.positionText,d.xFn(e),d.yFn(e)).call(h.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(l.convertToTspans,t),t._promises[i]?v.push(t._promises.pop().then(function(){x(n,m)})):x(n,m)}),Vt(e,[U]),y.exit().remove(),i.repositionOnUpdate&&y.each(function(t){r.select(this).select("text").call(l.positionText,d.xFn(t),d.yFn(t))}),e._adjustTickLabelsOverflow=function(){var n=e.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===e._id.charAt(0),l=0,u=s?t._fullLayout.width:t._fullLayout.height;if(-1!==n.indexOf("domain")){var c=o.simpleMap(e.range,e.r2l);l=e.l2p(c[0])+e._offset,u=e.l2p(c[1])+e._offset}var f=Math.min(l,u),p=Math.max(l,u),d=e.side,m=1/0,g=-1/0;for(var v in y.each(function(t){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.node()),o=0;s?(a.right>p||a.left<f)&&(o=1):(a.bottom>p||a.top+(e.tickangle?0:t.fontSize/4)<f)&&(o=1);var l=n.select("text");o?i&&l.style("display","none"):"none"!==l.node().style.display&&(l.style("display",null),m="bottom"===d||"right"===d?Math.min(m,s?a.top:a.left):-1/0,g="top"===d||"left"===d?Math.max(g,s?a.bottom:a.right):1/0)}}),a._plots){var x=a._plots[v];if(e._id===x.xaxis._id||e._id===x.yaxis._id){var _=s?x.yaxis:x.xaxis;_&&(_["_visibleLabelMin_"+e._id]=m,_["_visibleLabelMax_"+e._id]=g)}}}},e._hideCounterAxisInsideTickLabels=function(t){var n="x"===e._id.charAt(0),i=[];for(var o in a._plots){var s=a._plots[o];e._id!==s.xaxis._id&&e._id!==s.yaxis._id||i.push(n?s.yaxis:s.xaxis)}i.forEach(function(n,i){n&&jt(n)&&(t||[F,N,B,j,U]).forEach(function(t){var o="tick"===t.K&&"text"===t.L&&"period"===e.ticklabelmode,s=a._plots[e._mainSubplot];(t.K===F.K?(c?s.zerolinelayerAbove:s.zerolinelayer).selectAll("."+e._id+"zl"):t.K===N.K?s.minorGridlayer.selectAll("."+e._id):t.K===B.K?s.gridlayer.selectAll("."+e._id):s[e._id.charAt(0)+"axislayer"]).each(function(){var a=r.select(this);t.L&&(a=a.selectAll(t.L)),a.each(function(a){var s=e.l2p(o?St(a):a.x)+e._offset,l=r.select(this);s<e["_visibleLabelMax_"+n._id]&&s>e["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"===t.K&&!i&&"none"!==l.node().style.display&&l.style("display",null)})})})})},x(y,g+1?g:m);var _=null;e._selections&&(e._selections[f]=y);var b=[function(){return v.length&&Promise.all(v)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(_=g,b.push(function(){x(y,g)})):b.push(function(){if(x(y,m),p.length&&e.autotickangles&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){_=e.autotickangles[0];var t,r=0,n=[],a=1;y.each(function(t){r=Math.max(r,t.fontSize);var i=e.l2p(t.x),o=Lt(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})});var s=("boundaries"===e.tickson||e.showdividers)&&!i.secondary,u=p.length,c=Math.abs((p[u-1].x-p[0].x)*e._m)/(u-1),f=s?c/2:c,d=s?e.ticklen:1.25*r*a,g=f/Math.sqrt(Math.pow(f,2)+Math.pow(d,2)),v=e.autotickangles.map(function(t){return t*Math.PI/180}),b=v.find(function(t){return Math.abs(Math.cos(t))<=g});void 0===b&&(b=v.reduce(function(t,e){return Math.abs(Math.cos(t))<Math.abs(Math.cos(e))?t:e},v[0]));var w=b*(180/Math.PI);if(s){var T=2;for(e.ticks&&(T+=e.tickwidth/2),t=0;t<n.length;t++){var k=p[t].xbnd,A=n[t];if(null!==k[0]&&A.left-e.l2p(k[0])<T||null!==k[1]&&e.l2p(k[1])-A.right<T){_=w;break}}}else{var M=e.ticklabelposition||"",S=e.tickson||"",E=function(t){return-1!==M.indexOf(t)},C=E("top"),I=E("left"),L=E("right"),P=E("bottom"),z="boundaries"!==S&&(P||I||C||L)?(e.tickwidth||0)+6:0;for(t=0;t<n.length-1;t++)if(o.bBoxIntersect(n[t],n[t+1],z)){_=w;break}}_&&x(y,_)}}),e._tickAngles&&b.push(function(){e._tickAngles[f]=null===_?n(m)?m:0:_});var w=function(){var t=0,r=0;return y.each(function(n,i){var a,o=Lt(this);o.select(".text-math-group").empty()&&(e._vals[i]&&(a=e._vals[i].bb||h.bBox(o.node()),e._vals[i].bb=a),t=Math.max(t,a.width),r=Math.max(r,a.height))}),{labelsMaxW:t,labelsMaxH:r}},T=e._anchorAxis;if(T&&(T.autorange||T.insiderange)&&jt(e)&&!Q(a,e._id)&&(a._insideTickLabelsUpdaterange||(a._insideTickLabelsUpdaterange={}),T.autorange&&(a._insideTickLabelsUpdaterange[T._name+".autorange"]=T.autorange,b.push(w)),T.insiderange)){var k=w(),A="y"===e._id.charAt(0)?k.labelsMaxW:k.labelsMaxH;A+=6,"inside"===e.ticklabelposition&&(A+=e.ticklen||0);var M="right"===e.side||"top"===e.side?1:-1,S=1===M?1:0,E=1===M?0:1,C=[];C[E]=T.range[E];var I=T.range,L=T.r2p(I[S]),P=T.r2p(I[E]),z=a._insideTickLabelsUpdaterange[T._name+".range"];if(z){var O=T.r2p(z[S]),D=T.r2p(z[E]),R=M*("y"===e._id.charAt(0)?1:-1);R*L<R*O&&(L=O,C[S]=I[S]=z[S]),R*P>R*D&&(P=D,C[E]=I[E]=z[E])}var V=Math.abs(P-L);V-A>0?A*=1+A/(V-=A):A=0,"y"!==e._id.charAt(0)&&(A=-A),C[S]=T.p2r(T.r2p(I[S])+M*A),"min"===T.autorange||"max reversed"===T.autorange?(C[0]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0):("max"===T.autorange||"min reversed"===T.autorange)&&(C[1]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[T._name+".range"]=C}var q=o.syncOrAsync(b);return q&&q.then&&t._promises.push(q),q},X.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},X.shouldShowZeroLine=function(t,e,r){var n=o.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===R)&&(It(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var a=t._fullLayout,o=e._id.charAt(0),s=X.counterLetter(e._id),l=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length),u=a._plots[r._mainSubplot];if(!(u.mainplotinfo||u).overlays.length)return p(r);for(var c=X.list(t,s),h=0;h<c.length;h++){var f=c[h];if(f._mainAxis===i&&p(f))return!0}}function p(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"==typeof t&&Math.abs(t-l)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var i=t._linepositions||{};for(var a in i)if(n(i[a][0])||n(i[a][1]))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,i=e._id.charAt(0),o=0;o<r.length;o++){var s=r[o];if(!0===s.visible&&s.xaxis+s.yaxis===n&&(a.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[i]||s.fill&&s.fill.charAt(s.fill.length-1)===i))return!0}return!1}(t,e))},X.clipEnds=function(t,e){return e.filter(function(e){return It(t,e.x)})},X.allowAutoMargin=function(t){for(var e=X.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&(i.allowAutoMargin(t,Pt(n)),n.mirror&&i.allowAutoMargin(t,zt(n))),a.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(t,Ot(n))}},X.swap=function(t,e){for(var r=function(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)(-1!==i[n].x.indexOf(o)||-1!==i[n].y.indexOf(s))&&a.push(n);if(!a.length){i.push({x:[o],y:[s]});continue}var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],Dt(u.x,l.x),Dt(u.y,l.y);Dt(u.x,[o]),Dt(u.y,[s])}}return i}(t,e),n=0;n<r.length;n++)Rt(t,r[n].x,r[n].y)}}),nr=f((t,e)=>{e.exports=function(t,e,r){var n,i;if(r){var a="reversed"===e||"min reversed"===e||"max reversed"===e;n=r[a?1:0],i=r[a?0:1]}var o=t("autorangeoptions.minallowed",null===i?n:void 0),s=t("autorangeoptions.maxallowed",null===n?i:void 0);void 0===o&&t("autorangeoptions.clipmin"),void 0===s&&t("autorangeoptions.clipmax"),t("autorangeoptions.include")}}),ir=f((t,e)=>{var r=nr();e.exports=function(t,e,n,i){var a=e._template||{},o=e.type||a.type||"-";n("minallowed"),n("maxallowed");var s,l=n("range");l||!i.noInsiderange&&"log"!==o&&((s=n("insiderange"))&&(null===s[0]||null===s[1])&&(e.insiderange=!1,s=void 0),s&&(l=n("range",s)));var u,c=e.getAutorangeDflt(l,i),h=n("autorange",c);l&&(null===l[0]&&null===l[1]||(null===l[0]||null===l[1])&&("reversed"===h||!0===h)||null!==l[0]&&("min"===h||"max reversed"===h)||null!==l[1]&&("max"===h||"min reversed"===h))&&(l=void 0,delete e.range,e.autorange=!0,u=!0),u||(h=n("autorange",c=e.getAutorangeDflt(l,i))),h&&(r(n,h,l),("linear"===o||"-"===o)&&n("rangemode")),e.cleanRange()}}),ar=f((t,e)=>{var r={left:0,top:0};e.exports=function(t,e,n){e=e||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?r:t.getBoundingClientRect()}(e);return n[0]=i-o.left,n[1]=a-o.top,n}}),or=f((t,e)=>{var r=le();e.exports=r&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()}),sr=f((t,e)=>{e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}}),lr=f((t,e)=>{var r=oe(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,i,a){return t="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*e),0,2),n[e][t]}}),ur=f((t,e)=>{var r=he(),n=$t(),i=Ct().getGraphDiv,a=F(),o=e.exports={};o.wrapped=function(t,e,r){(t=i(t))._fullLayout&&n.clear(t._fullLayout._uid+a.HOVERID),o.raw(t,e,r)},o.raw=function(t,e){var n=t._fullLayout,i=t._hoverdata;e||(e={}),(!e.target||t._dragged||!1!==r.triggerHandler(t,"plotly_beforehover",e))&&(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}}),cr=f((t,e)=>{var r=ar(),n=ue(),i=or(),a=oe().removeElement,o=ge(),s=e.exports={};s.align=sr(),s.getCursor=lr();var l=ur();function u(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function c(t){return r(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(t){var e,r,l,h,f,p,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=b,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=b,x.addEventListener("touchstart",b,{passive:!1})):x.ontouchstart=b;var _=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function b(i){g._dragged=!1,g._dragging=!0;var a=c(i);e=a[0],r=a[1],d=i.target,p=i,m=2===i.buttons||i.ctrlKey,void 0===i.clientX&&void 0===i.clientY&&(i.clientX=e,i.clientY=r),(l=(new Date).getTime())-g._mouseDownTime<v?y+=1:(y=1,g._mouseDownTime=l),t.prepFn&&t.prepFn(i,e,r),n&&!m?(f=u()).style.cursor=window.getComputedStyle(x).cursor:n||(f=document,h=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",T),document.addEventListener("touchend",T),!1!==t.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var i=c(n),a=t.minDrag||o.MINDRAG,l=_(i[0]-e,i[1]-r,a),u=l[0],h=l[1];(u||h)&&(g._dragged=!0,s.unhover(g,n)),g._dragged&&t.moveFn&&!m&&(g._dragdata={element:x,dx:u,dy:h},t.moveFn(u,h))}function T(e){var r;delete g._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",T),document.removeEventListener("touchend",T),n?a(f):h&&(f.documentElement.style.cursor=h,h=null),g._dragging?(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>v&&(y=Math.max(y-1,1)),g._dragged?t.doneFn&&t.doneFn():(p.target===d?r=p:(r={target:d,srcElement:d,toElement:d},Object.keys(p).concat(Object.keys(p.__proto__)).forEach(t=>{var e=p[t];!r[t]&&"function"!=typeof e&&(r[t]=e)})),t.clickFn&&t.clickFn(y,r),m||d.dispatchEvent(new MouseEvent("click",e))),g._dragging=!1,g._dragged=!1):g._dragged=!1}},s.coverSlip=u}),hr=f((t,e)=>{e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}}),fr=f((t,e)=>{var r=hr(),n="data-savedcursor";e.exports=function(t,e){var i=t.attr(n);if(e){if(!i){for(var a=(t.attr("class")||"").split(" "),o=0;o<a.length;o++){var s=a[o];0===s.indexOf("cursor-")&&t.attr(n,s.substr(7)).classed(s,!1)}t.attr(n)||t.attr(n,"!!")}r(t,e)}else i&&(t.attr(n,null),"!!"===i?r(t):r(t,i))}}),pr=f((t,e)=>{var r=R(),n=V();e.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),grouptitlefont:r({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:r({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),dr=f(t=>{t.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},t.isVertical=function(t){return"h"!==t.orientation},t.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}}),mr=f((t,e)=>{var r=Ut(),n=oe(),i=me(),a=j(),o=pr(),s=Nt(),l=dr();function u(t,e,u,c){var h=e[t]||{},f=i.newContainer(u,t);function p(t,e){return n.coerce(h,f,o,t,e)}var d=n.coerceFont(p,"font",u.font);if(p("bgcolor",u.paper_bgcolor),p("bordercolor"),p("visible")){for(var m,g=function(t,e){var r=m._input,i=m;return n.coerce(r,i,a,t,e)},y=u.font||{},v=n.coerceFont(p,"grouptitlefont",y,{overrideDflt:{size:Math.round(1.1*y.size)}}),x=0,_=!1,b="normal",w=(u.shapes||[]).filter(function(t){return t.showlegend}),T=c.concat(w).filter(function(e){return t===(e.legend||"legend")}),k=0;k<T.length;k++)if((m=T[k]).visible){var A=m._isShape;(m.showlegend||m._dfltShowLegend&&!(m._module&&m._module.attributes&&m._module.attributes.showlegend&&!1===m._module.attributes.showlegend.dflt))&&(x++,m.showlegend&&(_=!0,(!A&&r.traceIs(m,"pie-like")||!0===m._input.showlegend)&&x++),n.coerceFont(g,"legendgrouptitle.font",v)),(!A&&r.traceIs(m,"bar")&&"stack"===u.barmode||-1!==["tonextx","tonexty"].indexOf(m.fill))&&(b=l.isGrouped({traceorder:b})?"grouped+reversed":"reversed"),void 0!==m.legendgroup&&""!==m.legendgroup&&(b=l.isReversed({traceorder:b})?"reversed+grouped":"grouped")}var M=n.coerce(e,u,s,"showlegend",_&&x>("legend"===t?1:0));if(!1===M&&(u[t]=void 0),(!1!==M||h.uirevision)&&(p("uirevision",u.uirevision),!1!==M)){p("borderwidth");var S,E,C,I="h"===p("orientation"),L="paper"===p("yref"),P="paper"===p("xref"),z="left";if(I?(S=0,r.getComponentMethod("rangeslider","isVisible")(e.xaxis)?L?(E=1.1,C="bottom"):(E=1,C="top"):L?(E=-.1,C="top"):(E=0,C="bottom")):(E=1,C="auto",P?S=1.02:(S=1,z="right")),n.coerce(h,f,{x:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:S}},"x"),n.coerce(h,f,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:E}},"y"),p("traceorder",b),l.isGrouped(u[t])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",z),p("yanchor",C),p("maxheight"),p("valign"),n.noneOrAll(h,f,["x","y"]),p("title.text")){p("title.side",I?"left":"top");var O=n.extendFlat({},d,{size:n.bigFont(d.size)});n.coerceFont(p,"title.font",O)}}}}e.exports=function(t,e,r){var i,a=r.slice(),o=e.shapes;if(o)for(i=0;i<o.length;i++){var s=o[i];if(s.showlegend){var l={_input:s._input,visible:s.visible,showlegend:s.showlegend,legend:s.legend};a.push(l)}}var c=["legend"];for(i=0;i<a.length;i++)n.pushUnique(c,a[i].legend);for(e._legends=[],i=0;i<c.length;i++){var h=c[i];u(h,t,e,a),e[h]&&e[h].visible&&(e[h]._id=h),e._legends.push(h)}}}),gr=f((t,e)=>{var r=Ut(),n=oe(),i=n.pushUnique,a=!0;e.exports=function(t,e,o){var s=e._fullLayout;if(!e._dragged&&!e._editing){var l,u=s.legend.itemclick,c=s.legend.itemdoubleclick,h=s.legend.groupclick;if(1===o&&"toggle"===u&&"toggleothers"===c&&a&&e.data&&e._context.showTips&&n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),a=!1,1===o?l=u:2===o&&(l=c),l){var f="togglegroup"===h,p=s.hiddenlabels?s.hiddenlabels.slice():[],d=t.data()[0][0];if(!d.groupTitle||!d.noClick){var m=e._fullData,g=(s.shapes||[]).filter(function(t){return t.showlegend}),y=m.concat(g),v=d.trace;v._isShape&&(v=v._fullInput);var x,_,b,w,T,k=v.legendgroup,A={},M=[],S=[],E=[],C=(s.shapes||[]).map(function(t){return t._input}),I=!1,L=v.legend,P=v._fullInput;if(P&&P._isShape||!r.traceIs(v,"pie-like")){var z,O=k&&k.length,D=[];if(O)for(x=0;x<y.length;x++)(z=y[x]).visible&&z.legendgroup===k&&D.push(x);if("toggle"===l){var R;switch(v.visible){case!0:R="legendonly";break;case!1:R=!1;break;case"legendonly":R=!0}if(O)if(f)for(x=0;x<y.length;x++){var F=y[x];!1!==F.visible&&F.legendgroup===k&&tt(F,R)}else tt(v,R);else tt(v,R)}else if("toggleothers"===l){var B,N,j,U,V,q=!0;for(x=0;x<y.length;x++)if(B=(V=y[x])===v,j=!0!==V.showlegend,!(B||j||(N=O&&V.legendgroup===k,N||V.legend!==L||!0!==V.visible||r.traceIs(V,"notLegendIsolatable")))){q=!1;break}for(x=0;x<y.length;x++)if(!1!==(V=y[x]).visible&&V.legend===L&&!r.traceIs(V,"notLegendIsolatable"))switch(v.visible){case"legendonly":tt(V,!0);break;case!0:U=!!q||"legendonly",B=V===v,j=!0!==V.showlegend&&!V.legendgroup,tt(V,!(!(N=B||O&&V.legendgroup===k)&&!j)||U)}}for(x=0;x<S.length;x++)if(b=S[x]){var H=b.constructUpdate(),G=Object.keys(H);for(_=0;_<G.length;_++)w=G[_],(A[w]=A[w]||[])[E[x]]=H[w]}for(T=Object.keys(A),x=0;x<T.length;x++)for(w=T[x],_=0;_<M.length;_++)A[w].hasOwnProperty(_)||(A[w][_]=void 0);I?r.call("_guiUpdate",e,A,{shapes:C},M):r.call("_guiRestyle",e,A,M)}else{var Z=d.label,W=p.indexOf(Z);if("toggle"===l)-1===W?p.push(Z):p.splice(W,1);else if("toggleothers"===l){var Y=-1!==W,X=[];for(x=0;x<e.calcdata.length;x++){var $=e.calcdata[x];for(_=0;_<$.length;_++){var J=$[_].label;L===$[0].trace.legend&&Z!==J&&(-1===p.indexOf(J)&&(Y=!0),i(p,J),X.push(J))}}if(!Y)for(var K=0;K<X.length;K++){var Q=p.indexOf(X[K]);-1!==Q&&p.splice(Q,1)}}r.call("_guiRelayout",e,"hiddenlabels",p)}}}}function tt(t,e){if(!d.groupTitle||f){var r=t._fullInput||t,n=r._isShape,i=r.index;void 0===i&&(i=r._index);var a=!1!==r.visible&&e;n?function(t,e){C[t].visible=e,I=!0}(i,a):function(t,e){var r=M.indexOf(t),n=A.visible;n||(n=A.visible=[]),-1===M.indexOf(t)&&(M.push(t),r=M.length-1),n[r]=e}(i,a)}}}}),yr=f((t,e)=>{e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),vr=f((t,e)=>{var r=Ut(),n=dr();e.exports=function(t,e,i){var a,o,s=e._inHover,l=n.isGrouped(e),u=n.isReversed(e),c={},h=[],f=!1,p={},d=0,m=0;function g(t,r,a){if(!1!==e.visible&&(!i||t===e._id))if(""!==r&&n.isGrouped(e))-1===h.indexOf(r)?(h.push(r),f=!0,c[r]=[a]):c[r].push(a);else{var o="~~i"+d;h.push(o),c[o]=[a],d++}}for(a=0;a<t.length;a++){var y=t[a],v=y[0],x=v.trace,_=x.legend,b=x.legendgroup;if(s||x.visible&&x.showlegend)if(r.traceIs(x,"pie-like"))for(p[b]||(p[b]={}),o=0;o<y.length;o++){var w=y[o].label;p[b][w]||(g(_,b,{label:w,color:y[o].color,i:y[o].i,trace:x,pts:y[o].pts}),p[b][w]=!0,m=Math.max(m,(w||"").length))}else g(_,b,v),m=Math.max(m,(x.name||"").length)}if(!h.length)return[];var T=!f||!l,k=[];for(a=0;a<h.length;a++){var A=c[h[a]];T?k.push(A[0]):k.push(A)}for(T&&(k=[k]),a=0;a<k.length;a++){var M=1/0;for(o=0;o<k[a].length;o++){var S=k[a][o].trace.legendrank;M>S&&(M=S)}k[a][0]._groupMinRank=M,k[a][0]._preGroupSort=a}var E=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(k.forEach(function(t,e){t[0]._preGroupSort=e}),k.sort(function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort}),a=0;a<k.length;a++){k[a].forEach(function(t,e){t._preSort=e}),k[a].sort(E);var C=k[a][0].trace,I=null;for(o=0;o<k[a].length;o++){var L=k[a][o].trace.legendgrouptitle;if(L&&L.text){I=L,s&&(L.font=e._groupTitleFont);break}}if(u&&k[a].reverse(),I){var P=!1;for(o=0;o<k[a].length;o++)if(r.traceIs(k[a][o].trace,"pie-like")){P=!0;break}k[a].unshift({i:-1,groupTitle:I,noClick:P,trace:{showlegend:C.showlegend,legendgroup:C.legendgroup,visible:"toggleitem"===e.groupclick||C.visible}})}for(o=0;o<k[a].length;o++)k[a][o]=[k[a][o]]}return e._lgroupsLength=k.length,e._maxNameLength=m,k}}),xr=f(t=>{var e=oe();function r(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}t.formatPiePercent=function(t,n){var i=r((100*t).toPrecision(3));return e.numSeparate(i,n)+"%"},t.formatPieValue=function(t,n){var i=r(t.toPrecision(10));return e.numSeparate(i,n)},t.getFirstFilled=function(t,r){if(e.isArrayOrTypedArray(t))for(var n=0;n<r.length;n++){var i=t[r[n]];if(i||0===i||""===i)return i}},t.castOption=function(r,n){return e.isArrayOrTypedArray(r)?t.getFirstFilled(r,n):r||void 0},t.getRotationAngle=function(t){return("auto"===t?0:t)*Math.PI/180}}),_r=f((t,e)=>{var r=Je(),n=q();e.exports=function(t,e,i,a){var o=i.marker.pattern;o&&o.shape?r.pointStyle(t,i,a,e):n.fill(t,e.color)}}),br=f((t,e)=>{var r=q(),n=xr().castOption,i=_r();e.exports=function(t,e,a,o){var s=a.marker.line,l=n(s.color,e.pts)||r.defaultLine,u=n(s.width,e.pts)||0;t.call(i,e,a,o).style("stroke-width",u).call(r.stroke,l)}}),wr=f((t,e)=>{var r=v(),n=Ut(),i=oe(),a=i.strTranslate,o=Je(),s=q(),l=Me().extractOpts,u=Ze(),c=br(),h=xr().castOption,f=yr();function p(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}function d(t){var e=t[0].trace,r=e.contours,n=u.hasLines(e),i=u.hasMarkers(e),a=e.visible&&e.fill&&"none"!==e.fill,o=!1,s=!1;if(r){var l=r.coloring;"lines"===l?o=!0:n="none"===l||"heatmap"===l||r.showlines,"constraint"===r.type?a="="!==r._operation:("fill"===l||"heatmap"===l)&&(s=!0)}return{showMarker:i,showLine:n,showFill:a,showGradientLine:o,showGradientFill:s,anyLine:n||o,anyFill:a||s}}function m(t,e,r){return t&&i.isArrayOrTypedArray(t)?e:t>r?r:t}e.exports=function(t,e,g){var y=e._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,_=(x+2*f.itemGap)/2,b=a(_,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function T(t,i,a){var u=t[0].trace,c=u.marker||{},h=c.line||{},f=c.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",p=a?u.visible&&u.type===a:n.traceIs(u,"bar"),d=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(p?[t]:[]);d.enter().append("path").classed("legend"+a,!0).attr("d",f).attr("transform",b),d.exit().remove(),d.each(function(t){var n=r.select(this),i=t[0],a=w(i.mlw,c.line,5,2);n.style("stroke-width",a+"px");var f=i.mcc;if(!g._inHover&&"mc"in i){var p=l(c),d=p.mid;void 0===d&&(d=(p.max+p.min)/2),f=o.tryColorscale(c,"")(d)}var y=f||i.mc||c.color,v=c.pattern,x=o.getPatternAttr,_=v&&(x(v.shape,0,"")||x(v.path,0,""));if(_){var b=x(v.bgcolor,0,null),T=x(v.fgcolor,0,null),k=v.fgopacity,A=m(v.size,8,10),M=m(v.solidity,.5,1),S="legend-"+u.uid;n.call(o.pattern,"legend",e,S,_,A,M,f,v.fillmode,b,T,k)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)})}function k(t,a,o){var s=t[0],l=s.trace,u=o?l.visible&&l.type===o:n.traceIs(l,o),f=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(u?[t]:[]);if(f.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),f.exit().remove(),f.size()){var p=l.marker||{},d=w(h(p.line.width,s.pts),p.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:d}}},m),y=i.minExtend(s,{trace:g},m);c(f,y,g,e)}}t.each(function(t){var e=r.select(this),n=i.ensureSingle(e,"g","layers");n.style("opacity",t[0].trace.opacity);var o=g.indentation,s=g.valign,l=t[0].lineHeight,u=t[0].height;if("middle"===s&&0===o||!l||!u)n.attr("transform",null);else{var c={top:1,bottom:-1}[s]*(.5*(l-u+3))||0,h=g.indentation;n.attr("transform",a(h,c))}n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=n.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var n,a=t[0].trace,u=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":u=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],n=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],n=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],n=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var c=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),c.exit().remove(),c.each(function(t,u){var c,h=r.select(this),f=l(a),d=f.colorscale,m=f.reversescale;if(d){if(!n){var g=d.length;c=0===u?d[m?g-1:0][1]:1===u?d[m?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(y)?y[u]||y[0]:y}h.attr("d",t[0]),c?h.call(s.fill,c):h.call(function(t){if(t.size()){var r="legendfill-"+a.uid;o.gradient(t,e,r,p(m,"radial"===n),d,"fill")}})})}).each(function(t){var e=t[0].trace,n="waterfall"===e.type;if(t[0]._distinct&&n){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&n&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each(function(t){var n=r.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)})}).each(function(t){T(t,this,"funnel")}).each(function(t){T(t,this)}).each(function(t){var a=t[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),l.exit().remove(),l.each(function(){var t=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);t.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(t,a.line.color)}else{var u=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}})}).each(function(t){k(t,this,"funnelarea")}).each(function(t){k(t,this,"pie")}).each(function(t){var n,a,s=d(t),c=s.showFill,h=s.showLine,f=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=t[0],_=v.trace,b=l(_),T=b.colorscale,k=b.reversescale,A=u.hasMarkers(_)||!g?"M5,0":y?"M5,-2":"M5,-3",M=r.select(this),S=M.select(".legendfill").selectAll("path").data(c||m?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+x+"v6h-"+x+"z").call(function(t){if(t.size())if(c)o.fillGroupStyle(t,e,!0);else{var r="legendfill-"+_.uid;o.gradient(t,e,r,p(k),T,"fill")}}),h||f){var E=w(void 0,_.line,10,5);a=i.minExtend(_,{line:{width:E}}),n=[i.minExtend(v,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(h||f?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",A+(f?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+_.uid;o.lineGroupStyle(t),o.gradient(t,e,r,p(k),T,"stroke")}})}).each(function(t){var n,a,s=d(t),l=s.anyFill,c=s.anyLine,h=s.showLine,f=s.showMarker,p=t[0],m=p.trace,g=!f&&!c&&!l&&u.hasText(m);function y(t,e,r,n){var a=i.nestedProperty(m,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(f||g||h){var _={},w={};if(f){_.mc=y("marker.color",x),_.mx=y("marker.symbol",x),_.mo=y("marker.opacity",i.mean,[.2,1]),_.mlc=y("marker.line.color",x),_.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=y("marker.size",i.mean,[2,16],12);_.ms=T,w.marker.size=T}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(_.tx="Aa",_.tp=y("textposition",x),_.ts=10,_.tc=y("textfont.color",x),_.tf=y("textfont.family",x),_.tw=y("textfont.weight",x),_.ty=y("textfont.style",x),_.tv=y("textfont.variant",x),_.tC=y("textfont.textcase",x),_.tE=y("textfont.lineposition",x),_.tS=y("textfont.shadow",x)),n=[i.minExtend(p,_)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var k=r.select(this).select("g.legendpoints"),A=k.selectAll("path.scatterpts").data(f?n:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),A.exit().remove(),A.call(o.pointStyle,a,e),f&&(n[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?n:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),M.exit().remove(),M.selectAll("text").call(o.textPointStyle,a,e)}).each(function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each(function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)})}).each(function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each(function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)})})}}),Tr=f((t,e)=>{var r=v(),n=oe(),i=we(),a=Ut(),o=he(),s=cr(),l=Je(),u=q(),c=Ae(),h=gr(),f=yr(),p=ke(),d=p.LINE_SPACING,m=p.FROM_TL,g=p.FROM_BR,y=vr(),x=wr(),_=dr(),b=/^legend[0-9]*$/;function w(t,e){var o,h,p=e||{},v=t._fullLayout,b=L(p),w=p._inHover;if(w?(h=p.layer,o="hover"):(h=v._infolayer,o=b),h){var M;if(o+=v._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),w){if(!p.entries)return;M=y(p.entries,p)}else{for(var P=(t.calcdata||[]).slice(),z=v.shapes,O=0;O<z.length;O++){var D=z[O];if(D.showlegend){var R={_isShape:!0,_fullInput:D,index:D._index,name:D.name||D.label.text||"shape "+D._index,legend:D.legend,legendgroup:D.legendgroup,legendgrouptitle:D.legendgrouptitle,legendrank:D.legendrank,legendwidth:D.legendwidth,showlegend:D.showlegend,visible:D.visible,opacity:D.opacity,mode:"line"===D.type?"lines":"markers",line:D.line,marker:{line:D.line,color:D.fillcolor,size:12,symbol:"rect"===D.type?"square":"circle"===D.type?"circle":"hexagon2"}};P.push([{trace:R}])}}M=v.showlegend&&y(P,p,v._legends.length>1)}var F=v.hiddenlabels||[];if(!(w||v.showlegend&&M.length))return h.selectAll("."+b).remove(),v._topdefs.select("#"+o).remove(),i.autoMargin(t,b);var B=n.ensureSingle(h,"g",b,function(t){w||t.attr("pointer-events","all")}),N=n.ensureSingleById(v._topdefs,"clipPath",o,function(t){t.append("rect")}),j=n.ensureSingle(B,"rect","bg",function(t){t.attr("shape-rendering","crispEdges")});j.call(u.stroke,p.bordercolor).call(u.fill,p.bgcolor).style("stroke-width",p.borderwidth+"px");var U,V=n.ensureSingle(B,"g","scrollbox"),q=p.title;p._titleWidth=0,p._titleHeight=0,q.text?((U=n.ensureSingle(V,"text",b+"titletext")).attr("text-anchor","start").call(l.font,q.font).text(q.text),E(U,V,t,p,1)):V.selectAll("."+b+"titletext").remove();var H=n.ensureSingle(B,"rect","scrollbar",function(t){t.attr(f.scrollBarEnterAttrs).call(u.fill,f.scrollBarColor)}),G=V.selectAll("g.groups").data(M);G.enter().append("g").attr("class","groups"),G.exit().remove();var Z=G.selectAll("g.traces").data(n.identity);Z.enter().append("g").attr("class","traces"),Z.exit().remove(),Z.style("opacity",function(t){var e=t[0].trace;return a.traceIs(e,"pie-like")?-1!==F.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){r.select(this).call(A,t,p)}).call(x,t,p).each(function(){w||r.select(this).call(S,t,b)}),n.syncOrAsync([i.previousPromises,function(){return function(t,e,n,i){var a=t._fullLayout,o=L(i);i||(i=a[o]);var s=a._size,u=_.isVertical(i),c=_.isGrouped(i),h="fraction"===i.entrywidthmode,p=i.borderwidth,d=2*p,m=f.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(p+m),v=I(i),x=i.y<0||0===i.y&&"top"===v,b=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,k={};let{orientation:A,yref:M}=i,{maxheight:S}=i,E=x||b||"v"!==A||"paper"!==M;S||(S=E?.5:1);let P=E?a.height:s.h;i._maxHeight=Math.max(S>1?S:S*P,30);var z=0;i._width=0,i._height=0;var O=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(u)n.each(function(t){var e=t[0].height;l.setTranslate(this,p+O[0],p+O[1]+i._height+e/2+m),i._height+=e,i._width=Math.max(i._width,t[0].width)}),z=g+i._width,i._width+=m+g+d,i._height+=y,c&&(e.each(function(t,e){l.setTranslate(this,0,e*i.tracegroupgap)}),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var D=C(i),R=i.x<0||0===i.x&&"right"===D,F=i.x>1||1===i.x&&"left"===D,B=b||x,N=a.width/2;i._maxWidth=Math.max(R?B&&"left"===D?s.l+s.w:N:F?B&&"right"===D?s.r+s.w:N:s.w,2*g);var j=0,U=0;n.each(function(t){var e=T(t,i,g);j=Math.max(j,e),U+=e}),z=null;var V=0;if(c){var q=0,H=0,G=0;e.each(function(){var t=0,e=0;r.select(this).selectAll("g.traces").each(function(r){var n=T(r,i,g),a=r[0].height;l.setTranslate(this,O[0],O[1]+p+m+a/2+e),e+=a,t=Math.max(t,n),k[r[0].trace.legendgroup]=t});var n=t+m;H>0&&n+p+H>i._maxWidth?(V=Math.max(V,H),H=0,G+=q+w,q=e):q=Math.max(q,e),l.setTranslate(this,H,G),H+=n}),i._width=Math.max(V,H)+p,i._height=G+q+y}else{var Z=n.size(),W=U+d+(Z-1)*m<i._maxWidth,Y=0,X=0,$=0,J=0;n.each(function(t){var e=t[0].height,r=T(t,i,g),n=W?r:j;h||(n+=m),n+p+X-m>=i._maxWidth&&(V=Math.max(V,J),X=0,$+=Y,i._height+=Y,Y=0),l.setTranslate(this,O[0]+p+X,O[1]+p+$+e/2+m),J=X+r+m,X+=n,Y=Math.max(Y,e)}),W?(i._width=X+d,i._height=Y+y):(i._width=Math.max(V,J)+d,i._height+=Y+y)}}i._width=Math.ceil(Math.max(i._width+O[0],i._titleWidth+2*(p+f.titlePad))),i._height=Math.ceil(Math.max(i._height+O[1],i._titleHeight+2*(p+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var K=t._context.edits,Q=K.legendText||K.legendPosition;n.each(function(t){var e=r.select(this).select("."+o+"toggle"),n=t[0].height,a=t[0].trace.legendgroup,s=T(t,i,g);c&&""!==a&&(s=k[a]);var f=Q?g:z||s;!u&&!h&&(f+=m/2),l.setRect(e,0,-n/2,f,n)})}(t,G,Z,p)},function(){var e,u,y,x,_=v._size,T=p.borderwidth,A="paper"===p.xref,M="paper"===p.yref;if(q.text&&function(t,e,r){if("top center"===e.title.side||"top right"===e.title.side){var n=e.title.font.size*d,i=0,a=t.node(),o=l.bBox(a).width;"top center"===e.title.side?i=.5*(e._width-2*r-2*f.titlePad-o):"top right"===e.title.side&&(i=e._width-2*r-2*f.titlePad-o),c.positionText(t,r+f.titlePad+i,r+n)}}(U,p,T),!w){var S,E;S=A?_.l+_.w*p.x-m[C(p)]*p._width:v.width*p.x-m[C(p)]*p._width,E=M?_.t+_.h*(1-p.y)-m[I(p)]*p._effHeight:v.height*(1-p.y)-m[I(p)]*p._effHeight;var L=function(t,e,r,n){var a=t._fullLayout,o=a[e],s=C(o),l=I(o),u="paper"===o.xref,c="paper"===o.yref;t._fullLayout._reservedMargin[e]={};var h=o.y<.5?"b":"t",f=o.x<.5?"l":"r",p={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(u&&c)return i.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});u?t._fullLayout._reservedMargin[e][h]=p[h]:c||"v"===o.orientation?t._fullLayout._reservedMargin[e][f]=p[f]:t._fullLayout._reservedMargin[e][h]=p[h]}(t,b,S,E);if(L)return;if(v.margin.autoexpand){var P=S,z=E;S=A?n.constrain(S,0,v.width-p._width):P,E=M?n.constrain(E,0,v.height-p._effHeight):z,S!==P&&n.log("Constrain "+b+".x to make legend fit inside graph"),E!==z&&n.log("Constrain "+b+".y to make legend fit inside graph")}l.setTranslate(B,S,E)}if(H.on(".drag",null),B.on("wheel",null),w||p._height<=p._maxHeight||t._context.staticPlot){var O=p._effHeight;w&&(O=p._height),j.attr({width:p._width-T,height:O-T,x:T/2,y:T/2}),l.setTranslate(V,0,0),N.select("rect").attr({width:p._width-2*T,height:O-2*T,x:T,y:T}),l.setClipUrl(V,o,t),l.setRect(H,0,0,0,0),delete p._scrollY}else{var D=Math.max(f.scrollBarMinHeight,p._effHeight*p._effHeight/p._height),R=p._effHeight-D-2*f.scrollBarMargin,F=p._height-p._effHeight,G=R/F,Z=Math.min(p._scrollY||0,F);j.attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-T,x:T/2,y:T/2}),N.select("rect").attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-2*T,x:T,y:T+Z}),l.setClipUrl(V,o,t),K(Z,D,G),B.on("wheel",function(){K(Z=n.constrain(p._scrollY+r.event.deltaY/R*F,0,F),D,G),0!==Z&&Z!==F&&r.event.preventDefault()});var W,Y,X,$=r.behavior.drag().on("dragstart",function(){var t=r.event.sourceEvent;W="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,X=Z}).on("drag",function(){var t=r.event.sourceEvent;2===t.buttons||t.ctrlKey||(Y="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Z=function(t,e,r){var i=(r-e)/G+t;return n.constrain(i,0,F)}(X,W,Y),K(Z,D,G))});H.call($);var J=r.behavior.drag().on("dragstart",function(){var t=r.event.sourceEvent;"touchstart"===t.type&&(W=t.changedTouches[0].clientY,X=Z)}).on("drag",function(){var t=r.event.sourceEvent;"touchmove"===t.type&&(Y=t.changedTouches[0].clientY,Z=function(t,e,r){var i=(e-r)/G+t;return n.constrain(i,0,F)}(X,W,Y),K(Z,D,G))});V.call(J)}function K(e,r,n){p._scrollY=t._fullLayout[b]._scrollY=e,l.setTranslate(V,0,-e),l.setRect(H,p._width,f.scrollBarMargin+e*n,f.scrollBarWidth,r),N.select("rect").attr("y",T+e)}t._context.edits.legendPosition&&(B.classed("cursor-move",!0),s.init({element:B.node(),gd:t,prepFn:function(t){if(t.target!==H.node()){var e=l.getTranslate(B);y=e.x,x=e.y}},moveFn:function(t,r){if(void 0!==y&&void 0!==x){var n=y+t,i=x+r;l.setTranslate(B,n,i),e=s.align(n,p._width,_.l,_.l+_.w,p.xanchor),u=s.align(i+p._height,-p._height,_.t+_.h,_.t,p.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==u){var r={};r[b+".x"]=e,r[b+".y"]=u,a.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=h.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom});n.size()>0&&k(t,B,n,e,r)}}))}],t)}}function T(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function k(t,e,r,n,i){var s=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:s.index,expandedIndex:s.index,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};s._group&&(l.group=s._group),a.traceIs(s,"pie-like")&&(l.label=r.datum()[0].label);var u=o.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===u)return;e._clickTimeout=setTimeout(function(){t._fullLayout&&h(r,t,n)},t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==o.triggerHandler(t,"plotly_legenddoubleclick",l)&&!1!==u&&h(r,t,n))}function A(t,e,r){var i,o,s=L(r),u=t.data()[0][0],h=u.trace,p=a.traceIs(h,"pie-like"),d=!r._inHover&&e._context.edits.legendText&&!p,m=r._maxNameLength;u.groupTitle?(i=u.groupTitle.text,o=u.groupTitle.font):(o=r.font,r.entries?i=u.text:(i=p?u.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(d?M(i,m):i);var y=r.indentation+r.itemwidth+2*f.itemGap;c.positionText(g,y,0),d?g.call(c.makeEditable,{gd:e,text:i}).call(E,t,e,r).on("edit",function(n){this.text(M(n,m)).call(E,t,e,r);var i=u.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",e,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",e,o,h.index)}):E(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e,i){var a,o=e._context.doubleClickDelay,s=1,l=n.ensureSingle(t,"rect",i+"toggle",function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")});e._context.staticPlot||(l.on("mousedown",function(){(a=(new Date).getTime())-e._legendMouseDownTime<o?s+=1:(s=1,e._legendMouseDownTime=a)}),l.on("mouseup",function(){if(!e._dragged&&!e._editing){var n=e._fullLayout[i];(new Date).getTime()-e._legendMouseDownTime>o&&(s=Math.max(s-1,1)),k(e,n,t,s,r.event)}}))}function E(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),c.convertToTspans(t,r,function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select("g[class*=math-group]"),o=a.node(),s=L(r);r||(r=e._fullLayout[s]);var u,h,p=r.borderwidth,m=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*d;if(o){var g=l.bBox(o);u=g.height,h=g.width,1===n?l.setTranslate(a,p,p+.75*u):l.setTranslate(a,0,.25*u)}else{var y="."+s+(1===n?"title":"")+"text",v=t.select(y),x=c.lineCount(v),_=v.node();if(u=m*x,h=_?l.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),c.positionText(v,p+f.titlePad,p+m);else{var b=2*f.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(b=f.itemGap,h-=r.indentation+r.itemwidth),c.positionText(v,b,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=m,i.height=Math.max(u,16)+3,i.width=h)}else t.remove()}(e,r,n,i)})}function C(t){return n.isRightAnchor(t)?"right":n.isCenterAnchor(t)?"center":"left"}function I(t){return n.isBottomAnchor(t)?"bottom":n.isMiddleAnchor(t)?"middle":"top"}function L(t){return t._id||"legend"}e.exports=function(t,e){if(e)w(t,e);else{var n=t._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each(function(){var t=r.select(this),e=t.attr("class").split(" ")[0];e.match(b)&&-1===i.indexOf(e)&&t.remove()});for(var a=0;a<i.length;a++){var o=i[a];w(t,t._fullLayout[o])}}}}),kr=f(t=>{var e=v(),r=T(),n=O(),i=oe(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,l=he(),u=Ae(),c=fr(),h=Je(),f=q(),p=cr(),d=rr(),m=ge().zindexSeparator,g=Ut(),y=Ye(),x=F(),_=mr(),b=Tr(),w=x.YANGLE,k=Math.PI*w/180,A=1/Math.sin(k),M=Math.cos(k),S=Math.sin(k),E=x.HOVERARROWSIZE,C=x.HOVERTEXTPAD,I={box:!0,ohlc:!0,violin:!0,candlestick:!0},L={scatter:!0,scattergl:!0,splom:!0};function P(t,e){return t.distance-e.distance}function z(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa?t.xa._id:"",t.ya?t.ya._id:""].join(",")}t.hover=function(t,n,o,s){t=i.getGraphDiv(t);var u=n.target;i.throttle(t._fullLayout._uid+x.HOVERID,x.HOVERMINTIME,function(){!function(t,n,o,s,u){o||(o="xy"),"string"==typeof o&&(o=o.split(m)[0]);var h,v,x,_=Array.isArray(o)?o:[o],b=t._fullLayout,w=b.hoversubplots,T=b._plots||[],k=T[o],M=b._has("cartesian"),S=n.hovermode||b.hovermode,C="x"===(S||"").charAt(0),O="y"===(S||"").charAt(0);if(M&&(C||O)&&"axis"===w)for(var D=_.length,F=0;F<D;F++)if(T[h=_[F]]){v=d.getFromId(t,h,"x"),x=d.getFromId(t,h,"y");var B=(C?v:x)._subplotsWith;if(B&&B.length)for(var q=0;q<B.length;q++)a(_,B[q])}if(k&&"single"!==w){var H=k.overlays.map(function(t){return t.id});_=_.concat(H)}for(var Y=_.length,X=new Array(Y),$=new Array(Y),J=!1,K=0;K<Y;K++)if(h=_[K],T[h])J=!0,X[K]=T[h].xaxis,$[K]=T[h].yaxis;else{if(!b[h]||!b[h]._subplot)return void i.warn("Unrecognized subplot: "+h);var Q=b[h]._subplot;X[K]=Q.xaxis,$[K]=Q.yaxis}if(S&&!J&&(S="closest"),-1===["x","y","closest","x unified","y unified"].indexOf(S)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return p.unhoverRaw(t,n);var tt=b.hoverdistance;-1===tt&&(tt=1/0);var et=b.spikedistance;-1===et&&(et=1/0);var rt,nt,it,at,ot,st,lt,ut,ct,ht,ft,pt,dt,mt=[],gt=[],yt={hLinePoint:null,vLinePoint:null},vt=!1;if(Array.isArray(n))for(S="array",it=0;it<n.length;it++)(ot=t.calcdata[n[it].curveNumber||0])&&(st=ot[0].trace,"skip"!==ot[0].trace.hoverinfo&&(gt.push(ot),"h"===st.orientation&&(vt=!0)));else{var xt,_t,bt=t.calcdata.slice();for(bt.sort(function(t,e){return(t[0].trace.zorder||0)-(e[0].trace.zorder||0)}),at=0;at<bt.length;at++)ot=bt[at],"skip"!==(st=ot[0].trace).hoverinfo&&y.isTraceInSubplots(st,_)&&(gt.push(ot),"h"===st.orientation&&(vt=!0));if(u){if(!1===l.triggerHandler(t,"plotly_beforehover",n))return;var wt=u.getBoundingClientRect();xt=n.clientX-wt.left,_t=n.clientY-wt.top,b._calcInverseTransform(t);var Tt=i.apply3DTransform(b._invTransform)(xt,_t);if(xt=Tt[0],_t=Tt[1],xt<0||xt>X[0]._length||_t<0||_t>$[0]._length)return p.unhoverRaw(t,n)}else xt="xpx"in n?n.xpx:X[0]._length/2,_t="ypx"in n?n.ypx:$[0]._length/2;if(n.pointerX=xt+X[0]._offset,n.pointerY=_t+$[0]._offset,rt="xval"in n?y.flat(_,n.xval):y.p2c(X,xt),nt="yval"in n?y.flat(_,n.yval):y.p2c($,_t),!r(rt[0])||!r(nt[0]))return i.warn("Fx.hover failed",n,t),p.unhoverRaw(t,n)}var kt=1/0;function At(e,a){for(at=0;at<gt.length;at++)if((ot=gt[at])&&ot[0]&&ot[0].trace&&!0===(st=ot[0].trace).visible&&0!==st._length&&-1===["carpet","contourcarpet"].indexOf(st._module.name)){if(ct=S,y.isUnifiedHover(ct)&&(ct=ct.charAt(0)),"splom"===st.type?lt=_[ut=0]:(lt=y.getSubplot(st),ut=_.indexOf(lt)),pt={cd:ot,trace:st,xa:X[ut],ya:$[ut],maxHoverDistance:tt,maxSpikeDistance:et,index:!1,distance:Math.min(kt,tt),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:st.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},b[lt]&&(pt.subplot=b[lt]._subplot),b._splomScenes&&b._splomScenes[st.uid]&&(pt.scene=b._splomScenes[st.uid]),"array"===ct){var o=n[at];"pointNumber"in o?(pt.index=o.pointNumber,ct="closest"):(ct="","xval"in o&&(ht=o.xval,ct="x"),"yval"in o&&(ft=o.yval,ct=ct?"closest":"y"))}else void 0!==e&&void 0!==a?(ht=e,ft=a):(ht=rt[ut],ft=nt[ut]);if(dt=mt.length,0!==tt)if(st._module&&st._module.hoverPoints){var s=st._module.hoverPoints(pt,ht,ft,ct,{finiteRange:!0,hoverLayer:b._hoverlayer,hoversubplots:w,gd:t});if(s)for(var l,u=0;u<s.length;u++)l=s[u],r(l.x0)&&r(l.y0)&&mt.push(U(l,S))}else i.log("Unrecognized trace type in hover:",st);if("closest"===S&&mt.length>dt&&(mt.splice(0,dt),kt=mt[0].distance),M&&0!==et&&0===mt.length){pt.distance=et,pt.index=!1;var c=st._module.hoverPoints(pt,ht,ft,"closest",{hoverLayer:b._hoverlayer});if(c&&(c=c.filter(function(t){return t.spikeDistance<=et})),c&&c.length){var h,p=c.filter(function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap});if(p.length){var d=p[0];r(d.x0)&&r(d.y0)&&(h=St(d),(!yt.vLinePoint||yt.vLinePoint.spikeDistance>h.spikeDistance)&&(yt.vLinePoint=h))}var m=c.filter(function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap});if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=St(g),(!yt.hLinePoint||yt.hLinePoint.spikeDistance>h.spikeDistance)&&(yt.hLinePoint=h))}}}}}function Mt(t,e,r){for(var n,i=null,a=1/0,o=0;o<t.length;o++)v&&v._id!==t[o].xa._id||x&&x._id!==t[o].ya._id||(n=t[o].spikeDistance,r&&0===o&&(n=-1/0),n<=a&&n<=e&&(i=t[o],a=n));return i}function St(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}At();var Et={fullLayout:b,container:b._hoverlayer,event:n};t._spikepoints;var Ct={vLinePoint:yt.vLinePoint,hLinePoint:yt.hLinePoint};t._spikepoints=Ct;var It=function(){var t=mt.filter(function(t){return v&&v._id===t.xa._id&&x&&x._id===t.ya._id}),e=mt.filter(function(t){return!(v&&v._id===t.xa._id&&x&&x._id===t.ya._id)});t.sort(P),e.sort(P),mt=function(t,e){for(var r=e.charAt(0),n=[],i=[],a=[],o=0;o<t.length;o++){var s=t[o];g.traceIs(s.trace,"bar-like")||g.traceIs(s.trace,"box-violin")?a.push(s):s.trace[r+"period"]?i.push(s):n.push(s)}return n.concat(i).concat(a)}(mt=t.concat(e),S)};It();var Lt=S.charAt(0),Pt=("x"===Lt||"y"===Lt)&&mt[0]&&L[mt[0].trace.type];if(M&&0!==et&&0!==mt.length){var zt=Mt(mt.filter(function(t){return t.ya.showspikes}),et,Pt);yt.hLinePoint=St(zt);var Ot=Mt(mt.filter(function(t){return t.xa.showspikes}),et,Pt);yt.vLinePoint=St(Ot)}if(0===mt.length){var Dt=p.unhoverRaw(t,n);return M&&(null!==yt.hLinePoint||null!==yt.vLinePoint)&&V(t,yt,Et),Dt}if(M&&V(t,yt,Et),y.isXYhover(ct)&&0!==mt[0].length&&"splom"!==mt[0].trace.type){var Rt=mt[0],Ft=(mt=I[Rt.trace.type]?mt.filter(function(t){return t.trace.index===Rt.trace.index}):[Rt]).length;At(G("x",Rt,b),G("y",Rt,b));var Bt,Nt=[],jt={},Ut=0,Vt=function(t){var e=I[t.trace.type]?z(t):t.trace.index;if(jt[e]){var r=jt[e]-1,n=Nt[r];r>0&&Math.abs(t.distance)<Math.abs(n.distance)&&(Nt[r]=t)}else Ut++,jt[e]=Ut,Nt.push(t)};for(Bt=0;Bt<Ft;Bt++)Vt(mt[Bt]);for(Bt=mt.length-1;Bt>Ft-1;Bt--)Vt(mt[Bt]);mt=Nt,It()}var qt=t._hoverdata,Ht=[],Gt=Z(t),Zt=W(t);for(it=0;it<mt.length;it++){var Wt=mt[it],Yt=y.makeEventData(Wt,Wt.trace,Wt.cd);if(!1!==Wt.hovertemplate){var Xt=!1;Wt.cd[Wt.index]&&Wt.cd[Wt.index].ht&&(Xt=Wt.cd[Wt.index].ht),Wt.hovertemplate=Xt||Wt.trace.hovertemplate||!1}if(Wt.xa&&Wt.ya){var $t=Wt.x0+Wt.xa._offset,Jt=Wt.x1+Wt.xa._offset,Kt=Wt.y0+Wt.ya._offset,Qt=Wt.y1+Wt.ya._offset,te=Math.min($t,Jt),ee=Math.max($t,Jt),re=Math.min(Kt,Qt),ne=Math.max(Kt,Qt);Yt.bbox={x0:te+Zt,x1:ee+Zt,y0:re+Gt,y1:ne+Gt}}Wt.eventData=[Yt],Ht.push(Yt)}t._hoverdata=Ht;var ie="y"===S&&(gt.length>1||mt.length>1)||"closest"===S&&vt&&mt.length>1,ae=f.combine(b.plot_bgcolor||f.background,b.paper_bgcolor),oe=R(mt,{gd:t,hovermode:S,rotateLabels:ie,bgColor:ae,container:b._hoverlayer,outerContainer:b._paper.node(),commonLabelOpts:b.hoverlabel,hoverdistance:b.hoverdistance}),se=oe.hoverLabels;if(y.isUnifiedHover(S)||(function(t,e,r,n){var i,a,o,s,l,u,c,h=e?"xa":"ya",f=e?"ya":"xa",p=0,d=1,m=t.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,_=n.minY,b=n.maxY,w=function(t){return t*r._invScaleX},T=function(t){return t*r._invScaleY};function k(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;s<t.length;s++)(u=t[s]).pos+u.dp+u.size>e.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(u=t[s]).pos>e.pmax-1&&(u.del=!0,n--);for(s=0;s<t.length&&!(n<=0);s++)if((u=t[s]).pos<e.pmin+1)for(u.del=!0,n--,o=2*u.size,l=t.length-1;l>=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(u=t[s]).pos+u.dp+u.size>e.pmax&&(u.del=!0,n--)}}}for(t.each(function(t){var n=t[h],i=t[f],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(d=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var u,c,p=N(t,e),m=t.anchor,k="end"===m?-1:1;if("middle"===m)c=(u=t.crossPos+(a?T(p.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?T(t.by):w(t.bx));else if(a)c=(u=t.crossPos+T(E+p.y)-T(t.by/2-E))+T(t.by);else{var M=w(k*E+p.x),S=M+w(k*t.bx);u=t.crossPos+Math.min(M,S),c=t.crossPos+Math.max(M,S)}a?void 0!==_&&void 0!==b&&Math.min(c,b)-Math.max(u,_)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(c,x)-Math.max(u,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:s,pmax:l}]}),g.sort(function(t,e){return t[0].posref-e[0].posref||d*(e[0].traceIndex-t[0].traceIndex)});!i&&p<=m;){for(p++,i=!0,s=0;s<g.length-1;){var M=g[s],S=g[s+1],C=M[M.length-1],I=S[0];if((a=C.pos+C.dp+C.size-I.pos-I.dp+I.size)>.01){for(l=S.length-1;l>=0;l--)S[l].dp+=a;for(M.push.apply(M,S),g.splice(s+1,1),c=0,l=M.length-1;l>=0;l--)c+=M[l].dp;for(o=c/M.length,l=M.length-1;l>=0;l--)M[l].dp-=o;i=!1}else s++}g.forEach(k)}for(s=g.length-1;s>=0;s--){var L=g[s];for(l=L.length-1;l>=0;l--){var P=L[l],z=P.datum;z.offset=P.dp,z.del=P.del}}}(se,ie,b,oe.commonLabelBoundingBox),j(se,ie,b._invScaleX,b._invScaleY)),u&&u.tagName){var le=g.getComponentMethod("annotations","hasClickToShow")(t,Ht);c(e.select(u),le?"pointer":"")}!u||s||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers)||i.binNumber!==a.binNumber)return!0}return!1}(t,0,qt)||(qt&&t.emit("plotly_unhover",{event:n,points:qt}),t.emit("plotly_hover",{event:n,points:t._hoverdata,xaxes:X,yaxes:$,xvals:rt,yvals:nt}))}(t,n,o,s,u)})},t.loneHover=function(t,r){var n=!0;Array.isArray(t)||(n=!1,t=[t]);var i=r.gd,a=Z(i),o=W(i),s=!1,l=R(t.map(function(t){var e=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(e,n),h=Math.max(e,n),p=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;c+=v,h+=v,p+=x,d+=x}u.bbox={x0:c+o,x1:h+o,y0:p+a,y1:d+a},r.inOut_bbox&&r.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}}),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||f.background,container:e.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,u=0,c=0;return l.sort(function(t,e){return t.y0-e.y0}).each(function(t,e){var n=t.y0-t.by/2;t.offset=n-5<u?u-n+5:0,u=n+t.by+t.offset,e===r.anchorIndex&&(c=t.offset)}).each(function(t){t.offset-=c}),j(l,s,i._fullLayout._invScaleX,i._fullLayout._invScaleY),n?l:l.node()};var D=/<extra>([\s\S]*)<\/extra>/;function R(t,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,c=r.rotateLabels,p=r.bgColor,d=r.container,m=r.outerContainer,v=r.commonLabelOpts||{};if(0===t.length)return[[]];var T=r.fontFamily||x.HOVERFONT,k=r.fontSize||x.HOVERFONTSIZE,A=r.fontWeight||a.font.weight,M=r.fontStyle||a.font.style,S=r.fontVariant||a.font.variant,I=r.fontTextcase||a.font.textcase,L=r.fontLineposition||a.font.lineposition,P=r.fontShadow||a.font.shadow,O=t[0],D=O.xa,R=O.ya,F=l.charAt(0),N=F+"Label",j=O[N];if(void 0===j&&"multicategory"===D.type)for(var U=0;U<t.length&&void 0===(j=t[U][N]);U++);var V=Y(n,m),q=V.top,H=V.width,G=V.height,Z=void 0!==j&&O.distance<=r.hoverdistance&&("x"===l||"y"===l);if(Z){var W,X,$=!0;for(W=0;W<t.length;W++)if($&&void 0===t[W].zLabel&&($=!1),X=t[W].hoverinfo||t[W].trace.hoverinfo){var J=Array.isArray(X)?X:X.split("+");if(-1===J.indexOf("all")&&-1===J.indexOf(l)){Z=!1;break}}$&&(Z=!1)}var K=d.selectAll("g.axistext").data(Z?[0]:[]);K.enter().append("g").classed("axistext",!0),K.exit().remove();var Q={minX:0,maxX:0,minY:0,maxY:0};if(K.each(function(){var t=e.select(this),r=i.ensureSingle(t,"path","",function(t){t.style({"stroke-width":"1px"})}),s=i.ensureSingle(t,"text","",function(t){t.attr("data-notex",1)}),c=v.bgcolor||f.defaultLine,p=v.bordercolor||f.contrast(c),d=f.contrast(c),m=v.font,g={weight:m.weight||A,style:m.style||M,variant:m.variant||S,textcase:m.textcase||I,lineposition:m.lineposition||L,shadow:m.shadow||P,family:m.family||T,size:m.size||k,color:m.color||d};r.style({fill:c,stroke:p}),s.text(j).call(h.font,g).call(u.positionText,0,0).call(u.convertToTspans,n),t.attr("transform","");var y,x,_=Y(n,s.node());if("x"===l){var b="top"===D.side?"-":"";s.attr("text-anchor","middle").call(u.positionText,0,"top"===D.side?q-_.bottom-E-C:q-_.top+E+C),y=D._offset+(O.x0+O.x1)/2,x=R._offset+("top"===D.side?0:R._length);var w=_.width/2+C,z=y;y<w?z=w:y>a.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+E)+","+b+E+"H"+w+"v"+b+(2*C+_.height)+"H"+-w+"V"+b+E+"H"+(y-z-E)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===D.side?(Q.minY=x-(2*C+_.height),Q.maxY=x-C):(Q.minY=x+C,Q.maxY=x+(2*C+_.height))}else{var F,B,N;"right"===R.side?(F="start",B=1,N="",y=D._offset+D._length):(F="end",B=-1,N="-",y=D._offset),x=R._offset+(O.y0+O.y1)/2,s.attr("text-anchor",F),r.attr("d","M0,0L"+N+E+","+E+"V"+(C+_.height/2)+"h"+N+(2*C+_.width)+"V-"+(C+_.height/2)+"H"+N+E+"V-"+E+"Z"),Q.minY=x-(C+_.height/2),Q.maxY=x+(C+_.height/2),"right"===R.side?(Q.minX=y+E,Q.maxX=y+E+(2*C+_.width)):(Q.minX=y-E-(2*C+_.width),Q.maxX=y-E);var U,V=_.height/2,H=q-_.top-V,G="clip"+a._uid+"commonlabel"+R._id;if(y<_.width+2*C+E){U="M-"+(E+C)+"-"+V+"h-"+(_.width-C)+"V"+V+"h"+(_.width-C)+"Z";var Z=_.width-y+C;u.positionText(s,Z,H),"end"===F&&s.selectAll("tspan").each(function(){var t=e.select(this),r=h.tester.append("text").text(t.text()).call(h.font,g),i=Y(n,r.node());Math.round(i.width)<Math.round(_.width)&&t.attr("x",Z-i.width),r.remove()})}else u.positionText(s,B*(C+E),H),U=null;var W=a._topclips.selectAll("#"+G).data(U?[0]:[]);W.enter().append("clipPath").attr("id",G).append("path"),W.exit().remove(),W.select("path").attr("d",U),h.setClipUrl(s,U?G:null,n)}t.attr("transform",o(y,x))}),y.isUnifiedHover(l)){d.selectAll("g.hovertext").remove();var tt=t.filter(function(t){return"none"!==t.hoverinfo});if(0===tt.length)return[];var et=a.hoverlabel,rt=et.font,nt=tt[0],it=(("x unified"===l?nt.xa:nt.ya).unifiedhovertitle||{}).text,at={showlegend:!0,legend:{title:{text:it?i.hovertemplateString(it,{},a._d3locale,"x unified"===l?{xa:nt.xa,x:nt.xVal}:{ya:nt.ya,y:nt.yVal}):j,font:rt},font:rt,bgcolor:et.bgcolor,bordercolor:et.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},ot={font:rt};_(at,ot,n._fullData);var st=ot.legend;st.entries=[];for(var lt=0;lt<tt.length;lt++){var ut=tt[lt];if("none"!==ut.hoverinfo){var ct=B(ut,!0,l,a,j),ht=ct[0],ft=ct[1];ut.name=ft,ut.text=""!==ft?ft+" : "+ht:ht;var pt=ut.cd[ut.index];pt&&(pt.mc&&(ut.mc=pt.mc),pt.mcc&&(ut.mc=pt.mcc),pt.mlc&&(ut.mlc=pt.mlc),pt.mlcc&&(ut.mlc=pt.mlcc),pt.mlw&&(ut.mlw=pt.mlw),pt.mrc&&(ut.mrc=pt.mrc),pt.dir&&(ut.dir=pt.dir)),ut._distinct=!0,st.entries.push([ut])}}st.entries.sort(function(t,e){return t[0].trace.index-e[0].trace.index}),st.layer=d,st._inHover=!0,st._groupTitleFont=et.grouptitlefont,b(n,st);var dt,mt,gt,yt,vt=d.select("g.legend"),xt=Y(n,vt.node()),_t=xt.width+2*C,bt=xt.height+2*C,wt=tt[0],Tt=(wt.x0+wt.x1)/2,kt=(wt.y0+wt.y1)/2,At=!(g.traceIs(wt.trace,"bar-like")||g.traceIs(wt.trace,"box-violin"));"y"===F?At?(mt=kt-C,dt=kt+C):(mt=Math.min.apply(null,tt.map(function(t){return Math.min(t.y0,t.y1)})),dt=Math.max.apply(null,tt.map(function(t){return Math.max(t.y0,t.y1)}))):mt=dt=i.mean(tt.map(function(t){return(t.y0+t.y1)/2}))-bt/2,"x"===F?At?(gt=Tt+C,yt=Tt-C):(gt=Math.max.apply(null,tt.map(function(t){return Math.max(t.x0,t.x1)})),yt=Math.min.apply(null,tt.map(function(t){return Math.min(t.x0,t.x1)}))):gt=yt=i.mean(tt.map(function(t){return(t.x0+t.x1)/2}))-_t/2;var Mt,St,Et=D._offset,Ct=R._offset;return yt+=Et-_t,mt+=Ct-bt,Mt=(gt+=Et)+_t<H&&gt>=0?gt:yt+_t<H&&yt>=0?yt:Et+_t<H?Et:gt-Tt<Tt-yt+_t?H-_t:0,Mt+=C,St=(dt+=Ct)+bt<G&&dt>=0?dt:mt+bt<G&&mt>=0?mt:Ct+bt<G?Ct:dt-kt<kt-mt+bt?G-bt:0,St+=C,vt.attr("transform",o(Mt-1,St-1)),vt}var It=d.selectAll("g.hovertext").data(t,function(t){return z(t)});return It.enter().append("g").classed("hovertext",!0).each(function(){var t=e.select(this);t.append("rect").call(f.fill,f.addOpacity(p,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(h.font,{weight:A,style:M,variant:S,textcase:I,lineposition:L,shadow:P,family:T,size:k})}),It.exit().remove(),It.each(function(t){var r=e.select(this).attr("transform",""),i=t.color;Array.isArray(i)&&(i=i[t.eventData[0].pointNumber]);var d=t.bgcolor||i,m=f.combine(f.opacity(d)?d:f.defaultLine,p),g=f.combine(f.opacity(i)?i:f.defaultLine,p),y=t.borderColor||f.contrast(m),v=B(t,Z,l,a,j,r),x=v[0],_=v[1],b=r.select("text.nums").call(h.font,{family:t.fontFamily||T,size:t.fontSize||k,color:t.fontColor||y,weight:t.fontWeight||A,style:t.fontStyle||M,variant:t.fontVariant||S,textcase:t.fontTextcase||I,lineposition:t.fontLineposition||L,shadow:t.fontShadow||P}).text(x).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,n),z=r.select("text.name"),O=0,D=0;if(_&&_!==x){z.call(h.font,{family:t.fontFamily||T,size:t.fontSize||k,color:g,weight:t.fontWeight||A,style:t.fontStyle||M,variant:t.fontVariant||S,textcase:t.fontTextcase||I,lineposition:t.fontLineposition||L,shadow:t.fontShadow||P}).text(_).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,n);var R=Y(n,z.node());O=R.width+2*C,D=R.height+2*C}else z.remove(),r.select("rect").remove();r.select("path").style({fill:m,stroke:y});var F=t.xa._offset+(t.x0+t.x1)/2,N=t.ya._offset+(t.y0+t.y1)/2,U=Math.abs(t.x1-t.x0),V=Math.abs(t.y1-t.y0),W=Y(n,b.node()),X=W.width/a._invScaleX,$=W.height/a._invScaleY;t.ty0=(q-W.top)/a._invScaleY,t.bx=X+2*C,t.by=Math.max($+2*C,D),t.anchor="start",t.txwidth=X,t.tx2width=O,t.offset=0;var J,K,Q=(X+E+C+O)*a._invScaleX;if(c)t.pos=F,J=N+V/2+Q<=G,K=N-V/2-Q>=0,"top"!==t.idealAlign&&J||!K?J?(N+=V/2,t.anchor="start"):t.anchor="middle":(N-=V/2,t.anchor="end"),t.crossPos=N;else{if(t.pos=N,J=F+U/2+Q<=H,K=F-U/2-Q>=0,"left"!==t.idealAlign&&J||!K)if(J)F+=U/2,t.anchor="start";else{t.anchor="middle";var tt=Q/2,et=F+tt-H,rt=F-tt;et>0&&(F-=et),rt<0&&(F+=-rt)}else F-=U/2,t.anchor="end";t.crossPos=F}b.attr("text-anchor",t.anchor),O&&z.attr("text-anchor",t.anchor),r.attr("transform",o(F,N)+(c?s(w):""))}),{hoverLabels:It,commonLabelBoundingBox:Q}}function B(t,e,r,n,a,o){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=i.templateString(t.name,t.trace._meta)),s=H(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"<br>"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&"choroplethmap"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",(t.text||0===t.text)&&!Array.isArray(t.text)&&(l+=(l?"<br>":"")+t.text),void 0!==t.extraText&&(l+=(l?"<br>":"")+t.extraText),o&&""===l&&!t.hovertemplate&&(""===s&&o.remove(),l=s);var h=t.hovertemplate||!1;if(h){var f=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(f[u+"other"]=f[u+"Val"],f[u+"otherLabel"]=f[u+"Label"]),l=(l=i.hovertemplateString(h,f,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(D,function(e,r){return s=H(r,t.nameLength),""})}return[l,s]}function N(t,e){var r=0,n=t.offset;return e&&(n*=-S,r=t.offset*M),{x:r,y:n}}function j(t,r,n,i){var a=function(t){return t*n},o=function(t){return t*i};t.each(function(t){var n=e.select(this);if(t.del)return n.remove();var i,s=n.select("text.nums"),l=t.anchor,c="end"===l?-1:1,f=function(t){var e={start:1,end:-1,middle:0}[t.anchor],r=e*(E+C),n=r+e*(t.txwidth+C);return"middle"===t.anchor&&(r-=t.tx2width/2,n+=t.txwidth/2+C),{alignShift:e,textShiftX:r,text2ShiftX:n}}(t),p=N(t,r),d=p.x,m=p.y,g="middle"===l,y=!("hoverlabel"in t.trace)||t.trace.hoverlabel.showarrow;i=g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":y?"M0,0L"+a(c*E+d)+","+o(E+m)+"v"+o(t.by/2-E)+"h"+a(c*t.bx)+"v-"+o(t.by)+"H"+a(c*E+d)+"V"+o(m-E)+"Z":"M"+a(c*E+d)+","+o(m-t.by/2)+"h"+a(c*t.bx)+"v"+o(t.by)+"h"+a(-c*t.bx)+"Z",n.select("path").attr("d",i);var v=d+f.textShiftX,x=m+t.ty0-t.by/2+C,_=t.textAlign||"auto";"auto"!==_&&("left"===_&&"start"!==l?(s.attr("text-anchor","start"),v=g?-t.bx/2-t.tx2width/2+C:-t.bx-C):"right"===_&&"end"!==l&&(s.attr("text-anchor","end"),v=g?t.bx/2-t.tx2width/2-C:t.bx+C)),s.call(u.positionText,a(v),o(x)),t.tx2width&&(n.select("text.name").call(u.positionText,a(f.text2ShiftX+f.alignShift*C+d),o(m+t.ty0-t.by/2+C)),n.select("rect").call(h.setRect,a(f.text2ShiftX+(f.alignShift-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))})}function U(t,e){var n=t.index,a=t.trace||{},o=t.cd[0],s=t.cd[n]||{};function l(t){return t||r(t)&&0===t}var u=Array.isArray(n)?function(t,e){var r=i.castOption(o,n,t);return l(r)?r:i.extractOption({},a,"",e)}:function(t,e){return i.extractOption(s,a,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("fontWeight","htw","hoverlabel.font.weight"),c("fontStyle","hty","hoverlabel.font.style"),c("fontVariant","htv","hoverlabel.font.variant"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===a.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=i.constrain(t.x0,0,t.xa._length),t.x1=i.constrain(t.x1,0,t.xa._length),t.y0=i.constrain(t.y0,0,t.ya._length),t.y1=i.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal,a.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal,a.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+f,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function V(t,e,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||c){var m=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var g,y,v=e.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=u.pointerX,y=u.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,_,b=n.readability(v.color,m)<1.5?f.contrast(m):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,A=d.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,_=g),-1!==w.indexOf("across")){var M=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),S=Math.max(S,a.position)),x=l.l+M*l.w,_=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?T:-T),cy:y,r:T,fill:k}).classed("spikeline",!0)}if(p){var E,C,I=e.vLinePoint;i=I&&I.xa,a=I&&I.ya,"cursor"===i.spikesnap?(E=u.pointerX,C=u.pointerY):(E=i._offset+I.x,C=a._offset+I.y);var L,P,z=n.readability(I.color,m)<1.5?f.contrast(m):I.color,O=i.spikemode,D=i.spikethickness,R=i.spikecolor||z,F=d.getPxPosition(t,i);if(-1!==O.indexOf("toaxis")||-1!==O.indexOf("across")){if(-1!==O.indexOf("toaxis")&&(L=F,P=C),-1!==O.indexOf("across")){var B=i._counterDomainMin,N=i._counterDomainMax;"free"===i.anchor&&(B=Math.min(B,i.position),N=Math.max(N,i.position)),L=l.t+(1-N)*l.h,P=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":D,stroke:R,"stroke-dasharray":h.dashStyle(i.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":D+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==O.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==i.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function H(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function G(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?i+=c:"middle"===o&&(i+=c/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"===r.boxmode||"group"===r.violinmode)&&(i+=a.t.dPos),i}function Z(t){return t.offsetTop+t.clientTop}function W(t){return t.offsetLeft+t.clientLeft}function Y(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,u=i.apply3DTransform(r._invTransform)(a,o),c=i.apply3DTransform(r._invTransform)(s,l),h=u[0],f=u[1],p=c[0],d=c[1];return{x:h,y:f,width:p-h,height:d-f,top:Math.min(f,d),left:Math.min(h,p),right:Math.max(h,p),bottom:Math.max(f,d)}}}),Ar=f((t,e)=>{var r=oe(),n=q(),i=Ye().isUnifiedHover;e.exports=function(t,e,a,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),a("hoverlabel.showarrow",o.showarrow),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}),Mr=f((t,e)=>{var r=oe(),n=Ar(),i=B();e.exports=function(t,e){n(t,e,function(n,a){return r.coerce(t,e,i,n,a)})}}),Sr=f((t,e)=>{var r=oe(),n=N(),i=Ar();e.exports=function(t,e,a,o){var s=r.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),i(t,e,function(i,a){return r.coerce(t,e,n,i,a)},s)}}),Er=f((t,e)=>{var r=oe(),n=B();e.exports=function(t,e){function i(i,a){return void 0!==e[i]?e[i]:r.coerce(t,e,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}),Cr=f((t,e)=>{var r=oe(),n=B(),i=Er(),a=Ar();e.exports=function(t,e){function o(i,a){return r.coerce(t,e,n,i,a)}i(t,e)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=e._has("mapbox"),l=e._has("map"),u=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l||u)&&1===c||(s||l)&&u&&2===c)&&(e.dragmode="pan"),a(t,e,o),r.coerceFont(o,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}),Ir=f((t,e)=>{var r=oe(),n=Ut();function i(t,e,n,i){i=i||r.identity,Array.isArray(t)&&(e[0][n]=i(t))}e.exports=function(t){var e=t.calcdata,a=t._fullLayout;function o(t){return function(e){return r.coerceHoverinfo({hoverinfo:e},{_module:t._module},a)}}for(var s=0;s<e.length;s++){var l=e[s],u=l[0].trace;if(!n.traceIs(u,"pie-like")){var c=n.traceIs(u,"2dMap")?i:r.fillArray;c(u.hoverinfo,l,"hi",o(u)),u.hovertemplate&&c(u.hovertemplate,l,"ht"),u.hoverlabel&&(c(u.hoverlabel.bgcolor,l,"hbg"),c(u.hoverlabel.bordercolor,l,"hbc"),c(u.hoverlabel.font.size,l,"hts"),c(u.hoverlabel.font.color,l,"htc"),c(u.hoverlabel.font.family,l,"htf"),c(u.hoverlabel.font.weight,l,"htw"),c(u.hoverlabel.font.style,l,"hty"),c(u.hoverlabel.font.variant,l,"htv"),c(u.hoverlabel.namelength,l,"hnl"),c(u.hoverlabel.align,l,"hta"),c(u.hoverlabel.showarrow,l,"htsa"))}}}}),Lr=f((t,e)=>{var r=Ut(),n=kr().hover;e.exports=function(t,e,i){var a=r.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==i&&n(t,e,i,!0),t._hoverdata&&e&&e.target&&(a&&a.then?a.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}}),Pr=f((t,e)=>{var r=v(),n=oe(),i=cr(),a=Ye(),o=B(),s=kr();e.exports={moduleType:"component",name:"fx",constants:F(),schema:{layout:o},attributes:N(),layoutAttributes:o,supplyLayoutGlobalDefaults:Mr(),supplyDefaults:Sr(),supplyLayoutDefaults:Cr(),calc:Ir(),getDistanceFunction:a.getDistanceFunction,getClosest:a.getClosest,inbox:a.inbox,quadrature:a.quadrature,appendArrayPointValue:a.appendArrayPointValue,castHoverOption:function(t,e,r){return n.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return n.castOption(t,r,"hoverinfo",function(r){return n.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(t){var e=n.isD3Selection(t)?t:r.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:Lr()}}),zr=f(t=>{t.selectMode=function(t){return"lasso"===t||"select"===t},t.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},t.openMode=function(t){return"drawline"===t||"drawopenpath"===t},t.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},t.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},t.selectingOrDrawing=function(e){return t.freeMode(e)||t.rectMode(e)}}),Or=f((t,e)=>{e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}}),Dr=f((t,e)=>{e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>"," <title>plotly-logomark</title>"," <g id='symbol'>"," <rect fill='#000' x='0' y='0' width='132' height='132' rx='18' ry='18'/>"," <circle fill='#9EF' cx='102' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='54' r='6'/>"," <circle fill='#D69' cx='54' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='54' r='6'/>"," <path fill='#FFF' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>"," <path fill='#FFF' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>"," <path fill='#FFF' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>"," <path fill='#FFF' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>"," </g>","</svg>"].join("")}}}),Rr=f((t,e)=>{e.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),Fr=f((t,e)=>{var r=oe().strTranslate;function n(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:n,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return n(t,r[e])}},getTransform:function(t){return r(t.xaxis._offset,t.yaxis._offset)}}}),Br=f(t=>{var e=Xe(),r=Rr(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=Fr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],u=[0,3,4,1,2];function c(t,e){return Math.abs(t-e)<=1e-6}function h(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}t.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n<e;n++)for(var i=t[n].length,a=0;a<i;a++){var o=t[n][a][0];if("Z"===o)r+="Z";else for(var s=t[n][a].length,c=0;c<s;c++){var h=c;"Q"===o||"S"===o?h=u[c]:"C"===o&&(h=l[c]),r+=t[n][a][h],c>0&&c<s-1&&(r+=",")}}return r},t.readPaths=function(t,r,i,a){var l,u,c,h=e(t),f=[],p=-1,d=function(){p++,f[p]=[]},m=0,g=0,y=function(){u=m,c=g};y();for(var v=0;v<h.length;v++){var x,_,b,w,T=[],k=h[v][0],A=k;switch(k){case"M":d(),m=+h[v][1],g=+h[v][2],T.push([A,m,g]),y();break;case"Q":case"S":x=+h[v][1],b=+h[v][2],m=+h[v][3],g=+h[v][4],T.push([A,m,g,x,b]);break;case"C":x=+h[v][1],b=+h[v][2],_=+h[v][3],w=+h[v][4],m=+h[v][5],g=+h[v][6],T.push([A,m,g,x,b,_,w]);break;case"T":case"L":m=+h[v][1],g=+h[v][2],T.push([A,m,g]);break;case"H":A="L",m=+h[v][1],T.push([A,m,g]);break;case"V":A="L",g=+h[v][1],T.push([A,m,g]);break;case"A":A="L";var M=+h[v][1],S=+h[v][2];+h[v][4]||(M=-M,S=-S);var E=m-M,C=g;for(l=1;l<=n/2;l++){var I=2*Math.PI*l/n;T.push([A,E+M*Math.cos(I),C+S*Math.sin(I)])}break;case"Z":(m!==u||g!==c)&&(m=u,g=c,T.push([A,m,g]))}for(var L=(i||{}).domain,P=r._fullLayout._size,z=i&&"pixel"===i.xsizemode,O=i&&"pixel"===i.ysizemode,D=!1===a,R=0;R<T.length;R++){for(l=0;l+2<7;l+=2){var F=T[R][l+1],B=T[R][l+2];void 0===F||void 0===B||(m=F,g=B,i&&(i.xaxis&&i.xaxis.p2r?(D&&(F-=i.xaxis._offset),F=z?s(i.xaxis,i.xanchor)+F:o(i.xaxis,F)):(D&&(F-=P.l),L?F=L.x[0]+F/P.w:F/=P.w),i.yaxis&&i.yaxis.p2r?(D&&(B-=i.yaxis._offset),B=O?s(i.yaxis,i.yanchor)-B:o(i.yaxis,B)):(D&&(B-=P.t),B=L?L.y[1]-B/P.h:1-B/P.h)),T[R][l+1]=F,T[R][l+2]=B)}f[p].push(T[R].slice())}}return f},t.pointsOnRectangle=function(t){if(5!==t.length)return!1;for(var e=1;e<3;e++){if(!c(t[0][e]-t[1][e],t[3][e]-t[2][e]))return!1;if(!c(t[0][e]-t[3][e],t[1][e]-t[2][e]))return!1}return!(!c(t[0][1],t[1][1])&&!c(t[0][1],t[3][1])||!(h(t[0],t[1])*h(t[0],t[3])))},t.pointsOnEllipse=function(t){var e=t.length;if(e!==n+1)return!1;e=n;for(var r=0;r<e;r++){var i=(2*e-r)%e,a=(e/2+i)%e,o=(e/2+r)%e;if(!c(h(t[r],t[o]),h(t[i],t[a])))return!1}return!0},t.handleEllipse=function(e,r,a){if(!e)return[r,a];var o=t.ellipseOver({x0:r[0],y0:r[1],x1:a[0],y1:a[1]}),s=(o.x1+o.x0)/2,l=(o.y1+o.y0)/2,u=(o.x1-o.x0)/2,c=(o.y1-o.y0)/2;u||(u=c/=i),c||(c=u/=i);for(var h=[],f=0;f<n;f++){var p=2*f*Math.PI/n;h.push([s+u*Math.cos(p),l+c*Math.sin(p)])}return h},t.ellipseOver=function(t){var e=t.x0,r=t.y0,n=t.x1,a=t.y1,o=n-e,s=a-r,l=((e-=o)+n)/2,u=((r-=s)+a)/2;return{x0:l-(o*=i),y0:u-(s*=i),x1:l+o,y1:u+s}},t.fixDatesForPaths=function(t,e,r){var n="date"===e.type,i="date"===r.type;if(!n&&!i)return t;for(var a=0;a<t.length;a++)for(var o=0;o<t[a].length;o++)for(var s=0;s+2<t[a][o].length;s+=2)n&&(t[a][o][s+1]=t[a][o][s+1].replace(" ","_")),i&&(t[a][o][s+2]=t[a][o][s+2].replace(" ","_"));return t}}),Nr=f((t,e)=>{var r=ye(),n=zr(),i=n.drawMode,a=n.openMode,o=Rr(),s=o.i000,l=o.i090,u=o.i180,c=o.i270,h=o.cos45,f=o.sin45,p=Fr(),d=p.p2r,m=p.r2p,g=ve().clearOutline,y=Br(),v=y.readPaths,x=y.writePaths,_=y.ellipseOver,b=y.fixDatesForPaths;function w(t,e,r){var n,i=t[0][0],o=e.gd,p=i.getAttribute("d"),g=o._fullLayout.newshape,y=e.plotinfo,w=e.isActiveShape,T=y.xaxis,k=y.yaxis,A=!!y.domain||!y.xaxis,M=!!y.domain||!y.yaxis,S=a(r),E=v(p,o,y,w),C={editable:!0,visible:g.visible,name:g.name,showlegend:g.showlegend,legend:g.legend,legendwidth:g.legendwidth,legendgroup:g.legendgroup,legendgrouptitle:{text:g.legendgrouptitle.text,font:g.legendgrouptitle.font},legendrank:g.legendrank,label:g.label,xref:A?"paper":T._id,yref:M?"paper":k._id,layer:g.layer,opacity:g.opacity,line:{color:g.line.color,width:g.line.width,dash:g.line.dash}};if(S||(C.fillcolor=g.fillcolor,C.fillrule=g.fillrule),1===E.length&&(n=E[0]),n&&5===n.length&&"drawrect"===r)C.type="rect",C.x0=n[0][1],C.y0=n[0][2],C.x1=n[2][1],C.y1=n[2][2];else if(n&&"drawline"===r)C.type="line",C.x0=n[0][1],C.y0=n[0][2],C.x1=n[1][1],C.y1=n[1][2];else if(n&&"drawcircle"===r){C.type="circle";var I=n[s][1],L=n[l][1],P=n[u][1],z=n[c][1],O=n[s][2],D=n[l][2],R=n[u][2],F=n[c][2],B=y.xaxis&&("date"===y.xaxis.type||"log"===y.xaxis.type),N=y.yaxis&&("date"===y.yaxis.type||"log"===y.yaxis.type);B&&(I=m(y.xaxis,I),L=m(y.xaxis,L),P=m(y.xaxis,P),z=m(y.xaxis,z)),N&&(O=m(y.yaxis,O),D=m(y.yaxis,D),R=m(y.yaxis,R),F=m(y.yaxis,F));var j=(L+z)/2,U=(O+R)/2,V=_({x0:j,y0:U,x1:j+(z-L+P-I)/2*h,y1:U+(F-D+R-O)/2*f});B&&(V.x0=d(y.xaxis,V.x0),V.x1=d(y.xaxis,V.x1)),N&&(V.y0=d(y.yaxis,V.y0),V.y1=d(y.yaxis,V.y1)),C.x0=V.x0,C.y0=V.y0,C.x1=V.x1,C.y1=V.y1}else C.type="path",T&&k&&b(E,T,k),C.path=x(E),n=null;return C}e.exports={newShapes:function(t,e){if(t.length&&t[0][0]){var n=e.gd,a=e.isActiveShape,o=e.dragmode,s=(n.layout||{}).shapes||[];if(!i(o)&&void 0!==a){var l=n._fullLayout._activeShapeIndex;if(l<s.length)switch(n._fullLayout.shapes[l].type){case"rect":o="drawrect";break;case"circle":o="drawcircle";break;case"line":o="drawline";break;case"path":var u=s[l].path||"";o="Z"===u[u.length-1]?"drawclosedpath":"drawopenpath"}}var c=w(t,e,o);g(n);for(var h=e.editHelpers,f=(h||{}).modifyItem,p=[],d=0;d<s.length;d++){var m=n._fullLayout.shapes[d];if(p[d]=m._input,void 0!==a&&d===n._fullLayout._activeShapeIndex){var y=c;switch(m.type){case"line":case"rect":case"circle":var v=r.getFromId(n,m.xref);"x"===m.xref.charAt(0)&&v.type.includes("category")?(f("x0",y.x0-(m.x0shift||0)),f("x1",y.x1-(m.x1shift||0))):(f("x0",y.x0),f("x1",y.x1));var x=r.getFromId(n,m.yref);"y"===m.yref.charAt(0)&&x.type.includes("category")?(f("y0",y.y0-(m.y0shift||0)),f("y1",y.y1-(m.y1shift||0))):(f("y0",y.y0),f("y1",y.y1));break;case"path":f("path",y.path)}}}return void 0===a?(p.push(c),p):h?h.getUpdateObj():{}}},createShapeObj:w}}),jr=f((t,e)=>{var r=zr().selectMode,n=ve().clearOutline,i=Br(),a=i.readPaths,o=i.writePaths,s=i.fixDatesForPaths;e.exports=function(t,e){if(t.length){var i=t[0][0];if(i){var l=i.getAttribute("d"),u=e.gd,c=u._fullLayout.newselection,h=e.plotinfo,f=h.xaxis,p=h.yaxis,d=e.isActiveSelection,m=e.dragmode,g=(u.layout||{}).selections||[];if(!r(m)&&void 0!==d){var y=u._fullLayout._activeSelectionIndex;if(y<g.length)switch(u._fullLayout.selections[y].type){case"rect":m="select";break;case"path":m="lasso"}}var v,x=a(l,u,h,d),_={xref:f._id,yref:p._id,opacity:c.opacity,line:{color:c.line.color,width:c.line.width,dash:c.line.dash}};1===x.length&&(v=x[0]),v&&5===v.length&&"select"===m?(_.type="rect",_.x0=v[0][1],_.y0=v[0][2],_.x1=v[2][1],_.y1=v[2][2]):(_.type="path",f&&p&&s(x,f,p),_.path=o(x),v=null),n(u);for(var b=e.editHelpers,w=(b||{}).modifyItem,T=[],k=0;k<g.length;k++){var A=u._fullLayout.selections[k];if(A){if(T[k]=A._input,void 0!==d&&k===u._fullLayout._activeSelectionIndex){var M=_;switch(A.type){case"rect":w("x0",M.x0),w("x1",M.x1),w("y0",M.y0),w("y1",M.y1);break;case"path":w("path",M.path)}}}else T[k]=A}return void 0===d?(T.push(_),T):b?b.getUpdateObj():{}}}}}),Ur=f((t,e)=>{e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),Vr=f(t=>{var e=Ur(),r=oe(),n=rr();function i(t,e){var r=0;return(e=e||0)&&t&&("category"===t.type||"multicategory"===t.type)&&(r=(t.r2p(1)-t.r2p(0))*e),r}t.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},t.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},t.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},t.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},t.extractPathCoords=function(t,n,i){var a=[];return t.match(e.segmentRE).forEach(function(t){var o=n[t.charAt(0)].drawn;if(void 0!==o){var s=t.substr(1).match(e.paramRE);if(s&&!(s.length<o)){var l=s[o],u=i?l:r.cleanNumber(l);a.push(u)}}}),a},t.getDataToPixel=function(e,r,n,a,o){var s,l=e._fullLayout._size;if(r)if("domain"===o)s=function(t){return r._length*(a?1-t:t)+r._offset};else{var u=t.shapePositionToRange(r);s=function(t){var e=i(r,n);return r._offset+r.r2p(u(t,!0))+e},"date"===r.type&&(s=t.decodeDate(s))}else s=a?function(t){return l.t+l.h*(1-t)}:function(t){return l.l+l.w*t};return s},t.getPixelToData=function(e,r,n,i){var a,o=e._fullLayout._size;if(r)if("domain"===i)a=function(t){var e=(t-r._offset)/r._length;return n?1-e:e};else{var s=t.rangeToShapePosition(r);a=function(t){return s(r.p2r(t-r._offset))}}else a=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a},t.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n},t.makeShapesOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.shapes[e]||{},n=t._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=t._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}},t.makeSelectionsOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.selections[e]||{},n=t._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&(n.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&(n.yaxis=t._fullLayout[r.yref+"axis"])),{options:r,plotinfo:n}},t.getPathString=function(a,o){var s,l,u,c,h,f,p,d,m=o.type,g=n.getRefType(o.xref),y=n.getRefType(o.yref),v=n.getFromId(a,o.xref),x=n.getFromId(a,o.yref),_=a._fullLayout._size,b=i(v,o.x0shift),w=i(v,o.x1shift),T=i(x,o.y0shift),k=i(x,o.y1shift);if(v?"domain"===g?l=function(t){return v._offset+v._length*t}:(s=t.shapePositionToRange(v),l=function(t){return v._offset+v.r2p(s(t,!0))}):l=function(t){return _.l+_.w*t},x?"domain"===y?c=function(t){return x._offset+x._length*(1-t)}:(u=t.shapePositionToRange(x),c=function(t){return x._offset+x.r2p(u(t,!0))}):c=function(t){return _.t+_.h*(1-t)},"path"===m)return v&&"date"===v.type&&(l=t.decodeDate(l)),x&&"date"===x.type&&(c=t.decodeDate(c)),function(t,n,i){var a=t.path,o=t.xsizemode,s=t.ysizemode,l=t.xanchor,u=t.yanchor;return a.replace(e.segmentRE,function(t){var a=0,c=t.charAt(0),h=e.paramIsX[c],f=e.paramIsY[c],p=e.numParams[c],d=t.substr(1).replace(e.paramRE,function(t){return h[a]?t="pixel"===o?n(l)+Number(t):n(t):f[a]&&(t="pixel"===s?i(u)-Number(t):i(t)),++a>p&&(t="X"),t});return a>p&&(d=d.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+t)),c+d})}(o,l,c);if("pixel"===o.xsizemode){var A=l(o.xanchor);h=A+o.x0+b,f=A+o.x1+w}else h=l(o.x0)+b,f=l(o.x1)+w;if("pixel"===o.ysizemode){var M=c(o.yanchor);p=M-o.y0+T,d=M-o.y1+k}else p=c(o.y0)+T,d=c(o.y1)+k;if("line"===m)return"M"+h+","+p+"L"+f+","+d;if("rect"===m)return"M"+h+","+p+"H"+f+"V"+d+"H"+h+"Z";var S=(h+f)/2,E=(p+d)/2,C=Math.abs(S-h),I=Math.abs(E-p),L="A"+C+","+I,P=S+C+","+E;return"M"+P+L+" 0 1,1 "+S+","+(E-I)+L+" 0 0,1 "+P+"Z"}}),qr=f((t,e)=>{var r=oe(),n=rr(),i=Ae(),a=Je(),o=Br().readPaths,s=Vr(),l=s.getPathString,u=Dt(),c=ke().FROM_TL;e.exports=function(t,e,h,f){if(f.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var p;if(h.label.texttemplate){var d={};if("path"!==h.type){var m=n.getFromId(t,h.xref),g=n.getFromId(t,h.yref);for(var y in u){var v=u[y](h,m,g);void 0!==v&&(d[y]=v)}}p=r.texttemplateStringForShapes(h.label.texttemplate,{},t._fullLayout._d3locale,d)}else p=h.label.text;var x,_,b,w,T={"data-index":e},k=h.label.font,A=f.append("g").attr(T).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(p);if(h.path){var M=l(t,h),S=o(M,t);x=1/0,b=1/0,_=-1/0,w=-1/0;for(var E=0;E<S.length;E++)for(var C=0;C<S[E].length;C++)for(var I=S[E][C],L=1;L<I.length;L+=2){var P=I[L],z=I[L+1];x=Math.min(x,P),_=Math.max(_,P),b=Math.min(b,z),w=Math.max(w,z)}}else{var O=n.getFromId(t,h.xref),D=h.x0shift,R=h.x1shift,F=n.getRefType(h.xref),B=n.getFromId(t,h.yref),N=h.y0shift,j=h.y1shift,U=n.getRefType(h.yref),V=function(e,r){return s.getDataToPixel(t,O,r,!1,F)(e)},q=function(e,r){return s.getDataToPixel(t,B,r,!0,U)(e)};x=V(h.x0,D),_=V(h.x1,R),b=q(h.y0,N),w=q(h.y1,j)}var H=h.label.textangle;"auto"===H&&(H="line"===h.type?function(t,e,r,n){var i,a;return a=Math.abs(r-t),i=r>=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,b,_,w):0),A.call(function(e){return e.call(a.font,k).attr({}),i.convertToTspans(e,t),e});var G=function(t,e,r,n,i,a,o){var s,l,u,h,f=i.label.textposition,p=i.label.textangle,d=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,_=i.label.yanchor;if("line"===m){"start"===f?(s=t,l=e):"end"===f?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===x&&(x="start"===f?"auto"===p?r>t?"left":r<t?"right":"center":r>t?"right":r<t?"left":"center":"end"===f?"auto"===p?r>t?"right":r<t?"left":"center":r>t?"left":r<t?"right":"center":"center");var b={left:1,center:0,right:-1},w={bottom:-1,middle:0,top:1};if("auto"===p){var T=w[_];u=-d*y*T,h=d*v*T}else u=d*b[x],h=d*w[_];s+=u,l+=h}else u=d+3,-1!==f.indexOf("right")?(s=Math.max(t,r)-u,"auto"===x&&(x="right")):-1!==f.indexOf("left")?(s=Math.min(t,r)+u,"auto"===x&&(x="left")):(s=(t+r)/2,"auto"===x&&(x="center")),l=-1!==f.indexOf("top")?Math.min(e,n):-1!==f.indexOf("bottom")?Math.max(e,n):(e+n)/2,h=d,"bottom"===_?l-=h:"top"===_&&(l+=h);var k=c[_],A=i.label.font.size,M=o.height,S=(M*k-A)*y,E=-(M*k-A)*v;return{textx:s+S,texty:l+E,xanchor:x}}(x,b,_,w,h,H,a.bBox(A.node())),Z=G.textx,W=G.texty,Y=G.xanchor;A.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[Y],y:W,x:Z,transform:"rotate("+H+","+Z+","+W+")"}).call(i.positionText,Z,W)}}}),Hr=f((t,e)=>{var r=oe().strTranslate,n=cr(),i=zr(),a=i.drawMode,o=i.selectMode,s=Ut(),l=q(),u=Rr(),c=u.i000,h=u.i090,f=u.i180,p=u.i270,d=ve().clearOutlineControllers,m=Br(),g=m.pointsOnRectangle,y=m.pointsOnEllipse,v=m.writePaths,x=Nr().newShapes,_=Nr().createShapeObj,b=jr(),w=qr();function T(t,e){var r,n,i,a=t[e][1],o=t[e][2],s=t.length;return n=t[r=(e+1)%s][1],i=t[r][2],n===a&&i===o&&(n=t[r=(e+2)%s][1],i=t[r][2]),[r,n,i]}e.exports=function t(e,i,u,m){m||(m=0);var k=u.gd;function A(){t(e,i,u,m++),(y(e[0])||u.hasText)&&M({redrawing:!0})}function M(t){var e={};void 0!==u.isActiveShape&&(u.isActiveShape=!1,e=x(i,u)),void 0!==u.isActiveSelection&&(u.isActiveSelection=!1,e=b(i,u),k._fullLayout._reselect=!0),Object.keys(e).length&&s.call((t||{}).redrawing?"relayout":"_guiRelayout",k,e)}var S,E,C,I,L,P=k._fullLayout._zoomlayer,z=u.dragmode,O=a(z),D=o(z);if((O||D)&&(k._fullLayout._outlining=!0),d(k),i.attr("d",v(e)),m||!u.isActiveShape&&!u.isActiveSelection||(L=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];t[r]=[];for(var i=0;i<n.length;i++){t[r][i]=[];for(var a=0;a<n[i].length;a++)t[r][i][a]=n[i][a]}}return t}([],e),function(t){S=[];for(var i=0;i<e.length;i++){var a=e[i],o=g(a),s=!o&&y(a);S[i]=[];for(var d=a.length,m=0;m<d;m++)if("Z"!==a[m][0]&&(!s||m===c||m===h||m===f||m===p)){var v,x=o&&u.isActiveSelection;x&&(v=T(a,m));var _=a[m][1],b=a[m][2],w=t.append(x?"rect":"circle").attr("data-i",i).attr("data-j",m).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(x){var A=v[1]-_,M=v[2]-b,E=M?5:Math.max(Math.min(25,Math.abs(A)-5),5),C=A?5:Math.max(Math.min(25,Math.abs(M)-5),5);w.classed(M?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",E).attr("height",C).attr("x",_-E/2).attr("y",b-C/2).attr("transform",r(A/2,M/2))}else w.classed("cursor-grab",!0).attr("r",5).attr("cx",_).attr("cy",b);S[i][m]={element:w.node(),gd:k,prepFn:B,doneFn:j,clickFn:U},n.init(S[i][m])}}}(P.append("g").attr("class","outline-controllers")),function(){if(E=[],e.length){var t=0;E[t]={element:i[0][0],gd:k,prepFn:q,doneFn:H,clickFn:G},n.init(E[t])}}()),O&&u.hasText){var R=P.select(".label-temp"),F=_(i,u,u.dragmode);w(k,"label-temp",F,R)}function B(t){C=+t.srcElement.getAttribute("data-i"),I=+t.srcElement.getAttribute("data-j"),S[C][I].moveFn=N}function N(t,r){if(e.length){var n=L[C][I][1],i=L[C][I][2],a=e[C],o=a.length;if(g(a)){var s=t,l=r;u.isActiveSelection&&(T(a,I)[1]===a[I][1]?l=0:s=0);for(var c=0;c<o;c++)if(c!==I){var h=a[c];h[1]===a[I][1]&&(h[1]=n+s),h[2]===a[I][2]&&(h[2]=i+l)}if(a[I][1]=n+s,a[I][2]=i+l,!g(a))for(var f=0;f<o;f++)for(var p=0;p<a[f].length;p++)a[f][p]=L[C][f][p]}else a[I][1]=n+t,a[I][2]=i+r;A()}}function j(){M()}function U(t,r){if(2===t){C=+r.srcElement.getAttribute("data-i"),I=+r.srcElement.getAttribute("data-j");var n=e[C];!g(n)&&!y(n)&&function(){if(e.length&&e[C]&&e[C].length){for(var t=[],r=0;r<e[C].length;r++)r!==I&&t.push(e[C][r]);t.length>1&&(2!==t.length||"Z"!==t[1][0])&&(0===I&&(t[0][0]="M"),e[C]=t,A(),M())}}()}}function V(t,r){(function(t,r){if(e.length)for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)for(var a=0;a+2<e[n][i].length;a+=2)e[n][i][a+1]=L[n][i][a+1]+t,e[n][i][a+2]=L[n][i][a+2]+r})(t,r),A()}function q(t){(C=+t.srcElement.getAttribute("data-i"))||(C=0),E[C].moveFn=V}function H(){M()}function G(t){2===t&&function(t){if(o(t._fullLayout.dragmode)){d(t);var e=t._fullLayout._activeSelectionIndex,r=(t.layout||{}).selections||[];if(e<r.length){for(var n=[],i=0;i<r.length;i++)i!==e&&n.push(r[i]);delete t._fullLayout._activeSelectionIndex;var a=t._fullLayout.selections[e];t._fullLayout._deselect={xref:a.xref,yref:a.yref},s.call("_guiRelayout",t,{selections:n})}}}(k)}}}),Gr=f((t,e)=>{var r=v(),n=Ut(),i=oe(),a=rr(),o=Br().readPaths,s=Hr(),l=qr(),u=ve().clearOutlineControllers,c=q(),h=Je(),f=me().arrayEditor,p=cr(),d=hr(),m=Ur(),g=Vr(),y=g.getPathString;function x(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeUpperLayer.selectAll("text").remove(),e._shapeLowerLayer.selectAll("text").remove(),e._plots){var n=e._plots[r].shapelayer;n&&(n.selectAll("path").remove(),n.selectAll("text").remove())}for(var i=0;i<e.shapes.length;i++)!0===e.shapes[i].visible&&w(t,i)}function _(t){return!!t._fullLayout._outlining}function b(t){return!t._context.edits.shapePosition}function w(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var u=g.makeShapesOptionsAndPlotinfo(t,e),v=u.options,w=u.plotinfo;function M(u){var M=y(t,v),S={"data-index":e,"fill-rule":v.fillrule,d:M},E=v.opacity,C=v.fillcolor,I=v.line.width?v.line.color:"rgba(0,0,0,0)",L=v.line.width,P=v.line.dash;!L&&!0===v.editable&&(L=5,P="solid");var z="Z"!==M[M.length-1],O=b(t)&&v.editable&&t._fullLayout._activeShapeIndex===e;O&&(C=z?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,E=t._fullLayout.activeshape.opacity);var D,R=u.append("g").classed("shape-group",!0).attr({"data-index":e}),F=R.append("path").attr(S).style("opacity",E).call(c.stroke,I).call(c.fill,C).call(h.dashLine,P,L);if(T(R,t,v),l(t,e,v,R),(O||t._context.edits.shapePosition)&&(D=f(t.layout,"shapes",v)),O){F.style({cursor:"move"});var B={element:F.node(),plotinfo:w,gd:t,editHelpers:D,hasText:v.label.text||v.label.texttemplate,isActiveShape:!0},N=o(M,t);s(N,F,B)}else t._context.edits.shapePosition?function(t,e,o,s,u,c){var f,v,x,b,w,A,M,S,E,C,I,L,P,z,O,D,R=10,F=10,B="pixel"===o.xsizemode,N="pixel"===o.ysizemode,j="line"===o.type,U="path"===o.type,V=c.modifyItem,q=r.select(e.node().parentNode),H=a.getFromId(t,o.xref),G=a.getRefType(o.xref),Z=a.getFromId(t,o.yref),W=a.getRefType(o.yref),Y=o.x0shift,X=o.x1shift,$=o.y0shift,J=o.y1shift,K=function(e,r){return g.getDataToPixel(t,H,r,!1,G)(e)},Q=function(e,r){return g.getDataToPixel(t,Z,r,!0,W)(e)},tt=g.getPixelToData(t,H,!1,G),et=g.getPixelToData(t,Z,!0,W),rt=it(),nt={element:rt.node(),gd:t,prepFn:st,doneFn:lt,clickFn:ut};function it(){return j?at():e}function at(){var t=10,r=Math.max(o.line.width,t),n=u.append("g").attr("data-index",s).attr("drag-helper",!0);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":r,"stroke-opacity":"0"});var i={"fill-opacity":"0"},a=Math.max(r/2,t);return n.append("circle").attr({"data-line-point":"start-point",cx:B?K(o.xanchor)+o.x0:K(o.x0,Y),cy:N?Q(o.yanchor)-o.y0:Q(o.y0,$),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:B?K(o.xanchor)+o.x1:K(o.x1,X),cy:N?Q(o.yanchor)-o.y1:Q(o.y1,J),r:a}).style(i).classed("cursor-grab",!0),n}function ot(r){if(_(t))D=null;else if(j)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=nt.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!U&&i>R&&a>F&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";d(e,l),D=l.split("-")[0]}}function st(r){_(t)||(B&&(w=K(o.xanchor)),N&&(A=Q(o.yanchor)),"path"===o.type?O=o.path:(f=B?o.x0:K(o.x0),v=N?o.y0:Q(o.y0),x=B?o.x1:K(o.x1),b=N?o.y1:Q(o.y1)),f<x?(E=f,P="x0",C=x,z="x1"):(E=x,P="x1",C=f,z="x0"),!N&&v<b||N&&v>b?(M=v,I="y0",S=b,L="y1"):(M=b,I="y1",S=v,L="y0"),ot(r),ft(u,o),dt(e,o,t),nt.moveFn="move"===D?ct:ht,nt.altKey=r.altKey)}function lt(){_(t)||(d(e),pt(u),T(e,t,o),n.call("_guiRelayout",t,c.getUpdateObj()))}function ut(){_(t)||pt(u)}function ct(r,n){if("path"===o.type){var i=function(t){return t},a=i,c=i;B?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(K(t)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),N?V("yanchor",o.yanchor=et(A+n)):(c=function(t){return et(Q(t)+n)},Z&&"date"===Z.type&&(c=g.encodeDate(c))),V("path",o.path=k(O,a,c))}else B?V("xanchor",o.xanchor=tt(w+r)):(V("x0",o.x0=tt(f+r)),V("x1",o.x1=tt(x+r))),N?V("yanchor",o.yanchor=et(A+n)):(V("y0",o.y0=et(v+n)),V("y1",o.y1=et(b+n)));e.attr("d",y(t,o)),ft(u,o),l(t,s,o,q)}function ht(r,n){if(U){var i=function(t){return t},a=i,c=i;B?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(K(t)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),N?V("yanchor",o.yanchor=et(A+n)):(c=function(t){return et(Q(t)+n)},Z&&"date"===Z.type&&(c=g.encodeDate(c))),V("path",o.path=k(O,a,c))}else if(j){if("resize-over-start-point"===D){var h=f+r,p=N?v-n:v+n;V("x0",o.x0=B?h:tt(h)),V("y0",o.y0=N?p:et(p))}else if("resize-over-end-point"===D){var d=x+r,m=N?b-n:b+n;V("x1",o.x1=B?d:tt(d)),V("y1",o.y1=N?m:et(m))}}else{var _=function(t){return-1!==D.indexOf(t)},T=_("n"),G=_("s"),W=_("w"),Y=_("e"),X=T?M+n:M,$=G?S+n:S,J=W?E+r:E,rt=Y?C+r:C;N&&(T&&(X=M-n),G&&($=S-n)),(!N&&$-X>F||N&&X-$>F)&&(V(I,o[I]=N?X:et(X)),V(L,o[L]=N?$:et($))),rt-J>R&&(V(P,o[P]=B?J:tt(J)),V(z,o[z]=B?rt:tt(rt)))}e.attr("d",y(t,o)),ft(u,o),l(t,s,o,q)}function ft(t,e){function r(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]),a=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":a}).classed("visual-cue",!0);var o=K(B?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,m.paramIsX))),s=Q(N?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,m.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,a),s=g.roundPositionForSharpStrokeRendering(s,a),B&&N){var l="M"+(o-1-a)+","+(s-1-a)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(B){var u="M"+(o-1-a)+","+(s-9-a)+"v18 h2 v-18 Z";n.attr("d",u)}else{var c="M"+(o-9-a)+","+(s-1-a)+"h18 v2 h-18 Z";n.attr("d",c)}}(B||N)&&r()}function pt(t){t.selectAll(".visual-cue").remove()}function dt(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"!==n&&!o.autorange&&(l+=n),"paper"!==i&&!s.autorange&&(l+=i),h.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}p.init(nt),rt.node().onmousemove=ot}(t,F,v,e,u,D):!0===v.editable&&F.style("pointer-events",z||c.opacity(C)*E<=.5?"stroke":"all");F.node().addEventListener("click",function(){return function(t,e){if(b(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,x(t)}}}(t,F)})}v._input&&!0===v.visible&&("above"===v.layer?M(t._fullLayout._shapeUpperLayer):"paper"===v.xref||"paper"===v.yref?M(t._fullLayout._shapeLowerLayer):"between"===v.layer?M(w.shapelayerBetween):w._hadPlotinfo?M((w.mainplotinfo||w).shapelayer):M(t._fullLayout._shapeLowerLayer))}function T(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function k(t,e,r){return t.replace(m.segmentRE,function(t){var n=0,i=t.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+t.substr(1).replace(m.paramRE,function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t})})}function A(t){b(t)&&t._fullLayout._activeShapeIndex>=0&&(u(t),delete t._fullLayout._activeShapeIndex,x(t))}e.exports={draw:x,drawOne:w,eraseActiveShape:function(t){if(b(t)){u(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e<r.length){for(var i=[],a=0;a<r.length;a++)a!==e&&i.push(r[a]);return delete t._fullLayout._activeShapeIndex,n.call("_guiRelayout",t,{shapes:i})}}},drawLabel:l}}),Zr=f((t,e)=>{var r=Ut(),n=we(),i=ye(),a=Dr(),o=Gr().eraseActiveShape,s=oe(),l=s._,u=e.exports={};function c(t,e){var n,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},h=i.list(t,null,!0),f=u._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(a=0;a<h.length;a++)if(("none"===(n=h[a]).modebardisable||-1===n.modebardisable.indexOf("auto"===l||"reset"===l?"autoscale":"zoominout"))&&!n.fixedrange)if(p=n._name,"auto"===l)c[p+".autorange"]=!0;else if("reset"===l)void 0===n._rangeInitial0&&void 0===n._rangeInitial1?c[p+".autorange"]=!0:void 0===n._rangeInitial0?(c[p+".autorange"]=n._autorangeInitial,c[p+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(c[p+".range"]=[n._rangeInitial0,null],c[p+".autorange"]=n._autorangeInitial):c[p+".range"]=[n._rangeInitial0,n._rangeInitial1],void 0!==n._showSpikeInitial&&(c[p+".showspikes"]=n._showSpikeInitial,"on"===f&&!n._showSpikeInitial&&(f="off"));else{var y=[n.r2l(n.range[0]),n.r2l(n.range[1])],v=[m*y[0]+g*y[1],m*y[1]+g*y[0]];c[p+".range[0]"]=n.l2r(v[0]),c[p+".range[1]"]=n.l2r(v[1])}}else"hovermode"===s&&("x"===l||"y"===l)&&(l=u._isHoriz?"y":"x",o.setAttribute("data-val",l)),c[s]=l;u._cartesianSpikesEnabled=f,r.call("_guiRelayout",t,c)}function h(t,e){for(var n=e.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d||[],s={},l=i.split("."),u=0;u<o.length;u++)s[o[u]+"."+l[1]]=a;var c="pan"===a?a:"zoom";s.dragmode=c,r.call("_guiRelayout",t,s)}function f(t,e){for(var n=e.currentTarget.getAttribute("data-attr"),i="resetLastSave"===n,a="resetDefault"===n,o=t._fullLayout,s=o._subplots.gl3d||[],l={},u=0;u<s.length;u++){var c,h=s[u],f=h+".camera",p=h+".aspectratio",d=h+".aspectmode",m=o[h]._scene;i?(l[f+".up"]=m.viewInitial.up,l[f+".eye"]=m.viewInitial.eye,l[f+".center"]=m.viewInitial.center,c=!0):a&&(l[f+".up"]=null,l[f+".eye"]=null,l[f+".center"]=null,c=!0),c&&(l[p+".x"]=m.viewInitial.aspectratio.x,l[p+".y"]=m.viewInitial.aspectratio.y,l[p+".z"]=m.viewInitial.aspectratio.z,l[d]=m.viewInitial.aspectmode)}r.call("_guiRelayout",t,l)}function p(t,e){var r=e.currentTarget,n=r._previousVal,i=t._fullLayout,a=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var u=0;u<a.length;u++){var c=a[u],h=i[c],f=c+".hovermode";s[f]=h.hovermode,l[f]=!1;for(var p=0;p<3;p++){var d=o[p],m=c+"."+d+".showspikes";l[m]=!1,s[m]=h[d].showspikes}}r._previousVal=s}return l}function d(t,e){for(var n=e.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=t._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var u=s[l],c=o[u];if("zoom"===i){var h=c.projection.scale,f="in"===a?2*h:.5*h;r.call("_guiRelayout",t,u+".projection.scale",f)}}"reset"===i&&_(t,"geo")}function m(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function g(t){var e=m(t);r.call("_guiRelayout",t,"hovermode",e)}function y(t,e){x(t,e,"mapbox")}function v(t,e){x(t,e,"map")}function x(t,e,n){for(var i=e.currentTarget.getAttribute("data-val"),a=t._fullLayout,o=a._subplots[n]||[],s={},l=0;l<o.length;l++){var u=o[l],c=a[u].zoom,h="in"===i?1.05*c:c/1.05;s[u+".zoom"]=h}r.call("_guiRelayout",t,s)}function _(t,e){for(var n=t._fullLayout,i=n._subplots[e]||[],a={},o=0;o<i.length;o++)for(var s=i[o],l=n[s]._subplot.viewInitial,u=Object.keys(l),c=0;c<u.length;c++){var h=u[c];a[s+"."+h]=l[h]}r.call("_guiRelayout",t,a)}u.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return l(t,"png"===e?"Download plot as a PNG":"Download plot")},icon:a.camera,click:function(t){var e=t._context.toImageButtonOptions,n={format:e.format||"png"};s.notifier(l(t,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(t){t in e&&(n[t]=e[t])}),r.call("downloadImage",t,n).then(function(e){s.notifier(l(t,"Snapshot succeeded")+" - "+e,"long")}).catch(function(){s.notifier(l(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}},u.sendDataToCloud={name:"sendDataToCloud",title:function(t){return l(t,"Edit in Chart Studio")},icon:a.disk,click:function(t){n.sendDataToCloud(t)}},u.editInChartStudio={name:"editInChartStudio",title:function(t){return l(t,"Edit in Chart Studio")},icon:a.pencil,click:function(t){n.sendDataToCloud(t)}},u.zoom2d={name:"zoom2d",_cat:"zoom",title:function(t){return l(t,"Zoom")},attr:"dragmode",val:"zoom",icon:a.zoombox,click:c},u.pan2d={name:"pan2d",_cat:"pan",title:function(t){return l(t,"Pan")},attr:"dragmode",val:"pan",icon:a.pan,click:c},u.select2d={name:"select2d",_cat:"select",title:function(t){return l(t,"Box Select")},attr:"dragmode",val:"select",icon:a.selectbox,click:c},u.lasso2d={name:"lasso2d",_cat:"lasso",title:function(t){return l(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:a.lasso,click:c},u.drawclosedpath={name:"drawclosedpath",title:function(t){return l(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:a.drawclosedpath,click:c},u.drawopenpath={name:"drawopenpath",title:function(t){return l(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:a.drawopenpath,click:c},u.drawline={name:"drawline",title:function(t){return l(t,"Draw line")},attr:"dragmode",val:"drawline",icon:a.drawline,click:c},u.drawrect={name:"drawrect",title:function(t){return l(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:a.drawrect,click:c},u.drawcircle={name:"drawcircle",title:function(t){return l(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:a.drawcircle,click:c},u.eraseshape={name:"eraseshape",title:function(t){return l(t,"Erase active shape")},icon:a.eraseshape,click:o},u.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:c},u.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:c},u.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(t){return l(t,"Autoscale")},attr:"zoom",val:"auto",icon:a.autoscale,click:c},u.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(t){return l(t,"Reset axes")},attr:"zoom",val:"reset",icon:a.home,click:c},u.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(t){return l(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:c},u.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(t){return l(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:a.tooltip_compare,gravity:"ne",click:c},u.zoom3d={name:"zoom3d",_cat:"zoom",title:function(t){return l(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:a.zoombox,click:h},u.pan3d={name:"pan3d",_cat:"pan",title:function(t){return l(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:a.pan,click:h},u.orbitRotation={name:"orbitRotation",title:function(t){return l(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:a["3d_rotate"],click:h},u.tableRotation={name:"tableRotation",title:function(t){return l(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:a["z-axis"],click:h},u.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(t){return l(t,"Reset camera to default")},attr:"resetDefault",icon:a.home,click:f},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(t){return l(t,"Reset camera to last save")},attr:"resetLastSave",icon:a.movie,click:f},u.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(t,e){var n=p(t,e);r.call("_guiRelayout",t,n)}},u.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:d},u.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:d},u.resetGeo={name:"resetGeo",_cat:"reset",title:function(t){return l(t,"Reset")},attr:"reset",val:null,icon:a.autoscale,click:d},u.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:g},u.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:g},u.resetViewSankey={name:"resetSankeyGroup",title:function(t){return l(t,"Reset view")},icon:a.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},n=0;n<t._fullData.length;n++){var i=t._fullData[n]._viewInitial;e["node.groups"].push(i.node.groups.slice()),e["node.x"].push(i.node.x.slice()),e["node.y"].push(i.node.y.slice())}r.call("restyle",t,e)}},u.toggleHover={name:"toggleHover",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(t,e){var n=p(t,e);n.hovermode=m(t),r.call("_guiRelayout",t,n)}},u.resetViews={name:"resetViews",title:function(t){return l(t,"Reset views")},icon:a.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),c(t,e),r.setAttribute("data-attr","resetLastSave"),f(t,e),_(t,"geo"),_(t,"mapbox"),_(t,"map")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(t){return l(t,"Toggle Spike Lines")},icon:a.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,n=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled="on"===n?"off":"on",r.call("_guiRelayout",t,function(t){for(var e="on"===t._fullLayout._cartesianSpikesEnabled,r=i.list(t,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!e||o._showSpikeInitial}return n}(t))}},u.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(t){return l(t,"Reset view")},attr:"reset",icon:a.home,click:function(t){_(t,"mapbox")}},u.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(t){return l(t,"Reset view")},attr:"reset",icon:a.home,click:function(t){_(t,"map")}},u.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:y},u.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:v},u.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:y},u.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:v}}),Wr=f((t,e)=>{var r=Zr(),n=Object.keys(r),i=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],a=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(i),o=[];n.forEach(function(t){!function(t){if(-1===a.indexOf(t._cat||t.name)){var e=t.name,r=(t._cat||t.name).toLowerCase();-1===o.indexOf(e)&&o.push(e),-1===o.indexOf(r)&&o.push(r)}}(r[t])}),o.sort(),e.exports={DRAW_MODES:i,backButtons:a,foreButtons:o}}),Yr=f((t,e)=>{Wr(),e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}),Xr=f((t,e)=>{var r=oe(),n=q(),i=me(),a=Yr();e.exports=function(t,e){var o=t.modebar||{},s=i.newContainer(e,"modebar");function l(t,e){return r.coerce(o,s,a,t,e)}l("orientation"),l("bgcolor",n.addOpacity(e.paper_bgcolor,.5));var u=n.contrast(n.rgb(e.modebar.bgcolor));l("color",n.addOpacity(u,.3)),l("activecolor",n.addOpacity(u,.7)),l("uirevision",e.uirevision),l("add"),l("remove")}}),$r=f((t,e)=>{var r=v(),n=T(),i=oe(),a=Dr(),o=g().version,s=new DOMParser;function l(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var u=l.prototype;u.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this.element.setAttribute("role","toolbar"),this._uid=a,this.element.className="modebar modebar--custom","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,s="#"+a+" .modebar-group";document.querySelectorAll(s).forEach(function(t){t.style.backgroundColor=o.bgcolor});var l=!this.hasButtons(e),u=this.hasLogo!==r.displaylogo,c=this.locale!==r.locale;if(this.locale=r.locale,(l||u||c)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var h=this.getLogo();r.watermark&&(h.className=h.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(h,this.element.childNodes[0]):this.element.appendChild(h),this.hasLogo=!0}this.updateActiveButton(),i.setStyleOnHover("#"+a+" .modebar-btn",".active",".icon path","fill: "+o.activecolor,"fill: "+o.color,this.element)},u.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)})},u.createGroup=function(){var t=document.createElement("div");t.className="modebar-group";var e=this.graphInfo._fullLayout.modebar;return t.style.backgroundColor=e.bgcolor,t},u.createButton=function(t){var e=this,n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("rel","tooltip"),n.className="modebar-btn";var i=t.title;void 0===i?i=t.name:"function"==typeof i&&(i=i(this.graphInfo)),(i||0===i)&&(n.setAttribute("data-title",i),n.setAttribute("aria-label",i)),void 0!==t.attr&&n.setAttribute("data-attr",t.attr);var o=t.val;if(void 0!==o&&("function"==typeof o&&(o=o(this.graphInfo)),n.setAttribute("data-val",o)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");n.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),n.setAttribute("data-toggle",t.toggle||!1),t.toggle&&r.select(n).classed("active",!0);var s=t.icon;return"function"==typeof s?n.appendChild(s()):n.appendChild(this.createIcon(s||a.question)),n.setAttribute("data-gravity",t.gravity||"n"),n},u.createIcon=function(t){var e,r=n(t.height)?Number(t.height):t.ascent-t.descent,i="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(i,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var a=document.createElementNS(i,"path");a.setAttribute("d",t.path),t.transform?a.setAttribute("transform",t.transform):void 0!==t.ascent&&a.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(a)}return t.svg&&(e=s.parseFromString(t.svg,"application/xml").childNodes[0]),e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},u.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,n=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var a=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=r.select(t),u=function(t,r){var n=e.modebar,i=t.querySelector(".icon path");i&&(r||t.matches(":hover")?i.style.fill=n.activecolor:i.style.fill=n.color)};if(s){if(o===n){var c=!l.classed("active");l.classed("active",c),u(t,c)}}else{var h=null===o?o:i.nestedProperty(e,o).get();l.classed("active",h===a),u(t,h===a)}})},u.hasButtons=function(t){var e=this.buttons;if(!e||t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},u.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",function(t){return t+" (v"+o+")"}(i._(this.graphInfo,"Produced with Plotly.js"))),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(a.newplotlylogo)),t.appendChild(e),t},u.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},u.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},e.exports=function(t,e){var n=t._fullLayout,i=new l({graphInfo:t,container:n._modebardiv.node(),buttons:e});return n._privateplot&&r.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}}),Jr=f((t,e)=>{var r=ye(),n=Ze(),i=Ut(),a=Ye().isUnifiedHover,o=$r(),s=Zr(),l=Wr().DRAW_MODES,u=oe().extendDeep;e.exports=function(t){var e=t._fullLayout,c=t._context,h=e._modeBar;if(c.displayModeBar||c.watermark){if(!Array.isArray(c.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(c.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,p=c.modeBarButtons;f=Array.isArray(p)&&p.length?function(t){for(var e=u([],t),r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if("string"==typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));e[r][i]=s[a]}}return e}(p):!c.displayModeBar&&c.watermark?[]:function(t){var e=t._fullLayout,o=t._fullData,u=t._context;function c(t,e){if("string"==typeof e){if(e.toLowerCase()===t.toLowerCase())return!0}else{var r=e.name,n=e._cat||e.name;if(r===t||n===t.toLowerCase())return!0}return!1}var h=e.modebar.add;"string"==typeof h&&(h=[h]);var f=e.modebar.remove;"string"==typeof f&&(f=[f]);var p=u.modeBarButtonsToAdd.concat(h.filter(function(t){for(var e=0;e<u.modeBarButtonsToRemove.length;e++)if(c(t,u.modeBarButtonsToRemove[e]))return!1;return!0})),d=u.modeBarButtonsToRemove.concat(f.filter(function(t){for(var e=0;e<u.modeBarButtonsToAdd.length;e++)if(c(t,u.modeBarButtonsToAdd[e]))return!1;return!0})),m=e._has("cartesian"),g=e._has("gl3d"),y=e._has("geo"),v=e._has("pie"),x=e._has("funnelarea"),_=e._has("ternary"),b=e._has("mapbox"),w=e._has("map"),T=e._has("polar"),k=e._has("smith"),A=e._has("sankey"),M=function(t){for(var e=r.list({_fullLayout:t},null,!0),n=0;n<e.length;n++){var i=e[n].modebardisable;if(!e[n].fixedrange&&"autoscale+zoominout"!==i&&"zoominout+autoscale"!==i)return!1}return!0}(e),S=a(e.hovermode),E=[];function C(t){if(t.length){for(var e=[],r=0;r<t.length;r++){for(var n=t[r],i=s[n],a=i.name.toLowerCase(),o=(i._cat||i.name).toLowerCase(),l=!1,u=0;u<d.length;u++){var c=d[u].toLowerCase();if(c===a||c===o){l=!0;break}}l||e.push(s[n])}E.push(e)}}var I=["toImage"];u.showEditInChartStudio?I.push("editInChartStudio"):u.showSendToCloud&&I.push("sendDataToCloud"),C(I);var L=[],P=[],z=[],O=[];(m||v||x||_)+y+g+b+w+T+k>1?(P=["toggleHover"],z=["resetViews"]):y?(L=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],z=["resetGeo"]):g?(P=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(L=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],z=["resetViewMapbox"]):w?(L=["zoomInMap","zoomOutMap"],P=["toggleHover"],z=["resetViewMap"]):v?P=["hoverClosestPie"]:A?(P=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):P=["toggleHover"],m&&P.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var e=0;e<t.length;e++)if(!i.traceIs(t[e],"noHover"))return!1;return!0}(o)||S)&&(P=[]),m&&!M&&(L=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==z[0]&&(z=["resetScale2d"])),g?O=["zoom3d","pan3d","orbitRotation","tableRotation"]:m&&!M||_?O=["zoom2d","pan2d"]:b||w||y?O=["pan2d"]:T&&(O=["zoom2d"]),function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var a=t[r];!a._module||!a._module.selectPoints||(i.traceIs(a,"scatter-like")?(n.hasMarkers(a)||n.hasText(a))&&(e=!0):i.traceIs(a,"box-violin")?("all"===a.boxpoints||"all"===a.points)&&(e=!0):e=!0)}return e}(o)&&O.push("select2d","lasso2d");var D=[],R=function(t){-1===D.indexOf(t)&&-1!==P.indexOf(t)&&D.push(t)};if(Array.isArray(p)){for(var F=[],B=0;B<p.length;B++){var N=p[B];"string"==typeof N?(N=N.toLowerCase(),-1!==l.indexOf(N)?(e._has("mapbox")||e._has("map")||e._has("cartesian"))&&O.push(N):"togglespikelines"===N?R("toggleSpikelines"):"togglehover"===N?R("toggleHover"):"hovercompare"===N?R("hoverCompareCartesian"):"hoverclosest"===N?(R("hoverClosestCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie")):"v1hovermode"===N&&(R("hoverClosestCartesian"),R("hoverCompareCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie"))):F.push(N)}p=F}return C(O),C(L.concat(z)),C(D),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(E,p)}(t),h?h.update(t,f):e._modeBar=o(t,f)}else h&&(h.destroy(),delete e._modeBar)}}),Kr=f((t,e)=>{e.exports={moduleType:"component",name:"modebar",layoutAttributes:Yr(),supplyLayoutDefaults:Xr(),manage:Jr()}}),Qr=f((t,e)=>{var r=ke().FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*n;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}}),tn=f(t=>{var e=oe(),r=er(),n=ye().id2name,i=Ee(),a=Qr(),o=Qe(),s=k().ALMOST_EQUAL,l=ke().FROM_BL;function u(t,r,a){var o=a.axIds,s=a.layoutOut,l=a.hasImage,u=s._axisConstraintGroups,p=s._axisMatchGroups,d=r._id,m=d.charAt(0),g=((s._splomAxes||{})[m]||{})[d]||{},y=r._id,v="x"===y.charAt(0);function x(n,a){return e.coerce(t,r,i,n,a)}r._matchGroup=null,r._constraintGroup=null,x("constrain",l?"domain":"range"),e.coerce(t,r,{constraintoward:{valType:"enumerated",values:v?["left","center","right"]:["bottom","middle","top"],dflt:v?"center":"middle"}},"constraintoward");var _,b,w=r.type,T=[];for(_=0;_<o.length;_++)(b=o[_])!==y&&s[n(b)].type===w&&T.push(b);var k=h(u,y);if(k){var A=[];for(_=0;_<T.length;_++)k[b=T[_]]||A.push(b);T=A}var M,S,E=T.length;E&&(t.matches||g.matches)&&(M=e.coerce(t,r,{matches:{valType:"enumerated",values:T,dflt:-1!==T.indexOf(g.matches)?g.matches:void 0}},"matches"));var C=l&&!v?r.anchor:void 0;if(E&&!M&&(t.scaleanchor||C)&&(S=e.coerce(t,r,{scaleanchor:{valType:"enumerated",values:T.concat([!1])}},"scaleanchor",C)),M){r._matchGroup=f(p,y,M,1);var I=s[n(M)],L=c(s,r)/c(s,I);v!==("x"===M.charAt(0))&&(L=(v?"x":"y")+L),f(u,y,M,L)}else t.matches&&-1!==o.indexOf(t.matches)&&e.warn("ignored "+r._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(S){var P=x("scaleratio");P||(P=r.scaleratio=1),f(u,y,S,P)}else t.scaleanchor&&-1!==o.indexOf(t.scaleanchor)&&e.warn("ignored "+r._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function c(t,e){var r=e.domain;return r||(r=t[n(e.overlaying)].domain),r[1]-r[0]}function h(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function f(t,e,r,n){var i,a,o,s,l,u=h(t,e);null===u?((u={})[e]=1,l=t.length,t.push(u)):l=t.indexOf(u);var c=Object.keys(u);for(i=0;i<t.length;i++)if(o=t[i],i!==l&&o[r]){var f=o[r];for(a=0;a<c.length;a++)o[s=c[a]]=p(f,p(n,u[s]));return void t.splice(l,1)}if(1!==n)for(a=0;a<c.length;a++){var d=c[a];u[d]=p(n,u[d])}u[r]=1}function p(t,e){var r,n,i="",a="";"string"==typeof t&&(r=(i=t.match(/^[xy]*/)[0]).length,t=+t.substr(r)),"string"==typeof e&&(n=(a=e.match(/^[xy]*/)[0]).length,e=+e.substr(n));var o=t*e;return r||n?r&&n&&i.charAt(0)!==a.charAt(0)?r===n?o:(r>n?i.substr(n):a.substr(r))+o:i+a+t*e:o}function d(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;o<a.length;o++){var s=a[o],l=t[s];if("string"==typeof l){var u=l.match(/^[xy]*/)[0],c=u.length;l=+l.substr(c);for(var h="y"===u.charAt(0)?n:1/n,f=0;f<c;f++)l*=h}i[s]=l}return i}function m(t,e){var r=t._inputDomain,n=l[t.constraintoward],i=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e],t.setScale()}t.handleDefaults=function(t,r,i){var a,s,l,c,h,f,p,d,m=i.axIds,g=i.axHasImage,y=r._axisConstraintGroups=[],v=r._axisMatchGroups=[];for(a=0;a<m.length;a++)u(h=t[c=n(m[a])],f=r[c],{axIds:m,layoutOut:r,hasImage:g[c]});function x(t,e){for(a=0;a<t.length;a++)for(l in s=t[a])r[n(l)][e]=s}for(x(v,"_matchGroup"),a=0;a<y.length;a++)for(l in s=y[a])if((f=r[n(l)]).fixedrange){for(var _ in s){var b=n(_);!1===(t[b]||{}).fixedrange&&e.warn("fixedrange was specified as false for axis "+b+" but was overridden because another axis in its constraint group has fixedrange true"),r[b].fixedrange=!0}break}for(a=0;a<y.length;){for(l in s=y[a]){(f=r[n(l)])._matchGroup&&Object.keys(f._matchGroup).length===Object.keys(s).length&&(y.splice(a,1),a--);break}a++}x(y,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],T=!1,k=!1;function A(){d=f[p],"rangebreaks"===p&&(k=f._hasDayOfWeekBreaks)}for(a=0;a<v.length;a++){s=v[a];for(var M=0;M<w.length;M++){var S;for(l in p=w[M],d=null,s)if(h=t[c=n(l)],f=r[c],p in f){if(!f.matches&&(S=f,p in h)){A();break}null===d&&p in h&&A()}if("range"===p&&d&&h.range&&2===h.range.length&&null!==h.range[0]&&null!==h.range[1]&&(T=!0),"autorange"===p&&null===d&&T&&(d=!1),null===d&&p in S&&(d=S[p]),null!==d)for(l in s)(f=r[n(l)])[p]="range"===p?d.slice():d,"rangebreaks"===p&&(f._hasDayOfWeekBreaks=k,o(f,r))}}},t.enforce=function(t){var e,i,o,l,u,c,h,f,p=t._fullLayout,g=p._axisConstraintGroups||[];for(e=0;e<g.length;e++){o=d(g[e],p);var y=Object.keys(o),v=1/0,x=0,_=1/0,b={},w={},T=!1;for(i=0;i<y.length;i++)w[l=y[i]]=u=p[n(l)],u._inputDomain?u.domain=u._inputDomain.slice():u._inputDomain=u.domain.slice(),u._inputRange||(u._inputRange=u.range.slice()),u.setScale(),b[l]=c=Math.abs(u._m)/o[l],v=Math.min(v,c),("domain"===u.constrain||!u._constraintShrinkable)&&(_=Math.min(_,c)),delete u._constraintShrinkable,x=Math.max(x,c),"domain"===u.constrain&&(T=!0);if(!(v>s*x)||T)for(i=0;i<y.length;i++)if(c=b[l=y[i]],h=(u=w[l]).constrain,c!==_||"domain"===h)if(f=c/_,"range"===h)a(u,f);else{var k=u._inputDomain,A=(u.domain[1]-u.domain[0])/(k[1]-k[0]),M=(u.r2l(u.range[1])-u.r2l(u.range[0]))/(u.r2l(u._inputRange[1])-u.r2l(u._inputRange[0]));if((f/=A)*M<1){u.domain=u._input.domain=k.slice(),a(u,f);continue}if(M<1&&(u.range=u._input.range=u._inputRange.slice(),f*=M),u.autorange){var S=u.r2l(u.range[0]),E=u.r2l(u.range[1]),C=(S+E)/2,I=C,L=C,P=Math.abs(E-C),z=C-P*f*1.0001,O=C+P*f*1.0001,D=r.makePadFn(p,u,0),R=r.makePadFn(p,u,1);m(u,f);var F,B,N=Math.abs(u._m),j=r.concatExtremes(t,u),U=j.min,V=j.max;for(B=0;B<U.length;B++)(F=U[B].val-D(U[B])/N)>z&&F<I&&(I=F);for(B=0;B<V.length;B++)(F=V[B].val+R(V[B])/N)<O&&F>L&&(L=F);f/=(L-I)/(2*P),I=u.l2r(I),L=u.l2r(L),u.range=u._input.range=S<E?[I,L]:[L,I]}m(u,f)}}},t.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n<r.length;n++)if(r[n][e])return"g"+n;return e},t.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,i=t._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}(!r||"domain"!==e.constrain)&&(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}}),en=f(t=>{var e=v(),r=Ut(),n=we(),i=oe(),a=Ae(),o=Or(),s=q(),l=Je(),u=Ke(),c=Kr(),h=rr(),f=ke(),p=tn(),d=p.enforce,m=p.clean,g=er().doAutoRange,y="start",x="middle",_="end",b=ge().zindexSeparator;function w(t,e,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=t[1]||i[1]<=t[0])&&a[0]<e[1]&&a[1]>e[0])return!0}return!1}function T(r){var a,o,u,p,d,m,g=r._fullLayout,y=g._size,v=y.p,x=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),t.drawMainTitle(r),c.manage(r),!g._has("cartesian"))return n.previousPromises(r);function _(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-v-n:e._offset+e._length+v+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+v+n:e._offset-v-n:y.l+y.w*(t.position||0)+n%1}for(a=0;a<x.length;a++){var T=(p=x[a])._anchorAxis;p._linepositions={},p._lw=l.crispRound(r,p.linewidth,1),p._mainLinePosition=_(p,T,p.side),p._mainMirrorPosition=p.mirror&&T?_(p,T,f.OPPOSITE_SIDE[p.side]):null}var A=[],S=[],E=[],C=1===s.opacity(g.paper_bgcolor)&&1===s.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(o in g._plots)if((u=g._plots[o]).mainplot)u.bg&&u.bg.remove(),u.bg=void 0;else{var I=u.xaxis.domain,L=u.yaxis.domain,P=u.plotgroup;if(w(I,L,E)&&-1===o.indexOf(b)){var z=P.node(),O=u.bg=i.ensureSingle(P,"rect","bg");z.insertBefore(O.node(),z.childNodes[0]),S.push(o)}else P.select("rect.bg").remove(),E.push([I,L]),C||(A.push(o),S.push(o))}var D,R,F,B,N,j,U,V,q,H,G,Z,W,Y=g._bgLayer.selectAll(".bg").data(A);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each(function(t){g._plots[t].bg=e.select(this)}),a=0;a<S.length;a++)u=g._plots[S[a]],d=u.xaxis,m=u.yaxis,u.bg&&void 0!==d._offset&&void 0!==m._offset&&u.bg.call(l.setRect,d._offset-v,m._offset-v,d._length+2*v,m._length+2*v).call(s.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(o in g._plots){u=g._plots[o],d=u.xaxis,m=u.yaxis;var X,$,J=u.clipId="clip"+g._uid+o+"plot",K=i.ensureSingleById(g._clips,"clipPath",J,function(t){t.classed("plotclip",!0).append("rect")});u.clipRect=K.select("rect").attr({width:d._length,height:m._length}),l.setTranslate(u.plot,d._offset,m._offset),u._hasClipOnAxisFalse?(X=null,$=J):(X=J,$=null),l.setClipUrl(u.plot,X,r),u.layerClipId=$}function Q(t){return"M"+D+","+t+"H"+R}function tt(t){return"M"+d._offset+","+t+"h"+d._length}function et(t){return"M"+t+","+V+"V"+U}function rt(t){return void 0!==m._shift&&(t+=m._shift),"M"+t+","+m._offset+"v"+m._length}function nt(t,e,r){if(!t.showline||o!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(o in g._plots){u=g._plots[o],d=u.xaxis,m=u.yaxis;var it="M0,0";k(d,o)&&(N=M(d,"left",m,x),D=d._offset-(N?v+N:0),j=M(d,"right",m,x),R=d._offset+d._length+(j?v+j:0),F=_(d,m,"bottom"),B=_(d,m,"top"),(W=!d._anchorAxis||o!==d._mainSubplot)&&("allticks"===d.mirror||"all"===d.mirror)&&(d._linepositions[o]=[F,B]),it=nt(d,Q,tt),W&&d.showline&&("all"===d.mirror||"allticks"===d.mirror)&&(it+=Q(F)+Q(B)),u.xlines.style("stroke-width",d._lw+"px").call(s.stroke,d.showline?d.linecolor:"rgba(0,0,0,0)")),u.xlines.attr("d",it);var at="M0,0";k(m,o)&&(G=M(m,"bottom",d,x),U=m._offset+m._length+(G?v:0),Z=M(m,"top",d,x),V=m._offset-(Z?v:0),q=_(m,d,"left"),H=_(m,d,"right"),(W=!m._anchorAxis||o!==m._mainSubplot)&&("allticks"===m.mirror||"all"===m.mirror)&&(m._linepositions[o]=[q,H]),at=nt(m,et,rt),W&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(at+=et(q)+et(H)),u.ylines.style("stroke-width",m._lw+"px").call(s.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),u.ylines.attr("d",at)}return h.makeClipPaths(r),n.previousPromises(r)}function k(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function A(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=f.FROM_BL[e];return r.side===e?n.domain[i]===t.domain[i]:r.mirror&&n.domain[1-i]===t.domain[1-i]}function M(t,e,r,n){if(A(t,e,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&A(t,e,a))return a._lw}return 0}function S(t){return"top"===t?f.CAP_SHIFT+.3+"em":"bottom"===t?"-0.3em":f.MID_SHIFT+"em"}t.layoutStyles=function(t){return i.syncOrAsync([n.doAutoMargin,T],t)},t.drawMainTitle=function(t){var r=t._fullLayout.title,o=t._fullLayout,s=function(t){var e=t.title,r=x;return i.isRightAnchor(e)?r=_:i.isLeftAnchor(e)&&(r=y),r}(o),c=function(t){var e=t.title,r="0em";return i.isTopAnchor(e)?r=f.CAP_SHIFT+"em":i.isMiddleAnchor(e)&&(r=f.MID_SHIFT+"em"),r}(o),h=function(t,e){var r=t.title,n=t._size,i=0;return"0em"!==e&&e?e===f.CAP_SHIFT+"em"&&(i=r.pad.t):i=-r.pad.b,"auto"===r.y?n.t/2:"paper"===r.yref?n.t+n.h-n.h*r.y+i:t.height-t.height*r.y+i}(o,c),p=function(t,e){var r=t.title,n=t._size,i=0;return"paper"===(e===y?i=r.pad.l:e===_&&(i=-r.pad.r),r.xref)?n.l+n.w*r.x+i:t.width*r.x+i}(o,s);if(u.draw(t,"gtitle",{propContainer:o,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:o._dfltTitle.plot,subtitlePlaceholder:o._dfltTitle.subtitle,attributes:{x:p,y:h,"text-anchor":s,dy:c}}),r.text&&r.automargin){var d=e.select(t).selectAll(".gtitle"),m=l.bBox(e.select(t).selectAll(".g-gtitle").node()).height,g=function(t,e,r){var n=e.y,i=e.yanchor,a=n>.5?"t":"b",o=t._fullLayout.margin[a],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===t?("top"===r&&(a+=i),a+=n-e*n):("bottom"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,r,m);if(g>0){(function(t,e,r,a){var o="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",u={x:s.x,y:s.y,t:0,b:0},c={};"paper"===s.yref&&function(t,e,r,n,a){var o="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=i.isTopAnchor(e)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(e)&&"t"===r||i.isBottomAnchor(e)&&"b"===r)&&l<a}(t,s,l,e,a)?u[l]=r:"container"===s.yref&&(c[l]=r,t._fullLayout._reservedMargin[o]=c),n.allowAutoMargin(t,o),n.autoMargin(t,o,u)})(t,h,g,m),d.attr({x:p,y:h,"text-anchor":s,dy:S(r.yanchor)}).call(a.positionText,p,h);var v=(r.text.match(a.BR_TAG_ALL)||[]).length;if(v){var b=f.LINE_SPACING*v+f.MID_SHIFT;0===r.y&&(b=-b),d.selectAll(".line").each(function(){var t=+this.getAttribute("dy").slice(0,-2)-b+"em";this.setAttribute("dy",t)})}var w=e.select(t).selectAll(".gtitle-subtitle");if(w.node()){var T=d.node().getBBox(),k=T.y+T.height+u.SUBTITLE_PADDING_EM*r.subtitle.font.size;w.attr({x:p,y:k,"text-anchor":s,dy:S(r.yanchor)}).call(a.positionText,p,k)}}}},t.doTraceStyle=function(e){var i,a=e.calcdata,s=[];for(i=0;i<a.length;i++){var l=a[i],u=l[0]||{},c=u.trace||{},h=c._module||{},f=h.arraysToCalcdata;f&&f(l,c);var p=h.editStyle;p&&s.push({fn:p,cd0:u})}if(s.length){for(i=0;i<s.length;i++){var d=s[i];d.fn(e,d.cd0)}o(e),t.redrawReglTraces(e)}return n.style(e),r.getComponentMethod("legend","draw")(e),n.previousPromises(e)},t.doColorBars=function(t){return r.getComponentMethod("colorbar","draw")(t),n.previousPromises(t)},t.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,r.call("_doPlot",t,"",e)},t.doLegend=function(t){return r.getComponentMethod("legend","draw")(t),n.previousPromises(t)},t.doTicksRelayout=function(e){return h.draw(e,"redraw"),e._fullLayout._hasOnlyLargeSploms&&(r.subplotsRegistry.splom.updateGrid(e),o(e),t.redrawReglTraces(e)),t.drawMainTitle(e),n.previousPromises(e)},t.doModeBar=function(t){var e=t._fullLayout;c.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var i=e._basePlotModules[r].updateFx;i&&i(t)}return n.previousPromises(t)},t.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var i=e[r[n]];i._scene.setViewport(i)}},t.drawData=function(e){var i=e._fullLayout;o(e);for(var a=i._basePlotModules,s=0;s<a.length;s++)a[s].plot(e);return t.redrawReglTraces(e),n.style(e),r.getComponentMethod("selections","draw")(e),r.getComponentMethod("shapes","draw")(e),r.getComponentMethod("annotations","draw")(e),r.getComponentMethod("images","draw")(e),i._replotting=!1,n.previousPromises(e)},t.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,a=t._fullData,o=[],s=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<a.length;r++){var l=a[r];!0===l.visible&&0!==l._length&&("splom"===l.type?e._splomScenes[l.uid].draw():"scattergl"===l.type?i.pushUnique(o,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&i.pushUnique(s,l.subplot))}for(r=0;r<o.length;r++)(n=e._plots[o[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=e[s[r]]._subplot)._scene&&n._scene.draw()}},t.doAutoRangeAndConstraints=function(t){for(var e,r=h.list(t,"",!0),n={},i=0;i<r.length;i++)if(!n[(e=r[i])._id]){n[e._id]=1,m(t,e),g(t,e);var a=e._matchGroup;if(a)for(var o in a){var s=h.getFromId(t,o);g(t,s,e.range),n[o]=1}}d(t)},t.finalDraw=function(t){r.getComponentMethod("rangeslider","draw")(t),r.getComponentMethod("rangeselector","draw")(t)},t.drawMarginPushers=function(t){r.getComponentMethod("legend","draw")(t),r.getComponentMethod("rangeselector","draw")(t),r.getComponentMethod("sliders","draw")(t),r.getComponentMethod("updatemenus","draw")(t),r.getComponentMethod("colorbar","draw")(t)}}),rn=f((t,e)=>{var r=Br().readPaths,n=Hr(),i=ve().clearOutlineControllers,a=q(),o=Je(),s=me().arrayEditor,l=Vr(),u=l.getPathString;function c(t){var e=t._fullLayout;for(var r in i(t),e._selectionLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].selectionLayer;n&&n.selectAll("path").remove()}for(var a=0;a<e.selections.length;a++)f(t,a)}function h(t){return t._context.editSelection}function f(t,e){t._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+e+'"]').remove();var i=l.makeSelectionsOptionsAndPlotinfo(t,e),f=i.options,m=i.plotinfo;f._input&&function(i){var l=u(t,f),g={"data-index":e,"fill-rule":"evenodd",d:l},y=f.opacity,v="rgba(0,0,0,0)",x=f.line.color||a.contrast(t._fullLayout.plot_bgcolor),_=f.line.width,b=f.line.dash;_||(_=5,b="solid");var w=h(t)&&t._fullLayout._activeSelectionIndex===e;w&&(v=t._fullLayout.activeselection.fillcolor,y=t._fullLayout.activeselection.opacity);for(var T=[],k=1;k>=0;k--){var A=i.append("path").attr(g).style("opacity",k?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,k?"solid":b,k?4+_:_);if(p(A,t,f),w){var M=s(t.layout,"selections",f);A.style({cursor:"move"});var S={element:A.node(),plotinfo:m,gd:t,editHelpers:M,isActiveSelection:!0},E=r(l,t);n(E,A,S)}else A.style("pointer-events",k?"all":"none");T[k]=A}var C=T[0];T[1].node().addEventListener("click",function(){return function(t,e){if(h(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void d(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=d,c(t)}}}(t,C)})}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;o.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function d(t){h(t)&&t._fullLayout._activeSelectionIndex>=0&&(i(t),delete t._fullLayout._activeSelectionIndex,c(t))}e.exports={draw:c,drawOne:f,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=d,c(t)}}}}),nn=f((t,e)=>{e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}}),an=f((t,e)=>{e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l<t||l-(a*a+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<t},linesIntersect:function(e,r,n,i){var a=r[0]-e[0],o=r[1]-e[1],s=i[0]-n[0],l=i[1]-n[1],u=a*l-o*s;if(Math.abs(u)<t)return!1;var c=e[0]-n[0],h=e[1]-n[1],f=(s*h-l*c)/u,p=(a*h-o*c)/u,d={alongA:0,alongB:0,pt:[e[0]+f*a,e[1]+f*o]};return d.alongA=f<=-t?-2:f<t?-1:f-1<=-t?0:f-1<t?1:2,d.alongB=p<=-t?-2:p<t?-1:p-1<=-t?0:p-1<t?1:2,d},pointInsideRegion:function(e,r){for(var n=e[0],i=e[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var u=r[l][0],c=r[l][1];c-i>t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}}),on=f((t,e)=>{e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return!(null===e||e===t.root)},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}}),sn=f((t,e)=>{var r=on();e.exports=function(t,e,n){function i(t,e){return{id:n?n.segmentId():-1,start:t,end:e,myFill:{above:null,below:null},otherFill:null}}function a(t,e,r){return{id:n?n.segmentId():-1,start:t,end:e,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var o=r.create();function s(t,r){o.insertBefore(t,function(n){var i=function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt);return i<0})}function l(t,e){var n=function(t,e){var n=r.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return s(n,t.end),n}(t,e);return function(t,e,n){var i=r.node({isStart:!1,pt:e.end,seg:e,primary:n,other:t,status:null});t.other=i,s(i,t.pt)}(n,t,e),n}function u(t,e){var r=a(e,t.seg.end,t.seg);return function(t,e){n&&n.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,s(t.other,t.pt)}(t,e),l(r,t.primary)}function c(i,a){var s=r.create();function l(t){return s.findTransition(function(r){var n=function(t,r){var n=t.seg.start,i=t.seg.end,a=r.seg.start,o=r.seg.end;return e.pointsCollinear(n,a,o)?e.pointsCollinear(i,a,o)||e.pointAboveOrOnLine(i,a,o)?1:-1:e.pointAboveOrOnLine(n,a,o)?1:-1}(t,r.ev);return n>0})}function c(t,r){var i=t.seg,a=r.seg,o=i.start,s=i.end,l=a.start,c=a.end;n&&n.checkIntersection(i,a);var h=e.linesIntersect(o,s,l,c);if(!1===h){if(!e.pointsCollinear(o,s,l)||e.pointsSame(o,c)||e.pointsSame(s,l))return!1;var f=e.pointsSame(o,l),p=e.pointsSame(s,c);if(f&&p)return r;var d=!f&&e.pointBetween(o,l,c),m=!p&&e.pointBetween(s,l,c);if(f)return m?u(r,s):u(t,c),r;d&&(p||(m?u(r,s):u(t,c)),u(r,o))}else 0===h.alongA&&(-1===h.alongB?u(t,l):0===h.alongB?u(t,h.pt):1===h.alongB&&u(t,c)),0===h.alongB&&(-1===h.alongA?u(r,o):0===h.alongA?u(r,h.pt):1===h.alongA&&u(r,s));return!1}for(var h=[];!o.isEmpty();){var f=o.getHead();if(n&&n.vert(f.pt[0]),f.isStart){let e=function(){if(d){var t=c(f,d);if(t)return t}return!!m&&c(f,m)};n&&n.segmentNew(f.seg,f.primary);var p=l(f),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;n&&n.tempStatus(f.seg,!!d&&d.seg,!!m&&m.seg);var g,y=e();if(y&&(t?(g=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above):y.seg.otherFill=f.seg.myFill,n&&n.segmentUpdate(y.seg),f.other.remove(),f.remove()),o.getHead()!==f){n&&n.rewind(f.seg);continue}if(t)g=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:i,f.seg.myFill.above=g?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill){var v;v=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?a:i,f.seg.otherFill={above:v,below:v}}n&&n.status(f.seg,!!d&&d.seg,!!m&&m.seg),f.other.status=p.insert(r.node({ev:f}))}else{var x=f.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}h.push(f.seg)}o.getHead().remove()}return n&&n.done(),h}return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a<t.length;a++){r=n,n=t[a];var o=e.pointsCompare(r,n);0!==o&&l(i(o<0?r:n,o<0?n:r),!0)}},calculate:function(t){return c(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach(function(t){l(a(t.start,t.end,t),!0)}),r.forEach(function(t){l(a(t.start,t.end,t),!1)}),c(e,n)}}}}),ln=f((t,e)=>{e.exports=function(t,e,r){var n=[],i=[];return t.forEach(function(t){var a=t.start,o=t.end;if(e.pointsSame(a,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s,c=0;c<n.length;c++){var h=(g=n[c])[0];g[1];var f=g[g.length-1];if(g[g.length-2],e.pointsSame(h,a)){if(k(c,!0,!0))break}else if(e.pointsSame(h,o)){if(k(c,!0,!1))break}else if(e.pointsSame(f,a)){if(k(c,!1,!0))break}else if(e.pointsSame(f,o)&&k(c,!1,!1))break}if(u===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(u===l){r&&r.chainMatch(s.index);var p=s.index,d=s.matches_pt1?o:a,m=s.matches_head,g=n[p],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],x=m?g[g.length-1]:g[0],_=m?g[g.length-2]:g[1];return e.pointsCollinear(v,y,d)&&(m?(r&&r.chainRemoveHead(s.index,d),g.shift()):(r&&r.chainRemoveTail(s.index,d),g.pop()),y=v),e.pointsSame(x,d)?(n.splice(p,1),e.pointsCollinear(_,x,y)&&(m?(r&&r.chainRemoveTail(s.index,y),g.pop()):(r&&r.chainRemoveHead(s.index,y),g.shift())),r&&r.chainClose(s.index),void i.push(g)):void(m?(r&&r.chainAddHead(s.index,d),g.unshift(d)):(r&&r.chainAddTail(s.index,d),g.push(d)))}var b=s.index,w=l.index;r&&r.chainConnect(b,w);var T=n[b].length<n[w].length;s.matches_head?l.matches_head?T?(A(b),M(b,w)):(A(w),M(w,b)):M(w,b):l.matches_head?M(b,w):T?(A(b),M(w,b)):(A(w),M(b,w))}function k(t,e,r){return u.index=t,u.matches_head=e,u.matches_pt1=r,u===s?(u=l,!1):(u=null,!0)}function A(t){r&&r.chainReverse(t),n[t].reverse()}function M(t,i){var a=n[t],o=n[i],s=a[a.length-1],l=a[a.length-2],u=o[0],c=o[1];e.pointsCollinear(l,s,u)&&(r&&r.chainRemoveTail(t,s),a.pop(),s=l),e.pointsCollinear(s,u,c)&&(r&&r.chainRemoveHead(i,u),o.shift()),r&&r.chainJoin(t,i),n[t]=a.concat(o),n.splice(i,1)}}),i}}),un=f((t,e)=>{function r(t,e,r){var n=[];return t.forEach(function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})}),r&&r.selected(n),n}var n={union:function(t,e){return r(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return r(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return r(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return r(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return r(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=n}),cn=f((t,e)=>{var r={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i<e.length;i++)n=t.selectDifference(t.combine(n,r(e[i])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),i=0;i<e.coordinates.length;i++)n=t.selectUnion(t.combine(n,r(e.coordinates[i])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function i(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var a=i(null);function o(t,e){for(var r=0;r<t.children.length;r++)if(n(e,(s=t.children[r]).region))return void o(s,e);var a=i(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(a.children.push(s),t.children.splice(r,1),r--)}t.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function u(t,e){for(var r=0,n=t[t.length-1][0],i=t[t.length-1][1],a=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==e&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var c=[];function h(t){var e=[u(t.region,!1)];c.push(e);for(var r=0;r<t.children.length;r++)e.push(f(t.children[r]))}function f(t){for(var e=0;e<t.children.length;e++)h(t.children[e]);return u(t.region,!0)}for(s=0;s<a.children.length;s++)h(a.children[s]);return c.length<=0?{type:"Polygon",coordinates:[]}:1==c.length?{type:"Polygon",coordinates:c[0]}:{type:"MultiPolygon",coordinates:c}}};e.exports=r}),hn=f((t,e)=>{var r,n=nn(),i=an(),a=sn(),o=ln(),s=un(),l=cn(),u=!1,c=i();function h(t,e,n){var i=r.segments(t),a=r.segments(e),o=n(r.combine(i,a));return r.polygon(o)}r={buildLog:function(t){return!0===t?u=n():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return c.epsilon(t)},segments:function(t){var e=a(!0,c,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:a(!1,c,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:o(t.segments,c,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return l.toPolygon(r,t)},polygonToGeoJSON:function(t){return l.fromPolygon(r,c,t)},union:function(t,e){return h(t,e,r.selectUnion)},intersect:function(t,e){return h(t,e,r.selectIntersect)},difference:function(t,e){return h(t,e,r.selectDifference)},differenceRev:function(t,e){return h(t,e,r.selectDifferenceRev)},xor:function(t,e){return h(t,e,r.selectXor)}},"object"==typeof window&&(window.PolyBool=r),e.exports=r}),fn=f((t,e)=>{e.exports=function(t,e,r,n){var i=t[0],a=t[1],o=!1;void 0===r&&(r=0),void 0===n&&(n=e.length);for(var s=n-r,l=0,u=s-1;l<s;u=l++){var c=e[l+r][0],h=e[l+r][1],f=e[u+r][0],p=e[u+r][1];h>a!=p>a&&i<(f-c)*(a-h)/(p-h)+c&&(o=!o)}return o}}),pn=f((t,e)=>{var r=Et().dot,n=k().BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for((r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),e=1;e<r.length;e++)i=Math.min(i,r[e][0]),a=Math.max(a,r[e][0]),o=Math.min(o,r[e][1]),s=Math.max(s,r[e][1]);var l,u=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(u=!0,l=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(u=!0,l=function(t){return t[1]===r[0][1]}));var c=!0,h=r[0];for(e=1;e<r.length;e++)if(h[0]!==r[e][0]||h[1]!==r[e][1]){c=!1;break}return{xmin:i,xmax:a,ymin:o,ymax:s,pts:r,contains:u?function(t,e){var r=t[0],u=t[1];return!(r===n||r<i||r>a||u===n||u<o||u>s||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===n||l<i||l>a||u===n||u<o||u>s)return!1;var c,h,f,p,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(c=1;c<m;c++)if(h=g,f=y,g=r[c][0],y=r[c][1],!(l<(p=Math.min(h,g))||l>Math.max(h,g)||u>Math.max(f,y)))if(u<Math.min(f,y))l!==p&&v++;else{if(u===(d=g===h?u:f+(l-h)*(y-f)/(g-h)))return!(1===c&&e);u<=d&&l!==p&&v++}return v%2==1},isRect:u,degenerate:c}},i.isSegmentBent=function(t,e,n,i){var a,o,s,l=t[e],u=[t[n][0]-l[0],t[n][1]-l[1]],c=r(u,u),h=Math.sqrt(c),f=[-u[1]/h,u[0]/h];for(a=e+1;a<n;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],(s=r(o,u))<0||s>c||Math.abs(r(o,f))>i)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||i.isSegmentBent(t,l,u+1,e))&&(r.push(t[u]),r.length<s-2&&(n=u,a=r.length-1),l=u)}return t.length>1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}}),dn=f((t,e)=>{e.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),mn=f((t,e)=>{var r=hn(),n=fn(),i=Ut(),a=Je().dashStyle,o=q(),s=Pr(),l=Ye().makeEventData,u=zr(),c=u.freeMode,h=u.rectMode,f=u.drawMode,p=u.openMode,d=u.selectMode,m=Vr(),g=Ur(),y=Hr(),v=ve().clearOutline,x=Br(),_=x.handleEllipse,b=x.readPaths,w=Nr().newShapes,T=jr(),k=rn().activateLastSelection,A=oe(),M=A.sorterAsc,S=pn(),E=$t(),C=ye().getFromId,I=Or(),L=en().redrawReglTraces,P=dn(),z=P.MINSELECT,O=S.filter,D=S.tester,R=Fr(),F=R.p2r,B=R.axValue,N=R.getTransform;function j(t){return void 0!==t.subplot}function U(t,e,r,n,i,a,o){var s,l,u,c,h,f,d,m,g,v=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,_=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){Z(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n<e.length;n++)if(r=e[n],i.fullData.index===r.cd[0].trace.index){if(!0===i.hoverOnBox)break;void 0!==i.pointNumber?a=i.pointNumber:void 0!==i.binNumber&&(a=i.binNumber,o=i.pointNumbers);break}return{pointNumber:a,pointNumbers:o,searchInfo:r}}(v,s=X(e,r,n,i));if(b.pointNumbers.length>0?function(t,e){var r,n,i,a=[];for(i=0;i<t.length;i++)(r=t[i]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i<e.pointNumbers.length;i++)if(n.selectedpoints.indexOf(e.pointNumbers[i])<0)return!1;return!0}return!1}(s,b):function(t){var e,r,n,i=0;for(n=0;n<t.length;n++)if(e=t[n],(r=e.cd[0].trace).selectedpoints&&(r.selectedpoints.length>1||(i+=r.selectedpoints.length)>1))return!1;return 1===i}(s)&&(f=J(b))){for(o&&o.remove(),g=0;g<s.length;g++)(l=s[g])._module.selectPoints(l,!1);K(e,s),W(a),x&&ft(e)}else{for(d=t.shiftKey&&(void 0!==f?f:J(b)),u=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:!!r}}(b.pointNumber,b.searchInfo,d),c=G(a.selectionDefs.concat([u])),g=0;g<s.length;g++)if(h=tt(s[g]._module.selectPoints(s[g],c),s[g]),_.length)for(var w=0;w<h.length;w++)_.push(h[w]);else _=h;if(K(e,s,m={points:_}),u&&a&&a.selectionDefs.push(u),o){var T=a.mergedPolygons,k=p(a.dragmode);y(et(T,k),o,a)}x&&ht(e,m)}}}function V(t){return"pointNumber"in t&&"searchInfo"in t}function H(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,i){var a=t.searchInfo.cd[0].trace.index;return i.cd[0].trace.index===a&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:!!t.subtract}}function G(t){if(t.length){for(var e=[],r=V(t[0])?0:t[0][0][0],n=r,i=V(t[0])?0:t[0][0][1],a=i,o=0;o<t.length;o++)if(V(t[o]))e.push(H(t[o]));else{var s=D(t[o]);s.subtract=!!t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:a,pts:[],contains:function(t,r,n,i){for(var a=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,i)&&(a=!e[o].subtract);return a},isRect:!1,degenerate:!1}}}function Z(t,e,r){var n=e._fullLayout,i=r.plotinfo,a=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===i.id,s=(t.shiftKey||t.altKey)&&!(f(a)&&p(a));o&&s&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):(!s||!i.selection)&&W(r),o||(v(e),n._lastSelectedSubplot=i.id)}function W(t,e){var r=t.dragmode,n=t.plotinfo,a=t.gd;(function(t){return t._fullLayout._activeShapeIndex>=0})(a)&&a._fullLayout._deactivateShape(a),function(t){return t._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=f(r),l=d(r);if(s||l){var u,c,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(u=w(h,t)),u&&i.call("_guiRelayout",a,{shapes:u}),l&&!j(t)&&(c=T(h,t)),c&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:c}).then(function(){e&&k(a)})),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Y(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Y),u=r.map(Y);for(o=0;o<t.calcdata.length;o++)if(!0===(a=(i=t.calcdata[o])[0].trace).visible&&a._module&&a._module.selectPoints)if(!j({subplot:n})||a.subplot!==n&&a.geo!==n)if("splom"===a.type){if(a._xaxes[l[0]]&&a._yaxes[u[0]]){var c=$(a._module,i,e[0],r[0]);c.scene=t._fullLayout._splomScenes[a.uid],s.push(c)}}else if("sankey"===a.type){var h=$(a._module,i,e[0],r[0]);s.push(h)}else{if(!(-1!==l.indexOf(a.xaxis)||a._xA&&a._xA.overlaying)||!(-1!==u.indexOf(a.yaxis)||a._yA&&a._yA.overlaying))continue;s.push($(a._module,i,C(t,a.xaxis),C(t,a.yaxis)))}else s.push($(a._module,i,e[0],r[0]));return s}function $(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}function J(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,i=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function K(t,e,r){var n,a;for(n=0;n<e.length;n++){var o=e[n].cd[0].trace._fullInput,s=t._fullLayout._tracePreGUI[o.uid]||{};void 0===s.selectedpoints&&(s.selectedpoints=o._input.selectedpoints||null)}if(r){var l=r.points||[];for(n=0;n<e.length;n++)(a=e[n].cd[0].trace)._input.selectedpoints=a._fullInput.selectedpoints=[],a._fullInput!==a&&(a.selectedpoints=[]);for(var u=0;u<l.length;u++){var c=l[u],h=c.data,f=c.fullData,p=c.pointIndex,d=c.pointIndices;d?([].push.apply(h.selectedpoints,d),a._fullInput!==a&&[].push.apply(f.selectedpoints,d)):(h.selectedpoints.push(p),a._fullInput!==a&&f.selectedpoints.push(p))}}else for(n=0;n<e.length;n++)delete(a=e[n].cd[0].trace).selectedpoints,delete a._input.selectedpoints,a._fullInput!==a&&delete a._fullInput.selectedpoints;!function(t,e){for(var r=!1,n=0;n<e.length;n++){var a=e[n],o=a.cd;i.traceIs(o[0].trace,"regl")&&(r=!0);var s=a._module,l=s.styleOnSelect||s.style;l&&(l(t,o,o[0].node3),o[0].nodeRangePlot3&&l(t,o,o[0].nodeRangePlot3))}r&&(I(t),L(t))}(t,e)}function Q(t,e,n){for(var i=(n?r.difference:r.union)({regions:t},{regions:[e]}).regions.reverse(),a=0;a<i.length;a++){var o=i[a];o.subtract=st(o,i.slice(0,a))}return i}function tt(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,i=0;i<t.length;i++)t[i]=l(t[i],n,r);return t}function et(t,e){for(var r=[],n=0;n<t.length;n++){r[n]=[];for(var i=0;i<t[n].length;i++){r[n][i]=[],r[n][i][0]=i?"L":"M";for(var a=0;a<t[n][i].length;a++)r[n][i].push(t[n][i][a])}e||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}function rt(t,e){for(var r,n,i=[],a=[],o=0;o<e.length;o++){var s=e[o];n=s._module.selectPoints(s,t),a.push(n),r=tt(n,s),i=i.concat(r)}return i}function nt(t,e,r,n,i){var a,o,s,l=!!n;i&&(a=i.plotinfo,o=i.xaxes[0]._id,s=i.yaxes[0]._id);var u=[],c=[],h=ot(t),p=t._fullLayout;if(a){var m=p._zoomlayer,g=p.dragmode,y=f(g),v=d(g);if(y||v){var x=C(t,o,"x"),_=C(t,s,"y");if(x&&_){var w=m.selectAll(".select-outline-"+a.id);if(w&&t._fullLayout._outlining&&w.length){for(var T=w[0][0].getAttribute("d"),k=b(T,t,a),A=[],M=0;M<k.length;M++){for(var S=k[M],E=[],I=0;I<S.length;I++)E.push([lt(x,S[I][1]),lt(_,S[I][2])]);E.xref=o,E.yref=s,E.subtract=st(E,A),A.push(E)}h=h.concat(A)}}}}var L=o&&s?[o+s]:p._subplots.cartesian;!function(t){var e=t.calcdata;if(e)for(var r=0;r<e.length;r++){var n=e[r][0].trace,i=t._fullLayout._splomScenes;if(i){var a=i[n.uid];a&&(a.selectBatch=[])}}}(t);for(var P={},z=0;z<L.length;z++){var O=L[z],D=O.indexOf("y"),R=O.slice(0,D),F=O.slice(D),B=o&&s?r:void 0;if(B=at(h,R,F,B)){var N=n;if(!l){var j=C(t,R,"x"),U=C(t,F,"y");N=X(t,[j],[U],O);for(var V=0;V<N.length;V++){var q=N[V],H=q.cd[0],G=H.trace;if("scattergl"===q._module.name&&!H.t.xpx){var Z=G.x,W=G.y,Y=G._length;H.t.xpx=[],H.t.ypx=[];for(var $=0;$<Y;$++)H.t.xpx[$]=j.c2p(Z[$]),H.t.ypx[$]=U.c2p(W[$])}"splom"===q._module.name&&(P[G.uid]||(P[G.uid]=!0))}}var J=rt(B,N);u=u.concat(J),c=c.concat(N)}}var Q={points:u};K(t,c,Q);var tt=p.clickmode.indexOf("event")>-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var dt=ut(et);ct([C(t,nt,"x"),C(t,pt,"y")])(Q,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ht(t,Q),p._reselect=!1}if(!a&&p._deselect){var mt=p._deselect;(function(t,e,r){for(var n=0;n<r.length;n++){var i=r[n];if(i.xaxis&&i.xaxis._id===t&&i.yaxis&&i.yaxis._id===e)return!0}return!1})(o=mt.xref,s=mt.yref,c)||it(t,o,s,n),tt&&(Q.points.length?ht(t,Q):ft(t)),p._deselect=!1}return{eventData:Q,selectionTesters:r}}function it(t,e,r,n){n=X(t,[C(t,e,"x")],[C(t,r,"y")],e+r);for(var i=0;i<n.length;i++){var a=n[i];a._module.selectPoints(a,!1)}K(t,n)}function at(t,e,r,n){for(var i,a=0;a<t.length;a++){var o=t[a];e===o.xref&&r===o.yref&&(i?n=G(i=Q(i,o,!!o.subtract)):(i=[o],n=D(o)))}return n}function ot(t,e){for(var r=[],n=t._fullLayout,i=n.selections,a=i.length,o=0;o<a;o++)if(!e||o===n._activeSelectionIndex){var s=i[o];if(s){var l,u,c,h,f,p=s.xref,d=s.yref,y=C(t,p,"x"),v=C(t,d,"y");if("rect"===s.type){f=[];var x=lt(y,s.x0),_=lt(y,s.x1),b=lt(v,s.y0),w=lt(v,s.y1);f=[[x,b],[x,w],[_,w],[_,b]],l=Math.min(x,_),u=Math.max(x,_),c=Math.min(b,w),h=Math.max(b,w),f.xmin=l,f.xmax=u,f.ymin=c,f.ymax=h,f.xref=p,f.yref=d,f.subtract=!1,f.isRect=!0,r.push(f)}else if("path"===s.type)for(var T=s.path.split("Z"),k=[],A=0;A<T.length;A++){var M=T[A];if(M){M+="Z";var S=m.extractPathCoords(M,g.paramIsX,"raw"),E=m.extractPathCoords(M,g.paramIsY,"raw");l=1/0,u=-1/0,c=1/0,h=-1/0,f=[];for(var I=0;I<S.length;I++){var L=lt(y,S[I]),P=lt(v,E[I]);f.push([L,P]),l=Math.min(L,l),u=Math.max(L,u),c=Math.min(P,c),h=Math.max(P,h)}f.xmin=l,f.xmax=u,f.ymin=c,f.ymax=h,f.xref=p,f.yref=d,f.subtract=st(f,k),k.push(f),r.push(f)}}}}return r}function st(t,e){for(var r=!1,i=0;i<e.length;i++)for(var a=e[i],o=0;o<t.length;o++)if(n(t[o],a)){r=!r;break}return r}function lt(t,e){return"date"===t.type&&(e=e.replace("_"," ")),"log"===t.type?t.c2p(e):t.r2p(e,null,t.calendar)}function ut(t){for(var e=t.length,r=[],n=0;n<e;n++){var i=t[n];r=(r=r.concat(i)).concat([i[0]])}return function(t){return t.isRect=5===t.length&&t[0][0]===t[4][0]&&t[0][1]===t[4][1]&&t[0][0]===t[1][0]&&t[2][0]===t[3][0]&&t[0][1]===t[3][1]&&t[1][1]===t[2][1]||t[0][1]===t[1][1]&&t[2][1]===t[3][1]&&t[0][0]===t[3][0]&&t[1][0]===t[2][0],t.isRect&&(t.xmin=Math.min(t[0][0],t[2][0]),t.xmax=Math.max(t[0][0],t[2][0]),t.ymin=Math.min(t[0][1],t[2][1]),t.ymax=Math.max(t[0][1],t[2][1])),t}(r)}function ct(t){return function(e,r){for(var n,i,a=0;a<t.length;a++){var o=t[a],s=o._id,l=s.charAt(0);if(r.isRect){n||(n={});var u=r[l+"min"],c=r[l+"max"];void 0!==u&&void 0!==c&&(n[s]=[F(o,u),F(o,c)].sort(M))}else i||(i={}),i[s]=r.map(B(o))}n&&(e.range=n),i&&(e.lassoPoints=i)}}function ht(t,e){e&&(e.selections=(t.layout||{}).selections||[]),t.emit("plotly_selected",e)}function ft(t){t.emit("plotly_deselect",null)}e.exports={reselect:nt,prepSelect:function(t,e,r,n,l){var u=!j(n),m=c(l),g=h(l),v=p(l),x=f(l),b=d(l),w="drawcircle"===l,T="drawline"===l||w,k=n.gd,M=k._fullLayout,S=b&&"immediate"===M.newselection.mode&&u,C=M._zoomlayer,I=n.element.getBoundingClientRect(),L=n.plotinfo,R=N(L),F=e-I.left,B=r-I.top;M._calcInverseTransform(k);var V=A.apply3DTransform(M._invTransform)(F,B);F=V[0],B=V[1];var q,H,Y,$,J,tt,at,ot=M._invScaleX,st=M._invScaleY,lt=F,pt=B,dt="M"+F+","+B,mt=n.xaxes[0],gt=n.yaxes[0],yt=mt._length,vt=gt._length,xt=t.altKey&&!(f(l)&&v);Z(t,k,n),m&&(q=O([[F,B]],P.BENDPX));var _t=C.selectAll("path.select-outline-"+L.id).data([1]),bt=x?M.newshape:M.newselection;x&&(n.hasText=bt.label.text||bt.label.texttemplate);var wt=x&&!v?bt.fillcolor:"rgba(0,0,0,0)",Tt=bt.line.color||(u?o.contrast(k._fullLayout.plot_bgcolor):"#7f7f7f");_t.enter().append("path").attr("class","select-outline select-outline-"+L.id).style({opacity:x?bt.opacity/2:1,"stroke-dasharray":a(bt.line.dash,bt.line.width),"stroke-width":bt.line.width+"px","shape-rendering":"crispEdges"}).call(o.stroke,Tt).call(o.fill,wt).attr("fill-rule","evenodd").classed("cursor-move",!!x).attr("transform",R).attr("d",dt+"Z");var kt=C.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",R).attr("d","M0,0Z");if(x&&n.hasText){var At=C.select(".label-temp");At.empty()&&(At=C.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Mt=M._uid+P.SELECTID,St=[],Et=X(k,n.xaxes,n.yaxes,n.subplot);S&&!t.shiftKey&&(n._clearSubplotSelections=function(){if(u){var t=mt._id,e=gt._id;it(k,t,e,Et);for(var r=(k.layout||{}).selections||[],n=[],a=!1,o=0;o<r.length;o++){var s=M.selections[o];s&&s.xref===t&&s.yref===e?a=!0:n.push(r[o])}a&&(k._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",k,{selections:n}))}});var Ct=function(t){var e=t.plotinfo;return e.fillRangeItems||ct(t.xaxes.concat(t.yaxes))}(n);n.moveFn=function(t,e){n._clearSubplotSelections&&(n._clearSubplotSelections(),n._clearSubplotSelections=void 0),lt=Math.max(0,Math.min(yt,ot*t+F)),pt=Math.max(0,Math.min(vt,st*e+B));var r=Math.abs(lt-F),i=Math.abs(pt-B);if(g){var a,o,s;if(b){var l=M.selectdirection;switch(a="any"===l?i<Math.min(.6*r,z)?"h":r<Math.min(.6*i,z)?"v":"d":l){case"h":o=w?vt/2:0,s=vt;break;case"v":o=w?yt/2:0,s=yt}}if(x)switch(M.newshape.drawdirection){case"vertical":a="h",o=w?vt/2:0,s=vt;break;case"horizontal":a="v",o=w?yt/2:0,s=yt;break;case"ortho":r<i?(a="h",o=B,s=pt):(a="v",o=F,s=lt);break;default:a="d"}"h"===a?(($=T?_(w,[lt,o],[lt,s]):[[F,o],[F,s],[lt,s],[lt,o]]).xmin=T?lt:Math.min(F,lt),$.xmax=T?lt:Math.max(F,lt),$.ymin=Math.min(o,s),$.ymax=Math.max(o,s),kt.attr("d","M"+$.xmin+","+(B-z)+"h-4v"+2*z+"h4ZM"+($.xmax-1)+","+(B-z)+"h4v"+2*z+"h-4Z")):"v"===a?(($=T?_(w,[o,pt],[s,pt]):[[o,B],[o,pt],[s,pt],[s,B]]).xmin=Math.min(o,s),$.xmax=Math.max(o,s),$.ymin=T?pt:Math.min(B,pt),$.ymax=T?pt:Math.max(B,pt),kt.attr("d","M"+(F-z)+","+$.ymin+"v-4h"+2*z+"v4ZM"+(F-z)+","+($.ymax-1)+"v4h"+2*z+"v-4Z")):"d"===a&&(($=T?_(w,[F,B],[lt,pt]):[[F,B],[F,pt],[lt,pt],[lt,B]]).xmin=Math.min(F,lt),$.xmax=Math.max(F,lt),$.ymin=Math.min(B,pt),$.ymax=Math.max(B,pt),kt.attr("d","M0,0Z"))}else m&&(q.addPt([lt,pt]),$=q.filtered);if(n.selectionDefs&&n.selectionDefs.length?(Y=Q(n.mergedPolygons,$,xt),$.subtract=xt,H=G(n.selectionDefs.concat([$]))):(Y=[$],H=D($)),y(et(Y,v),_t,n),b){var u,c=nt(k,!1),h=c.eventData?c.eventData.points.slice():[];c=nt(k,!1,H,Et,n),H=c.selectionTesters,at=c.eventData,u=q?q.filtered:ut(Y),E.throttle(Mt,P.SELECTDELAY,function(){for(var t=(St=rt(H,Et)).slice(),e=0;e<h.length;e++){for(var r=h[e],n=!1,i=0;i<t.length;i++)if(t[i].curveNumber===r.curveNumber&&t[i].pointNumber===r.pointNumber){n=!0;break}n||t.push(r)}t.length&&(at||(at={}),at.points=t),Ct(at,u),function(t,e){t.emit("plotly_selecting",e)}(k,at)})}},n.clickFn=function(t,e){if(kt.remove(),k._fullLayout._activeShapeIndex>=0)k._fullLayout._deactivateShape(k);else if(!x){var r=M.clickmode;E.done(Mt).then(function(){if(E.clear(Mt),2===t){for(_t.remove(),J=0;J<Et.length;J++)(tt=Et[J])._module.selectPoints(tt,!1);if(K(k,Et),W(n),ft(k),Et.length){var a=Et[0].xaxis,o=Et[0].yaxis;if(a&&o){for(var l=[],u=k._fullLayout.selections,c=0;c<u.length;c++){var h=u[c];h&&(h.xref!==a._id||h.yref!==o._id)&&l.push(h)}l.length<u.length&&(k._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",k,{selections:l}))}}}else r.indexOf("select")>-1&&U(e,k,n.xaxes,n.yaxes,n.subplot,n,_t),"event"===r&&ht(k,void 0);s.click(k,e,L.id)}).catch(A.error)}},n.doneFn=function(){kt.remove(),E.done(Mt).then(function(){E.clear(Mt),!S&&$&&n.selectionDefs&&($.subtract=xt,n.selectionDefs.push($),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(S||x)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),b&&ht(k,at)}).catch(A.error)}},clearOutline:v,clearSelectionsCache:W,selectOnClick:U}}),gn=f((t,e)=>{e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}),yn=f((t,e)=>{e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}}),vn=f((t,e)=>{var r=gn(),n=R(),i=ge(),a=me().templatedArray;yn(),e.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),xn=f((t,e)=>{e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),_n=f((t,e)=>{e.exports=function(t){return{valType:"color",editType:"style",anim:!0}}}),bn=f((t,e)=>{var r=Se().axisHoverFormat,n=Ot().texttemplateAttrs,i=Ot().hovertemplateAttrs,a=Ie(),o=R(),s=Pt().dash,l=Pt().pattern,u=Je(),c=xn(),h=D().extendFlat,f=_n();e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:c.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:h({},s,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:f(!0),fillgradient:h({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:h({symbol:{valType:"enumerated",values:u.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:h({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),wn=f((t,e)=>{var r=vn(),n=bn().line,i=Pt().dash,a=D().extendFlat,o=Lt().overrideAll,s=me().templatedArray;yn(),e.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}),Tn=f((t,e)=>{var r=oe(),n=rr(),i=Fe(),a=wn(),o=Vr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}var l=s("path"),u="path"!==s("type",l?"path":"rect");u&&delete e.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var c=["x","y"],h=0;h<2;h++){var f,p,d,m=c[h],g={_fullLayout:i},y=n.coerceRef(t,e,g,m);if((f=n.getFromId(g,y))._selectionIndices.push(e._index),d=o.rangeToShapePosition(f),p=o.shapePositionToRange(f),u){var v=m+"0",x=m+"1",_=t[v],b=t[x];t[v]=p(t[v],!0),t[x]=p(t[x],!0),n.coercePosition(e,g,s,y,v),n.coercePosition(e,g,s,y,x);var w=e[v],T=e[x];void 0!==w&&void 0!==T&&(e[v]=d(w),e[x]=d(T),t[v]=_,t[x]=b)}}u&&r.noneOrAll(t,e,["x0","x1","y0","y1"])}e.exports=function(t,e){i(t,e,{name:"selections",handleItemDefaults:s});for(var r=e.selections,n=0;n<r.length;n++){var a=r[n];a&&void 0===a.path&&(void 0===a.x0||void 0===a.x1||void 0===a.y0||void 0===a.y1)&&(e.selections[n]=null)}}}),kn=f((t,e)=>{e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}}),An=f((t,e)=>{var r=Ut(),n=oe(),i=ye();e.exports=function(t){return function(e,a){var o=e[t];if(Array.isArray(o))for(var s=r.subplotsRegistry.cartesian,l=s.idRegex,u=a._subplots,c=u.xaxis,h=u.yaxis,f=u.cartesian,p=a._has("cartesian"),d=0;d<o.length;d++){var m=o[d];if(n.isPlainObject(m)){var g=i.cleanId(m.xref,"x",!1),y=i.cleanId(m.yref,"y",!1),v=l.x.test(g),x=l.y.test(y);if(v||x){p||n.pushUnique(a._basePlotModules,s);var _=!1;v&&-1===c.indexOf(g)&&(c.push(g),_=!0),x&&-1===h.indexOf(y)&&(h.push(y),_=!0),_&&v&&x&&f.push(g+y)}}}}}}),Mn=f((t,e)=>{var r=rn(),n=mn();e.exports={moduleType:"component",name:"selections",layoutAttributes:wn(),supplyLayoutDefaults:Tn(),supplyDrawNewSelectionDefaults:kn(),includeBasePlot:An()("selections"),draw:r.draw,drawOne:r.drawOne,reselect:n.reselect,prepSelect:n.prepSelect,clearOutline:n.clearOutline,clearSelectionsCache:n.clearSelectionsCache,selectOnClick:n.selectOnClick}}),Sn=f((t,e)=>{var r=v(),n=oe(),i=n.numberFormat,a=O(),o=or(),s=Ut(),l=n.strTranslate,u=Ae(),c=q(),h=Je(),f=Pr(),p=rr(),d=hr(),m=cr(),g=zr(),y=g.selectingOrDrawing,x=g.freeMode,_=ke().FROM_TL,b=Or(),w=en().redrawReglTraces,T=we(),k=ye().getFromId,A=Mn().prepSelect,M=Mn().clearOutline,S=Mn().selectOnClick,E=Qr(),C=ge(),I=C.MINDRAG,L=C.MINZOOM,P=!0;function z(t,e,r,i){var a=n.ensureSingle(t.draglayer,e,r,function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)});return a.call(d,i),a.node()}function D(t,e,n,i,a,o,s){var l=z(t,"rect",e,n);return r.select(l).call(h.setRect,i,a,o,s),l}function R(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function F(t,e,r,n,i){for(var a=0;a<t.length;a++){var o=t[a];if(!o.fixedrange)if(o.rangebreaks){var s="y"===o._id.charAt(0),l=s?1-e:e,u=s?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(l*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(u*o._length))}else{var c=o._rl[0],h=o._rl[1]-c;n[o._name+".range[0]"]=o.l2r(c+h*e),n[o._name+".range[1]"]=o.l2r(c+h*r)}}if(i&&i.length){var f=(e+(1-r))/2;F(i,f,1-f,n,[])}}function B(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(!n.fixedrange){if(n.rangebreaks){var i=n._length,a=(n.p2l(0+e)-n.p2l(0)+(n.p2l(i+e)-n.p2l(i)))/2;n.range=[n.l2r(n._rl[0]-a),n.l2r(n._rl[1]-a)]}else n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)];n.limitRange&&n.limitRange()}}}function N(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function j(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function U(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(e,r)).attr("d","M0,0Z")}function V(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function G(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Z(t){P&&t.data&&t._context.showTips&&(n.notifier(n._(t,"Double-click to zoom back out"),"long"),P=!1)}function W(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,i,a){for(var o,s,l,u,c=!1,h={},f={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m<e.length;m++){var g=e[m];for(o in r)if(g[o]){for(l in g)(!a||!p[l]&&!d[l])&&!("x"===l.charAt(0)?r:i)[l]&&(h[l]=o);for(s in i)(!a||!p[s]&&!d[s])&&g[s]&&(c=!0)}for(s in i)if(g[s])for(u in g)(!a||!p[u]&&!d[u])&&!("x"===u.charAt(0)?r:i)[u]&&(f[u]=s)}c&&(n.extendFlat(h,f),f={});var y={},v=[];for(l in h){var x=k(t,l);v.push(x),y[x._id]=x}var _={},b=[];for(u in f){var w=k(t,u);b.push(w),_[w._id]=w}return{xaHash:y,yaHash:_,xaxes:v,yaxes:b,xLinks:h,yLinks:f,isSubplotConstrained:c}}function X(t,e){if(o){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel?t.onmousewheel=e:t.isAddedWheelEvent||(t.isAddedWheelEvent=!0,t.addEventListener("wheel",e,{passive:!1}))}function $(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,o,l,c,d,g,v){var P,z,O,q,H,J,K,Q,tt,et,rt,nt,it,at,ot,st,lt,ut,ct,ht,ft,pt,dt,mt=t._fullLayout._zoomlayer,gt=g+v==="nsew",yt=1===(g+v).length;function vt(){if(P=e.xaxis,z=e.yaxis,tt=P._length,et=z._length,K=P._offset,Q=z._offset,(O={})[P._id]=P,(q={})[z._id]=z,g&&v)for(var r=e.overlays,n=0;n<r.length;n++){var i=r[n].xaxis;O[i._id]=i;var a=r[n].yaxis;q[a._id]=a}H=$(O),J=$(q),it=R(H,v),at=R(J,g),ot=!at&&!it,nt=Y(t,t._fullLayout._axisMatchGroups,O,q);var o=(rt=Y(t,t._fullLayout._axisConstraintGroups,O,q,nt)).isSubplotConstrained||nt.isSubplotConstrained;st=v||o,lt=g||o;var s=t._fullLayout;ut=s._has("scattergl"),ct=s._has("splom"),ht=s._has("svg")}o+=e.yaxis._shift,vt();var xt=function(t,e,r){return t?"nsew"===t?r?"":"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}(at+it,t._fullLayout.dragmode,gt),_t=D(e,g+v+"drag",xt,o,l,c,d);if(ot&&!gt)return _t.onmousedown=null,_t.style.pointerEvents="none",_t;var bt,wt,Tt,kt,At,Mt,St,Et,Ct,It,Lt={element:_t,gd:t,plotinfo:e};function Pt(){Lt.plotinfo.selection=!1,M(t)}function zt(n,a){var o=Lt.gd;if(o._fullLayout._activeShapeIndex>=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(G(o),2===n&&!yt&&function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];it&&(r=r.concat(H)),at&&(r=r.concat(J)),nt.xaxes&&(r=r.concat(nt.xaxes)),nt.yaxes&&(r=r.concat(nt.yaxes));var n,i,a={};if("reset+autosize"===e)for(e="autosize",i=0;i<r.length;i++){var o=(n=r[i])._rangeInitial0,l=n._rangeInitial1,u=void 0!==o||void 0!==l;if(u&&(void 0!==o&&o!==n.range[0]||void 0!==l&&l!==n.range[1])||!u&&!0!==n.autorange){e="reset";break}}if("autosize"===e)for(i=0;i<r.length;i++)(n=r[i]).fixedrange||(a[n._name+".autorange"]=!0);else if("reset"===e)for((it||rt.isSubplotConstrained)&&(r=r.concat(rt.xaxes)),at&&!rt.isSubplotConstrained&&(r=r.concat(rt.yaxes)),rt.isSubplotConstrained&&(it?at||(r=r.concat(J)):r=r.concat(H)),i=0;i<r.length;i++)if(!(n=r[i]).fixedrange){var c=n._name,h=n._autorangeInitial;void 0===n._rangeInitial0&&void 0===n._rangeInitial1?a[c+".autorange"]=!0:void 0===n._rangeInitial0?(a[c+".autorange"]=h,a[c+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(a[c+".range"]=[n._rangeInitial0,null],a[c+".autorange"]=h):a[c+".range"]=[n._rangeInitial0,n._rangeInitial1]}t.emit("plotly_doubleclick",null),s.call("_guiRelayout",t,a)}}(),gt)l.indexOf("select")>-1&&S(a,o,H,J,e.id,Lt),l.indexOf("event")>-1&&f.click(o,a,e.id);else if(1===n&&yt){var c=g?z:P,h="s"===g||"w"===v?0:1,p=c._name+".range["+h+"]",d=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(c,h),m="left",y="middle";if(c.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===c.side&&(m="right")):"e"===v&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(_t).call(u.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(d),fill:c.tickfont?c.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",function(t){var e=c.d2r(t);void 0!==e&&s.call("_guiRelayout",o,p,e)})}}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+bt)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-bt),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Ct.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>L||o>L?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,bt>n?Tt.l=bt-a:Tt.r=bt+a),Ct.attr("d",W(Tt))):s();else if(nt.isSubplotConstrained)if(a>L||o>L){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),u=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=u*tt,Tt.b=(1-l)*et,Tt.t=(1-u)*et,Ct.attr("d",W(Tt))}else s();else!at||o<Math.min(Math.max(.6*a,I),L)?a<I||!it?s():(Tt.t=0,Tt.b=et,St="x",Ct.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-L-.5)+"h-3v"+(2*L+1)+"h3ZM"+(t.r+.5)+","+(e-L-.5)+"h3v"+(2*L+1)+"h-3Z"}(Tt,wt))):!it||a<Math.min(.6*o,L)?(Tt.l=0,Tt.r=tt,St="y",Ct.attr("d",function(t,e){return"M"+(e-L-.5)+","+(t.t-.5)+"v-3h"+(2*L+1)+"v3ZM"+(e-L-.5)+","+(t.b+.5)+"v3h"+(2*L+1)+"v-3Z"}(Tt,bt))):(St="xy",Ct.attr("d",W(Tt)));Tt.w=Tt.r-Tt.l,Tt.h=Tt.b-Tt.t,St&&(It=!0),t._dragged=It,V(Et,Ct,Tt,At,Mt,kt),Dt(),t.emit("plotly_relayouting",ft),Mt=!0}function Dt(){ft={},("xy"===St||"x"===St)&&(F(H,Tt.l/tt,Tt.r/tt,ft,rt.xaxes),Vt("x",ft)),("xy"===St||"y"===St)&&(F(J,(et-Tt.b)/et,(et-Tt.t)/et,ft,rt.yaxes),Vt("y",ft))}function Rt(){Dt(),G(t),Ht(),Z(t)}Lt.prepFn=function(e,r,i){var o=Lt.dragmode,s=t._fullLayout.dragmode;s!==o&&(Lt.dragmode=s),vt(),pt=t._fullLayout._invScaleX,dt=t._fullLayout._invScaleY,ot||(gt?e.shiftKey?"pan"===s?s="zoom":y(s)||(s="pan"):e.ctrlKey&&(s="pan"):s="pan"),x(s)?Lt.minDrag=1:Lt.minDrag=void 0,y(s)?(Lt.xaxes=H,Lt.yaxes=J,A(e,r,i,Lt,s)):(Lt.clickFn=zt,y(o)&&Pt(),ot||("zoom"===s?(Lt.moveFn=Ot,Lt.doneFn=Rt,Lt.minDrag=1,function(e,r,i){var o=_t.getBoundingClientRect();bt=r-o.left,wt=i-o.top,t._fullLayout._calcInverseTransform(t);var s=n.apply3DTransform(t._fullLayout._invTransform)(bt,wt);bt=s[0],wt=s[1],Tt={l:bt,r:bt,w:0,t:wt,b:wt,h:0},kt=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),Mt=!1,St="xy",It=!1,Et=j(mt,kt,K,Q,At="M0,0H"+tt+"V"+et+"H0V0"),Ct=U(mt,K,Q)}(0,r,i)):"pan"===s&&(Lt.moveFn=Ut,Lt.doneFn=Ht))),t._fullLayout._redrag=function(){var e=t._dragdata;if(e&&e.element===_t){var r=t._fullLayout.dragmode;y(r)||(vt(),Gt([0,0,tt,et]),Lt.moveFn(e.dx,e.dy))}}},m.init(Lt);var Ft=[0,0,tt,et],Bt=null,Nt=C.REDRAWDELAY,jt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Ut(e,r){if(e*=pt,r*=dt,!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===it||"ns"===at){var n=it?-e:0,i=at?-r:0;if(nt.isSubplotConstrained){if(it&&at){var a=(e/tt-r/et)/2;n=-(e=a*tt),i=-(r=-a*et)}at?n=-i*tt/et:i=-n*et/tt}return it&&(B(H,e),Vt("x")),at&&(B(J,r),Vt("y")),Gt([n,i,tt,et]),qt(),void t.emit("plotly_relayouting",ft)}var o,s,l="w"===it==("n"===at)?1:-1;if(it&&at&&(rt.isSubplotConstrained||nt.isSubplotConstrained)){var u=(e/tt+l*r/et)/2;e=u*tt,r=l*u*et}if("w"===it?e=p(H,0,e):"e"===it?e=p(H,1,-e):it||(e=0),"n"===at?r=p(J,1,r):"s"===at?r=p(J,0,-r):at||(r=0),o="w"===it?e:0,s="n"===at?r:0,rt.isSubplotConstrained&&!nt.isSubplotConstrained||nt.isSubplotConstrained&&it&&at&&l>0){var c;if(nt.isSubplotConstrained||!it&&1===at.length){for(c=0;c<H.length;c++)H[c].range=H[c]._r.slice(),E(H[c],1-r/et);o=(e=r*tt/et)/2}if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;c<J.length;c++)J[c].range=J[c]._r.slice(),E(J[c],1-e/tt);s=(r=e*et/tt)/2}}(!nt.isSubplotConstrained||!at)&&Vt("x"),(!nt.isSubplotConstrained||!it)&&Vt("y");var h=tt-e,f=et-r;nt.isSubplotConstrained&&!(it&&at)&&(it?(s=o?0:e*et/tt,f=h*et/tt):(o=s?0:r*tt/et,h=f*tt/et)),Gt([o,s,h,f]),qt(),t.emit("plotly_relayouting",ft)}function p(t,e,r){for(var n,i,a=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[e]-s._rl[a])/N(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}}function Vt(t,e){for(var r=nt.isSubplotConstrained?{x:J,y:H}[t]:nt[t+"axes"],n=nt.isSubplotConstrained?{x:H,y:J}[t]:[],i=0;i<r.length;i++){var a=r[i],o=a._id,s=nt.xLinks[o]||nt.yLinks[o],l=n[0]||O[s]||q[s];l&&(e?(e[a._name+".range[0]"]=e[l._name+".range[0]"],e[a._name+".range[1]"]=e[l._name+".range[1]"]):a.range=l.range.slice())}}function qt(){var r,n=[];function i(t){for(r=0;r<t.length;r++)t[r].fixedrange||n.push(t[r]._id)}function a(t,e){for(r=0;r<t.length;r++){var i=t[r],a=i[e];!i.fixedrange&&"sync"===a.tickmode&&n.push(a._id)}}for(st&&(i(H),i(rt.xaxes),i(nt.xaxes),a(e.overlays,"xaxis")),lt&&(i(J),i(rt.yaxes),i(nt.yaxes),a(e.overlays,"yaxis")),ft={},r=0;r<n.length;r++){var o=n[r],s=k(t,o);p.drawOne(t,s,{skipTitle:!0}),ft[s._name+".range[0]"]=s.range[0],ft[s._name+".range[1]"]=s.range[1]}p.redrawComponents(t,n)}function Ht(){Gt([0,0,tt,et]),n.syncOrAsync([T.previousPromises,function(){t._fullLayout._replotting=!1,s.call("_guiRelayout",t,ft)}],t)}function Gt(e){var r,i,a,o,l=t._fullLayout,u=l._plots,c=l._subplots.cartesian;if(ct&&s.subplotsRegistry.splom.drag(t),ut)for(r=0;r<c.length;r++)if(a=(i=u[c[r]]).xaxis,o=i.yaxis,i._scene){a.limitRange&&a.limitRange(),o.limitRange&&o.limitRange();var f=n.simpleMap(a.range,a.r2l),p=n.simpleMap(o.range,o.r2l);i._scene.update({range:[f[0],p[0],f[1],p[1]]})}if((ct||ut)&&(b(t),w(t)),ht){var d=e[2]/P._length,m=e[3]/z._length;for(r=0;r<c.length;r++){a=(i=u[c[r]]).xaxis,o=i.yaxis;var y,x,_,T,k=(st||nt.isSubplotConstrained)&&!a.fixedrange&&O[a._id],A=(lt||nt.isSubplotConstrained)&&!o.fixedrange&&q[o._id];if(k?(y=d,_=v||nt.isSubplotConstrained?e[0]:Yt(a,y)):nt.xaHash[a._id]?(y=d,_=e[0]*a._length/P._length):nt.yaHash[a._id]?(y=m,_="ns"===at?-e[1]*a._length/z._length:Yt(a,y,{n:"top",s:"bottom"}[at])):_=Wt(a,y=Zt(a,d,m)),y>1&&(void 0!==a.maxallowed&&st===(a.range[0]<a.range[1]?"e":"w")||void 0!==a.minallowed&&st===(a.range[0]<a.range[1]?"w":"e"))&&(y=1,_=0),A?(x=m,T=g||nt.isSubplotConstrained?e[1]:Yt(o,x)):nt.yaHash[o._id]?(x=m,T=e[1]*o._length/z._length):nt.xaHash[o._id]?(x=d,T="ew"===it?-e[0]*o._length/P._length:Yt(o,x,{e:"right",w:"left"}[it])):T=Wt(o,x=Zt(o,d,m)),x>1&&(void 0!==o.maxallowed&&lt===(o.range[0]<o.range[1]?"n":"s")||void 0!==o.minallowed&&lt===(o.range[0]<o.range[1]?"s":"n"))&&(x=1,T=0),y||x){y||(y=1),x||(x=1);var M=a._offset-_/y,S=o._offset-T/x;i.clipRect.call(h.setTranslate,_,T).call(h.setScale,y,x),i.plot.call(h.setTranslate,M,S).call(h.setScale,1/y,1/x),(y!==i.xScaleFactor||x!==i.yScaleFactor)&&(h.setPointGroupScale(i.zoomScalePts,y,x),h.setTextPointsScale(i.zoomScaleTxt,y,x)),h.hideOutsideRangePoints(i.clipOnAxisFalseTraces,i),i.xScaleFactor=y,i.yScaleFactor=x}}}}function Zt(t,e,r){return t.fixedrange?0:st&&rt.xaHash[t._id]?e:lt&&(rt.isSubplotConstrained?rt.xaHash:rt.yaHash)[t._id]?r:0}function Wt(t,e){return e?(t.range=t._r.slice(),E(t,e),Yt(t,e)):0}function Yt(t,e,r){return t._length*(1-e)*_[r||t.constraintoward||"middle"]}return g.length*v.length!==1&&X(_t,function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(Pt(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();vt(),clearTimeout(Bt);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var i,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),o=jt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-o.left)/o.width,l=(o.bottom-e.clientY)/o.height;if(st){for(v||(s=.5),i=0;i<H.length;i++)u(H[i],s,a);Vt("x"),Ft[2]*=a,Ft[0]+=Ft[2]*s*(1/a-1)}if(lt){for(g||(l=.5),i=0;i<J.length;i++)u(J[i],l,a);Vt("y"),Ft[3]*=a,Ft[1]+=Ft[3]*(1-l)*(1/a-1)}Gt(Ft),qt(),t.emit("plotly_relayouting",ft),Bt=setTimeout(function(){t._fullLayout&&(Ft=[0,0,tt,et],Ht())},Nt),e.preventDefault()}else n.log("Did not find wheel motion attributes: ",e)}function u(t,e,r){if(!t.fixedrange){var i=n.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(function(e){return t.l2r(a+(e-a)*r)})}}}),_t},makeDragger:z,makeRectDragger:D,makeZoombox:j,makeCorners:U,updateZoombox:V,xyCorners:W,transitionZoombox:H,removeZoombox:G,showDoubleClickNotifier:Z,attachWheelEventHandler:X}}),En=f(t=>{var e=v(),r=Pr(),n=cr(),i=hr(),a=Sn().makeDragBox,o=ge().DRAGGERSIZE;t.initInteractions=function(i){var s=i._fullLayout;if(i._context.staticPlot)e.select(i).selectAll(".drag").remove();else if(s._has("cartesian")||s._has("splom")){Object.keys(s._plots||{}).sort(function(t,e){if((s._plots[t].mainplot&&!0)===(s._plots[e].mainplot&&!0)){var r=t.split("y"),n=e.split("y");return r[0]===n[0]?Number(r[1]||1)-Number(n[1]||1):Number(r[0]||1)-Number(n[0]||1)}return s._plots[t].mainplot?1:-1}).forEach(function(t){var e=s._plots[t],l=e.xaxis,u=e.yaxis;if(!e.mainplot){var c=a(i,e,l._offset,u._offset,l._length,u._length,"ns","ew");c.onmousemove=function(e){i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===t&&i._fullLayout._plots[t]&&r.hover(i,e,t)},r.hover(i,e,t),i._fullLayout._lasthover=c,i._fullLayout._hoversubplot=t},c.onmouseout=function(t){i._dragging||(i._fullLayout._hoversubplot=null,n.unhover(i,t))},i._context.showAxisDragHandles&&(a(i,e,l._offset-o,u._offset-o,o,o,"n","w"),a(i,e,l._offset+l._length,u._offset-o,o,o,"n","e"),a(i,e,l._offset-o,u._offset+u._length,o,o,"s","w"),a(i,e,l._offset+l._length,u._offset+u._length,o,o,"s","e"))}if(i._context.showAxisDragHandles){if(t===l._mainSubplot){var h=l._mainLinePosition;"top"===l.side&&(h-=o),a(i,e,l._offset+.1*l._length,h,.8*l._length,o,"","ew"),a(i,e,l._offset,h,.1*l._length,o,"","w"),a(i,e,l._offset+.9*l._length,h,.1*l._length,o,"","e")}if(t===u._mainSubplot){var f=u._mainLinePosition;"right"!==u.side&&(f-=o),a(i,e,f,u._offset+.1*u._length,o,.8*u._length,"ns",""),a(i,e,f,u._offset+.9*u._length,o,.1*u._length,"s",""),a(i,e,f,u._offset,o,.1*u._length,"n","")}}});var l=s._hoverlayer.node();l.onmousemove=function(t){t.target=i._fullLayout._lasthover,r.hover(i,t,s._hoversubplot)},l.onclick=function(t){t.target=i._fullLayout._lasthover,r.click(i,t)},l.onmousedown=function(t){i._fullLayout._lasthover.onmousedown(t)},t.updateFx(i)}},t.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";i(e._draggers,r)}}),Cn=f((t,e)=>{var r=Ut();e.exports=function(t){for(var e,n,i=r.layoutArrayContainers,a=r.layoutArrayRegexes,o=t.split("[")[0],s=0;s<a.length;s++)if((n=t.match(a[s]))&&0===n.index){e=n[0];break}if(e||(e=i[i.indexOf(o)]),!e)return!1;var l=t.substr(e.length);return l?!!(n=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(n[1]),property:n[3]||""}:{array:e,index:"",property:""}}}),In=f(t=>{var e=M(),r=$(),n=X(),i=Ht().sorterAsc,a=Ut();t.containerArrayMatch=Cn();var o=t.isAddVal=function(t){return"add"===t||e(t)},s=t.isRemoveVal=function(t){return null===t||"remove"===t};t.applyContainerArrayChanges=function(t,e,l,u,c){var h=e.astr,f=a.getComponentMethod(h,"supplyLayoutDefaults"),p=a.getComponentMethod(h,"draw"),d=a.getComponentMethod(h,"drawOne"),m=u.replot||u.recalc||f===r||p===r,g=t.layout,y=t._fullLayout;if(l[""]){Object.keys(l).length>1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))e.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;e.set(v)}return!m&&(f(g,y),p(t),!0)}var x,_,b,w,T,k,A,M,S=Object.keys(l).map(Number).sort(i),E=e.get(),C=E||[],I=c(y,h).get(),L=[],P=-1,z=C.length;for(x=0;x<S.length;x++)if(w=l[b=S[x]],T=Object.keys(w),k=w[""],A=o(k),b<0||b>C.length-(A?0:1))n.warn("index out of range",h,b);else if(void 0!==k)T.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,b),s(k)?L.push(b):A?("add"===k&&(k={}),C.splice(b,0,k),I&&I.splice(b,0,{})):n.warn("Unrecognized full object edit value",h,b,k),-1===P&&(P=b);else for(_=0;_<T.length;_++)M=h+"["+b+"].",c(C[b],T[_],M).set(w[T[_]]);for(x=L.length-1;x>=0;x--)C.splice(L[x],1),I&&I.splice(L[x],1);if(C.length?E||e.set(C):e.set(null),m)return!1;if(f(g,y),d!==r){var O;if(-1===P)O=S;else{for(z=Math.max(C.length,z),O=[],x=0;x<S.length&&!((b=S[x])>=P);x++)O.push(b);for(x=P;x<z;x++)O.push(x)}for(x=0;x<O.length;x++)d(t,O[x])}else p(t);return!0}}),Ln=f(t=>{var e=T();_t();var r=Ut(),n=oe(),i=we(),a=ye(),o=q(),s=a.cleanId,l=a.getFromTrace,u=r.traceIs;function c(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=s(r,n,!0))}function h(t){if(!n.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function f(t,e,r,n){if(r&&!n)return t;if(n&&!r||!t.trim())return e;if(!e.trim())return t;var i,a=Math.min(t.length,e.length);for(i=0;i<a&&t.charAt(i)===e.charAt(i);i++);return t.substr(0,i).trim()}function p(t){var e="middle",r="center";return"string"==typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function d(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}t.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&n.log("Clearing previous rejected promises from queue."),t._promises=[]},t.cleanLayout=function(e){var r;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex;(i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex;var l=Object.keys(e);for(r=0;r<l.length;r++){var u=l[r];if(a&&a.test(u)){var h=e[u];h.anchor&&"free"!==h.anchor&&(h.anchor=s(h.anchor)),h.overlaying&&(h.overlaying=s(h.overlaying)),h.type||(h.isdate?h.type="date":h.islog?h.type="log":!1===h.isdate&&!1===h.islog&&(h.type="linear")),("withzero"===h.autorange||"tozero"===h.autorange)&&(h.autorange=!0,h.rangemode="tozero"),h.insiderange&&delete h.range,delete h.islog,delete h.isdate,delete h.categories,d(h,"domain")&&delete h.domain}}var f=Array.isArray(e.annotations)?e.annotations.length:0;for(r=0;r<f;r++){var p=e.annotations[r];n.isPlainObject(p)&&(c(p,"xref"),c(p,"yref"))}var m=Array.isArray(e.shapes)?e.shapes.length:0;for(r=0;r<m;r++){var g=e.shapes[r];n.isPlainObject(g)&&(c(g,"xref"),c(g,"yref"))}var y=Array.isArray(e.images)?e.images.length:0;for(r=0;r<y;r++){var v=e.images[r];n.isPlainObject(v)&&(c(v,"xref"),c(v,"yref"))}var x=e.legend;return x&&(x.x>3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===e.dragmode&&(e.dragmode="orbit"),o.clean(e),e.template&&e.template.layout&&t.cleanLayout(e.template.layout),e},t.cleanData=function(e){for(var a=0;a<e.length;a++){var l,c=e[a];if("histogramy"===c.type&&"xbins"in c&&!("ybins"in c)&&(c.ybins=c.xbins,delete c.xbins),"histogramy"===c.type&&t.swapXYData(c),("histogramx"===c.type||"histogramy"===c.type)&&(c.type="histogram"),"scl"in c&&!("colorscale"in c)&&(c.colorscale=c.scl,delete c.scl),"reversescl"in c&&!("reversescale"in c)&&(c.reversescale=c.reversescl,delete c.reversescl),c.xaxis&&(c.xaxis=s(c.xaxis,"x")),c.yaxis&&(c.yaxis=s(c.yaxis,"y")),u(c,"gl3d")&&c.scene&&(c.scene=i.subplotsRegistry.gl3d.cleanId(c.scene)),!u(c,"pie-like")&&!u(c,"bar-like"))if(Array.isArray(c.textposition))for(l=0;l<c.textposition.length;l++)c.textposition[l]=p(c.textposition[l]);else c.textposition&&(c.textposition=p(c.textposition));var m=r.getModule(c);if(m&&m.colorbar){var g=m.colorbar.container,y=g?c[g]:c;y&&y.colorscale&&("YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd"))}if("surface"===c.type&&n.isPlainObject(c.contours)){var v=["x","y","z"];for(l=0;l<v.length;l++){var x=c.contours[v[l]];n.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if("candlestick"===c.type||"ohlc"===c.type){var _=!1!==(c.increasing||{}).showlegend,b=!1!==(c.decreasing||{}).showlegend,w=h(c.increasing),T=h(c.decreasing);if(!1!==w&&!1!==T){var k=f(w,T,_,b);k&&(c.name=k)}else(w||T)&&!c.name&&(c.name=w||T)}d(c,"line")&&delete c.line,"marker"in c&&(d(c.marker,"line")&&delete c.marker.line,d(c,"marker")&&delete c.marker),o.clean(c),c.autobinx&&(delete c.autobinx,delete c.xbins),c.autobiny&&(delete c.autobiny,delete c.ybins)}},t.swapXYData=function(t){var e;if(n.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,i="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);n.swapAttrs(t,["error_?.copy_ystyle"]),i&&n.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},t.coerceTraceIndices=function(t,r){if(e(r))return[r];if(!Array.isArray(r)||!r.length)return t.data.map(function(t,e){return e});if(Array.isArray(r)){for(var i=[],a=0;a<r.length;a++)n.isIndex(r[a],t.data.length)?i.push(r[a]):n.warn("trace index (",r[a],") is not a number or is out of bounds");return i}return r},t.manageArrayContainers=function(t,r,i){var a=t.obj,o=t.parts,s=o.length,l=o[s-1],u=e(l);if(u&&null===r){var c=o.slice(0,s-1).join(".");n.nestedProperty(a,c).get().splice(l,1)}else u&&void 0===t.get()&&void 0===t.get()&&(i[t.astr]=null),t.set(r)};var m=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function g(t){var e=t.search(m);if(e>0)return t.substr(0,e)}t.hasParent=function(t,e){for(var r=g(e);r;){if(r in t)return!0;r=g(r)}return!1};var y=["x","y","z"];t.clearAxisTypes=function(t,e,r){for(var i=0;i<e.length;i++)for(var a=t._fullData[i],o=0;o<3;o++){var s=l(t,a,y[o]);if(s&&"log"!==s.type){var u=s._name,c=s._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;u=c+"."+u}var h=u+".type";void 0===r[u]&&void 0===r[h]&&n.nestedProperty(t.layout,h).set(null)}}}}),Pn=f(t=>{var e=v(),r=T(),n=ue(),i=oe(),a=i.nestedProperty,o=he(),s=fe(),l=Ut(),u=de(),c=we(),h=rr(),f=ir(),p=Ee(),d=Je(),m=q(),g=En().initInteractions,y=Te(),x=Mn().clearOutline,_=W().dfltConfig,b=In(),w=Ln(),k=en(),A=Lt(),M=ge().AX_NAME_PATTERN,S=0;function E(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function C(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){i.error(t)}}function I(t,e){C(t,m.combine(e,"white"))}function L(t,r){if(!t._context){t._context=i.extendDeep({},_);var a=e.select("base");t._context._baseUrl=a.size()&&a.attr("href")?window.location.href.split("#")[0]:""}var o,s,l,u=t._context;if(r){for(s=Object.keys(r),o=0;o<s.length;o++)"editable"!==(l=s[o])&&"edits"!==l&&l in u&&("setBackground"===l&&"opaque"===r[l]?u[l]=I:u[l]=r[l]);var c=r.editable;if(void 0!==c)for(u.editable=c,s=Object.keys(u.edits),o=0;o<s.length;o++)u.edits[s[o]]=c;if(r.edits)for(s=Object.keys(r.edits),o=0;o<s.length;o++)(l=s[o])in u.edits&&(u.edits[l]=r.edits[l]);u._exportedPlot=r._exportedPlot}u.staticPlot&&(u.editable=!1,u.edits={},u.autosizable=!1,u.scrollZoom=!1,u.doubleClick=!1,u.showTips=!1,u.showLink=!1,u.displayModeBar=!1),"hover"===u.displayModeBar&&!n&&(u.displayModeBar=!0),("transparent"===u.setBackground||"function"!=typeof u.setBackground)&&(u.setBackground=C),u._hasZeroHeight=u._hasZeroHeight||0===t.clientHeight,u._hasZeroWidth=u._hasZeroWidth||0===t.clientWidth;var h=u.scrollZoom,f=u._scrollZoom={};if(!0===h)f.cartesian=1,f.gl3d=1,f.geo=1,f.mapbox=1,f.map=1;else if("string"==typeof h){var p=h.split("+");for(o=0;o<p.length;o++)f[p[o]]=1}else!1!==h&&(f.gl3d=1,f.geo=1,f.mapbox=1,f.map=1)}function P(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)(n=t[r])<0?a.push(i+n):a.push(n);return a}function z(t,e,r){var n,i;for(n=0;n<e.length;n++){if((i=e[n])!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),void 0!==r&&!Array.isArray(r)&&(r=[r]),void 0!==r&&z(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,n,o,s){!function(t,e,r,n){var a=i.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var o in z(t,r,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}(t,e,n,o);for(var l=function(t,e,n,o){var s,l,u,c,h,f=i.isPlainObject(o),p=[];for(var d in Array.isArray(n)||(n=[n]),n=P(n,t.data.length-1),e)for(var m=0;m<n.length;m++){if(s=t.data[n[m]],l=(u=a(s,d)).get(),c=e[d][m],!i.isArrayOrTypedArray(c))throw new Error("attribute: "+d+" index: "+m+" must be an array");if(!i.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+d);if(l.constructor!==c.constructor)throw new Error("cannot extend array with an array of a different type: "+d);h=f?o[d][m]:o,r(h)||(h=-1),p.push({prop:u,target:l,insert:c,maxp:Math.floor(h)})}return p}(t,e,n,o),u={},c={},h=0;h<l.length;h++){var f=l[h].prop,p=l[h].maxp,d=s(l[h].target,l[h].insert,p);f.set(d[0]),Array.isArray(u[f.astr])||(u[f.astr]=[]),u[f.astr].push(d[1]),Array.isArray(c[f.astr])||(c[f.astr]=[]),c[f.astr].push(l[h].target.length)}return{update:u,maxPoints:c}}function R(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function F(e,r,n,a){e=i.getGraphDiv(e),w.clearPromiseQueue(e);var o={};if("string"==typeof r)o[r]=n;else{if(!i.isPlainObject(r))return i.warn("Restyle fail.",r,n,a),Promise.reject();o=i.extendFlat({},r),void 0===a&&(a=n)}Object.keys(o).length&&(e.changed=!0);var l=w.coerceTraceIndices(e,a),u=U(e,o,l),h=u.flags;h.calc&&(e.calcdata=void 0),h.clearAxisTypes&&w.clearAxisTypes(e,l,{});var f=[];h.fullReplot?f.push(t._doPlot):(f.push(c.previousPromises),c.supplyDefaults(e),h.markerSize&&(c.doCalcdata(e),G(f)),h.style&&f.push(k.doTraceStyle),h.colorbars&&f.push(k.doColorBars),f.push(E)),f.push(c.rehover,c.redrag,c.reselect),s.add(e,F,[e,u.undoit,u.traces],F,[e,u.redoit,u.traces]);var p=i.syncOrAsync(f,e);return(!p||!p.then)&&(p=Promise.resolve()),p.then(function(){return e.emit("plotly_restyle",u.eventData),e})}function B(t){return void 0===t?null:t}function N(t,e){return e?function(e,r,n){var i=a(e,r),o=i.set;return i.set=function(e){j((n||"")+r,i.get(),e,t),o(e)},i}:a}function j(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var a=Array.isArray(e)?e:[],o=Array.isArray(r)?r:[],s=Math.max(a.length,o.length),l=0;l<s;l++)j(t+"["+l+"]",a[l],o[l],n);else if(i.isPlainObject(e)||i.isPlainObject(r)){var u=i.isPlainObject(e)?e:{},c=i.isPlainObject(r)?r:{},h=i.extendFlat({},u,c);for(var f in h)j(t+"."+f,u[f],c[f],n)}else void 0===n[t]&&(n[t]=B(e))}function U(t,e,r){var n,o,s=t._fullLayout,f=t._fullData,p=t.data,d=s._guiEditing,m=N(s._preGUI,d),g=i.extendDeepAll({},e),y=A.traceFlags(),v={},x={};function _(){return r.map(function(){})}function b(t){var e=h.id2name(t);-1===o.indexOf(e)&&o.push(e)}function T(t){return"LAYOUT"+t+".autorange"}function k(t){return"LAYOUT"+t+".range"}function M(t){for(var e=t;e<f.length;e++)if(f[e]._input===p[t])return f[e]}function S(n,i,a){if(Array.isArray(n))n.forEach(function(t){S(t,i,a)});else if(!(n in e)&&!w.hasParent(e,n)){var o;if("LAYOUT"===n.substr(0,6))o=m(t.layout,n.replace("LAYOUT",""));else{var l=r[a];o=N(s._tracePreGUI[M(l)._fullInput.uid],d)(p[l],n)}n in x||(x[n]=_()),void 0===x[n][a]&&(x[n][a]=B(o.get())),void 0!==i&&o.set(i)}}function E(t){return function(e){return f[e][t]}}function C(t){return function(e,n){return!1===e?f[r[n]][t]:null}}for(var I in e){if(w.hasParent(e,I))throw new Error("cannot set "+I+" and a parent attribute simultaneously");var L,P,z,O,D,R,F=e[I];if(("autobinx"===I||"autobiny"===I)&&(I=I.charAt(I.length-1)+"bins",F=Array.isArray(F)?F.map(C(I)):!1===F?r.map(E(I)):null),v[I]=F,"LAYOUT"!==I.substr(0,6)){for(x[I]=_(),n=0;n<r.length;n++)if(L=p[r[n]],P=M(r[n]),O=(z=N(s._tracePreGUI[P._fullInput.uid],d)(L,I)).get(),void 0!==(D=Array.isArray(F)?F[n%F.length]:F)){var j=z.parts[z.parts.length-1],U=I.substr(0,I.length-j.length-1),V=U?U+".":"",q=U?a(P,U).get():P;if((R=u.getTraceValObject(P,z.parts))&&R.impliedEdits&&null!==D)for(var H in R.impliedEdits)S(i.relativeAttr(I,H),R.impliedEdits[H],n);else if("thicknessmode"!==j&&"lenmode"!==j||O===D||"fraction"!==D&&"pixels"!==D||!q){if("type"===I&&("pie"===D!=("pie"===O)||"funnelarea"===D!=("funnelarea"===O))){var G="x",Z="y";("bar"===D||"bar"===O)&&"h"===L.orientation&&(G="y",Z="x"),i.swapAttrs(L,["?","?src"],"labels",G),i.swapAttrs(L,["d?","?0"],"label",G),i.swapAttrs(L,["?","?src"],"values",Z),"pie"===O||"funnelarea"===O?(a(L,"marker.color").set(a(L,"marker.colors").get()),s._pielayer.selectAll("g.trace").remove()):l.traceIs(L,"cartesian")&&a(L,"marker.colors").set(a(L,"marker.color").get())}}else{var W=s._size,Y=q.orient,X="top"===Y||"bottom"===Y;if("thicknessmode"===j){var $=X?W.h:W.w;S(V+"thickness",q.thickness*("fraction"===D?1/$:$),n)}else{var J=X?W.w:W.h;S(V+"len",q.len*("fraction"===D?1/J:J),n)}}if(x[I][n]=B(O),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(I)){if("orientation"===I){z.set(D);var K=L.x&&!L.y?"h":"v";if((z.get()||K)===P.orientation)continue}else"orientationaxes"===I&&(L.orientation={v:"h",h:"v"}[P.orientation]);w.swapXYData(L),y.calc=y.clearAxisTypes=!0}else-1!==c.dataArrayContainers.indexOf(z.parts[0])?(w.manageArrayContainers(z,D,x),y.calc=!0):(R?R.arrayOk&&!l.traceIs(P,"regl")&&(i.isArrayOrTypedArray(D)||i.isArrayOrTypedArray(O))?y.calc=!0:A.update(y,R):y.calc=!0,z.set(D))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(I)&&h.swap(t,r),"orientationaxes"===I){var Q=a(t.layout,"hovermode"),tt=Q.get();"x"===tt?Q.set("y"):"y"===tt?Q.set("x"):"x unified"===tt?Q.set("y unified"):"y unified"===tt&&Q.set("x unified")}if(-1!==["orientation","type"].indexOf(I)){for(o=[],n=0;n<r.length;n++){var et=p[r[n]];l.traceIs(et,"cartesian")&&(b(et.xaxis||"x"),b(et.yaxis||"y"))}S(o.map(T),!0,0),S(o.map(k),[0,1],0)}}else z=m(t.layout,I.replace("LAYOUT","")),x[I]=[B(z.get())],z.set(Array.isArray(F)?F[0]:F),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:x,redoit:v,traces:r,eventData:i.extendDeepNoArrays([],[g,r])}}function V(t,e,r){t=i.getGraphDiv(t),w.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!i.isPlainObject(e))return i.warn("Relayout fail.",e,r),Promise.reject();n=i.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=$(t,n),o=a.flags;o.calc&&(t.calcdata=void 0);var l=[c.previousPromises];o.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(H(t,o,a)||c.supplyDefaults(t),o.legend&&l.push(k.doLegend),o.layoutstyle&&l.push(k.layoutStyles),o.axrange&&G(l,a.rangesAltered),o.ticks&&l.push(k.doTicksRelayout),o.modebar&&l.push(k.doModeBar),o.camera&&l.push(k.doCamera),o.colorbars&&l.push(k.doColorBars),l.push(E)),l.push(c.rehover,c.redrag,c.reselect),s.add(t,V,[t,a.undoit],V,[t,a.redoit]);var u=i.syncOrAsync(l,t);return(!u||!u.then)&&(u=Promise.resolve(t)),u.then(function(){return t.emit("plotly_relayout",a.eventData),t})}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;var o,s,l=function(t,e){return i.coerce(o,s,p,t,e)},u={};for(var c in r.rangesAltered){var d=h.id2name(c);if(o=t.layout[d],s=n[d],f(o,s,l,u),s._matchGroup)for(var m in s._matchGroup)if(m!==c){var g=n[h.id2name(m)];g.autorange=s.autorange,g.range=s.range.slice(),g._input.range=s.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[];for(var n in e){var i=h.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return h.draw(t,r,{skipTitle:!0})}:function(t){return h.draw(t,"redraw")};t.push(x,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function $(t,e){var r,n,o,s=t.layout,c=t._fullLayout,f=c._guiEditing,p=N(c._preGUI,f),d=Object.keys(e),m=h.list(t),g=i.extendDeepAll({},e),y={};for(d=Object.keys(e),n=0;n<d.length;n++)if(0===d[n].indexOf("allaxes")){for(o=0;o<m.length;o++){var v=m[o]._id.substr(1),x=-1!==v.indexOf("scene")?v+".":"",_=d[n].replace("allaxes",x+m[o]._name);e[_]||(e[_]=e[d[n]])}delete e[d[n]]}var T=A.layoutFlags(),k={},S={};function E(t,r){if(Array.isArray(t))t.forEach(function(t){E(t,r)});else if(!(t in e)&&!w.hasParent(e,t)){var n=p(s,t);t in S||(S[t]=B(n.get())),void 0!==r&&n.set(r)}}var C,I={};function L(t){var e=h.name2id(t.split(".")[0]);return I[e]=1,e}for(var P in e){if(w.hasParent(e,P))throw new Error("cannot set "+P+" and a parent attribute simultaneously");for(var z=p(s,P),O=e[P],D=z.parts.length-1;D>0&&"string"!=typeof z.parts[D];)D--;var R=z.parts[D],F=z.parts[D-1]+"."+R,j=z.parts.slice(0,D).join("."),U=a(t.layout,j).get(),V=a(c,j).get(),q=z.get();if(void 0!==O){k[P]=O,S[P]="reverse"===R?O:B(q);var H=u.getLayoutValObject(c,z.parts);if(H&&H.impliedEdits&&null!==O)for(var G in H.impliedEdits)E(i.relativeAttr(P,G),H.impliedEdits[G]);if(-1!==["width","height"].indexOf(P))if(O){E("autosize",null);var W="height"===P?"width":"height";E(W,c[W])}else c[P]=t._initialAutoSize[P];else if("autosize"===P)E("width",O?null:c.width),E("height",O?null:c.height);else if(F.match(Z))L(F),a(c,j+"._inputRange").set(null);else if(F.match(Y)){L(F),a(c,j+"._inputRange").set(null);var $=a(c,j).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&a(c,j+"._inputDomain").set(null);if("type"===R){C=U;var K="linear"===V.type&&"log"===O,Q="log"===V.type&&"linear"===O;if(K||Q){if(C&&C.range)if(V.autorange)K&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var tt=C.range[0],et=C.range[1];K?(tt<=0&&et<=0&&E(j+".autorange",!0),tt<=0?tt=et/1e6:et<=0&&(et=tt/1e6),E(j+".range[0]",Math.log(tt)/Math.LN10),E(j+".range[1]",Math.log(et)/Math.LN10)):(E(j+".range[0]",Math.pow(10,tt)),E(j+".range[1]",Math.pow(10,et)))}else E(j+".autorange",!0);Array.isArray(c._subplots.polar)&&c._subplots.polar.length&&c[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete c[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(t,V,O,E),l.getComponentMethod("images","convertCoords")(t,V,O,E)}else E(j+".autorange",!0),E(j+".range",null);a(c,j+"._inputRange").set(null)}else if(R.match(M)){var rt=a(c,P).get(),nt=(O||{}).type;(!nt||"-"===nt)&&(nt="linear"),l.getComponentMethod("annotations","convertCoords")(t,rt,nt,E),l.getComponentMethod("images","convertCoords")(t,rt,nt,E)}var it=b.containerArrayMatch(P);if(it){r=it.array,n=it.index;var at=it.property,ot=H||{editType:"calc"};""!==n&&""===at&&(b.isAddVal(O)?S[P]=null:b.isRemoveVal(O)?S[P]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",e)),A.update(T,ot),y[r]||(y[r]={});var st=y[r][n];st||(st=y[r][n]={}),st[at]=O,delete e[P]}else"reverse"===R?(U.range?U.range.reverse():(E(j+".autorange",!0),U.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===O&&!1!==q||!1!==O&&!1===q)||c._has("scatter-like")&&c._has("regl")&&"dragmode"===P&&("lasso"===O||"select"===O)&&"lasso"!==q&&"select"!==q?T.plot=!0:H?A.update(T,H):T.calc=!0,z.set(O))}}for(r in y)b.applyContainerArrayChanges(t,p(s,r),y[r],T,p)||(T.plot=!0);for(var lt in I){var ut=(C=h.getFromId(t,lt))&&C._constraintGroup;if(ut)for(var ct in T.calc=!0,ut)I[ct]||(h.getFromId(t,ct)._constraintShrinkable=!0)}(J(t)||e.height||e.width)&&(T.plot=!0);var ht=c.shapes;for(n=0;n<ht.length;n++)if(ht[n].showlegend){T.calc=!0;break}return(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:I,undoit:S,redoit:k,eventData:g}}function J(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&c.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function K(e,r,n,a){e=i.getGraphDiv(e),w.clearPromiseQueue(e),i.isPlainObject(r)||(r={}),i.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var o=w.coerceTraceIndices(e,a),l=U(e,i.extendFlat({},r),o),u=l.flags,h=$(e,i.extendFlat({},n)),f=h.flags;(u.calc||f.calc)&&(e.calcdata=void 0),u.clearAxisTypes&&w.clearAxisTypes(e,o,n);var p=[];f.layoutReplot?p.push(k.layoutReplot):u.fullReplot?p.push(t._doPlot):(p.push(c.previousPromises),H(e,f,h)||c.supplyDefaults(e),u.style&&p.push(k.doTraceStyle),(u.colorbars||f.colorbars)&&p.push(k.doColorBars),f.legend&&p.push(k.doLegend),f.layoutstyle&&p.push(k.layoutStyles),f.axrange&&G(p,h.rangesAltered),f.ticks&&p.push(k.doTicksRelayout),f.modebar&&p.push(k.doModeBar),f.camera&&p.push(k.doCamera),p.push(E)),p.push(c.rehover,c.redrag,c.reselect),s.add(e,K,[e,l.undoit,h.undoit,l.traces],K,[e,l.redoit,h.redoit,l.traces]);var d=i.syncOrAsync(p,e);return(!d||!d.then)&&(d=Promise.resolve(e)),d.then(function(){return e.emit("plotly_update",{data:l.eventData,layout:h.eventData}),e})}function Q(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var tt=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],et=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function rt(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=t.match(n.pattern);if(i){var a=i[1]||"";return{head:a,tail:t.substr(a.length+1),attr:n.attr}}}}function nt(t,e){var r=a(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=a(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function at(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function ot(t,e){var r=i.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&i.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function st(t,e,r,n){var a,o,s,l=n.getValObject,u=n.flags,c=n.immutable,h=n.inArray,f=n.arrayIndex;function p(){var t=a.editType;h&&-1!==t.indexOf("arraydraw")?i.pushUnique(u.arrays[h],f):(A.update(u,a),"none"!==t&&u.nChanges++,n.transition&&a.anim&&u.nChangesAnim++,(Z.test(s)||Y.test(s))&&(u.rangesAltered[r[0]]=1),"datarevision"===o&&(u.newDataRevision=1))}function d(t){return"data_array"===t.valType||t.arrayOk}for(o in t){if(u.calc&&!n.transition)return;var m=t[o],g=e[o],y=r.concat(o);if(s=y.join("."),"_"!==o.charAt(0)&&"function"!=typeof m&&m!==g){if(("tick0"===o||"dtick"===o)&&"geo"!==r[0]){var v=e.tickmode;if("auto"===v||"array"===v||!v)continue}if(("range"!==o||!e.autorange)&&("zmin"!==o&&"zmax"!==o||"contourcarpet"!==e.type)&&(a=l(y))&&(!a._compareAsJSON||JSON.stringify(m)!==JSON.stringify(g))){var x,_=a.valType,b=d(a),w=Array.isArray(m),T=Array.isArray(g);if(w&&T){var k="_input_"+o,M=t[k],S=e[k];if(Array.isArray(M)&&M===S)continue}if(void 0===g)b&&w?u.calc=!0:p();else if(a._isLinkedToArray){var E=[],C=!1;h||(u.arrays[o]=E);var I=Math.min(m.length,g.length),L=Math.max(m.length,g.length);if(I!==L){if("arraydraw"!==a.editType){p();continue}C=!0}for(x=0;x<I;x++)st(m[x],g[x],y.concat(x),i.extendFlat({inArray:o,arrayIndex:x},n));if(C)for(x=I;x<L;x++)E.push(x)}else!_&&i.isPlainObject(m)?st(m,g,y,n):b?w&&T?(c&&(u.calc=!0),(c||n.newDataRevision)&&p()):w!==T?u.calc=!0:p():w&&T?(m.length!==g.length||String(m)!==String(g))&&p():p()}}}for(o in e)if(!(o in t)&&"_"!==o.charAt(0)&&"function"!=typeof e[o]){if(d(a=l(r.concat(o)))&&Array.isArray(e[o]))return void(u.calc=!0);p()}}function lt(t,e){var r;for(r in t)if("_"!==r.charAt(0)){var n=t[r],a=e[r];if(n!==a)if(i.isPlainObject(n)&&i.isPlainObject(a)){if(lt(n,a))return!0}else{if(!Array.isArray(n)||!Array.isArray(a))return!0;if(n.length!==a.length)return!0;for(var o=0;o<n.length;o++)if(n[o]!==a[o]){if(!i.isPlainObject(n[o])||!i.isPlainObject(a[o]))return!0;if(lt(n[o],a[o]))return!0}}}}function ut(t){var e=t._fullLayout,r=t.getBoundingClientRect();if(!i.equalDomRects(r,e._lastBBox)){var n=e._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(t));e._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),e._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),e._lastBBox=r}}t.animate=function(t,e,r){if(t=i.getGraphDiv(t),!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=c.supplyAnimationDefaults(r)).transition,o=r.frame;function s(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(o,h){var f=0;function p(t){return Array.isArray(a)?f>=a.length?t.transitionOpts=a[f]:t.transitionOpts=a[0]:t.transitionOpts=a,f++,t}var d,m,g=[],y=null==e,v=Array.isArray(e);if(y||v||!i.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(d=0;d<n._frames.length;d++)(m=n._frames[d])&&(y||String(m.group)===String(e))&&g.push({type:"byname",name:String(m.name),data:p({name:m.name})});else if(v)for(d=0;d<e.length;d++){var x=e[d];-1!==["number","string"].indexOf(typeof x)?(x=String(x),g.push({type:"byname",name:x,data:p({name:x})})):i.isPlainObject(x)&&g.push({type:"object",data:p(i.extendFlat({},x))})}}else g.push({type:"object",data:p(i.extendFlat({},e))});for(d=0;d<g.length;d++)if("byname"===(m=g[d]).type&&!n._frameHash[m.data.name])return i.warn('animate failure: frame not found: "'+m.data.name+'"'),void h();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&g.reverse();var _=t._fullLayout._currentFrame;if(_&&r.fromcurrent){var b=-1;for(d=0;d<g.length;d++)if("byname"===(m=g[d]).type&&m.name===_){b=d;break}if(b>0&&b<g.length-1){var T=[];for(d=0;d<g.length;d++)m=g[d],("byname"!==g[d].type||d>b)&&T.push(m);g=T}}g.length>0?function(e){if(0!==e.length){for(var i=0;i<e.length;i++){var a;a="byname"===e[i].type?c.computeFrame(t,e[i].name):e[i].data;var f=l(i),p=s(i);p.duration=Math.min(p.duration,f.duration);var d={frame:a,name:e[i].name,frameOpts:f,transitionOpts:p};i===e.length-1&&(d.onComplete=u(o,2),d.onInterrupt=h),n._frameQueue.push(d)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||function(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,c.transition(t,e.frame.data,e.frame.layout,w.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}()}}(g):(t.emit("plotly_animated"),o())})},t.addFrames=function(t,e,r){if(t=i.getGraphDiv(t),null==e)return Promise.resolve();if(!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,o,l,u=t._transitionData._frames,h=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var f=u.length+2*e.length,p=[],d={};for(n=e.length-1;n>=0;n--)if(i.isPlainObject(e[n])){var m=e[n].name,g=(h[m]||d[m]||{}).name,y=e[n].name,v=h[g]||d[g];g&&y&&"number"==typeof y&&v&&S<5&&(S++,i.warn('addFrames: overwriting frame "'+(h[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},p.push({frame:c.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var x=[],_=[],b=u.length;for(n=p.length-1;n>=0;n--){if("number"==typeof(a=p[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+t._transitionData._counter++];);if(h[a.name]){for(o=0;o<u.length&&(u[o]||{}).name!==a.name;o++);x.push({type:"replace",index:o,value:a}),_.unshift({type:"replace",index:o,value:u[o]})}else l=Math.max(0,Math.min(p[n].index,b)),x.push({type:"insert",index:l,value:a}),_.unshift({type:"delete",index:l}),b++}var w=c.modifyFrames,T=c.modifyFrames,k=[t,_],A=[t,x];return s&&s.add(t,w,k,T,A),c.modifyFrames(t,x)},t.deleteFrames=function(t,e){if(t=i.getGraphDiv(t),!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,o=[],l=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for((e=e.slice()).sort(),r=e.length-1;r>=0;r--)n=e[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var u=c.modifyFrames,h=c.modifyFrames,f=[t,l],p=[t,o];return s&&s.add(t,u,f,h,p),c.modifyFrames(t,o)},t.addTraces=function e(r,n,a){r=i.getGraphDiv(r);var o,l,u=[],c=t.deleteTraces,h=e,f=[r,u],p=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(i=e[n])||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if(void 0!==r&&!Array.isArray(r)&&(r=[r]),void 0!==r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(r,n,a),Array.isArray(n)||(n=[n]),n=n.map(function(t){return i.extendFlat({},t)}),w.cleanData(n),o=0;o<n.length;o++)r.data.push(n[o]);for(o=0;o<n.length;o++)u.push(-n.length+o);if(void 0===a)return l=t.redraw(r),s.add(r,c,f,h,p),l;Array.isArray(a)||(a=[a]);try{O(r,u,a)}catch(t){throw r.data.splice(r.data.length-n.length,n.length),t}return s.startSequence(r),s.add(r,c,f,h,p),l=t.moveTraces(r,u,a),s.stopSequence(r),l},t.deleteTraces=function e(r,n){r=i.getGraphDiv(r);var a,o,l=[],u=t.addTraces,c=e,h=[r,l,n],f=[r,n];if(void 0===n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(r,n,"indices"),(n=P(n,r.data.length-1)).sort(i.sorterDes),a=0;a<n.length;a+=1)o=r.data.splice(n[a],1)[0],l.push(o);var p=t.redraw(r);return s.add(r,u,h,c,f),p},t.extendTraces=function e(r,n,a,o){var l=D(r=i.getGraphDiv(r),n,a,o,function(t,e,r){var n,a;if(i.isTypedArray(t))if(r<0){var o=new t.constructor(0),s=R(t,e);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(l)),a.set(t),a.set(e.subarray(0,l),t.length)}else{var u=r-e.length,c=t.length-u;n.set(t.subarray(c)),n.set(e,u),a.set(t.subarray(0,c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}),u=t.redraw(r),c=[r,l.update,a,l.maxPoints];return s.add(r,t.prependTraces,c,e,arguments),u},t.moveTraces=function e(r,n,a){var o,l=[],u=[],c=e,h=e,f=[r=i.getGraphDiv(r),a,n],p=[r,n,a];if(O(r,n,a),n=Array.isArray(n)?n:[n],void 0===a)for(a=[],o=0;o<n.length;o++)a.push(-n.length+o);for(a=Array.isArray(a)?a:[a],n=P(n,r.data.length-1),a=P(a,r.data.length-1),o=0;o<r.data.length;o++)-1===n.indexOf(o)&&l.push(r.data[o]);for(o=0;o<n.length;o++)u.push({newIndex:a[o],trace:r.data[n[o]]});for(u.sort(function(t,e){return t.newIndex-e.newIndex}),o=0;o<u.length;o+=1)l.splice(u[o].newIndex,0,u[o].trace);r.data=l;var d=t.redraw(r);return s.add(r,c,f,h,p),d},t.prependTraces=function e(r,n,a,o){var l=D(r=i.getGraphDiv(r),n,a,o,function(t,e,r){var n,a;if(i.isTypedArray(t))if(r<=0){var o=new t.constructor(0),s=R(e,t);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(0,l)),a.set(e.subarray(l)),a.set(t,l)}else{var u=r-e.length;n.set(e),n.set(t.subarray(0,u),e.length),a.set(t.subarray(u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}),u=t.redraw(r),c=[r,l.update,a,l.maxPoints];return s.add(r,t.extendTraces,c,e,arguments),u},t.newPlot=function(e,r,n,a){return e=i.getGraphDiv(e),c.cleanPlot([],{},e._fullData||[],e._fullLayout||{}),c.purge(e),t._doPlot(e,r,n,a)},t._doPlot=function(r,n,a,s){var u;if(r=i.getGraphDiv(r),o.init(r),i.isPlainObject(n)){var f=n;n=f.data,a=f.layout,s=f.config,u=f.frames}if(!1===o.triggerHandler(r,"plotly_beforeplot",[n,a,s]))return Promise.reject();!n&&!a&&!i.isPlotDiv(r)&&i.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",r),L(r,s),a||(a={}),e.select(r).classed("js-plotly-plot",!0),d.makeTester(),Array.isArray(r._promises)||(r._promises=[]);var p=0===(r.data||[]).length&&Array.isArray(n);Array.isArray(n)&&(w.cleanData(n),p?r.data=n:r.data.push.apply(r.data,n),r.empty=!1),(!r.layout||p)&&(r.layout=w.cleanLayout(a)),c.supplyDefaults(r);var m=r._fullLayout,v=m._has("cartesian");m._replotting=!0,(p||m._shouldCreateBgLayer)&&(function(t){var r=e.select(t),n=t._fullLayout;if(n._calcInverseTransform=ut,n._calcInverseTransform(t),n._container=r.selectAll(".plot-container").data([0]),n._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),n._paperdiv=n._container.selectAll(".svg-container").data([0]),n._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),n._glcontainer=n._paperdiv.selectAll(".gl-container").data([{}]),n._glcontainer.enter().append("div").classed("gl-container",!0),n._paperdiv.selectAll(".main-svg").remove(),n._paperdiv.select(".modebar-container").remove(),n._paper=n._paperdiv.insert("svg",":first-child").classed("main-svg",!0),n._toppaper=n._paperdiv.append("svg").classed("main-svg",!0),n._modebardiv=n._paperdiv.append("div"),delete n._modeBar,n._hoverpaper=n._paperdiv.append("svg").classed("main-svg",!0),!n._uid){var a={};e.selectAll("defs").each(function(){this.id&&(a[this.id.split("-")[1]]=1)}),n._uid=i.randstr(a)}n._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),n._defs=n._paper.append("defs").attr("id","defs-"+n._uid),n._clips=n._defs.append("g").classed("clips",!0),n._topdefs=n._toppaper.append("defs").attr("id","topdefs-"+n._uid),n._topclips=n._topdefs.append("g").classed("clips",!0),n._bgLayer=n._paper.append("g").classed("bglayer",!0),n._draggers=n._paper.append("g").classed("draglayer",!0);var o=n._paper.append("g").classed("layer-below",!0);n._imageLowerLayer=o.append("g").classed("imagelayer",!0),n._shapeLowerLayer=o.append("g").classed("shapelayer",!0),n._cartesianlayer=n._paper.append("g").classed("cartesianlayer",!0),n._polarlayer=n._paper.append("g").classed("polarlayer",!0),n._smithlayer=n._paper.append("g").classed("smithlayer",!0),n._ternarylayer=n._paper.append("g").classed("ternarylayer",!0),n._geolayer=n._paper.append("g").classed("geolayer",!0),n._funnelarealayer=n._paper.append("g").classed("funnelarealayer",!0),n._pielayer=n._paper.append("g").classed("pielayer",!0),n._iciclelayer=n._paper.append("g").classed("iciclelayer",!0),n._treemaplayer=n._paper.append("g").classed("treemaplayer",!0),n._sunburstlayer=n._paper.append("g").classed("sunburstlayer",!0),n._indicatorlayer=n._toppaper.append("g").classed("indicatorlayer",!0),n._glimages=n._paper.append("g").classed("glimages",!0);var s=n._toppaper.append("g").classed("layer-above",!0);n._imageUpperLayer=s.append("g").classed("imagelayer",!0),n._shapeUpperLayer=s.append("g").classed("shapelayer",!0),n._selectionLayer=n._toppaper.append("g").classed("selectionlayer",!0),n._infolayer=n._toppaper.append("g").classed("infolayer",!0),n._menulayer=n._toppaper.append("g").classed("menulayer",!0),n._zoomlayer=n._toppaper.append("g").classed("zoomlayer",!0),n._hoverlayer=n._hoverpaper.append("g").classed("hoverlayer",!0),n._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),t.emit("plotly_framework")}(r),m._shouldCreateBgLayer&&delete m._shouldCreateBgLayer),d.initGradients(r),d.initPatterns(r),p&&h.saveShowSpikeInitial(r);var x=!r.calcdata||r.calcdata.length!==(r._fullData||[]).length;x&&c.doCalcdata(r);for(var _=0;_<r.calcdata.length;_++)r.calcdata[_][0].trace=r._fullData[_];r._context.responsive?r._responsiveChartHandler||(r._responsiveChartHandler=function(){i.isHidden(r)||c.resize(r)},window.addEventListener("resize",r._responsiveChartHandler)):i.clearResponsive(r);var b=i.extendFlat({},m._size),T=0;function A(){if(c.clearAutoMarginIds(r),k.drawMarginPushers(r),h.allowAutoMargin(r),r._fullLayout.title.text&&r._fullLayout.title.automargin&&c.allowAutoMargin(r,"title.automargin"),m._has("pie"))for(var t=r._fullData,e=0;e<t.length;e++){var n=t[e];"pie"===n.type&&n.automargin&&c.allowAutoMargin(r,"pie."+n.uid+".automargin")}return c.doAutoMargin(r),c.previousPromises(r)}function M(){r._transitioning||(k.doAutoRangeAndConstraints(r),p&&h.saveRangeInitial(r),l.getComponentMethod("rangeslider","calcAutorange")(r))}var S=[c.previousPromises,function(){if(u)return t.addFrames(r,u)},function t(){for(var e=m._basePlotModules,n=0;n<e.length;n++)e[n].drawFramework&&e[n].drawFramework(r);!m._glcanvas&&m._has("gl")&&(m._glcanvas=m._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(t){return t.key}),m._glcanvas.enter().append("canvas").attr("class",function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var a=r._context.plotGlPixelRatio;if(m._glcanvas){m._glcanvas.attr("width",m.width*a).attr("height",m.height*a).style("width",m.width+"px").style("height",m.height+"px");var o=m._glcanvas.data()[0].regl;if(o&&(Math.floor(m.width*a)!==o._gl.drawingBufferWidth||Math.floor(m.height*a)!==o._gl.drawingBufferHeight)){var s="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!T)return i.log(s+" Clearing graph and plotting again."),c.cleanPlot([],{},r._fullData,m),c.supplyDefaults(r),m=r._fullLayout,c.doCalcdata(r),T++,t();i.error(s)}}return"h"===m.modebar.orientation?m._modebardiv.style("height",null).style("width","100%"):m._modebardiv.style("width",null).style("height",m.height+"px"),c.previousPromises(r)},A,function(){if(c.didMarginChange(b,m._size))return i.syncOrAsync([A,k.layoutStyles],r)}];v&&S.push(function(){if(x)return i.syncOrAsync([l.getComponentMethod("shapes","calcAutorange"),l.getComponentMethod("annotations","calcAutorange"),M],r);M()}),S.push(k.layoutStyles),v&&S.push(function(){return h.draw(r,p?"":"redraw")},function(t){var e=t._fullLayout._insideTickLabelsUpdaterange;if(e)return t._fullLayout._insideTickLabelsUpdaterange=void 0,V(t,e).then(function(){h.saveRangeInitial(t,!0)})}),S.push(k.drawData,k.finalDraw,g,c.addLinks,c.rehover,c.redrag,c.reselect,c.doAutoMargin,c.previousPromises);var C=i.syncOrAsync(S,r);return(!C||!C.then)&&(C=Promise.resolve()),C.then(function(){return E(r),r})},t.purge=function(t){var e=(t=i.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return c.cleanPlot([],{},r,e),c.purge(t),o.purge(t),e._container&&e._container.remove(),delete t._context,t},t.react=function(e,r,n,o){var s,h;e=i.getGraphDiv(e),w.clearPromiseQueue(e);var f=e._fullData,p=e._fullLayout;if(i.isPlotDiv(e)&&f&&p){if(i.isPlainObject(r)){var d=r;r=d.data,n=d.layout,o=d.config,s=d.frames}var m=!1;if(o){var g=i.extendDeep({},e._context);e._context=void 0,L(e,o),m=lt(g,e._context)}if(m){let i=e._ev.eventNames().map(t=>[t,e._ev.listeners(t)]);h=t.newPlot(e,r,n,o).then(()=>{for(let[t,r]of i)r.forEach(r=>e.on(t,r));return t.react(e,r,n,o)})}else{e.data=r||[],w.cleanData(e.data),e.layout=n||{},w.cleanLayout(e.layout),function(t,e,r,n){var o,s,l,u,c,h,f,p,d,m,g=n._preGUI,y=[],v={},x={};for(o in g){if(c=rt(o,tt)){if(d=c.head,m=c.tail,s=c.attr||d+".uirevision",(u=(l=a(n,s).get())&&nt(s,e))&&u===l){if(null===(h=g[o])&&(h=void 0),ot(p=(f=a(e,o)).get(),h)){void 0===p&&"autorange"===m&&y.push(d),f.set(B(a(n,o).get()));continue}if("autorange"===m||"range["===m.substr(0,6)){var _=g[d+".range[0]"],b=g[d+".range[1]"],w=g[d+".autorange"];if(w||null===w&&null===_&&null===b){if(!(d in v)){var T=a(e,d).get();v[d]=T&&(T.autorange||!1!==T.autorange&&(!T.range||2!==T.range.length))}if(v[d]){f.set(B(a(n,o).get()));continue}}}}}else i.warn("unrecognized GUI edit: "+o);delete g[o],c&&"range["===c.tail.substr(0,6)&&(x[c.head]=1)}for(var k=0;k<y.length;k++){var A=y[k];if(x[A]){var M=a(e,A).get();M&&delete M.autorange}}var S=n._tracePreGUI;for(var E in S){var C,I=S[E],L=null;for(o in I){if(!L){var P=it(E,r);if(P<0){delete S[E];break}var z=at(E,t,(C=r[P]._fullInput).index);if(z<0){delete S[E];break}L=t[z]}if(c=rt(o,et)){if(c.attr?u=(l=a(n,c.attr).get())&&nt(c.attr,e):(l=C.uirevision,void 0===(u=L.uirevision)&&(u=e.uirevision)),u&&u===l&&(null===(h=I[o])&&(h=void 0),ot(p=(f=a(L,o)).get(),h))){f.set(B(a(C,o).get()));continue}}else i.warn("unrecognized GUI edit: "+o+" in trace uid "+E);delete I[o]}}}(e.data,e.layout,f,p),c.supplyDefaults(e,{skipUpdateCalc:!0});var y=e._fullData,v=e._fullLayout,x=void 0===v.datarevision,_=v.transition,b=function(t,e,r,n,i){var a=A.layoutFlags();function o(t){return u.getLayoutValObject(r,t)}for(var s in a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0,r)if((s.startsWith("xaxis")||s.startsWith("yaxis"))&&e[s]){var l=r[s].domain,c=e[s].domain,h=e[s]._inputDomain;e[s]._inputDomain&&(l[0]===h[0]&&l[1]===h[1]?r[s].domain=e[s].domain:(l[0]!==c[0]||l[1]!==c[1])&&(r[s]._inputDomain=null))}var f={getValObject:o,flags:a,immutable:n,transition:i,gd:t};return st(e,r,[],f),(a.plot||a.calc)&&(a.layoutReplot=!0),i&&a.nChanges&&a.nChangesAnim&&(a.anim=a.nChanges===a.nChangesAnim?"all":"some"),a}(e,p,v,x,_),T=b.newDataRevision,M=function(t,e,r,n,i,a){var o=e.length===r.length;if(!i&&!o)return{fullReplot:!0,calc:!0};var s,l,c=A.traceFlags();function h(t){var e=u.getTraceValObject(l,t);return!l._module.animatable&&e.anim&&(e.anim=!1),e}c.arrays={},c.nChanges=0,c.nChangesAnim=0;var f={getValObject:h,flags:c,immutable:n,transition:i,newDataRevision:a,gd:t},p={};for(s=0;s<e.length;s++)if(r[s]){if(p[(l=r[s]._fullInput).uid])continue;p[l.uid]=1,st(e[s]._fullInput,l,[],f)}return(c.calc||c.plot)&&(c.fullReplot=!0),i&&c.nChanges&&c.nChangesAnim&&(c.anim=c.nChanges===c.nChangesAnim&&o?"all":"some"),c}(e,f,y,x,_,T);if(J(e)&&(b.layoutReplot=!0),M.calc||b.calc){e.calcdata=void 0;for(var S=Object.getOwnPropertyNames(v),C=0;C<S.length;C++){var I=S[C],P=I.substring(0,5);if("xaxis"===P||"yaxis"===P){var z=v[I]._emptyCategories;z&&z()}}}else c.supplyDefaultsUpdateCalc(e.calcdata,y);var O=[];if(s&&(e._transitionData={},c.createTransitionData(e),O.push(function(){return t.addFrames(e,s)})),v.transition&&(M.anim||b.anim))b.ticks&&O.push(k.doTicksRelayout),c.doCalcdata(e),k.doAutoRangeAndConstraints(e),O.push(function(){return c.transitionFromReact(e,M,b,p)});else if(M.fullReplot||b.layoutReplot)e._fullLayout._skipDefaults=!0,O.push(t._doPlot);else{for(var D in b.arrays){var R=b.arrays[D];if(R.length){var F=l.getComponentMethod(D,"drawOne");if(F!==i.noop)for(var N=0;N<R.length;N++)F(e,R[N]);else{var j=l.getComponentMethod(D,"draw");if(j===i.noop)throw new Error("cannot draw components: "+D);j(e)}}}O.push(c.previousPromises),M.style&&O.push(k.doTraceStyle),(M.colorbars||b.colorbars)&&O.push(k.doColorBars),b.legend&&O.push(k.doLegend),b.layoutstyle&&O.push(k.layoutStyles),b.axrange&&G(O),b.ticks&&O.push(k.doTicksRelayout),b.modebar&&O.push(k.doModeBar),b.camera&&O.push(k.doCamera),O.push(E)}O.push(c.rehover,c.redrag,c.reselect),(!(h=i.syncOrAsync(O,e))||!h.then)&&(h=Promise.resolve(e))}}else h=t.newPlot(e,r,n,o);return h.then(()=>(m||e.emit("plotly_react",{config:o,data:r,layout:n}),e))},t.redraw=function(e){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);return w.cleanData(e.data),w.cleanLayout(e.layout),e.calcdata=void 0,t._doPlot(e).then(function(){return e.emit("plotly_redraw"),e})},t.relayout=V,t.restyle=F,t.setPlotConfig=function(t){return i.extendFlat(_,t)},t.update=K,t._guiRelayout=Q(V),t._guiRestyle=Q(F),t._guiUpdate=Q(K),t._storeDirectGUIEdit=function(t,e,r){for(var n in r)j(n,a(t,n).get(),r[n],e)}}),zn=f(t=>{var e=Ut();t.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("mapbox")||t._has("map"))?500:0},t.getRedrawFunc=function(t){return function(){e.getComponentMethod("colorbar","draw")(t)}},t.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)},t.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var r=window.URL||window.webkitURL;t.createObjectURL=function(t){return r.createObjectURL(t)},t.revokeObjectURL=function(t){return r.revokeObjectURL(t)},t.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if("full-json"===e)return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),i=0;i<e;i++)n[i]=t.charCodeAt(i);return r}(window.atob(t));return new window.Blob([r],{type:"image/"+e})},t.octetStream=function(t){document.location.href="data:application/octet-stream"+t},t.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}),On=f((t,e)=>{var r=v();oe();var n=Je(),i=q();Te();var a=/"/g,o="TOBESTRIPPED",s=new RegExp('("'+o+")|("+o+'")',"g");e.exports=function(t,e,l){var u,c=t._fullLayout,h=c._paper,f=c._toppaper,p=c.width,d=c.height;h.insert("rect",":first-child").call(n.setRect,0,0,p,d).call(i.fill,c.paper_bgcolor);var m=c._basePlotModules||[];for(u=0;u<m.length;u++){var g=m[u];g.toSVG&&g.toSVG(t)}if(f){var y=f.node().childNodes,v=Array.prototype.slice.call(y);for(u=0;u<v.length;u++){var x=v[u];x.childNodes.length&&h.node().appendChild(x)}}c._draggers&&c._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var t=r.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(a,o));var n=this.style.fontWeight;n&&("normal"===n||"400"===n)&&t.style("font-weight",void 0);var i=this.style.fontStyle;i&&"normal"===i&&t.style("font-style",void 0);var s=this.style.fontVariant;s&&"normal"===s&&t.style("font-variant",void 0)}else t.remove()}),h.selectAll(".gradient_filled,.pattern_filled").each(function(){var t=r.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(a,o));var n=this.style.stroke;n&&-1!==n.indexOf("url(")&&t.style("stroke",n.replace(a,o))}),("pdf"===e||"eps"===e)&&h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),"svg"===e&&l&&(h.attr("width",l*p),h.attr("height",l*d),h.attr("viewBox","0 0 "+p+" "+d));var _=(new window.XMLSerializer).serializeToString(h.node());return _=function(t){var e=r.select("body").append("div").style({display:"none"}).html(""),n=t.replace(/(&[^;]*;)/gi,function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),n}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(s,"'")}}),Dn=f((t,e)=>{var r=oe(),n=ce().EventEmitter,i=zn();e.exports=function(t){var e=t.emitter||new n,a=new Promise(function(n,a){var o,s,l=window.Image,u=t.svg,c=t.format||"png",h=t.canvas,f=t.scale||1,p=t.width||300,d=t.height||150,m=f*p,g=f*d,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===c||r.isSafari()?s=i.encodeSVG(u):(o=i.createBlob(u,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==c&&y.drawImage(v,0,0,m,g),c){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!t.promise)return e.emit("error",l)}n(r),t.promise||e.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!t.promise)return e.emit("error",r)},v.src=s});return t.promise?a:e}}),Rn=f((t,e)=>{var r=T(),n=Pn(),i=we(),a=oe(),o=zn(),s=On(),l=Dn(),u=g().version,c={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var h,f,p,d;function m(t){return!(t in e)||a.validate(e[t],c[t])}if(e=e||{},a.isPlainObject(t)?(h=t.data||[],f=t.layout||{},p=t.config||{},d={}):(t=a.getGraphDiv(t),h=a.extendDeep([],t.data),f=a.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(c.format.values,", "," or ")+".");var g={};function y(t,r){return a.coerce(e,g,c,t,r)}var v=y("format"),x=y("width"),_=y("height"),b=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=a.extendFlat({},f);x?A.width=x:null===e.width&&r(d.width)&&(A.width=d.width),_?A.height=_:null===e.height&&r(d.height)&&(A.height=d.height);var M=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(k);function E(){return new Promise(function(t){setTimeout(t,o.getDelay(k._fullLayout))})}function C(){return new Promise(function(t,e){var r=s(k,v,b),c=k._fullLayout.width,h=k._fullLayout.height;function f(){n.purge(k),document.body.removeChild(k)}if("full-json"===v){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),t(T?p:o.encodeJSON(p))}if(f(),"svg"===v)return t(T?r:o.encodeSVG(r));var d=document.createElement("canvas");d.id=a.randstr(),l({format:v,width:c,height:h,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){n.newPlot(k,h,A,M).then(S).then(E).then(C).then(function(e){t(function(t){return T?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))}).catch(function(t){e(t)})})}}),Fn=f((t,e)=>{var r=oe(),n=we(),i=de(),a=W().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function u(t,e,n,i,a,c){c=c||[];for(var h=Object.keys(t),m=0;m<h.length;m++){var g=h[m],y=c.slice();y.push(g);var v=t[g],x=e[g],_=d(n,g),b=(_||{}).valType,w="info_array"===b,T="colorscale"===b,k=(_||{}).items;if(p(n,g))if(o(v)&&o(x)&&"any"!==b)u(v,x,_,i,a,y);else if(w&&s(v)){v.length>x.length&&i.push(f("unused",a,y.concat(x.length)));var A,M,S,E,C,I=x.length,L=Array.isArray(k);if(L&&(I=Math.min(I,k.length)),2===_.dimensions)for(M=0;M<I;M++)if(s(v[M])){v[M].length>x[M].length&&i.push(f("unused",a,y.concat(M,x[M].length)));var P=x[M].length;for(A=0;A<(L?Math.min(P,k[M].length):P);A++)S=L?k[M][A]:k,E=v[M][A],C=x[M][A],r.validate(E,S)?C!==E&&C!==+E&&i.push(f("dynamic",a,y.concat(M,A),E,C)):i.push(f("value",a,y.concat(M,A),E))}else i.push(f("array",a,y.concat(M),v[M]));else for(M=0;M<I;M++)S=L?k[M]:k,E=v[M],C=x[M],r.validate(E,S)?C!==E&&C!==+E&&i.push(f("dynamic",a,y.concat(M),E,C)):i.push(f("value",a,y.concat(M),E))}else if(_.items&&!w&&s(v)){var z,O,D=k[Object.keys(k)[0]],R=[];for(z=0;z<x.length;z++){var F=x[z]._index||z;if((O=y.slice()).push(F),o(v[F])&&o(x[z])){R.push(F);var B=v[F],N=x[z];o(B)&&!1!==B.visible&&!1===N.visible?i.push(f("invisible",a,O)):u(B,N,D,i,a,O)}}for(z=0;z<v.length;z++)(O=y.slice()).push(z),o(v[z])?-1===R.indexOf(z)&&i.push(f("unused",a,O)):i.push(f("object",a,O,v[z]))}else!o(v)&&o(x)?i.push(f("object",a,y,v)):l(v)||!l(x)||w||T?g in e?r.validate(v,_)?"enumerated"===_.valType&&(_.coerceNumber&&v!==+x||!l(v)&&v!==x||String(v)!==String(x))&&i.push(f("dynamic",a,y,v,x)):i.push(f("value",a,y,v)):i.push(f("unused",a,y,v)):i.push(f("array",a,y,v));else i.push(f("schema",a,y))}return i}e.exports=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var l,c,h=i.get(),p=[],d={_context:r.extendFlat({},a)};s(t)?(d.data=r.extendDeep([],t),l=t):(d.data=[],l=[],p.push(f("array","data"))),o(e)?(d.layout=r.extendDeep({},e),c=e):(d.layout={},c={},arguments.length>1&&p.push(f("object","layout"))),n.supplyDefaults(d);for(var m=d._fullData,g=l.length,y=0;y<g;y++){var v=l[y],x=["data",y];if(o(v)){var _=m[y],b=_.type,w=h.traces[b].attributes;w.type={valType:"enumerated",values:[b]},!1===_.visible&&!1!==v.visible&&p.push(f("invisible",x)),u(v,_,w,p,x)}else p.push(f("object",x))}var T=d._fullLayout,k=function(t,e){for(var n=t.layout.layoutAttributes,i=0;i<e.length;i++){var a=e[i],o=t.traces[a.type],s=o.layoutAttributes;s&&(a.subplot?r.extendFlat(n[o.attributes.subplot.dflt],s):r.extendFlat(n,s))}return n}(h,m);return u(c,T,k,p,"layout"),0===p.length?void 0:p};var c={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":h(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":h(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return h(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=o(r)?"container":"key";return h(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[h(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?h(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[h(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function h(t){return s(t)?"In data trace "+t[1]+", ":"In "+t+", "}function f(t,e,n,i,a){var o,l;n=n||"",s(e)?(o=e[0],l=e[1]):(o=e,l=null);var u=function(t){if(!s(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(n),h=c[t](e,u,i,a);return r.log(h),{code:t,container:o,trace:l,path:n,astr:u,msg:h}}function p(t,e){var r=g(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function d(t,e){return e in t?t[e]:t[g(e).keyMinusId]}var m=r.counterRegex("([a-z]+)");function g(t){var e=t.match(m);return{keyMinusId:e&&e[1],id:e&&e[2]}}}),Bn=f((t,e)=>{var r=oe(),n=zn();e.exports=function(t,e,i){var a=document.createElement("a"),o="download"in a;return new Promise(function(s,l){var u,c;if(o)return u=n.createBlob(t,i),c=n.createObjectURL(u),a.href=c,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),n.revokeObjectURL(c),u=null,s(e);if(r.isSafari()){var h="svg"===i?",":";base64,";return n.octetStream(h+encodeURIComponent(t)),s(e)}l(new Error("download error"))})}}),Nn=f((t,e)=>{var r=oe(),n=Rn(),i=Bn();zn(),e.exports=function(t,e){var a;return r.isPlainObject(t)||(a=r.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise(function(r,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var s=n(t,e),l=e.filename||t.fn||"newplot";l+="."+e.format.replace("-","."),s.then(function(t){return a&&(a._snapshotInProgress=!1),i(t,l,e.format)}).then(function(t){r(t)}).catch(function(t){a&&(a._snapshotInProgress=!1),o(t)})})}}),jn=f(t=>{var e=oe(),r=e.isPlainObject,n=de(),i=we(),a=j(),o=me(),s=W().dfltConfig;function l(t,n){t=e.extendDeep({},t);var i,a,s=Object.keys(t).sort();function c(e,n,i){if(r(n)&&r(e))l(e,n);else if(Array.isArray(n)&&Array.isArray(e)){var s=o.arrayTemplater({_template:t},i);for(a=0;a<n.length;a++){var u=n[a],c=s.newItem(u)._template;c&&l(c,u)}var h=s.defaultItems();for(a=0;a<h.length;a++)n.push(h[a]._template);for(a=0;a<n.length;a++)delete n[a].templateitemname}}for(i=0;i<s.length;i++){var h=s[i],f=t[h];if(h in n?c(f,n[h],h):n[h]=f,u(h)===h)for(var p in n){var d=u(p);p!==d&&d===h&&!(p in t)&&c(f,n[p],h)}}}function u(t){return t.replace(/[0-9]+$/,"")}function c(t,n,i,a,s){var l=s&&i(s);for(var h in t){var f=t[h],d=p(t,h,a),m=p(t,h,s),g=i(m);if(!g){var y=u(h);y!==h&&(g=i(m=p(t,y,s)))}if(!(l&&l===g||!g||g._noTemplating||"data_array"===g.valType||g.arrayOk&&Array.isArray(f)))if(!g.valType&&r(f))c(f,n,i,d,m);else if(g._isLinkedToArray&&Array.isArray(f))for(var v=!1,x=0,_={},b=0;b<f.length;b++){var w=f[b];if(r(w)){var T=w.name;if(T)_[T]||(c(w,n,i,p(f,x,d),p(f,x,m)),x++,_[T]=1);else if(!v){var k=p(t,o.arrayDefaultKey(h),a),A=p(f,x,d);c(w,n,i,A,p(f,x,m));var M=e.nestedProperty(n,A);e.nestedProperty(n,k).set(M.get()),M.set(null),v=!0}}}else e.nestedProperty(n,d).set(f)}}function h(t,r){return n.getLayoutValObject(t,e.nestedProperty({},r).parts)}function f(t,r){return n.getTraceValObject(t,e.nestedProperty({},r).parts)}function p(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function d(t){for(var e=0;e<t.length;e++)if(r(t[e]))return!0}function m(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}t.makeTemplate=function(t){t=e.isPlainObject(t)?t:e.getGraphDiv(t),t=e.extendDeep({_context:s},{data:t.data,layout:t.layout}),i.supplyDefaults(t);var n=t.data||[],o=t.layout||{};o._basePlotModules=t._fullLayout._basePlotModules,o._modules=t._fullLayout._modules;var u={data:{},layout:{}};n.forEach(function(t){var r={};c(t,r,f.bind(null,t));var n=e.coerce(t,{},a,"type"),i=u.data[n];i||(i=u.data[n]=[]),i.push(r)}),c(o,u.layout,h.bind(null,o)),delete u.layout.template;var p=o.template;if(r(p)){var d,m,g,y,v,x,_=p.layout;r(_)&&l(_,u.layout);var b=p.data;if(r(b)){for(m in u.data)if(g=b[m],Array.isArray(g)){for(x=(v=u.data[m]).length,y=g.length,d=0;d<x;d++)l(g[d%y],v[d]);for(d=x;d<y;d++)v.push(e.extendDeep({},g[d]))}for(m in b)m in u.data||(u.data[m]=e.extendDeep([],b[m]))}}return u},t.validateTemplate=function(t,n){var a=e.extendDeep({},{_context:s,data:t.data,layout:t.layout}),o=a.layout||{};r(n)||(n=o.template||{});var l=n.layout,c=n.data,h=[];a.layout=o,a.layout.template=n,i.supplyDefaults(a);var f=a._fullLayout,g=a._fullData,y={};if(r(l)?(function t(e,n){for(var i in e)if("_"!==i.charAt(0)&&r(e[i])){var a,o=u(i),s=[];for(a=0;a<n.length;a++)s.push(p(e,i,n[a])),o!==i&&s.push(p(e,o,n[a]));for(a=0;a<s.length;a++)y[s[a]]=1;t(e[i],s)}}(f,["layout"]),function t(e,n){for(var i in e)if(-1===i.indexOf("defaults")&&r(e[i])){var a=p(e,i,n);y[a]?t(e[i],a):h.push({code:"unused",path:a})}}(l,"layout")):h.push({code:"layout"}),r(c)){for(var v,x={},_=0;_<g.length;_++){var b=g[_];x[v=b.type]=(x[v]||0)+1,b._fullInput._template||h.push({code:"missing",index:b.index,traceType:v})}for(v in c){var w=c[v].length,T=x[v]||0;w>T?h.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else h.push({code:"data"});if(function t(e,n){for(var i in e)if("_"!==i.charAt(0)){var a=e[i],o=p(e,i,n);r(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:g,layout:f},""),h.length)return h.map(m)}}),Un=f(t=>{var e=Pn();t._doPlot=e._doPlot,t.newPlot=e.newPlot,t.restyle=e.restyle,t.relayout=e.relayout,t.redraw=e.redraw,t.update=e.update,t._guiRestyle=e._guiRestyle,t._guiRelayout=e._guiRelayout,t._guiUpdate=e._guiUpdate,t._storeDirectGUIEdit=e._storeDirectGUIEdit,t.react=e.react,t.extendTraces=e.extendTraces,t.prependTraces=e.prependTraces,t.addTraces=e.addTraces,t.deleteTraces=e.deleteTraces,t.moveTraces=e.moveTraces,t.purge=e.purge,t.addFrames=e.addFrames,t.deleteFrames=e.deleteFrames,t.animate=e.animate,t.setPlotConfig=e.setPlotConfig;var r=Ct().getGraphDiv,n=Gr().eraseActiveShape;t.deleteActiveShape=function(t){return n(r(t))},t.toImage=Rn(),t.validate=Fn(),t.downloadImage=Nn();var i=jn();t.makeTemplate=i.makeTemplate,t.validateTemplate=i.validateTemplate}),Vn=f((t,e)=>{var r=oe(),n=Ut();e.exports=function(t,e,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),s){var u=r.minRowLength(s);l?o=Math.min(u,r.minRowLength(l)):(o=u,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}}),qn=f((t,e)=>{var r=oe().dateTick0,n=k().ONEWEEK;function i(t,e){return r(e,t%n===0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}}),Hn=f((t,e)=>{var r=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=a[s];l||(l=a[s]={});var u=l[o],c=!1;u?u.traces.push(e):(u=l[o]={traceIndices:[],traces:[e]},c=!0);for(var h={orientation:e.x&&!e.y?"h":"v"},f=0;f<r.length;f++){var p=r[f],d=p+"Found";if(!u[d]){var m=void 0!==t[p],g="orientation"===p;if((m||c)&&(u[p]=i(p,h[p]),g&&(u.fillDflt="h"===u[p]?"tonextx":"tonexty"),m&&(u[d]=!0,!c&&(delete u.traces[0][p],g))))for(var y=0;y<u.traces.length-1;y++){var v=u.traces[y];v._input.fill!==v.fill&&(v.fill=u.fillDflt)}}}return u}}}),Gn=f((t,e)=>{var r=q(),n=Me().hasColorscale,i=Ue(),a=Ze();e.exports=function(t,e,o,s,l,u){var c=a.isBubble(t),h=(t.line||{}).color;u=u||{},h&&(o=h),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),u.noAngle||(l("marker.angle"),u.noAngleRef||l("marker.angleref"),u.noStandOff||l("marker.standoff")),l("marker.color",o),n(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:c?r.background:r.defaultLine),n(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}),Zn=f((t,e)=>{var r=oe().isArrayOrTypedArray,n=Me().hasColorscale,i=Ue();e.exports=function(t,e,a,o,s,l){l||(l={});var u=(t.marker||{}).color;u&&u._inputArray&&(u=u._inputArray),s("line.color",a),n(t,"line")?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!r(u)&&u||a),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}}),Wn=f((t,e)=>{e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}}),Yn=f((t,e)=>{var r=oe();e.exports=function(t,e,n,i,a){a=a||{},i("textposition"),r.coerceFont(i,"textfont",a.font||n.font,a),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}}),Xn=f((t,e)=>{var r=q(),n=oe().isArrayOrTypedArray;e.exports=function(t,e,i,a,o){o||(o={});var s,l=!1;if(e.marker){var u=e.marker.color,c=(e.marker.line||{}).color;u&&!n(u)?l=u:c&&!n(c)&&(l=c)}if(o.moduleHasFillgradient&&"none"!==a("fillgradient.type")){a("fillgradient.start"),a("fillgradient.stop");var h=a("fillgradient.colorscale");h&&(s=function(t){for(var e=r.interpolate(t[0][1],t[1][1],.5),n=2;n<t.length;n++){var i=r.interpolate(t[n-1][1],t[n][1],.5);e=r.interpolate(e,i,t[n-1][0]/t[n][0])}return e}(h))}a("fillcolor",r.addOpacity((e.line||{}).color||l||s||i,.5))}}),$n=f((t,e)=>{var r=oe(),n=Ut(),i=bn(),a=xn(),o=Ze(),s=Vn(),l=qn(),u=Hn(),c=Gn(),h=Zn(),f=Wn(),p=Yn(),d=Xn(),m=oe().coercePattern;e.exports=function(t,e,g,y){function v(n,a){return r.coerce(t,e,i,n,a)}var x=s(t,e,y,v);if(x||(e.visible=!1),e.visible){l(t,e,y,v),v("xhoverformat"),v("yhoverformat"),v("zorder");var _=u(t,e,y,v);"group"===y.scattermode&&void 0===e.orientation&&v("orientation","v");var b=!_&&x<a.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",b),o.hasMarkers(e)&&c(t,e,g,y,v,{gradient:!0}),o.hasLines(e)&&(h(t,e,g,y,v,{backoff:!0}),f(t,e,v),v("connectgaps"),v("line.simplify")),o.hasText(e)&&(v("texttemplate"),p(t,e,y,v));var w=[];(o.hasMarkers(e)||o.hasText(e))&&(v("cliponaxis"),v("marker.maxdisplayed"),w.push("points")),v("fill",_?_.fillDflt:"none"),"none"!==e.fill&&(d(t,e,g,v,{moduleHasFillgradient:!0}),o.hasLines(e)||f(t,e,v),m(v,"fillpattern",e.fillcolor,!1));var T=(e.line||{}).color,k=(e.marker||{}).color;("tonext"===e.fill||"toself"===e.fill)&&w.push("fills"),v("hoveron",w.join("+")||"points"),"fills"!==e.hoveron&&v("hovertemplate");var A=n.getComponentMethod("errorbars","supplyDefaults");A(t,e,T||k||g,{axis:"y"}),A(t,e,T||k||g,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(e,v)}}}),Jn=f((t,e)=>{var r=tn().getAxisGroup;e.exports=function(t,e,n,i,a){var o=e.orientation,s=e[{v:"x",h:"y"}[o]+"axis"],l=r(n,s)+o,u=n._alignmentOpts||{},c=i("alignmentgroup"),h=u[l];h||(h=u[l]={});var f=h[c];f?f.traces.push(e):f=h[c]={traces:[e],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var p=i("offsetgroup")||"",d=f.offsetGroups,m=d[p];e._offsetIndex=0,("group"!==a||p)&&(m||(m=d[p]={offsetIndex:Object.keys(d).length}),e._offsetIndex=m.offsetIndex)}}),Kn=f((t,e)=>{var r=oe(),n=Jn(),i=bn();e.exports=function(t,e){var a,o,s,l=e.scattermode;function u(t){return r.coerce(o._input,o,i,t)}if("group"===e.scattermode)for(s=0;s<t.length;s++)"scatter"===(o=t[s]).type&&(a=o._input,n(a,o,e,u,l));for(s=0;s<t.length;s++){var c=t[s];if("scatter"===c.type){var h=c.fill;if("none"!==h&&"toself"!==h&&(c.opacity=void 0,"tonexty"===h||"tonextx"===h))for(var f=s-1;f>=0;f--){var p=t[f];if("scatter"===p.type&&p.xaxis===c.xaxis&&p.yaxis===c.yaxis){p.opacity=void 0;break}}}}}}),Qn=f((t,e)=>{var r=oe(),n=xe();e.exports=function(t,e){var i,a,o="group"===e.barmode;"group"===e.scattermode&&(i="scattergap",a=o?e.bargap:.2,r.coerce(t,e,n,i,a))}}),ti=f((t,e)=>{var r=T(),n=oe(),i=n.dateTime2ms,a=n.incrementMonth,o=k().ONEAVGMONTH;e.exports=function(t,e,n,s){if("date"!==e.type)return{vals:s};var l=t[n+"periodalignment"];if(!l)return{vals:s};var u,c=t[n+"period"];if(r(c)){if((c=+c)<=0)return{vals:s}}else if("string"==typeof c&&"M"===c.charAt(0)){var h=+c.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};u=h}for(var f=e.calendar,p="start"===l,d="end"===l,m=t[n+"period0"],g=i(m,f)||0,y=[],v=[],x=[],_=s.length,b=0;b<_;b++){var w,T,k,A=s[b];if(u){for(w=Math.round((A-g)/(u*o)),k=a(g,u*w,f);k>A;)k=a(k,-u,f);for(;k<=A;)k=a(k,u,f);T=a(k,-u,f)}else{for(k=g+(w=Math.round((A-g)/c))*c;k>A;)k-=c;for(;k<=A;)k+=c;T=k-c}y[b]=p?T:d?k:(T+k)/2,v[b]=T,x[b]=k}return{vals:y,starts:v,ends:x}}}),ei=f((t,e)=>{var r=Me().hasColorscale,n=He(),i=Ze();e.exports=function(t,e){i.hasLines(e)&&r(e,"line")&&n(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(r(e,"marker")&&n(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),r(e,"marker.line")&&n(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),ri=f((t,e)=>{var r=oe();e.exports=function(t,e){for(var n=0;n<t.length;n++)t[n].i=n;r.mergeArray(e.text,t,"tx"),r.mergeArray(e.texttemplate,t,"txt"),r.mergeArray(e.hovertext,t,"htx"),r.mergeArray(e.customdata,t,"data"),r.mergeArray(e.textposition,t,"tp"),e.textfont&&(r.mergeArrayCastPositive(e.textfont.size,t,"ts"),r.mergeArray(e.textfont.color,t,"tc"),r.mergeArray(e.textfont.family,t,"tf"),r.mergeArray(e.textfont.weight,t,"tw"),r.mergeArray(e.textfont.style,t,"ty"),r.mergeArray(e.textfont.variant,t,"tv"),r.mergeArray(e.textfont.textcase,t,"tC"),r.mergeArray(e.textfont.lineposition,t,"tE"),r.mergeArray(e.textfont.shadow,t,"tS"));var i=e.marker;if(i){r.mergeArrayCastPositive(i.size,t,"ms"),r.mergeArrayCastPositive(i.opacity,t,"mo"),r.mergeArray(i.symbol,t,"mx"),r.mergeArray(i.angle,t,"ma"),r.mergeArray(i.standoff,t,"mf"),r.mergeArray(i.color,t,"mc");var a=i.line;i.line&&(r.mergeArray(a.color,t,"mlc"),r.mergeArrayCastPositive(a.width,t,"mlw"));var o=i.gradient;o&&"none"!==o.type&&(r.mergeArray(o.type,t,"mgt"),r.mergeArray(o.color,t,"mgc"))}}}),ni=f((t,e)=>{var r=oe();e.exports=function(t,e){r.isArrayOrTypedArray(e.selectedpoints)&&r.tagSelected(t,e)}}),ii=f((t,e)=>{var r=T(),n=oe(),i=rr(),a=ti(),o=k().BADNUM,s=Ze(),l=ei(),u=ri(),c=ni();function h(t,e,r,n,a,o,l){var u=e._length,c=t._fullLayout,h=r._id,f=n._id,p=c._firstScatter[d(e)]===e.uid,g=(m(e,c,r,n)||{}).orientation,y=e.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},x={padded:!0};l&&(v.ppad=x.ppad=l);var _=u<2||a[0]!==a[u-1]||o[0]!==o[u-1];_&&("tozerox"===y||"tonextx"===y&&(p||"h"===g))?v.tozero=!0:!(e.error_y||{}).visible&&("tonexty"===y||"tozeroy"===y||!s.hasMarkers(e)&&!s.hasText(e))&&(v.padded=!1,v.ppad=0),_&&("tozeroy"===y||"tonexty"===y&&(p||"v"===g))?x.tozero=!0:("tonextx"===y||"tozerox"===y)&&(x.padded=!1),h&&(e._extremes[h]=i.findExtremes(r,a,v)),f&&(e._extremes[f]=i.findExtremes(n,o,x))}function f(t,e){if(s.hasMarkers(t)){var r,a=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},n.isArrayOrTypedArray(a.size)){var l={type:"linear"};i.setConvert(l);for(var u=l.makeCalcdata(t.marker,"size"),c=new Array(e),h=0;h<e;h++)c[h]=r(u[h]);return c}return r(a.size)}}function p(t,e){var r=d(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function d(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function m(t,e,r,n){var i=t.stackgroup;if(i){var a=e._scatterStackOpts[r._id+n._id][i],o="v"===a.orientation?n:r;if("linear"===o.type||"log"===o.type)return a}}e.exports={calc:function(t,e){var s,d,g,y,v,x,_=t._fullLayout,b=e._xA=i.getFromId(t,e.xaxis||"x","x"),w=e._yA=i.getFromId(t,e.yaxis||"y","y"),T=b.makeCalcdata(e,"x"),k=w.makeCalcdata(e,"y"),A=a(e,b,"x",T),M=a(e,w,"y",k),S=A.vals,E=M.vals,C=e._length,I=new Array(C),L=e.ids,P=m(e,_,b,w),z=!1;p(_,e);var O,D="x",R="y";P?(n.pushUnique(P.traceIndices,e.index),(s="v"===P.orientation)?(R="s",O="x"):(D="s",O="y"),v="interpolate"===P.stackgaps):h(t,e,b,w,S,E,f(e,C));var F=!!e.xperiodalignment,B=!!e.yperiodalignment;for(d=0;d<C;d++){var N=I[d]={},j=r(S[d]),U=r(E[d]);j&&U?(N[D]=S[d],N[R]=E[d],F&&(N.orig_x=T[d],N.xEnd=A.ends[d],N.xStart=A.starts[d]),B&&(N.orig_y=k[d],N.yEnd=M.ends[d],N.yStart=M.starts[d])):P&&(s?j:U)?(N[O]=s?S[d]:E[d],N.gap=!0,v?(N.s=o,z=!0):N.s=0):N[D]=N[R]=o,L&&(N.id=String(L[d]))}if(u(I,e),l(t,e),c(I,e),P){for(d=0;d<I.length;)I[d][O]===o?I.splice(d,1):d++;if(n.sort(I,function(t,e){return t[O]-e[O]||t.i-e.i}),z){for(d=0;d<I.length-1&&I[d].gap;)d++;for((x=I[d].s)||(x=I[d].s=0),g=0;g<d;g++)I[g].s=x;for(y=I.length-1;y>d&&I[y].gap;)y--;for(x=I[y].s,g=I.length-1;g>y;g--)I[g].s=x;for(;d<y;)if(I[++d].gap){for(g=d+1;I[g].gap;)g++;for(var V=I[d-1][O],q=I[d-1].s,H=(I[g].s-q)/(I[g][O]-V);d<g;)I[d].s=q+(I[d][O]-V)*H,d++}}}return I},calcMarkerSize:f,calcAxisExpansion:h,setFirstScatter:p,getStackOpts:m}}),ai=f((t,e)=>{e.exports=n;var r=oe().distinctVals;function n(t,e){this.traces=t,this.sepNegVal=e.sepNegVal,this.overlapNoMerge=e.overlapNoMerge;for(var n=1/0,i=e.posAxis._id.charAt(0),a=[],o=0;o<t.length;o++){for(var s=t[o],l=0;l<s.length;l++){var u=s[l],c=u.p;void 0===c&&(c=u[i]),void 0!==c&&a.push(c)}s[0]&&s[0].width1&&(n=Math.min(s[0].width1,n))}this.positions=a;var h=r(a);this.distinctPositions=h.vals,1===h.vals.length&&n!==1/0?this.minDiff=n:this.minDiff=Math.min(h.minDiff,n);var f=(e.posAxis||{}).type;("category"===f||"multicategory"===f)&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}n.prototype.put=function(t,e,r){var n=this.getLabel(t,e,r),i=this.bins[n]||0;return this.bins[n]=i+r,i},n.prototype.get=function(t,e,r){var n=this.getLabel(t,e,r);return this.bins[n]||0},n.prototype.getLabel=function(t,e,r){return(r<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?t:Math.round(t/this.binWidth))+"g"+e}}),oi=f((t,e)=>{var r=T(),n=oe().isArrayOrTypedArray,i=k().BADNUM,a=Ut(),o=rr(),s=tn().getAxisGroup,l=ai();function u(t,e,a,s,u){if(s.length){var f,y,v,x;switch(function(t,e){var i,a;for(i=0;i<e.length;i++){var o,s=e[i],l=s[0].trace,u="funnel"===l.type?l._base:l.base,c="h"===l.orientation?l.xcalendar:l.ycalendar,h="category"===t.type||"multicategory"===t.type?function(){return null}:t.d2c;if(n(u)){for(a=0;a<Math.min(u.length,s.length);a++)o=h(u[a],0,c),r(o)?(s[a].b=+o,s[a].hasB=1):s[a].b=0;for(;a<s.length;a++)s[a].b=0}else{o=h(u,0,c);var f=r(o);for(o=f?o:0,a=0;a<s.length;a++)s[a].b=o,f&&(s[a].hasB=1)}}}(a,s),u.mode){case"overlay":c(t,e,a,s,u);break;case"group":for(f=[],y=[],v=0;v<s.length;v++)void 0===(x=s[v])[0].trace.offset?y.push(x):f.push(x);y.length&&function(t,e,r,n,a){var o=new l(n,{posAxis:e,sepNegVal:!1,overlapNoMerge:!a.norm});h(t,e,o,a),function(t,e){for(var r=t.traces,n=0;n<r.length;n++){var a=r[n],o=a[0].trace,s=a[0].t.offsetindex;if(void 0===o.base)for(var u=new l([a],{posAxis:e,sepNegVal:!0,overlapNoMerge:!0}),c=0;c<a.length;c++){var h=a[c];if(h.p!==i){var f=u.put(h.p,s,h.b+h.s);f&&(h.b=f)}}}}(o,e),a.norm?(d(o),m(r,o,a)):p(r,o)}(t,e,a,y,u),f.length&&c(t,e,a,f,u);break;case"stack":case"relative":for(f=[],y=[],v=0;v<s.length;v++)void 0===(x=s[v])[0].trace.base?y.push(x):f.push(x);(function(t){if(!(t.length<2)){var e,n,i,a,o,s;for(e=0;e<t.length&&void 0===(a=(n=t[e][0].trace).marker?n.marker.cornerradius:void 0);e++);if(void 0!==a)for(o=r(a)?+a:+a.slice(0,-1),s=r(a)?"px":"%",e=0;e<t.length;e++)(i=t[e][0].t).cornerradiusvalue=o,i.cornerradiusform=s}})(y),y.length&&function(t,e,r,n,a){var s=new l(n,{posAxis:e,sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});h(t,e,s,a),function(t,e,r){var n,a,s,l,u,c,h,f=g(t),p=e.traces;for(l=0;l<p.length;l++)if(n=p[l],"funnel"===(a=n[0].trace).type)for(h=n[0].t.offsetindex,u=0;u<n.length;u++)(c=n[u]).s!==i&&e.put(c.p,h,-.5*c.s);for(l=0;l<p.length;l++){s="funnel"===(a=(n=p[l])[0].trace).type,h="barpolar"===a.type?0:n[0].t.offsetindex;var d=[];for(u=0;u<n.length;u++)if((c=n[u]).s!==i){var m;m=s?c.s:c.s+c.b;var y=e.put(c.p,h,m),v=y+m;c.b=y,c[f]=v,r.norm||(d.push(v),c.hasB&&d.push(y))}r.norm||(a._extremes[t._id]=o.findExtremes(t,d,{tozero:!0,padded:!0}))}}(r,s,a);for(var u=0;u<n.length;u++)for(var c=n[u],f=c[0].t.offsetindex,p=0;p<c.length;p++){var d=c[p];d.s!==i&&d.b+d.s===s.get(d.p,f,d.s)&&(d._outmost=!0)}a.norm&&m(r,s,a)}(t,e,a,y,u),f.length&&c(t,e,a,f,u)}(function(t){var e,n,i,a,o,s,l;for(e=0;e<t.length;e++)n=t[e],i=n[0].trace,void 0===(a=n[0].t).cornerradiusvalue&&void 0!==(o=i.marker?i.marker.cornerradius:void 0)&&(s=r(o)?+o:+o.slice(0,-1),l=r(o)?"px":"%",a.cornerradiusvalue=s,a.cornerradiusform=l)})(s),function(t,e){var i,a,o,s=g(e),l={},u=1/0,c=-1/0;for(i=0;i<t.length;i++)for(o=t[i],a=0;a<o.length;a++){var h=o[a].p;r(h)&&(u=Math.min(u,h),c=Math.max(c,h))}var f=1e4/(c-u),p=l.round=function(t){return String(Math.round(f*(t-u)))},d={},m={},y=t.some(function(t){var e=t[0].trace;return"marker"in e&&e.marker.cornerradius});for(i=0;i<t.length;i++){(o=t[i])[0].t.extents=l;var v=o[0].t.poffset,x=n(v);for(a=0;a<o.length;a++){var _=o[a],b=_[s]-_.w/2;if(r(b)){var w=_[s]+_.w/2,T=p(_.p);l[T]?l[T]=[Math.min(b,l[T][0]),Math.max(w,l[T][1])]:l[T]=[b,w]}if(_.p0=_.p+(x?v[a]:v),_.p1=_.p0+_.w,_.s0=_.b,_.s1=_.s0+_.s,y){var k=Math.min(_.s0,_.s1)||0,A=Math.max(_.s0,_.s1)||0,M=_[s];d[M]=M in d?Math.min(d[M],k):k,m[M]=M in m?Math.max(m[M],A):A}}}y&&function(t,e,r,n){for(var i=g(n),a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s],u=l[i];l._sMin=e[u],l._sMax=r[u]}}(t,d,m,e)}(s,e)}}function c(t,e,r,n,i){for(var a=0;a<n.length;a++){var o=n[a],s=new l([o],{posAxis:e,sepNegVal:!1,overlapNoMerge:!i.norm});h(t,e,s,i),i.norm?(d(s),m(r,s,i)):p(r,s)}}function h(t,e,i,a){var o,l,u,c,h=t._fullLayout,p=i.positions,d=i.distinctPositions,m=i.minDiff,y=i.traces,v=y.length,x=p.length!==d.length,_=m*(1-a.gap);if("angularaxis"===e._id)u=-(l=(o=_)*(1-(a.groupgap||0)))/2;else{var b=s(h,e._id)+y[0][0].trace.orientation;c=h._alignmentOpts[b]||{}}for(var w=0;w<v;w++){var T=y[w],k=T[0].trace;if("angularaxis"!==e._id){var A=c[k.alignmentgroup]||{},M=Object.keys(A.offsetGroups||{}).length;l=(o=M?_/M:x?_/v:_)*(1-(a.groupgap||0)),u=M?((2*k._offsetIndex+1-M)*o-l)/2:x?((2*w+1-v)*o-l)/2:-l/2}var S=T[0].t;S.barwidth=l,S.offsetindex=k._offsetIndex||0,S.poffset=u,S.bargroupwidth=_,S.bardelta=m}i.binWidth=y[0][0].t.barwidth/100,function(t){var e,i,a=t.traces;for(e=0;e<a.length;e++){var o,s=a[e],l=s[0],u=l.trace,c=l.t,h=u._offset||u.offset,f=c.poffset;if(n(h)){for(o=Array.prototype.slice.call(h,0,s.length),i=0;i<o.length;i++)r(o[i])||(o[i]=f);for(i=o.length;i<s.length;i++)o.push(f);c.poffset=o}else void 0!==h&&(c.poffset=h);var p=u._width||u.width,d=c.barwidth;if(n(p)){var m=Array.prototype.slice.call(p,0,s.length);for(i=0;i<m.length;i++)r(m[i])||(m[i]=d);for(i=m.length;i<s.length;i++)m.push(d);if(c.barwidth=m,void 0===h){for(o=[],i=0;i<s.length;i++)o.push(f+(d-m[i])/2);c.poffset=o}}else void 0!==p&&(c.barwidth=p,void 0===h&&(c.poffset=f+(d-p)/2))}}(i),function(t,e){for(var r=e.traces,i=g(t),a=0;a<r.length;a++)for(var o=r[a],s=o[0].t,l=s.poffset,u=n(l),c=s.barwidth,h=n(c),f=0;f<o.length;f++){var p=o[f],d=p.w=h?c[f]:c;void 0===p.p&&(p.p=p[i],p["orig_"+i]=p[i]);var m=(u?l[f]:l)+d/2;p[i]=p.p+m}}(e,i),"angularaxis"===e._id?f(e,i):f(e,i,x)}function f(t,e,r){var i=e.traces,a=e.minDiff/2;o.minDtick(t,e.minDiff,e.distinctPositions[0],r);for(var s=0;s<i.length;s++){var l,u,c,h,f=i[s],p=f[0],d=p.trace,m=[];for(h=0;h<f.length;h++)u=(l=f[h]).p-a,c=l.p+a,m.push(u,c);if(d.width||d.offset){var g=p.t,y=g.poffset,v=g.barwidth,x=n(y),_=n(v);for(h=0;h<f.length;h++){l=f[h];var b=x?y[h]:y,w=_?v[h]:v;c=(u=l.p+b)+w,m.push(u,c)}}d._extremes[t._id]=o.findExtremes(t,m,{padded:!1})}}function p(t,e){for(var r=e.traces,n=g(t),i=0;i<r.length;i++){for(var a=r[i],s=a[0].trace,l="scatter"===s.type,u="v"===s.orientation,c=[],h=!1,f=0;f<a.length;f++){var p=a[f],d=l?0:p.b,m=l?u?p.y:p.x:d+p.s;p[n]=m,c.push(m),p.hasB&&c.push(d),(!p.hasB||!p.b)&&(h=!0)}s._extremes[t._id]=o.findExtremes(t,c,{tozero:h,padded:!0})}}function d(t){for(var e=t.traces,r=0;r<e.length;r++)for(var n=e[r],a=n[0].t.offsetindex,o=0;o<n.length;o++){var s=n[o];s.s!==i&&t.put(s.p,a,s.b+s.s)}}function m(t,e,n){var a=e.traces,s=g(t),l="fraction"===n.norm?1:100,u=l/1e9,c=t.l2c(t.c2l(0)),h="stack"===n.mode?l:c;function f(e){return r(t.c2l(e))&&(e<c-u||e>h+u||!r(c))}for(var p=0;p<a.length;p++){for(var d=a[p],m=d[0].t.offsetindex,y=d[0].trace,v=[],x=!1,_=!1,b=0;b<d.length;b++){var w=d[b];if(w.s!==i){var T=Math.abs(l/e.get(w.p,m,w.s));w.b*=T,w.s*=T;var k=w.b,A=k+w.s;w[s]=A,v.push(A),_=_||f(A),w.hasB&&(v.push(k),_=_||f(k)),(!w.hasB||!w.b)&&(x=!0)}}y._extremes[t._id]=o.findExtremes(t,v,{tozero:x,padded:_})}}function g(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,i=t._fullLayout,o=t._fullData,s=t.calcdata,l=[],c=[],h=0;h<o.length;h++){var f=o[h];if(!0===f.visible&&a.traceIs(f,"bar")&&f.xaxis===r._id&&f.yaxis===n._id&&("h"===f.orientation?l.push(s[h]):c.push(s[h]),f._computePh))for(var p=t.calcdata[h],d=0;d<p.length;d++)"function"==typeof p[d].ph0&&(p[d].ph0=p[d].ph0()),"function"==typeof p[d].ph1&&(p[d].ph1=p[d].ph1())}var m={xCat:"category"===r.type||"multicategory"===r.type,yCat:"category"===n.type||"multicategory"===n.type,mode:i.barmode,norm:i.barnorm,gap:i.bargap,groupgap:i.bargroupgap};u(t,r,n,c,m),u(t,n,r,l,m)},setGroupPositions:u}}),si=f((t,e)=>{var r=ii(),n=oi().setGroupPositions;function i(t,e,r,n,i,a,o){i[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,t.splice(e,0,s),e&&r===t[e-1][o]){var l=t[e-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else a&&(s.s=function(t,e,r,n){var i=t[e-1],a=t[e+1];return a?i?i.s+(a.s-i.s)*(r-i[n])/(a[n]-i[n]):a.s:i.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){"group"===t._fullLayout.scattermode&&function(t,e){for(var r=e.xaxis,i=e.yaxis,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=[],u=[],c=0;c<o.length;c++){var h=o[c];!0===h.visible&&"scatter"===h.type&&h.xaxis===r._id&&h.yaxis===i._id&&("h"===h.orientation?l.push(s[c]):"v"===h.orientation&&u.push(s[c]))}var f={mode:a.scattermode,gap:a.scattergap};n(t,r,i,u,f),n(t,i,r,l,f)}(t,e);var a=e.xaxis,o=e.yaxis,s=a._id+o._id,l=t._fullLayout._scatterStackOpts[s];if(l){var u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k=t.calcdata;for(var A in l){var M=(v=l[A]).traceIndices;if(M.length){for(x="interpolate"===v.stackgaps,_=v.groupnorm,"v"===v.orientation?(b="x",w="y"):(b="y",w="x"),T=new Array(M.length),u=0;u<T.length;u++)T[u]=!1;d=k[M[0]];var S=new Array(d.length);for(u=0;u<d.length;u++)S[u]=d[u][b];for(u=1;u<M.length;u++){for(p=k[M[u]],c=h=0;c<p.length;c++){for(m=p[c][b];m>S[h]&&h<S.length;h++)i(p,c,S[h],u,T,x,b),c++;if(m!==S[h]){for(f=0;f<u;f++)i(k[M[f]],h,m,f,T,x,b);S.splice(h,0,m)}h++}for(;h<S.length;h++)i(p,c,S[h],u,T,x,b),c++}var E=S.length;for(c=0;c<d.length;c++){for(g=d[c][w]=d[c].s,u=1;u<M.length;u++)(p=k[M[u]])[0].trace._rawLength=p[0].trace._length,p[0].trace._length=E,g+=p[c].s,p[c][w]=g;if(_)for(y=("fraction"===_?g:g/100)||1,u=0;u<M.length;u++){var C=k[M[u]][c];C[w]/=y,C.sNorm=C.s/y}}for(u=0;u<M.length;u++){var I=(p=k[M[u]])[0].trace,L=r.calcMarkerSize(I,I._rawLength),P=Array.isArray(L);if(L&&T[u]||P){var z=L;for(L=new Array(E),c=0;c<E;c++)L[c]=p[c].gap?0:P?z[p[c].i]:z}var O=new Array(E),D=new Array(E);for(c=0;c<E;c++)O[c]=p[c].x,D[c]=p[c].y;r.calcAxisExpansion(t,I,a,o,O,D,L),p[0].t.orientation=v.orientation}}}}}}),li=f((t,e)=>{var r=Je(),n=k(),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=oe(),u=l.segmentsIntersect,c=l.constrain,h=xn();e.exports=function(t,e){var n,a,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E=e.trace||{},C=e.xaxis,I=e.yaxis,L="log"===C.type,P="log"===I.type,z=C._length,O=I._length,D=e.backoff,R=E.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,U=E.fill&&"none"!==E.fill,V=[],q=h.minTolerance,H=t.length,G=new Array(H),Z=0;function W(r){var n=t[r];if(!n)return!1;var a=e.linearized?C.l2p(n.x):C.c2p(n.x),l=e.linearized?I.l2p(n.y):I.c2p(n.y);if(a===i){if(L&&(a=C.c2p(n.x,!0)),a===i)return!1;P&&l===i&&(a*=Math.abs(C._m*O*(C._m>0?o:s)/(I._m*z*(I._m>0?o:s)))),a*=1e3}if(l===i){if(P&&(l=I.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Y(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&u<l){var c=o*a-s*i;if(c*c<l)return!0}}function X(t,e){var r=t[0]/z,n=t[1]/O,i=Math.max(0,-r,r-1,-n,n-1);return i&&void 0!==M&&Y(r,n,M,S)&&(i=0),i&&e&&Y(r,n,e[0]/z,e[1]/O)&&(i=0),(1+h.toleranceGrowth*i)*B}function $(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var J,K,Q,tt,et,rt,nt,it=h.maxScreensAway,at=-z*it,ot=z*(1+it),st=-O*it,lt=O*(1+it),ut=[[at,st,ot,st],[ot,st,ot,lt],[ot,lt,at,lt],[at,lt,at,st]];function ct(t){if(t[0]<at||t[0]>ot||t[1]<st||t[1]>lt)return[c(t[0],at,ot),c(t[1],st,lt)]}function ht(t,e){if(t[0]===e[0]&&(t[0]===at||t[0]===ot)||t[1]===e[1]&&(t[1]===st||t[1]===lt))return!0}function ft(t,e,r){return function(n,i){var a=ct(n),o=ct(i),s=[];if(a&&o&&ht(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u),s}}function pt(t){var e=t[0],r=t[1],n=e===G[Z-1][0],i=r===G[Z-1][1];if(!n||!i)if(Z>1){var a=e===G[Z-2][0],o=r===G[Z-2][1];n&&(e===at||e===ot)&&a?o?Z--:G[Z-1]=t:i&&(r===st||r===lt)&&o?a?Z--:G[Z-1]=t:G[Z++]=t}else G[Z++]=t}function dt(t){G[Z-1][0]!==t[0]&&G[Z-1][1]!==t[1]&&pt([Q,tt]),pt(t),et=null,Q=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ut[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&$(o,t)<$(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===N||"vh"===N?nt=function(t,e){var r=[],n=ct(t),i=ct(e);return n&&i&&ht(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===N?nt=ft(0,at,ot):"vhv"===N&&(nt=ft(1,st,lt));var mt=l.isArrayOrTypedArray(R);function gt(e){if(e&&D&&(e.i=n,e.d=t,e.trace=E,e.marker=mt?R[e.i]:R,e.backoff=D),M=e[0]/z,S=e[1]/O,J=e[0]<at?at:e[0]>ot?ot:0,K=e[1]<st?st:e[1]>lt?lt:0,J||K){if(Z)if(et){var r=nt(et,e);r.length>1&&(dt(r[0]),G[Z++]=r[1])}else rt=nt(G[Z-1],e)[0],G[Z++]=rt;else G[Z++]=[J||e[0],K||e[1]];var i=G[Z-1];J&&K&&(i[0]!==J||i[1]!==K)?(et&&(Q!==J&&tt!==K?pt(Q&&tt?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?at:ot,lt]:[n>0?ot:at,st]}(et,e):[Q||J,tt||K]):Q&&tt&&pt([Q,tt])),pt([J,K])):Q-J&&tt-K&&pt([J||Q,K||tt]),et=e,Q=J,tt=K}else et&&dt(nt(et,e)[0]),G[Z++]=e}for(n=0;n<H;n++)if(a=W(n)){for(Z=0,et=null,gt(a),n++;n<H;n++){if(!(p=W(n))){if(F)continue;break}if(j&&e.simplify){var yt=W(n+1);if(x=$(p,a),U&&(0===Z||Z===H-1)||!(x<X(p,yt)*q)){for(y=[(p[0]-a[0])/x,(p[1]-a[1])/x],d=a,_=x,b=T=k=0,g=!1,f=p,n++;n<t.length;n++){if(m=yt,yt=W(n+1),!m){if(F)continue;break}if(A=(v=[m[0]-a[0],m[1]-a[1]])[0]*y[1]-v[1]*y[0],T=Math.min(T,A),(k=Math.max(k,A))-T>X(m,yt))break;f=m,(w=v[0]*y[0]+v[1]*y[1])>_?(_=w,p=m,g=!1):w<b&&(b=w,d=m,g=!0)}if(g?(gt(p),f!==d&&gt(d)):(d!==a&&gt(d),f!==p&&gt(p)),gt(f),n>=t.length||!m)break;gt(m),a=m}}else gt(p)}et&&pt([Q||et[0],tt||et[1]]),V.push(G.slice(0,Z))}var vt=N.slice(N.length-1);if(D&&"h"!==vt&&"v"!==vt){for(var xt=!1,_t=-1,bt=[],wt=0;wt<V.length;wt++)for(var Tt=0;Tt<V[wt].length-1;Tt++){var kt=V[wt][Tt],At=V[wt][Tt+1],Mt=r.applyBackoff(At,kt);(Mt[0]!==At[0]||Mt[1]!==At[1])&&(xt=!0),bt[_t+1]||(bt[++_t]=[kt,[Mt[0],Mt[1]]])}return xt?bt:V}return V}}),ui=f((t,e)=>{var r={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,n){var i,a,o,s,l,u={},c=!1,h=-1,f=0,p=-1;for(a=0;a<n.length;a++)(o=(i=n[a][0].trace).stackgroup||"")?o in u?l=u[o]:(l=u[o]=f,f++):i.fill in r&&p>=0?l=p:(l=p=f,f++),l<h&&(c=!0),i._groupIndex=h=l;var d=n.slice();c&&d.sort(function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index});var m={};for(a=0;a<d.length;a++)o=(i=d[a][0].trace).stackgroup||"",!0===i.visible?(i._nexttrace=null,i.fill in r&&(s=m[o],i._prevtrace=s||null,s&&(s._nexttrace=i)),i._ownfill=i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace),m[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return d}}),ci=f((t,e)=>{var r=v(),n=Ut(),i=oe(),a=i.ensureSingle,o=i.identity,s=Je(),l=Ze(),u=li(),c=ui(),h=pn().tester;function f(t,e,c,f,p,d,m){var g,y=t._context.staticPlot;!function(t,e,n,a,o){var s=n.xaxis,u=n.yaxis,c=r.extent(i.simpleMap(s.range,s.r2c)),h=r.extent(i.simpleMap(u.range,u.r2c)),f=a[0].trace;if(l.hasMarkers(f)){var p=f.marker.maxdisplayed;if(0!==p){var d=a.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(d.length/p),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&g++});var y=Math.round(g*m/3+Math.floor(g/3)*m/7.1);a.forEach(function(t){delete t.vis}),d.forEach(function(t,e){0===Math.round((e+y)%m)&&(t.vis=!0)})}}}(0,e,c,f,p);var v=!!m&&m.duration>0;function x(t){return v?t.transition():t}var _=c.xaxis,b=c.yaxis,w=f[0].trace,T=w.line,k=r.select(d),A=a(k,"g","errorbars"),M=a(k,"g","lines"),S=a(k,"g","points"),E=a(k,"g","text");if(n.getComponentMethod("errorbars","plot")(t,A,c,m),!0===w.visible){x(k).style("opacity",w.opacity);var C,I,L,P,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(L=1,P=b.c2p(0,!0)):"x"===z&&(L=0,P=_.c2p(0,!0)),f[0][c.isRangePlot?"nodeRangePlot3":"node3"]=k;var O="",D=[],R=w._prevtrace,F=null,B=null;R&&(O=R._prevRevpath||"",I=R._nextFill,D=R._ownPolygons,F=R._fillsegments,B=R._fillElement);var N,j,U,V,q,H,G,Z,W="",Y="",X=[];w._polygons=[];var $=[],J=[],K=i.noop;if(C=w._ownFill,l.hasLines(w)||"none"!==w.fill){I&&I.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(U=s.steps(T.shape),V=s.steps(T.shape.split("").reverse().join(""))):U=V="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),T.smoothing):s.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},q=function(t){return V(t.reverse())},J=u(f,{xaxis:_,yaxis:b,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:w.fill}),$=new Array(J.length);var Q=0;for(g=0;g<J.length;g++){var tt,et=J[g];tt&&z?tt.push.apply(tt,et):(tt=et.slice(),$[Q]=tt,Q++)}w._fillElement=null,w._fillExclusionElement=B,w._fillsegments=$.slice(0,Q),$=w._fillsegments,J.length&&(H=J[0][0].slice(),Z=(G=J[J.length-1])[G.length-1].slice()),K=function(t){return function(e){if(N=U(e),j=q(e),W?z?(W+="L"+N.substr(1),Y=j+"L"+Y.substr(1)):(W+="Z"+N,Y=j+"Z"+Y):(W=N,Y=j),l.hasLines(w)){var n=r.select(this);if(n.datum(f),t)x(n.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var i=x(n);i.attr("d",N),s.singleLineStyle(f,i)}}}}}var rt=M.selectAll(".js-line").data(J);x(rt.exit()).style("opacity",0).remove(),rt.each(K(!1)),rt.enter().append("path").classed("js-line",!0).style("vector-effect",y?"none":"non-scaling-stroke").call(s.lineGroupStyle).each(K(!0)),s.setClipUrl(rt,c.layerClipId,t);var nt=function(){var t=new Array($.length);for(g=0;g<$.length;g++)t[g]=h($[g]);return t},it=function(t){var e,r;if(t&&0!==t.length){for(e=new Array(t.length-1+$.length),r=0;r<t.length-1;r++)e[r]=h(t[r]);var n=t[t.length-1].slice();for(n.reverse(),r=0;r<$.length;r++)e[t.length-1+r]=h($[r].concat(n))}else for(e=new Array($.length),r=0;r<$.length;r++){var i=$[r][0].slice(),a=$[r][$[r].length-1].slice();i[L]=a[L]=P;var o=[a,i].concat($[r]);e[r]=h(o)}return e};J.length?(C?(C.datum(f),H&&Z&&(z?(H[L]=Z[L]=P,x(C).attr("d","M"+Z+"L"+H+"L"+W.substr(1)).call(s.singleFillStyle,t),X=it(null)):(x(C).attr("d",W+"Z").call(s.singleFillStyle,t),X=nt())),w._polygons=X,w._fillElement=C):I&&("tonext"===w.fill.substr(0,6)&&W&&O?("tonext"===w.fill?(x(I).attr("d",W+"Z"+O+"Z").call(s.singleFillStyle,t),X=nt(),w._polygons=X.concat(D)):(x(I).attr("d",W+"L"+O.substr(1)+"Z").call(s.singleFillStyle,t),X=it(F),w._polygons=X),w._fillElement=I):ot(I)),w._prevRevpath=Y):(C?ot(C):I&&ot(I),w._prevRevpath=null),w._ownPolygons=X,S.datum(f),E.datum(f),function(e,n,i){var a,u=i[0].trace,h=l.hasMarkers(u),f=l.hasText(u),p=function(t){if(t.ids)return ct}(u),d=ht,m=ht;if(h||f){var g=o,y=u.stackgroup,w=y&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+b._id][y].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?lt:st:y&&!w&&(g=ut),h&&(d=g),f&&(m=g)}var T,k=(a=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(s.pointStyle,u,t).call(s.translatePoints,_,b).style("opacity",0).transition().style("opacity",1),a.order(),h&&(T=s.makePointStyleFns(u)),a.each(function(e){var n=r.select(this),i=x(n);s.translatePoint(e,i,_,b)?(s.singlePointStyle(e,i,u,T,t),c.layerClipId&&s.hideOutsideRangePoint(e,i,_,b,u.xcalendar,u.ycalendar),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),v?a.exit().transition().style("opacity",0).remove():a.exit().remove(),(a=n.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),a.order(),a.each(function(t){var e=r.select(this),n=x(e.select("text"));s.translatePoint(t,n,_,b)?c.layerClipId&&s.hideOutsideRangePoint(t,e,_,b,u.xcalendar,u.ycalendar):e.remove()}),a.selectAll("text").call(s.textPointStyle,u,t).each(function(t){var e=_.c2p(t.x),n=b.c2p(t.y);r.select(this).selectAll("tspan.line").each(function(){x(r.select(this)).attr({x:e,y:n})})}),a.exit().remove()}(S,E,f);var at=!1===w.cliponaxis?null:c.layerClipId;s.setClipUrl(S,at,t),s.setClipUrl(E,at,t)}function ot(t){x(t).attr("d","M0,0Z")}function st(t){return t.filter(function(t){return!t.gap&&t.vis})}function lt(t){return t.filter(function(t){return t.vis})}function ut(t){return t.filter(function(t){return!t.gap})}function ct(t){return t.id}function ht(){return!1}}e.exports=function(t,e,n,i,l,u){var h,p,d=!l,m=!!l&&l.duration>0,g=c(t,e,n);(h=i.selectAll("g.trace").data(g,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),h.order(),function(t,e,n){e.each(function(e){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,t);var l=e[0].trace,u=[];l._ownfill&&u.push("_ownFill"),l._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,o);c.enter().append("g"),c.exit().each(function(t){l[t]=null}).remove(),c.order().each(function(t){l[t]=a(r.select(this),"path","js-fill")})})}(t,h,e),m?(u&&(p=u()),r.transition().duration(l.duration).ease(l.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){i.selectAll("g.trace").each(function(r,n){f(t,n,e,r,g,this,l)})})):h.each(function(r,n){f(t,n,e,r,g,this,l)}),d&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}),hi=f((t,e)=>{e.exports={container:"marker",min:"cmin",max:"cmax"}}),fi=f((t,e)=>{var r=rr();e.exports=function(t,e,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,e,"x"),s=r.getFromTrace(a,e,"y"),l=t.orig_x;void 0===l&&(l=t.x);var u=t.orig_y;return void 0===u&&(u=t.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(u),!0).text,i}}),pi=f((t,e)=>{var r=v(),n=Je(),i=Ut();function a(t,e,r){n.pointStyle(t.selectAll("path.point"),e,r)}function o(t,e,r){n.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=r.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(e){a(r.select(this),e.trace||e[0].trace,t)}),e.selectAll("g.text").each(function(e){o(r.select(this),e.trace||e[0].trace,t)}),e.selectAll("g.trace path.js-line").call(n.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,t,!1),i.getComponentMethod("errorbars","style")(e)},stylePoints:a,styleText:o,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,t),o(r,i,t))}}}),di=f((t,e)=>{var r=q(),n=Ze();e.exports=function(t,e){var i,a;if("lines"===t.mode)return(i=t.line.color)&&r.opacity(i)?i:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(t.line||{}).color)&&r.opacity(i)&&n.hasLines(t)&&t.line.width?i:t.fillcolor}}),mi=f((t,e)=>{var r=oe(),n=Pr(),i=Ut(),a=di(),o=q(),s=r.fillText;e.exports=function(t,e,l,u){var c=t.cd,h=c[0].trace,f=t.xa,p=t.ya,d=f.c2p(e),m=p.c2p(l),g=[d,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,_=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var b=function(t){var e=Math.max(v,t.mrc||0),r=f.c2p(t.x)-d,n=p.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},w=n.getDistanceFunction(u,function(t){if(x){var e=f.c2p(t.xStart),r=f.c2p(t.xEnd);return d>=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(f.c2p(t.x)-d);return a<n?i*a/n:a-n+i},function(t){if(_){var e=p.c2p(t.yStart),r=p.c2p(t.yEnd);return m>=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return a<n?i*a/n:a-n+i},b);if(n.getClosest(c,w,t),!1!==t.index){var T=c[t.index],k=f.c2p(T.x,!0),A=p.c2p(T.y,!0),M=T.mrc||1;t.index=T.i;var S=c[0].t.orientation,E=S&&(T.sNorm||T.s),C="h"===S?E:void 0!==T.orig_x?T.orig_x:T.x,I="v"===S?E:void 0!==T.orig_y?T.orig_y:T.y;return r.extendFlat(t,{color:a(h,T),x0:k-M,x1:k+M,xLabelVal:C,y0:A-M,y1:A+M,yLabelVal:I,spikeDistance:b(T),hovertemplate:h.hovertemplate}),s(T,h,t),i.getComponentMethod("errorbars","hoverInfo")(T,h,t),[t]}}function L(t){if(!t)return!1;var e=t.node();try{var r=new DOMPoint(g[0],g[1]);return e.isPointInFill(r)}catch(t){var n=e.ownerSVGElement.createSVGPoint();return n.x=g[0],n.y=g[1],e.isPointInFill(n)}}if(-1!==y.indexOf("fills")&&h._fillElement&&L(h._fillElement)&&!L(h._fillExclusionElement)){var P=function(t){var e,r,n,i,a,o,s,l,u,c=[],h=1/0,d=-1/0,m=1/0,y=-1/0;for(e=0;e<t.length;e++){var v=t[e];v.contains(g)&&(c.push(v),m=Math.min(m,v.ymin),y=Math.max(y,v.ymax))}if(0===c.length)return null;for(r=((m=Math.max(m,0))+(y=Math.min(y,p._length)))/2,e=0;e<c.length;e++)for(i=c[e].pts,n=1;n<i.length;n++)(l=i[n-1][1])>r!=(u=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],u-l&&(a=o+(s-o)*(r-l)/(u-l),h=Math.min(h,a),d=Math.max(d,a)));return{x0:h=Math.max(h,0),x1:d=Math.min(d,f._length),y0:r,y1:r}}(h._polygons);null===P&&(P={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(t,{distance:t.maxHoverDistance,x0:P.x0,x1:P.x1,y0:P.y0,y1:P.y1,color:z,hovertemplate:!1}),delete t.index,h.text&&!r.isArrayOrTypedArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}),gi=f((t,e)=>{var r=Ze();e.exports=function(t,e){var n,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===e)for(n=0;n<s.length;n++)s[n].selected=0;else for(n=0;n<s.length;n++)i=s[n],a=l.c2p(i.x),o=u.c2p(i.y),null!==i.i&&e.contains([a,o],!1,n,t)?(c.push({pointNumber:i.i,x:l.c2d(i.x),y:u.c2d(i.y)}),i.selected=1):i.selected=0;return c}}),yi=f((t,e)=>{e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),vi=f((t,e)=>{var r=Ut().traceIs,n=tr();function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function a(t,e){var n=i(t),a=r(t,"box-violin"),o=r(t._fullInput||{},"candlestick");return a&&!o&&e===n&&void 0===t[n]&&void 0===t[n+"0"]}e.exports=function(t,e,o,s){o("autotypenumbers",s.autotypenumbersDflt),"-"===o("type",(s.splomStash||{}).type)&&(function(t,e){if("-"===t.type){var o,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if("splom"===i.type&&i._length>0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(u){if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",h=u[c],f={noMultiCategory:!r(u,"cartesian")||r(u,"noMultiCategory")};if("box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(f.noMultiCategory=!0),f.autotypenumbers=t.autotypenumbers,a(u,l)){var p=i(u),d=[];for(o=0;o<e.length;o++){var m=e[o];!r(m,"box-violin")||(m[l+"axis"]||l)!==s||(void 0!==m[p]?d.push(m[p][0]):void 0!==m.name?d.push(m.name):d.push("text"),m[c]!==h&&(h=void 0))}t.type=n(d,h,f)}else if("splom"===u.type){var g=u.dimensions[u._axesDim[s]];g.visible&&(t.type=n(g.values,h,f))}else t.type=n(u[l]||[u[l+"0"]],h,f)}}}(e,s.data),"-"===e.type?e.type="linear":t.type=e.type)}}),xi=f((t,e)=>{var r=S().isTypedArraySpec;e.exports=function(t,e,n,i){if("category"===e.type){var a,o=t.categoryarray,s=Array.isArray(o)&&o.length>0||r(o);s&&(a="array");var l,u=n("categoryorder",a);"array"===u&&(l=n("categoryarray")),!s&&"array"===u&&(u=e.categoryorder="trace"),"trace"===u?e._initialCategories=[]:"array"===u?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var s=e.data[n];s[a+"axis"]===t._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][a];for(i=0;i<l.length;i++){var u=l[i];null!=u&&(o[u]=1)}}return Object.keys(o)}(e,i).sort(),"category ascending"===u?e._initialCategories=l:"category descending"===u&&(e._initialCategories=l.reverse()))}}}),_i=f((t,e)=>{var r=O().mix,n=V(),i=oe();e.exports=function(t,e,a,o){var s=(o=o||{}).dfltColor;function l(r,n){return i.coerce2(t,e,o.attributes,r,n)}var u=l("linecolor",s),c=l("linewidth");a("showline",o.showLine||!!u||!!c)||(delete e.linecolor,delete e.linewidth);var h=l("gridcolor",r(s,o.bgColor,o.blend||n.lightFraction).toRgbString()),f=l("gridwidth"),p=l("griddash");if(a("showgrid",o.showGrid||!!h||!!f||!!p)||(delete e.gridcolor,delete e.gridwidth,delete e.griddash),o.hasMinor){var d=l("minor.gridcolor",r(e.gridcolor,o.bgColor,67).toRgbString()),m=l("minor.gridwidth",e.gridwidth||1),g=l("minor.griddash",e.griddash||"solid");a("minor.showgrid",!!d||!!m||!!g)||(delete e.minor.gridcolor,delete e.minor.gridwidth,delete e.minor.griddash)}if(!o.noZeroLine){l("zerolinelayer");var y=l("zerolinecolor",s),v=l("zerolinewidth");a("zeroline",o.showGrid||!!y||!!v)||(delete e.zerolinelayer,delete e.zerolinecolor,delete e.zerolinewidth)}}}),bi=f((t,e)=>{var r=T(),n=Ut(),i=oe(),a=me(),o=Fe(),s=Ee(),l=Oe(),u=De(),c=Be(),h=Ne(),f=xi(),p=_i(),d=ir(),m=Qe(),g=ge().WEEKDAY_PATTERN,y=ge().HOUR_PATTERN;function v(t,e,n){function a(r,n){return i.coerce(t,e,s.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=_(o[l])){c=g;break}var h=a("pattern",c);if(h===g)for(l=0;l<2;l++)(u=_(o[l]))&&(e.bounds[l]=o[l]=u-1);if(h)for(l=0;l<2;l++)switch(u=o[l],h){case g:if(!r(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case y:if(!r(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===n.autorange){var f=n.range;if(f[0]<f[1]){if(o[0]<f[0]&&o[1]>f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]<f[1])return void(e.enabled=!1)}}else{var p=a("values");if(!p||!p.length)return void(e.enabled=!1);a("dvalue")}}}e.exports=function(t,e,r,y,x){var _,b=y.letter,w=y.font||{},T=y.splomStash||{},k=r("visible",!y.visibleDflt),A=e._template||{},M=e.type||A.type||"-";"date"===M&&(n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",y.calendar),y.noTicklabelmode||(_=r("ticklabelmode"))),!y.noTicklabelindex&&("date"===M||"linear"===M)&&r("ticklabelindex");var S="";(!y.noTicklabelposition||"multicategory"===M)&&(S=i.coerce(t,e,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===_?["outside","inside"]:"x"===b?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),y.noTicklabeloverflow||r("ticklabeloverflow",-1!==S.indexOf("inside")?"hide past domain":"category"===M||"multicategory"===M?"allow":"hide past div"),m(e,x),d(t,e,r,y),f(t,e,r,y),y.noHover||("category"!==M&&r("hoverformat"),y.noUnifiedhovertitle||r("unifiedhovertitle.text"));var E=r("color"),C=E!==s.color.dflt?E:w.color,I=T.label||x._dfltTitle[b];if(h(t,e,r,M,y),!k)return e;r("title.text",I),i.coerceFont(r,"title.font",w,{overrideDflt:{size:i.bigFont(w.size),color:C}}),l(t,e,r,M);var L=y.hasMinor;if(L&&(a.newContainer(e,"minor"),l(t,e,r,M,{isMinor:!0})),c(t,e,r,M,y),u(t,e,r,y),L){var P=y.isMinor;y.isMinor=!0,u(t,e,r,y),y.isMinor=P}p(t,e,r,{dfltColor:E,bgColor:y.bgColor,showGrid:y.showGrid,hasMinor:L,attributes:s}),L&&!e.minor.ticks&&!e.minor.showgrid&&delete e.minor,(e.showline||e.ticks)&&r("mirror");var z="multicategory"===M;if(!y.noTickson&&("category"===M||z)&&(e.ticks||e.showgrid)&&(z?(r("tickson","boundaries"),delete e.ticklabelposition):r("tickson")),z&&r("showdividers")&&(r("dividercolor"),r("dividerwidth")),"date"===M)if(o(t,e,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),e.rangebreaks.length){for(var O=0;O<e.rangebreaks.length;O++)if(e.rangebreaks[O].pattern===g){e._hasDayOfWeekBreaks=!0;break}if(m(e,x),x._has("scattergl")||x._has("splom"))for(var D=0;D<y.data.length;D++){var R=y.data[D];("scattergl"===R.type||"splom"===R.type)&&(R.visible=!1,i.warn(R.type+" traces do not work on axes with rangebreaks. Setting trace "+R.index+" to `visible: false`."))}}else delete e.rangebreaks;return e};var x={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function _(t){if("string"==typeof t)return x[t.substr(0,3).toLowerCase()]}}),wi=f((t,e)=>{var r=T(),n=oe();e.exports=function(t,e,i,a){var o,s,l,u,c,h,f=a.counterAxes||[],p=a.overlayableAxes||[],d=a.letter,m=a.grid,g=a.overlayingDomain;m&&(s=m._domains[d][m._axisMap[e._id]],o=m._anchors[e._id],s&&(l=m[d+"side"].split(" ")[0],u=m.domain[d]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(r(t.position)?"free":f[0]||"free"),l=l||("x"===d?"bottom":"left"),u=u||0,c=0,h=!1;var y=n.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(f),dflt:o}},"anchor"),v=n.coerce(t,e,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:l}},"side");"free"===y&&("y"===d&&(i("autoshift")&&(u="left"===v?g[0]:g[1],h=!e.automargin||e.automargin,c="left"===v?-3:3),i("shift",c)),i("position",u)),i("automargin",h);var x=!1;if(p.length&&(x=n.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(p),dflt:!1}},"overlaying")),!x){var _=i("domain",s);_[0]>_[1]-1/4096&&(e.domain=s),n.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return i("layer"),e}}),Ti=f((t,e)=>{var r=oe(),n=q(),i=Ye().isUnifiedHover,a=Er(),o=me(),s=Nt(),l=Ee(),u=vi(),c=bi(),h=tn(),f=wi(),p=ye(),d=p.id2name,m=p.name2id,g=ge().AX_ID_PATTERN,y=Ut(),v=y.traceIs,x=y.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,y){var b,w,T=e.autotypenumbers,k={},A={},M={},S={},E={},C={},I={},L={},P={},z={};for(b=0;b<y.length;b++){var O=y[b];if(v(O,"cartesian")){var D,R;if(O.xaxis)D=d(O.xaxis),_(k,D,O);else if(O.xaxes)for(w=0;w<O.xaxes.length;w++)_(k,d(O.xaxes[w]),O);if(O.yaxis)R=d(O.yaxis),_(k,R,O);else if(O.yaxes)for(w=0;w<O.yaxes.length;w++)_(k,d(O.yaxes[w]),O);"funnel"===O.type?"h"===O.orientation?(D&&(A[D]=!0),R&&(I[R]=!0)):R&&(M[R]=!0):"image"===O.type?(R&&(L[R]=!0),D&&(L[D]=!0)):(R&&(E[R]=!0,C[R]=!0),(!v(O,"carpet")||"carpet"===O.type&&!O._cheater)&&D&&(S[D]=!0)),"carpet"===O.type&&O._cheater&&D&&(A[D]=!0),v(O,"2dMap")&&(P[D]=!0,P[R]=!0),v(O,"oriented")&&(z["h"===O.orientation?R:D]=!0)}}var F=e._subplots,B=F.xaxis,N=F.yaxis,j=r.simpleMap(B,d),U=r.simpleMap(N,d),V=j.concat(U),q=n.background;B.length&&N.length&&(q=r.coerce(t,e,s,"plot_bgcolor"));var H,G,Z,W,Y,X=n.combine(q,e.paper_bgcolor);function $(){var t=k[H]||[];Y._traceIndices=t.map(function(t){return t.index}),Y._annIndices=[],Y._shapeIndices=[],Y._selectionIndices=[],Y._imgIndices=[],Y._subplotsWith=[],Y._counterAxes=[],Y._name=Y._attr=H,Y._id=G}function J(t,e){return r.coerce(W,Y,l,t,e)}function K(t,e){return r.coerce2(W,Y,l,t,e)}function Q(t){return"x"===t?N:B}function tt(e,r){for(var n="x"===e?j:U,i=[],a=0;a<n.length;a++){var o=n[a];o!==r&&!(t[o]||{}).overlaying&&i.push(m(o))}return i}var et={x:Q("x"),y:Q("y")},rt=et.x.concat(et.y),nt={},it=[];function at(){var t=W.matches;g.test(t)&&-1===rt.indexOf(t)&&(nt[t]=W.type,it=Object.keys(nt))}var ot=a(t,e),st=i(ot);for(b=0;b<V.length;b++){H=V[b],G=m(H),Z=H.charAt(0),r.isPlainObject(t[H])||(t[H]={}),W=t[H],Y=o.newContainer(e,H,Z+"axis"),$();var lt="x"===Z&&!S[H]&&A[H]||"y"===Z&&!E[H]&&M[H],ut="y"===Z&&(!C[H]&&I[H]||L[H]),ct={hasMinor:!0,letter:Z,font:e.font,outerTicks:P[H],showGrid:!z[H],data:k[H]||[],bgColor:X,calendar:e.calendar,automargin:!0,visibleDflt:lt,reverseDflt:ut,autotypenumbersDflt:T,splomStash:((e._splomAxes||{})[Z]||{})[G],noAutotickangles:"y"===Z};J("uirevision",e.uirevision),u(W,Y,J,ct),c(W,Y,J,ct,e);var ht=st&&Z===ot.charAt(0),ft=K("spikecolor",st?Y.color:void 0),pt=K("spikethickness",st?1.5:void 0),dt=K("spikedash",st?"dot":void 0),mt=K("spikemode",st?"across":void 0),gt=K("spikesnap");J("showspikes",!!(ht||ft||pt||dt||mt||gt))||(delete Y.spikecolor,delete Y.spikethickness,delete Y.spikedash,delete Y.spikemode,delete Y.spikesnap);var yt=d(W.overlaying),vt=[0,1];if(void 0!==e[yt]){var xt=d(e[yt].anchor);void 0!==e[xt]&&(vt=e[xt].domain)}f(W,Y,J,{letter:Z,counterAxes:et[Z],overlayableAxes:tt(Z,H),grid:e.grid,overlayingDomain:vt}),J("title.standoff"),at(),Y._input=W}for(b=0;b<it.length;){G=it[b++],Z=(H=d(G)).charAt(0),r.isPlainObject(t[H])||(t[H]={}),W=t[H],Y=o.newContainer(e,H,Z+"axis"),$();var _t={letter:Z,font:e.font,outerTicks:P[H],showGrid:!z[H],data:[],bgColor:X,calendar:e.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((e._splomAxes||{})[Z]||{})[G]};J("uirevision",e.uirevision),Y.type=nt[G]||"linear",c(W,Y,J,_t,e),f(W,Y,J,{letter:Z,counterAxes:et[Z],overlayableAxes:tt(Z,H),grid:e.grid}),J("fixedrange"),J("modebardisable"),at(),Y._input=W}var bt=x("rangeslider","handleDefaults"),wt=x("rangeselector","handleDefaults");for(b=0;b<j.length;b++)H=j[b],W=t[H],Y=e[H],bt(t,e,H),"date"===Y.type&&wt(W,Y,e,U,Y.calendar),J("fixedrange"),J("modebardisable");for(b=0;b<U.length;b++){H=U[b],W=t[H],Y=e[H];var Tt=e[d(Y.anchor)];J("fixedrange",x("rangeslider","isVisible")(Tt)),J("modebardisable")}h.handleDefaults(t,e,{axIds:rt.concat(it).sort(p.idSort),axHasImage:L})}}),ki=f((t,e)=>{var r=v(),n=Ut(),i=oe(),a=Je(),o=rr();e.exports=function(t,e,s,l){var u=t._fullLayout;if(0!==e.length){var c;l&&(c=l());var h,f,p,d=r.ease(s.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},i=0;i<e.length;i++){var a=e[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr0&&(r[o._name+".range"]=a.xr0.slice()),a.yr0&&(r[s._name+".range"]=a.yr0.slice())}return n.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)})}()}),h=Date.now(),p=window.requestAnimationFrame(function r(){f=Date.now();for(var i=Math.min(1,(f-h)/s.duration),a=d(i),o=0;o<e.length;o++)g(e[o],a);f-h>s.duration?(function(){for(var r={},i=0;i<e.length;i++){var a=e[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr1&&(r[o._name+".range"]=a.xr1.slice()),a.yr1&&(r[s._name+".range"]=a.yr1.slice())}c&&c(),n.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)})}(),p=window.cancelAnimationFrame(r)):p=window.requestAnimationFrame(r)}),Promise.resolve()}function m(t){var e=t.xaxis,r=t.yaxis;u._defs.select("#"+t.clipId+"> rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,s=n.xaxis,l=n.yaxis,u=s._length,c=l._length,h=!!e.xr1,f=!!e.yr1,p=[];if(h){var d=i.simpleMap(e.xr0,s.r2l),m=i.simpleMap(e.xr1,s.r2l),g=d[1]-d[0],y=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,p[2]=u*(1-r+r*y/g),s.range[0]=s.l2r(d[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=u;if(f){var v=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),_=v[1]-v[0],b=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*c,p[3]=c*(1-r+r*b/_),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=c;o.drawOne(t,s,{skipTitle:!0}),o.drawOne(t,l,{skipTitle:!0}),o.redrawComponents(t,[s._id,l._id]);var w=h?u/p[2]:1,T=f?c/p[3]:1,k=h?p[0]:0,A=f?p[1]:0,M=h?p[0]/p[2]*u:0,S=f?p[1]/p[3]*c:0,E=s._offset-M,C=l._offset-S;n.clipRect.call(a.setTranslate,k,A).call(a.setScale,1/w,1/T),n.plot.call(a.setTranslate,E,C).call(a.setScale,w,T),a.setPointGroupScale(n.zoomScalePts,1/w,1/T),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}o.redrawComponents(t)}}),Ai=f(t=>{var e=v(),r=Ut(),n=oe(),i=we(),a=Je(),o=_e().getModuleCalcData,s=ye(),l=ge(),u=Te(),c=n.ensureSingle;function h(t,e,r){return n.ensureSingle(t,e,r,function(t){t.datum(r)})}var f=l.zindexSeparator;function p(t,n,i,s,u){for(var c,h,f,p=l.traceLayerClasses,d=t._fullLayout,m=d._zindices,g=d._modules,y=[],v=[],x=0;x<m.length;x++)for(var _=m[x],b=0;b<g.length;b++){var w=(c=g[b]).name,T=r.modules[w].categories;if(T.svg){var k=c.layerName||w+"layer",A=k+(x?Number(x)+1:""),M=c.plot;f=(h=o(i,M,_))[0],i=h[1],f.length&&y.push({i:p.indexOf(k),zindex:x,className:A,plotMethod:M,cdModule:f}),T.zoomScale&&v.push("."+A)}}y.sort(function(t,e){return(t.zindex||0)-(e.zindex||0)||t.i-e.i});var S=n.plot.selectAll("g.mlayer").data(y,function(t){return t.className});if(S.enter().append("g").attr("class",function(t){return t.className}).classed("mlayer",!0).classed("rangeplot",n.isRangePlot),S.exit().remove(),S.order(),S.each(function(r){var i=e.select(this),o=r.className;r.plotMethod(t,n,r.cdModule,i,s,u),-1===l.clipOnAxisFalseQuery.indexOf("."+o)&&a.setClipUrl(i,n.layerClipId,t)}),d._has("scattergl")&&(c=r.getModule("scattergl"),f=o(i,c)[0],c.plot(t,n,f)),!t._context.staticPlot&&(n._hasClipOnAxisFalse&&(n.clipOnAxisFalseTraces=n.plot.selectAll(l.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),v.length)){var E=n.plot.selectAll(v.join(",")).selectAll(".trace");n.zoomScalePts=E.selectAll("path.point"),n.zoomScaleTxt=E.selectAll(".textpoint")}}function d(t,e){var r=t._fullLayout,n=e.plotgroup,i=e.id,a=-1!==i.indexOf(f),o=l.layerValue2layerClass[e.xaxis.layer],u=l.layerValue2layerClass[e.yaxis.layer],p=r._hasOnlyLargeSploms,d=r._zindices.length>1,m=e.mainplotinfo;if(!e.mainplot||d)if(p)e.xlines=c(n,"path","xlines-above"),e.ylines=c(n,"path","ylines-above"),e.xaxislayer=c(n,"g","xaxislayer-above"),e.yaxislayer=c(n,"g","yaxislayer-above");else{if(!a){var g=c(n,"g","layer-subplot");e.shapelayer=c(g,"g","shapelayer"),e.imagelayer=c(g,"g","imagelayer"),m&&d?(e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer):(e.minorGridlayer=c(n,"g","minor-gridlayer"),e.gridlayer=c(n,"g","gridlayer"),e.zerolinelayer=c(n,"g","zerolinelayer"));var y=c(n,"g","layer-between");e.shapelayerBetween=c(y,"g","shapelayer"),e.imagelayerBetween=c(y,"g","imagelayer"),c(n,"path","xlines-below"),c(n,"path","ylines-below"),e.overlinesBelow=c(n,"g","overlines-below"),c(n,"g","xaxislayer-below"),c(n,"g","yaxislayer-below"),e.overaxesBelow=c(n,"g","overaxes-below")}e.overplot=c(n,"g","overplot"),e.plot=c(e.overplot,"g",i),e.zerolinelayerAbove=m&&d?m.zerolinelayerAbove:c(n,"g","zerolinelayer-above"),a||(e.xlines=c(n,"path","xlines-above"),e.ylines=c(n,"path","ylines-above"),e.overlinesAbove=c(n,"g","overlines-above"),c(n,"g","xaxislayer-above"),c(n,"g","yaxislayer-above"),e.overaxesAbove=c(n,"g","overaxes-above"),e.xlines=n.select(".xlines-"+o),e.ylines=n.select(".ylines-"+u),e.xaxislayer=n.select(".xaxislayer-"+o),e.yaxislayer=n.select(".yaxislayer-"+u))}else{var v=m.plotgroup,x=i+"-x",_=i+"-y";e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer,e.zerolinelayerAbove=m.zerolinelayerAbove,c(m.overlinesBelow,"path",x),c(m.overlinesBelow,"path",_),c(m.overaxesBelow,"g",x),c(m.overaxesBelow,"g",_),e.plot=c(m.overplot,"g",i),c(m.overlinesAbove,"path",x),c(m.overlinesAbove,"path",_),c(m.overaxesAbove,"g",x),c(m.overaxesAbove,"g",_),e.xlines=v.select(".overlines-"+o).select("."+x),e.ylines=v.select(".overlines-"+u).select("."+_),e.xaxislayer=v.select(".overaxes-"+o).select("."+x),e.yaxislayer=v.select(".overaxes-"+u).select("."+_)}a||(p||(h(e.minorGridlayer,"g",e.xaxis._id),h(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map(function(t){return t[0]}).sort(s.idSort),h(e.gridlayer,"g",e.xaxis._id),h(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map(function(t){return t[0]}).sort(s.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0))}function m(t,r){if(t){var n={};for(var i in t.each(function(t){var i=t[0];e.select(this).remove(),g(i,r),n[i]=!0}),r._plots)for(var a=r._plots[i].overlays||[],o=0;o<a.length;o++){var s=a[o];n[s.id]&&s.plot.selectAll(".trace").remove()}}}function g(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}t.name="cartesian",t.attr=["xaxis","yaxis"],t.idRoot=["x","y"],t.idRegex=l.idRegex,t.attrRegex=l.attrRegex,t.attributes=yi(),t.layoutAttributes=Ee(),t.supplyLayoutDefaults=Ti(),t.transitionAxes=ki(),t.finalizeSubplots=function(t,e){var r,i,a,o=e._subplots,u=o.xaxis,c=o.yaxis,h=o.cartesian,f=h,p={},d={};for(r=0;r<f.length;r++){var m=f[r].split("y");p[m[0]]=1,d["y"+m[1]]=1}for(r=0;r<u.length;r++)p[i=u[r]]||(a=(t[s.id2name(i)]||{}).anchor,l.idRegex.y.test(a)||(a="y"),h.push(i+a),f.push(i+a),d[a]||(d[a]=1,n.pushUnique(c,a)));for(r=0;r<c.length;r++)d[a=c[r]]||(i=(t[s.id2name(a)]||{}).anchor,l.idRegex.x.test(i)||(i="x"),h.push(i+a),f.push(i+a),p[i]||(p[i]=1,n.pushUnique(u,i)));if(!f.length){for(var g in i="",a="",t)l.attrRegex.test(g)&&("x"===g.charAt(0)?(!i||+g.substr(5)<+i.substr(5))&&(i=g):(!a||+g.substr(5)<+a.substr(5))&&(a=g));i=i?s.name2id(i):"x",a=a?s.name2id(a):"y",u.push(i),c.push(a),h.push(i+a)}},t.plot=function(t,e,r,i){var a,o=t._fullLayout,s=o._subplots.cartesian,l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(var u=o._zindices,c=0;c<u.length;c++){var h=u[c];for(a=0;a<s.length;a++){var d=s[a],m=o._plots[d];if(c>0){var g=m.id;if(-1!==g.indexOf(f))continue;g+=f+(c+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x<l.length;x++){var _=l[x],b=_[0].trace;h===(b.zorder||0)&&b.xaxis+b.yaxis===d&&((-1!==e.indexOf(b.index)||b.carpet)&&(y&&y[0].trace.xaxis+y[0].trace.yaxis===d&&-1!==["tonextx","tonexty","tonext"].indexOf(b.fill)&&-1===v.indexOf(y)&&v.push(y),v.push(_)),y=_)}p(t,m,v,r,i)}}},t.clean=function(t,e,r,n){var i,a,o,l=n._plots||{},u=e._plots||{},c=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in l)(i=l[o]).plotgroup&&i.plotgroup.remove();var h=n._has&&n._has("gl"),p=e._has&&e._has("gl");if(h&&!p)for(o in l)(i=l[o])._scene&&i._scene.destroy();if(c.xaxis&&c.yaxis){var d=s.listIds({_fullLayout:n});for(a=0;a<d.length;a++){var y=d[a];e[s.id2name(y)]||n._infolayer.selectAll(".g-"+y+"title").remove()}}var v=n._has&&n._has("cartesian"),x=e._has&&e._has("cartesian");if(v&&!x)m(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(c.cartesian)for(a=0;a<c.cartesian.length;a++){var _=c.cartesian[a];if(-1===_.indexOf(f)&&!u[_]){var b="."+_+",."+_+"-x,."+_+"-y";n._cartesianlayer.selectAll(b).remove(),g(_,n)}}},t.drawFramework=function(t){var r,i=t._fullLayout,a=t.calcdata,o={};for(r=0;r<a.length;r++){var s=a[r][0],l=s.trace.zorder||0;o[l]||(o[l]=[]),o[l].push(s)}var u=Object.keys(o).map(Number).sort(n.sorterAsc);u.length||(u=[0]),i._zindices=u;var h=function(t){var e,r,n,i,a,o,s=t._fullLayout,l=s._zindices.length,u=s._subplots.cartesian,c=u.length,h=[],p=[];for(e=0;e<c;e++){n=u[e],a=(i=s._plots[n]).xaxis,o=i.yaxis;var d=a._mainAxis,m=o._mainAxis,g=d._id+m._id,y=s._plots[g];i.overlays=[],g!==n&&y?(i.mainplot=g,i.mainplotinfo=y,p.push(n)):(i.mainplot=void 0,i.mainplotinfo=void 0,h.push(n))}for(e=0;e<p.length;e++)n=p[e],(i=s._plots[n]).mainplotinfo.overlays.push(i);var v=h.concat(p),x=[];for(e=0;e<c;e++){n=v[e],a=(i=s._plots[n]).xaxis,o=i.yaxis;for(var _=[],b=1;b<=l;b++){var w="";for(b>1&&(w+=f+b),_.push(n+w),r=0;r<i.overlays.length;r++)_.push(i.overlays[r].id+w)}_=_.concat([a.layer,o.layer,a.overlaying||"",o.overlaying||""]),x.push(_)}return x}(t),p=h.length,g=[];for(r=0;r<p;r++)g[r]=h[r].slice();for(var y=1;y<u.length;y++){var v=[];for(r=0;r<p;r++)v[r]=h[r].slice(),v[r][0]+=f+(y+1);g=g.concat(v)}var x=i._cartesianlayer.selectAll(".subplot").data(g,String);x.enter().append("g").attr("class",function(t){return"subplot "+t[0]}),x.order(),x.exit().call(m,i),x.each(function(r){var a=r[0],o=a.indexOf(f),s=-1!==o,l=s?a.slice(0,o):a,u=i._plots[a];u||(u=n.extendFlat({},i._plots[l]))&&(u.id=a,i._plots[a]=u,i._subplots.cartesian.push(a)),u&&(u.plotgroup=e.select(this),d(t,u),s||(u.draglayer=c(i._draggers,"g",a)))})},t.rangePlot=function(t,e,r){d(t,e),p(t,e,r),i.style(t)},t.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(".svg-container");n.filter(function(t,e){return e===n.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this,e=t.toDataURL("image/png");r.append("svg:image").attr({xmlns:u.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})})},t.updateFx=En().updateFx}),Mi=f((t,e)=>{var r=Ze();e.exports={hasLines:r.hasLines,hasMarkers:r.hasMarkers,hasText:r.hasText,isBubble:r.isBubble,attributes:bn(),layoutAttributes:xe(),supplyDefaults:$n(),crossTraceDefaults:Kn(),supplyLayoutDefaults:Qn(),calc:ii().calc,crossTraceCalc:si(),arraysToCalcdata:ri(),plot:ci(),colorbar:hi(),formatLabels:fi(),style:pi().style,styleOnSelect:pi().styleOnSelect,hoverPoints:mi(),selectPoints:gi(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Ai(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),Si=f((t,e)=>{var r=v(),n=q(),i=gn(),a=oe(),o=a.strScale,s=a.strRotate,l=a.strTranslate;e.exports=function(t,e,a){var u,c,h,f,p=t.node(),d=i[a.arrowhead||0],m=i[a.startarrowhead||0],g=(a.arrowwidth||1)*(a.arrowsize||1),y=(a.arrowwidth||1)*(a.startarrowsize||1),v=e.indexOf("start")>=0,x=e.indexOf("end")>=0,_=d.backoff*g+a.standoff,b=m.backoff*y+a.startstandoff;if("line"===p.nodeName){u={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=u.x-c.x,T=u.y-c.y;if(f=(h=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void O();if(_){if(_*_>w*w+T*T)return void O();var k=_*Math.cos(h),A=_*Math.sin(h);c.x+=k,c.y+=A,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>w*w+T*T)return void O();var M=b*Math.cos(h),S=b*Math.sin(h);u.x-=M,u.y-=S,t.attr({x1:u.x,y1:u.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),C="";if(E<_+b)return void O();var I=p.getPointAtLength(0),L=p.getPointAtLength(.1);h=Math.atan2(I.y-L.y,I.x-L.x),u=p.getPointAtLength(Math.min(b,E)),C="0px,"+b+"px,";var P=p.getPointAtLength(E),z=p.getPointAtLength(E-.1);f=Math.atan2(P.y-z.y,P.x-z.x),c=p.getPointAtLength(Math.max(0,E-_)),C+=E-(C?b+_:_)+"px,"+E+"px",t.style("stroke-dasharray",C)}function O(){t.style("stroke-dasharray","0px,100px")}function D(e,i,u,c){e.path&&(e.noRotate&&(u=0),r.select(p.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:l(i.x,i.y)+s(180*u/Math.PI)+o(c)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&D(m,u,h,y),x&&D(d,c,f,g)}}),Ei=f((t,e)=>{var r=v(),n=Ut(),i=we(),a=oe(),o=a.strTranslate,s=rr(),l=q(),u=Je(),c=Pr(),h=Ae(),f=hr(),p=cr(),d=me().arrayEditor,m=Si();function g(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),i=s.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),x(t,r,e,!1,n,i)}function y(t,e,r,n,i){var a=i[r],o=i[r+"ref"],l=-1!==r.indexOf("y"),u="domain"===s.getRefType(o),c=l?n.h:n.w;return t?u?a+(l?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(l?-e:e)/c}function x(t,e,i,g,v,x){var _,b,w=t._fullLayout,T=t._fullLayout._size,k=t._context.edits;g?(_="annotation-"+g,b=g+".annotations"):(_="annotation",b="annotations");var A=d(t.layout,b,e),M=A.modifyBase,S=A.modifyItem,E=A.getUpdateObj;w._infolayer.selectAll("."+_+'[data-index="'+i+'"]').remove();var C="clip"+w._uid+"_ann"+i;if(e._input&&!1!==e.visible){var I={x:{},y:{}},L=+e.textangle||0,P=w._infolayer.append("g").classed(_,!0).attr("data-index",String(i)).style("opacity",e.opacity),z=P.append("g").classed("annotation-text-g",!0),O=k[e.showarrow?"annotationTail":"annotationPosition"],D=e.captureevents||k.annotationText||O,R=z.append("g").style("pointer-events",D?"all":null).call(f,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",Z(r.event))});e.hovertext&&R.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();c.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})}).on("mouseout",function(){c.loneUnhover(w._hoverlayer.node())});var F=e.borderwidth,B=e.borderpad,N=F+B,j=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll("#"+C).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var q=e.font,H=w._meta?a.templateString(e.text,w._meta):e.text,G=R.append("text").classed("annotation-text",!0).text(H);k.annotationText?G.call(h.makeEditable,{delegate:R,gd:t}).call(W).on("edit",function(r){e.text=r,this.call(W),S("text",r),v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0),n.call("_guiRelayout",t,E())}):G.call(W)}else r.selectAll("#"+C).remove();function Z(t){var r={index:i,annotation:e._input,fullAnnotation:e,event:t};return g&&(r.subplotId=g),r}function W(r){return r.call(u.font,q).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,Y),r}function Y(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(j.node());var i=R.select(".annotation-text-math-group"),c=!i.empty(),d=u.bBox((c?i:G).node()),_=d.width,b=d.height,A=e.width||_,D=e.height||b,B=Math.round(A+2*N),q=Math.round(D+2*N);function H(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Y=["x","y"],X=0;X<Y.length;X++){var $,J,K,Q,tt,et=Y[X],rt=e[et+"ref"]||et,nt=e["a"+et+"ref"],it={x:v,y:x}[et],at=(L+("x"===et?0:-90))*Math.PI/180,ot=B*Math.cos(at),st=q*Math.sin(at),lt=Math.abs(ot)+Math.abs(st),ut=e[et+"anchor"],ct=e[et+"shift"]*("x"===et?1:-1),ht=I[et],ft=s.getRefType(rt);if(it&&"domain"!==ft){var pt=it.r2fraction(e[et]);(pt<0||pt>1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),$=it._offset+it.r2p(e[et]),Q=.5}else{var dt="domain"===ft;"x"===et?(K=e[et],$=dt?it._offset+it._length*K:$=T.l+T.w*K):(K=1-e[et],$=dt?it._offset+it._length*K:$=T.t+T.h*K),Q=e.showarrow?.5:K}if(e.showarrow){ht.head=$;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=s.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ht.tail=T.t+T.h*mt):ht.tail=T.l+T.w*mt:ht.tail=it._offset+it.r2p(mt),J=tt}else ht.tail=$+mt,J=tt+mt;ht.text=ht.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ht.head=a.constrain(ht.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(ht.tail-3,ht.text),xt=Math.min(ht.tail+3,ht.text)-yt;vt>0?(ht.tail+=vt,ht.text+=vt):xt>0&&(ht.tail-=xt,ht.text-=xt)}ht.tail+=ct,ht.head+=ct}else J=tt=lt*H(Q,ut),ht.text=$+tt;ht.text+=ct,tt+=ct,J+=ct,e["_"+et+"padplus"]=lt/2+J,e["_"+et+"padminus"]=lt/2-J,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var _t=0,bt=0;if("left"!==e.align&&(_t=(A-_)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(D-b)*("middle"===e.valign?.5:1)),c)i.select("svg").attr({x:N+_t-1,y:N+bt}).call(u.setClipUrl,U?C:null,t);else{var wt=N+bt-d.top,Tt=N+_t-d.left;G.call(h.positionText,Tt,wt).call(u.setClipUrl,U?C:null,t)}V.select("rect").call(u.setRect,N,N,A,D),j.call(u.setRect,F/2,F/2,B-F,q-F),R.call(u.setTranslate,Math.round(I.x.text-B/2),Math.round(I.y.text-q/2)),z.attr({transform:"rotate("+L+","+I.x.text+","+I.y.text+")"});var kt,At=function(r,i){P.selectAll(".annotation-arrow-g").remove();var s=I.x.head,c=I.y.head,h=I.x.tail+r,f=I.y.tail+i,d=I.x.text+r,_=I.y.text+i,b=a.rotationXYMatrix(L,d,_),w=a.apply2DTransform(b),A=a.apply2DTransform2(b),C=+j.attr("width"),O=+j.attr("height"),D=d-.5*C,F=D+C,B=_-.5*O,N=B+O,U=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(A);if(!U.reduce(function(t,e){return t^!!a.segmentsIntersect(s,c,s+1e6,c+1e6,e[0],e[1],e[2],e[3])},!1)){U.forEach(function(t){var e=a.segmentsIntersect(h,f,s,c,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)});var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=P.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),Z=G.append("path").attr("d","M"+h+","+f+"L"+s+","+c).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(Z,H,e),k.annotationPosition&&Z.node().parentNode&&!g){var W=s,Y=c;if(e.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(c-f,2));W+=e.standoff*(h-s)/X,Y+=e.standoff*(f-c)/X}var $,J,K=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(f-Y),transform:o(W,Y)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:K.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);$=t.x,J=t.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w($,J),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",o(t,r)),z.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&At(0,0),O&&p.init({element:R.node(),gd:t,prepFn:function(){kt=z.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),At(t,r);else{if(g)return;var i,a;if(v)i=y(v,t,"x",T,e);else{var s=e._xsize/T.w,l=e.x+(e._xshift-e.xshift)/T.w-s/2;i=p.align(l+t/T.w,s,0,1,e.xanchor)}if(x)a=y(x,r,"y",T,e);else{var u=e._ysize/T.h,c=e.y-(e._yshift+e.yshift)/T.h-u/2;a=p.align(c-r/T.h,u,0,1,e.yanchor)}S("x",i),S("y",a),(!v||!x)&&(n=p.getCursor(v?.5:i,x?.5:a,e.xanchor,e.yanchor))}z.attr({transform:o(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Z(n))},doneFn:function(){f(R),n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&g(t,r);return i.previousPromises(t)},drawOne:g,drawRaw:x}}),Ci=f((t,e)=>{var r=oe(),n=Ut(),i=me().arrayEditor;function a(t,e){var r,n,i,a,s,l,u,c=t._fullLayout.annotations,h=[],f=[],p=[],d=(e||[]).length;for(r=0;r<c.length;r++)if(a=(i=c[r]).clicktoshow){for(n=0;n<d;n++)if(l=(s=e[n]).xaxis,u=s.yaxis,l._id===i.xref&&u._id===i.yref&&l.d2r(s.x)===o(i._xclick,l)&&u.d2r(s.y)===o(i._yclick,u)){(i.visible?"onout"===a?f:p:h).push(r);break}n===d&&i.visible&&"onout"===a&&f.push(r)}return{on:h,off:f,explicitOff:p}}function o(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var o,s,l=a(t,e),u=l.on,c=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(u.length||c.length){for(o=0;o<u.length;o++)(s=i(t.layout,"annotations",f[u[o]])).modifyItem("visible",!0),r.extendFlat(h,s.getUpdateObj());for(o=0;o<c.length;o++)(s=i(t.layout,"annotations",f[c[o]])).modifyItem("visible",!1),r.extendFlat(h,s.getUpdateObj());return n.call("update",t,{},h)}}}}),Ii=f((t,e)=>{var r=oe(),n=q();e.exports=function(t,e,i,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=n.opacity(s);a("borderpad");var u=a("borderwidth"),c=a("showarrow");if(a("text",c?" ":i._dfltTitle.annotation),a("textangle"),r.coerceFont(a,"font",i.font),a("width"),a("align"),a("height")&&a("valign"),c){var h,f,p=a("arrowside");-1!==p.indexOf("end")&&(h=a("arrowhead"),f=a("arrowsize")),-1!==p.indexOf("start")&&(a("startarrowhead",h),a("startarrowsize",f)),a("arrowcolor",l?e.bordercolor:n.defaultLine),a("arrowwidth",2*(l&&u||1)),a("standoff"),a("startstandoff")}var d=a("hovertext"),m=i.hoverlabel||{};if(d){var g=a("hoverlabel.bgcolor",m.bgcolor||(n.opacity(o)?n.rgb(o):n.defaultLine)),y=a("hoverlabel.bordercolor",m.bordercolor||n.contrast(g)),v=r.extendFlat({},m.font);v.color||(v.color=y),r.coerceFont(a,"hoverlabel.font",v)}a("captureevents",!!d)}}),Li=f((t,e)=>{var r=oe(),n=rr(),i=Fe(),a=Ii(),o=vn();function s(t,e,i){function s(n,i){return r.coerce(t,e,o,n,i)}var l=s("visible"),u=s("clicktoshow");if(l||u){a(t,e,i,s);for(var c=e.showarrow,h=["x","y"],f=[-10,-30],p={_fullLayout:i},d=0;d<2;d++){var m=h[d],g=n.coerceRef(t,e,p,m,"","paper");if("paper"!==g&&n.getFromId(p,g)._annIndices.push(e._index),n.coercePosition(e,p,s,g,m,.5),c){var y="a"+m,v=n.coerceRef(t,e,p,y,"pixel",["pixel","paper"]);"pixel"!==v&&v!==g&&(v=e[y]="pixel");var x="pixel"===v?f[d]:.4;n.coercePosition(e,p,s,v,y,x)}s(m+"anchor"),s(m+"shift")}if(r.noneOrAll(t,e,["x","y"]),c&&r.noneOrAll(t,e,["ax","ay"]),u){var _=s("xclick"),b=s("yclick");e._xclick=void 0===_?e.x:n.cleanPosition(_,p,e.xref),e._yclick=void 0===b?e.y:n.cleanPosition(b,p,e.yref)}}}e.exports=function(t,e){i(t,e,{name:"annotations",handleItemDefaults:s})}}),Pi=f((t,e)=>{var r=oe(),n=rr(),i=Ei().draw;function a(t){var e=t._fullLayout;r.filterVisible(e.annotations).forEach(function(e){var r=n.getFromId(t,e.xref),i=n.getFromId(t,e.yref),a=n.getRefType(e.xref),s=n.getRefType(e.yref);e._extremes={},"range"===a&&o(e,r),"range"===s&&o(e,i)})}function o(t,e){var r,i=e._id,a=i.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],h=t["_"+a+"padminus"],f={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+f,m=p-f,g=3*t.startarrowsize*t.arrowwidth||0,y=g+f,v=g-f;if(u===l){var x=n.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),_=n.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,y),ppadminus:Math.max(h,v)});r={min:[x.min[0],_.min[0]],max:[x.max[0],_.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=n.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,y),ppadminus:Math.max(h,m,v)});t._extremes[i]=r}e.exports=function(t){var e=t._fullLayout;if(r.filterVisible(e.annotations).length&&t._fullData.length)return r.syncOrAsync([i,a],t)}}),zi=f((t,e)=>{var r=T(),n=L();e.exports=function(t,e,i,a){e=e||{};var o="log"===i&&"linear"===e.type,s="linear"===i&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.annotations,h=e._id.charAt(0),f=0;f<c.length;f++)l=c[f],u="annotations["+f+"].",l[h+"ref"]===e._id&&p(h),l["a"+h+"ref"]===e._id&&p("a"+h);function p(t){var i=l[t],s=null;s=o?n(i,e.range):Math.pow(10,i),r(s)||(s=null),a(u+t,s)}}}),Oi=f((t,e)=>{var r=Ei(),n=Ci();e.exports={moduleType:"component",name:"annotations",layoutAttributes:vn(),supplyLayoutDefaults:Li(),includeBasePlot:An()("annotations"),calcAutorange:Pi(),draw:r.draw,drawOne:r.drawOne,drawRaw:r.drawRaw,hasClickToShow:n.hasClickToShow,onClick:n.onClick,convertCoords:zi()}}),Di=f((t,e)=>{var r=vn(),n=Lt().overrideAll,i=me().templatedArray;e.exports=n(i("annotation",{visible:r.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:r.xanchor,xshift:r.xshift,yanchor:r.yanchor,yshift:r.yshift,text:r.text,textangle:r.textangle,font:r.font,width:r.width,height:r.height,opacity:r.opacity,align:r.align,valign:r.valign,bgcolor:r.bgcolor,bordercolor:r.bordercolor,borderpad:r.borderpad,borderwidth:r.borderwidth,showarrow:r.showarrow,arrowcolor:r.arrowcolor,arrowhead:r.arrowhead,startarrowhead:r.startarrowhead,arrowside:r.arrowside,arrowsize:r.arrowsize,startarrowsize:r.startarrowsize,arrowwidth:r.arrowwidth,standoff:r.standoff,startstandoff:r.startstandoff,hovertext:r.hovertext,hoverlabel:r.hoverlabel,captureevents:r.captureevents}),"calc","from-root")}),Ri=f((t,e)=>{var r=oe(),n=rr(),i=Fe(),a=Ii(),o=Di();function s(t,e,i,s){function l(n,i){return r.coerce(t,e,o,n,i)}function u(t){var r=t+"axis",a={_fullLayout:{}};return a._fullLayout[r]=i[r],n.coercePosition(e,a,l,t,t,.5)}l("visible")&&(a(t,e,s.fullLayout,l),u("x"),u("y"),u("z"),r.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),r.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}}),Fi=f((t,e)=>{var r=oe(),n=rr();function i(t,e){var i=e.fullSceneLayout.domain,a=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},r.extendFlat(t._xa,o),n.setConvert(t._xa),t._xa._offset=a.l+i.x[0]*a.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*a.w*(i.x[1]-i.x[0])},t._ya={},r.extendFlat(t._ya,o),n.setConvert(t._ya),t._ya._offset=a.t+(1-i.y[1])*a.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*a.h*(i.y[1]-i.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)i(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}}),Bi=f((t,e)=>{function r(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}e.exports=function(t,e){return r(t.projection,r(t.view,r(t.model,[e[0],e[1],e[2],1])))}}),Ni=f((t,e)=>{var r=Ei().drawRaw,n=Bi(),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,a=t.dataScale,o=e.annotations,s=0;s<o.length;s++){for(var l=o[s],u=!1,c=0;c<3;c++){var h=i[c],f=l[h],p=e[h+"axis"].r2fraction(f);if(p<0||p>1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=n(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*a[0],e.yaxis.r2l(l.y)*a[1],e.zaxis.r2l(l.z)*a[2]]),r(t.graphDiv,l,s,t.id,l._xa,l._ya))}}}),ji=f((t,e)=>{var r=Ut(),n=oe();e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Di()}}},layoutAttributes:Di(),handleDefaults:Ri(),includeBasePlot:function(t,e){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];a.test(l)&&(t[l].annotations||[]).length&&(n.pushUnique(e._basePlotModules,i),n.pushUnique(e._subplots.gl3d,l))}},convert:Fi(),draw:Ni()}}),Ui=f((t,e)=>{var r=vn(),n=R(),i=bn().line,a=Pt().dash,o=D().extendFlat,s=me().templatedArray;yn();var l=j(),u=Ot().shapeTexttemplateAttrs,c=Dt();e.exports=s("shape",{visible:o({},l.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:o({},l.legend,{editType:"calc+arraydraw"}),legendgroup:o({},l.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:o({},l.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:n({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:o({},l.legendrank,{editType:"calc+arraydraw"}),legendwidth:o({},l.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:o({},r.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:o({},r.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:u({},{keys:Object.keys(c)}),font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),Vi=f((t,e)=>{var r=oe(),n=rr(),i=Fe(),a=Ui(),o=Vr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}if(e._isShape=!0,s("visible")){s("showlegend")&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),r.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var l=s("path"),u=s("type",l?"path":"rect"),c="path"!==u;c&&delete e.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule"),s("line.width")&&(s("line.color"),s("line.dash"));for(var h=s("xsizemode"),f=s("ysizemode"),p=["x","y"],d=0;d<2;d++){var m,g,y,v=p[d],x=v+"anchor",_="x"===v?h:f,b={_fullLayout:i},w=n.coerceRef(t,e,b,v,void 0,"paper");if("range"===n.getRefType(w)?((m=n.getFromId(b,w))._shapeIndices.push(e._index),y=o.rangeToShapePosition(m),g=o.shapePositionToRange(m),("category"===m.type||"multicategory"===m.type)&&(s(v+"0shift"),s(v+"1shift"))):g=y=r.identity,c){var T=v+"0",k=v+"1",A=t[T],M=t[k];t[T]=g(t[T],!0),t[k]=g(t[k],!0),"pixel"===_?(s(T,0),s(k,10)):(n.coercePosition(e,b,s,w,T,.25),n.coercePosition(e,b,s,w,k,.75)),e[T]=y(e[T]),e[k]=y(e[k]),t[T]=A,t[k]=M}if("pixel"===_){var S=t[x];t[x]=g(t[x],!0),n.coercePosition(e,b,s,w,x,.25),e[x]=y(e[x]),t[x]=S}}c&&r.noneOrAll(t,e,["x0","x1","y0","y1"]);var E,C,I="line"===u;if(c&&(E=s("label.texttemplate")),E||(C=s("label.text")),C||E){s("label.textangle");var L=s("label.textposition",I?"middle":"middle center");s("label.xanchor"),s("label.yanchor",function(t,e){return t?"bottom":-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle"}(I,L)),s("label.padding"),r.coerceFont(s,"label.font",i.font)}}}e.exports=function(t,e){i(t,e,{name:"shapes",handleItemDefaults:s})}}),qi=f((t,e)=>{var r=q(),n=oe();e.exports=function(t,e,i){if(i("newshape.visible"),i("newshape.name"),i("newshape.showlegend"),i("newshape.legend"),i("newshape.legendwidth"),i("newshape.legendgroup"),i("newshape.legendgrouptitle.text"),n.coerceFont(i,"newshape.legendgrouptitle.font"),i("newshape.legendrank"),i("newshape.drawdirection"),i("newshape.layer"),i("newshape.fillcolor"),i("newshape.fillrule"),i("newshape.opacity"),i("newshape.line.width")){var a=(t||{}).plot_bgcolor||"#FFF";i("newshape.line.color",r.contrast(a)),i("newshape.line.dash")}var o="drawline"===t.dragmode,s=i("newshape.label.text"),l=i("newshape.label.texttemplate");if(s||l){i("newshape.label.textangle");var u=i("newshape.label.textposition",o?"middle":"middle center");i("newshape.label.xanchor"),i("newshape.label.yanchor",function(t,e){return t?"bottom":-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle"}(o,u)),i("newshape.label.padding"),n.coerceFont(i,"newshape.label.font",e.font)}i("activeshape.fillcolor"),i("activeshape.opacity")}}),Hi=f((t,e)=>{var r=oe(),n=rr(),i=Ur(),a=Vr();function o(t){return l(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function s(t){return l(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function l(t,e,n,o,s,l){var u=t/2,c=l;if("pixel"===e){var h=s?a.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[n,o],f=r.aggNums(Math.max,null,h),p=r.aggNums(Math.min,null,h),d=p<0?Math.abs(p)+u:u,m=f>0?f+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function u(t,e,r){var n,o,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,u=0,c=0,h=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],o=e[s+"1"],l&&(u=e[s+"0shift"],c=e[s+"1shift"])):(n=e[s+"anchor"],o=e[s+"anchor"]),void 0!==n)return[h(n)+u,h(o)+c];if(e.path){var f,p,d,m,g=1/0,y=-1/0,v=e.path.match(i.segmentRE);for("date"===t.type&&(h=a.decodeDate(h)),f=0;f<v.length;f++)void 0!==(p=r[v[f].charAt(0)].drawn)&&(d=v[f].substr(1).match(i.paramRE))&&!(d.length<p)&&((m=h(d[p]))<g&&(g=m),m>y&&(y=m));if(y>=g)return[g,y]}}e.exports=function(t){var e=t._fullLayout,a=r.filterVisible(e.shapes);if(a.length&&t._fullData.length)for(var l=0;l<a.length;l++){var c=a[l];c._extremes={};var h,f,p=n.getRefType(c.xref),d=n.getRefType(c.yref);"paper"!==c.xref&&"domain"!==p&&(f=u(h=n.getFromId(t,c.xref),c,i.paramIsX))&&(c._extremes[h._id]=n.findExtremes(h,f,o(c))),"paper"!==c.yref&&"domain"!==d&&(f=u(h=n.getFromId(t,c.yref),c,i.paramIsY))&&(c._extremes[h._id]=n.findExtremes(h,f,s(c)))}}}),Gi=f((t,e)=>{var r=Gr();e.exports={moduleType:"component",name:"shapes",layoutAttributes:Ui(),supplyLayoutDefaults:Vi(),supplyDrawNewShapeDefaults:qi(),includeBasePlot:An()("shapes"),calcAutorange:Hi(),draw:r.draw,drawOne:r.drawOne}}),Zi=f((t,e)=>{var r=ge(),n=me().templatedArray;yn(),e.exports=n("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",r.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",r.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),Wi=f((t,e)=>{var r=oe(),n=rr(),i=Fe(),a=Zi();function o(t,e,i){function o(n,i){return r.coerce(t,e,a,n,i)}var s=o("source");if(!o("visible",!!s))return e;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var l={_fullLayout:i},u=["x","y"],c=0;c<2;c++){var h=u[c],f=n.coerceRef(t,e,l,h,"paper",void 0);"paper"!==f&&n.getFromId(l,f)._imgIndices.push(e._index),n.coercePosition(e,l,o,f,h,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:o})}}),Yi=f((t,e)=>{var r=v(),n=Je(),i=rr(),a=ye(),o=Te();e.exports=function(t){var e,s,l=t._fullLayout,u=[],c={},h=[];for(s=0;s<l.images.length;s++){var f=l.images[s];if(f.visible)if("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref){e=a.ref2id(f.xref)+a.ref2id(f.yref);var p=l._plots[e];if(!p){h.push(f);continue}p.mainplot&&(e=p.mainplot.id),c[e]||(c[e]=[]),c[e].push(f)}else"above"===f.layer?u.push(f):h.push(f)}var d={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},m={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function g(e){var n=r.select(this);if(this._imgSrc!==e.source)if(n.attr("xmlns",o.svg),!t._context.staticPlot||e.source&&"data:"===e.source.slice(0,5))n.attr("xlink:href",e.source),this._imgSrc=e.source;else{var i=new Promise(function(t){var r=new Image;function i(){n.remove(),t()}this.img=r,r.setAttribute("crossOrigin","anonymous"),r.onerror=i,r.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d",{willReadFrequently:!0}).drawImage(this,0,0);var r=e.toDataURL("image/png");n.attr("xlink:href",r),t()},n.on("error",i),r.src=e.source,this._imgSrc=e.source}.bind(this));t._promises.push(i)}}function y(e){var a,o,s=r.select(this),u=i.getFromId(t,e.xref),c=i.getFromId(t,e.yref),h="domain"===i.getRefType(e.xref),f="domain"===i.getRefType(e.yref),p=l._size;a=void 0!==u?"string"==typeof e.xref&&h?u._length*e.sizex:Math.abs(u.l2p(e.sizex)-u.l2p(0)):e.sizex*p.w,o=void 0!==c?"string"==typeof e.yref&&f?c._length*e.sizey:Math.abs(c.l2p(e.sizey)-c.l2p(0)):e.sizey*p.h;var g,y,v=a*d[e.xanchor].offset,x=o*m[e.yanchor].offset,_=d[e.xanchor].sizing+m[e.yanchor].sizing;switch(g=void 0!==u?"string"==typeof e.xref&&h?u._length*e.x+u._offset:u.r2p(e.x)+u._offset:e.x*p.w+p.l,g+=v,y=void 0!==c?"string"==typeof e.yref&&f?c._length*(1-e.y)+c._offset:c.r2p(e.y)+c._offset:p.h-e.y*p.h+p.t,y+=x,e.sizing){case"fill":_+=" slice";break;case"stretch":_="none"}s.attr({x:g,y:y,width:a,height:o,preserveAspectRatio:_,opacity:e.opacity});var b=(u&&"domain"!==i.getRefType(e.xref)?u._id:"")+(c&&"domain"!==i.getRefType(e.yref)?c._id:"");n.setClipUrl(s,b?"clip"+l._uid+b:null,t)}function v(t){return[t.xref,t.x,t.sizex,t.yref,t.y,t.sizey].join("_")}function x(t,e){return t._index-e._index}var _=l._imageLowerLayer.selectAll("image").data(h,v),b=l._imageUpperLayer.selectAll("image").data(u,v);_.enter().append("image"),b.enter().append("image"),_.exit().remove(),b.exit().remove(),_.each(function(t){g.bind(this)(t),y.bind(this)(t)}),b.each(function(t){g.bind(this)(t),y.bind(this)(t)}),_.sort(x),b.sort(x);var w=Object.keys(l._plots);for(s=0;s<w.length;s++){e=w[s];var T=l._plots[e];if(T.imagelayer){var k=T.imagelayer.selectAll("image").data(c[e]||[],v);k.enter().append("image"),k.exit().remove(),k.each(function(t){g.bind(this)(t),y.bind(this)(t)}),k.sort(x)}}}}),Xi=f((t,e)=>{var r=T(),n=L();e.exports=function(t,e,i,a){e=e||{};var o="log"===i&&"linear"===e.type,s="linear"===i&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.images,h=e._id.charAt(0),f=0;f<c.length;f++)if(u="images["+f+"].",(l=c[f])[h+"ref"]===e._id){var p=l[h],d=l["size"+h],m=null,g=null;if(o){m=n(p,e.range);var y=d/Math.pow(10,m)/2;g=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=(m=Math.pow(10,p))*(Math.pow(10,d/2)-Math.pow(10,-d/2));r(m)?r(g)||(g=null):(m=null,g=null),a(u+h,m),a(u+"size"+h,g)}}}),$i=f((t,e)=>{e.exports={moduleType:"component",name:"images",layoutAttributes:Zi(),supplyLayoutDefaults:Wi(),includeBasePlot:An()("images"),draw:Yi(),convertCoords:Xi()}}),Ji=f((t,e)=>{e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}}),Ki=f((t,e)=>{var r=R(),n=V(),i=D().extendFlat,a=Lt().overrideAll,o=Bt(),s=me().templatedArray,l=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=a(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:l,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(o({editType:"arraydraw"}),{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:n.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),Qi=f((t,e)=>{var r=oe(),n=Fe(),i=Ki(),a=Ji().name,o=i.buttons;function s(t,e,a){function o(n,a){return r.coerce(t,e,i,n,a)}o("visible",n(t,e,{name:"buttons",handleItemDefaults:l}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(t,e){function n(n,i){return r.coerce(t,e,o,n,i)}n("visible","skip"===t.method||Array.isArray(t.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}e.exports=function(t,e){n(t,e,{name:a,handleItemDefaults:s})}}),ta=f((t,e)=>{e.exports=o;var r=v(),n=q(),i=Je(),a=oe();function o(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(t,e,a){var s=this.gd._fullLayout,l=s.width,u=s.height;this.position=t;var c,h,f,p,d=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,_="left"===v,b="up"===v,w=m,T=y;!x&&!_&&!("right"===v)&&!b&&(this.position.direction="down",x=!0),x||b?(h=(c=d)+w,x?(f=g,T=(p=Math.min(f+T,u))-f):T=(p=g+T)-(f=Math.max(p-T,0))):(p=(f=g)+T,_?w=(h=d+w)-(c=Math.max(h-w,0)):(c=d,w=(h=Math.min(c+w,l))-c)),this._box={l:c,t:f,w:w,h:T};var k=m>w,A=o.barLength+2*o.barPad,M=o.barWidth+2*o.barPad,S=d,E=g+y;E+M>u&&(E=u-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),k?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=y>T,L=o.barWidth+2*o.barPad,P=o.barLength+2*o.barPad,z=d+m,O=g;z+L>l&&(z=l-L);var D=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),I?(this.vbar=D.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:O,width:L,height:P}),this._vbarYMin=O+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=I?h+L+.5:h+.5,N=f-.5,j=k?p+M+.5:p+.5,U=s._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},o.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=r.event.dx),this.vbar&&(e-=r.event.dy),this.setTranslate(t,e)},o.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=r.event.deltaY),this.vbar&&(e+=r.event.deltaY),this.setTranslate(t,e)},o.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,i=n+this._hbarTranslateMax;t=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,s=o+this._vbarTranslateMax;e=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},o.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=a.constrain(t||0,0,r),e=a.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var o=t/r;this.hbar.call(i.setTranslate,t+o*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}}),ea=f((t,e)=>{var r=v(),n=we(),i=q(),a=Je(),o=oe(),s=Ae(),l=me().arrayEditor,u=ke().LINE_SPACING,c=Ji(),h=ta();function f(t){return t._index}function p(t,e){return+t.attr(c.menuIndexAttrName)===e._index}function d(t,e,r,n,i,a,o,s){e.active=o,l(t.layout,c.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(c.menuIndexAttrName,"-1"),m(t,n,i,a,e),s||g(t,n,i,a,e))}function m(t,e,r,n,i){var s=o.ensureSingle(e,"g",c.headerClassName,function(t){t.style("pointer-events","all")}),l=i._dims,u=i.active,h=i.buttons[u]||c.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,t).call(M,i,f,d),o.ensureSingle(e,"text",c.headerArrowClassName,function(t){t.attr("text-anchor","end").call(a.font,i.font).text(c.arrowSymbol[i.direction])}).attr({x:l.headerWidth-c.arrowOffsetX+i.pad.l,y:l.headerHeight/2+c.textOffsetY+i.pad.t}),s.on("click",function(){r.call(S,String(p(r,i)?-1:i._index)),g(t,e,r,n,i)}),s.on("mouseover",function(){s.call(w)}),s.on("mouseout",function(){s.call(T,i)}),a.setTranslate(e,l.lx,l.ly)}function g(t,e,i,a,s){i||(i=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(c.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,u="dropdown"===s.type?c.dropdownButtonClassName:c.buttonClassName,h=i.selectAll("g."+u).data(o.filterVisible(l)),f=h.enter().append("g").classed(u,!0),p=h.exit();"dropdown"===s.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+c.gapButtonHeader:m=v.headerWidth+c.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-c.gapButtonHeader+c.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-c.gapButtonHeader+c.gapButton-v.openWidth);var _={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:c.gapButton,xPad:c.gapButton,index:0},k={l:_.x+s.borderwidth,t:_.y+s.borderwidth};h.each(function(o,l){var u=r.select(this);u.call(y,s,o,t).call(M,s,_),u.on("click",function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(d(t,s,0,e,i,a,-1),n.executeAPICommand(t,o.method,o.args2)):(d(t,s,0,e,i,a,l),n.executeAPICommand(t,o.method,o.args))),t.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))}),u.on("mouseover",function(){u.call(w)}),u.on("mouseout",function(){u.call(T,s),h.call(b,s)})}),h.call(b,s),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=_.y-k.t):(k.w=_.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=s.direction,a&&(h.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,h="up"===u||"down"===u,f=i._dims,p=i.active;if(h)for(s=0,l=0;l<p;l++)s+=f.heights[l]+c.gapButton;else for(o=0,l=0;l<p;l++)o+=f.widths[l]+c.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,a,s,k):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()}),r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}(a))}function y(t,e,r,n){t.call(x,e).call(_,e,r,n)}function x(t,e){o.ensureSingle(t,"rect",c.itemRectClassName,function(t){t.attr({rx:c.rx,ry:c.ry,"shape-rendering":"crispEdges"})}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function _(t,e,r,n){var i=o.ensureSingle(t,"text",c.itemTextClassName,function(t){t.attr({"text-anchor":"start","data-notex":1})}),l=r.label,u=n._fullLayout._meta;u&&(l=o.templateString(l,u)),i.call(a.font,e.font).text(l).call(s.convertToTspans,n)}function b(t,e){var n=e.active;t.each(function(t,a){var o=r.select(this);a===n&&e.showactive&&o.select("rect."+c.itemRectClassName).call(i.fill,c.activeColor)})}function w(t){t.select("rect."+c.itemRectClassName).call(i.fill,c.hoverColor)}function T(t,e){t.select("rect."+c.itemRectClassName).call(i.fill,e.bgcolor)}function k(t,e){var i=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},l=a.tester.selectAll("g."+c.dropdownButtonClassName).data(o.filterVisible(e.buttons));l.enter().append("g").classed(c.dropdownButtonClassName,!0);var h=-1!==["up","down"].indexOf(e.direction);l.each(function(n,o){var l=r.select(this);l.call(y,e,n,t);var f=l.select("."+c.itemTextClassName),p=f.node()&&a.bBox(f.node()).width,d=Math.max(p+c.textPadX,c.minWidth),m=e.font.size*u,g=s.lineCount(f),v=Math.max(m*g,c.minHeight)+c.textOffsetY;v=Math.ceil(v),d=Math.ceil(d),i.widths[o]=d,i.heights[o]=v,i.height1=Math.max(i.height1,v),i.width1=Math.max(i.width1,d),h?(i.totalWidth=Math.max(i.totalWidth,d),i.openWidth=i.totalWidth,i.totalHeight+=v+c.gapButton,i.openHeight+=v+c.gapButton):(i.totalWidth+=d+c.gapButton,i.openWidth+=d+c.gapButton,i.totalHeight=Math.max(i.totalHeight,v),i.openHeight=i.totalHeight)}),h?i.totalHeight-=c.gapButton:i.totalWidth-=c.gapButton,i.headerWidth=i.width1+c.arrowPadX,i.headerHeight=i.height1,"dropdown"===e.type&&(h?(i.width1+=c.arrowPadX,i.totalHeight=i.height1):i.totalWidth=i.width1,i.totalWidth+=c.arrowPadX),l.remove();var f=i.totalWidth+e.pad.l+e.pad.r,p=i.totalHeight+e.pad.t+e.pad.b,d=t._fullLayout._size;i.lx=d.l+d.w*e.x,i.ly=d.t+d.h*(1-e.y);var m="left";o.isRightAnchor(e)&&(i.lx-=f,m="right"),o.isCenterAnchor(e)&&(i.lx-=f/2,m="center");var g="top";o.isBottomAnchor(e)&&(i.ly-=p,g="bottom"),o.isMiddleAnchor(e)&&(i.ly-=p/2,g="middle"),i.totalWidth=Math.ceil(i.totalWidth),i.totalHeight=Math.ceil(i.totalHeight),i.lx=Math.round(i.lx),i.ly=Math.round(i.ly),n.autoMargin(t,A(e),{x:e.x,y:e.y,l:f*({right:1,center:.5}[m]||0),r:f*({left:1,center:.5}[m]||0),b:p*({top:1,middle:.5}[g]||0),t:p*({bottom:1,middle:.5}[g]||0)})}function A(t){return c.autoMarginIdRoot+t._index}function M(t,e,r,n){n=n||{};var i=t.select("."+c.itemRectClassName),o=t.select("."+c.itemTextClassName),l=e.borderwidth,h=r.index,f=e._dims;a.setTranslate(t,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(e.direction),d=n.height||(p?f.heights[h]:f.height1);i.attr({x:0,y:0,width:n.width||(p?f.width1:f.widths[h]),height:d});var m=e.font.size*u,g=(s.lineCount(o)-1)*m/2;s.positionText(o,c.textOffsetX,d/2-g+c.textOffsetY),p?r.y+=f.heights[h]+r.yPad:r.x+=f.widths[h]+r.xPad,r.index++}function S(t,e){t.attr(c.menuIndexAttrName,e||"-1").selectAll("g."+c.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,i=o.filterVisible(e[c.name]);function a(e){n.autoMargin(t,A(e))}var s=e._menulayer.selectAll("g."+c.containerClassName).data(i.length>0?[0]:[]);if(s.enter().append("g").classed(c.containerClassName,!0).style("cursor","pointer"),s.exit().each(function(){r.select(this).selectAll("g."+c.headerGroupClassName).each(a)}).remove(),0!==i.length){var l=s.selectAll("g."+c.headerGroupClassName).data(i,f);l.enter().append("g").classed(c.headerGroupClassName,!0);for(var u=o.ensureSingle(s,"g",c.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),y=0;y<i.length;y++){var v=i[y];k(t,v)}var x="updatemenus"+e._uid,_=new h(t,u,x);l.enter().size()&&(u.node().parentNode.appendChild(u.node()),u.call(S)),l.exit().each(function(t){u.call(S),a(t)}).remove(),l.each(function(e){var i=r.select(this),a="dropdown"===e.type?u:null;n.manageCommandObserver(t,e,e.buttons,function(r){d(t,e,e.buttons[r.index],i,a,_,r.index,!0)}),"dropdown"===e.type?(m(t,i,u,_,e),p(u,e)&&g(t,i,u,_,e)):g(t,i,null,null,e)})}}}),ra=f((t,e)=>{var r=Ji();e.exports={moduleType:"component",name:r.name,layoutAttributes:Ki(),supplyLayoutDefaults:Qi(),draw:ea()}}),na=f((t,e)=>{e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}),ia=f((t,e)=>{var r=R(),n=Bt(),i=D().extendDeepAll,a=Lt().overrideAll,o=It(),s=me().templatedArray,l=na(),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=a(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(n({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:o.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:r({})},font:r({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}),"arraydraw","from-root")}),aa=f((t,e)=>{var r=oe(),n=Fe(),i=ia(),a=na().name,o=i.steps;function s(t,e,a){function o(n,a){return r.coerce(t,e,i,n,a)}for(var s=n(t,e,{name:"steps",handleItemDefaults:l}),u=0,c=0;c<s.length;c++)s[c].visible&&u++;if(u<2?e.visible=!1:o("visible")){e._stepCount=u;var h=e._visibleSteps=r.filterVisible(s);(s[o("active")]||{}).visible||(e.active=h[0]._index),o("x"),o("y"),r.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),r.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function l(t,e){function n(n,i){return r.coerce(t,e,o,n,i)}if("skip"===t.method||Array.isArray(t.args)?n("visible"):e.visible=!1){n("method"),n("args");var i=n("label","step-"+e._index);n("value",i),n("execute")}}e.exports=function(t,e){n(t,e,{name:a,handleItemDefaults:s})}}),oa=f((t,e)=>{var r=v(),n=we(),i=q(),a=Je(),o=oe(),s=o.strTranslate,l=Ae(),u=me().arrayEditor,c=na(),h=ke(),f=h.LINE_SPACING,p=h.FROM_TL,d=h.FROM_BR;function m(t){return c.autoMarginIdRoot+t._index}function g(t){return t._index}function y(t,e){var i=a.tester.selectAll("g."+c.labelGroupClass).data(e._visibleSteps);i.enter().append("g").classed(c.labelGroupClass,!0);var s=0,u=0;i.each(function(t){var n=b(r.select(this),{step:t},e).node();if(n){var i=a.bBox(n);u=Math.max(u,i.height),s=Math.max(s,i.width)}}),i.remove();var h=e._dims={};h.inputAreaWidth=Math.max(c.railWidth,c.gripHeight);var f=t._fullLayout._size;h.lx=f.l+f.w*e.x,h.ly=f.t+f.h*(1-e.y),"fraction"===e.lenmode?h.outerLength=Math.round(f.w*e.len):h.outerLength=e.len,h.inputAreaStart=0,h.inputAreaLength=Math.round(h.outerLength-e.pad.l-e.pad.r);var g=(h.inputAreaLength-2*c.stepInset)/(e._stepCount-1),y=s+c.labelPadding;if(h.labelStride=Math.max(1,Math.ceil(y/g)),h.labelHeight=u,h.currentValueMaxWidth=0,h.currentValueHeight=0,h.currentValueTotalHeight=0,h.currentValueMaxLines=1,e.currentvalue.visible){var v=a.tester.append("g");i.each(function(t){var r=x(v,e,t.label),n=r.node()&&a.bBox(r.node())||{width:0,height:0},i=l.lineCount(r);h.currentValueMaxWidth=Math.max(h.currentValueMaxWidth,Math.ceil(n.width)),h.currentValueHeight=Math.max(h.currentValueHeight,Math.ceil(n.height)),h.currentValueMaxLines=Math.max(h.currentValueMaxLines,i)}),h.currentValueTotalHeight=h.currentValueHeight+e.currentvalue.offset,v.remove()}h.height=h.currentValueTotalHeight+c.tickOffset+e.ticklen+c.labelOffset+h.labelHeight+e.pad.t+e.pad.b;var _="left";o.isRightAnchor(e)&&(h.lx-=h.outerLength,_="right"),o.isCenterAnchor(e)&&(h.lx-=h.outerLength/2,_="center");var w="top";o.isBottomAnchor(e)&&(h.ly-=h.height,w="bottom"),o.isMiddleAnchor(e)&&(h.ly-=h.height/2,w="middle"),h.outerLength=Math.ceil(h.outerLength),h.height=Math.ceil(h.height),h.lx=Math.round(h.lx),h.ly=Math.round(h.ly);var T={y:e.y,b:h.height*d[w],t:h.height*p[w]};"fraction"===e.lenmode?(T.l=0,T.xl=e.x-e.len*p[_],T.r=0,T.xr=e.x+e.len*d[_]):(T.x=e.x,T.l=h.outerLength*p[_],T.r=h.outerLength*d[_]),n.autoMargin(t,m(e),T)}function x(t,e,r){if(e.currentvalue.visible){var n,i,s=e._dims;switch(e.currentvalue.xanchor){case"right":n=s.inputAreaLength-c.currentValueInset-s.currentValueMaxWidth,i="left";break;case"center":n=.5*s.inputAreaLength,i="middle";break;default:n=c.currentValueInset,i="left"}var u=o.ensureSingle(t,"text",c.labelClass,function(t){t.attr({"text-anchor":i,"data-notex":1})}),h=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)h+=r;else{var p=e.steps[e.active].label,d=e._gd._fullLayout._meta;d&&(p=o.templateString(p,d)),h+=p}e.currentvalue.suffix&&(h+=e.currentvalue.suffix),u.call(a.font,e.currentvalue.font).text(h).call(l.convertToTspans,e._gd);var m=l.lineCount(u),g=(s.currentValueMaxLines+1-m)*e.currentvalue.font.size*f;return l.positionText(u,n,g),u}}function _(t,e,r){o.ensureSingle(t,"rect",c.gripRectClass,function(n){n.call(A,e,t,r).style("pointer-events","all")}).attr({width:c.gripWidth,height:c.gripHeight,rx:c.gripRadius,ry:c.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function b(t,e,r){var n=o.ensureSingle(t,"text",c.labelClass,function(t){t.attr({"text-anchor":"middle","data-notex":1})}),i=e.step.label,s=r._gd._fullLayout._meta;return s&&(i=o.templateString(i,s)),n.call(a.font,r.font).text(i).call(l.convertToTspans,r._gd),n}function w(t,e){var n=o.ensureSingle(t,"g",c.labelsClass),i=e._dims,s=n.selectAll("g."+c.labelGroupClass).data(i.labelSteps);s.enter().append("g").classed(c.labelGroupClass,!0),s.exit().remove(),s.each(function(t){var n=r.select(this);n.call(b,t,e),a.setTranslate(n,E(e,t.fraction),c.tickOffset+e.ticklen+e.font.size*f+c.labelOffset+i.currentValueTotalHeight)})}function T(t,e,r,n,i){var a=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[a]._index;o!==r.active&&k(t,e,r,o,!0,i)}function k(t,e,r,i,a,o){var s=r.active;r.active=i,u(t.layout,c.name,r).applyUpdate("active",i);var l=r.steps[r.active];e.call(S,r,o),e.call(x,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&n.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function A(t,e,n){if(!e._context.staticPlot){var a=n.node(),o=r.select(e);t.on("mousedown",l),t.on("touchstart",l)}function s(){return n.data()[0]}function l(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=n.select("."+c.gripRectClass);r.event.stopPropagation(),r.event.preventDefault(),l.call(i.fill,t.activebgcolor);var u=C(t,r.mouse(a)[0]);function h(){var t=s(),i=C(t,r.mouse(a)[0]);T(e,n,t,i,!1)}function f(){var t=s();t._dragging=!1,l.call(i.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),o.on("touchend",null),o.on("touchmove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})}T(e,n,t,u,!0),t._dragging=!0,o.on("mousemove",h),o.on("touchmove",h),o.on("mouseup",f),o.on("touchend",f)}}function M(t,e){var n=t.selectAll("rect."+c.tickRectClass).data(e._visibleSteps),o=e._dims;n.enter().append("rect").classed(c.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each(function(t,n){var s=n%o.labelStride===0,l=r.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),a.setTranslate(l,E(e,n/(e._stepCount-1))-.5*e.tickwidth,(s?c.tickOffset:c.minorTickOffset)+o.currentValueTotalHeight)})}function S(t,e,r){for(var n=t.select("rect."+c.gripRectClass),i=0,a=0;a<e._stepCount;a++)if(e._visibleSteps[a]._index===e.active){i=a;break}var o=E(e,i/(e._stepCount-1));if(!e._invokingCommand){var l=n;r&&e.transition.duration>0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",s(o-.5*c.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,s=o.ensureSingle(t,"rect",c.railTouchRectClass,function(n){n.call(A,e,t,r).style("pointer-events","all")});s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,s=o.ensureSingle(t,"rect",c.railRectClass);s.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),a.setTranslate(s,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._context.staticPlot,i=t._fullLayout,o=function(t,e){for(var r=t[c.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&(a._gd=e,n.push(a))}return n}(i,t),s=i._infolayer.selectAll("g."+c.containerClassName).data(o.length>0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),n.autoMargin(t,m(e))}if(s.enter().append("g").classed(c.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each(function(){r.select(this).selectAll("g."+c.groupClassName).each(l)}).remove(),0!==o.length){var u=s.selectAll("g."+c.groupClassName).data(o,g);u.enter().append("g").classed(c.groupClassName,!0),u.exit().each(l).remove();for(var h=0;h<o.length;h++){var f=o[h];y(t,f)}u.each(function(e){var i=r.select(this);(function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})})(e),n.manageCommandObserver(t,e,e._visibleSteps,function(e){var r=i.data()[0];r.active!==e.index&&(r._dragging||k(t,i,r,e.index,!1,!0))}),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),e.call(x,r).call(L,r).call(w,r).call(M,r).call(I,t,r).call(_,t,r);var n=r._dims;a.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(S,r,!1),e.call(x,r)}(t,r.select(this),e)})}}}),sa=f((t,e)=>{var r=na();e.exports={moduleType:"component",name:r.name,layoutAttributes:ia(),supplyLayoutDefaults:aa(),draw:oa()}}),la=f((t,e)=>{var r=V();e.exports={bgcolor:{valType:"color",dflt:r.background,editType:"plot"},bordercolor:{valType:"color",dflt:r.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),ua=f((t,e)=>{e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}),ca=f((t,e)=>{e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}),ha=f(t=>{var e=ye(),r=Ae(),n=ca(),i=ke().LINE_SPACING,a=n.name;function o(t){var e=t&&t[a];return e&&e.visible}t.isVisible=o,t.makeData=function(t){for(var r=e.list({_fullLayout:t},"x",!0),n=t.margin,i=[],s=0;s<r.length;s++){var l=r[s];if(o(l)){i.push(l);var u=l[a];u._id=a+l._id,u._height=(t.height-n.b-n.t)*u.thickness,u._offsetShift=Math.floor(u.borderwidth/2)}}t._rangeSliderData=i},t.autoMarginOpts=function(t,e){var o=t._fullLayout,s=e[a],l=e._id.charAt(0),u=0,c=0;return"bottom"===e.side&&(u=e._depth,e.title.text!==o._dfltTitle[l])&&(c=1.5*e.title.font.size+10+s._offsetShift,c+=(e.title.text.match(r.BR_TAG_ALL)||[]).length*e.title.font.size*i),{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:s._height+u+Math.max(o.margin.b,c),pad:n.extraPad+2*s._offsetShift}}}),fa=f((t,e)=>{var r=oe(),n=me(),i=ye(),a=la(),o=ua();e.exports=function(t,e,s){var l=t[s],u=e[s];if(l.rangeslider||e._requestRangeslider[u._id]){r.isPlainObject(l.rangeslider)||(l.rangeslider={});var c,h,f=l.rangeslider,p=n.newContainer(u,"rangeslider");if(b("visible")){b("bgcolor",e.plot_bgcolor),b("bordercolor"),b("borderwidth"),b("thickness"),b("autorange",!u.isValidRange(f.range)),b("range");var d=e._subplots;if(d)for(var m=d.cartesian.filter(function(t){return t.substr(0,t.indexOf("y"))===i.name2id(s)}).map(function(t){return t.substr(t.indexOf("y"),t.length)}),g=r.simpleMap(m,i.id2name),y=0;y<g.length;y++){var v=g[y];c=f[v]||{},h=n.newContainer(p,v,"yaxis");var x,_=e[v];c.range&&_.isValidRange(c.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",_.range.slice())}p._input=f}}function b(t,e){return r.coerce(f,p,a,t,e)}function w(t,e){return r.coerce(c,h,o,t,e)}}}),pa=f((t,e)=>{var r=ye().list,n=er().getAutoRange,i=ca();e.exports=function(t){for(var e=r(t,"x",!0),a=0;a<e.length;a++){var o=e[a],s=o[i.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=n(t,o))}}}),da=f((t,e)=>{var r=v(),n=Ut(),i=we(),a=oe(),o=a.strTranslate,s=Je(),l=q(),u=Ke(),c=Ai(),h=ye(),f=cr(),p=hr(),d=ca();function m(t){return"number"==typeof t.clientX?t.clientX:t.touches&&t.touches.length>0?t.touches[0].clientX:0}function g(t,e,r,n){var i=a.ensureSingle(t,"rect",d.bgClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),u=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,c=-n._offsetShift,h=s.crispRound(e,n.borderwidth);i.attr({width:n._width+u,height:n._height+u,transform:o(c,c),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(t,e,r,n){var i=e._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,function(t){t.append("rect").attr({x:0,y:0})}).select("rect").attr({width:n._width,height:n._height})}function x(t,e,n,o){var l,u=e.calcdata,f=t.selectAll("g."+d.rangePlotClassName).data(n._subplotsWith,a.identity);f.enter().append("g").attr("class",function(t){return d.rangePlotClassName+" "+t}).call(s.setClipUrl,o._clipId,e),f.order(),f.exit().remove(),f.each(function(t,a){var s=r.select(this),f=0===a,p=h.getFromId(e,t,"y"),d=p._name,m=o[d],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[d]={type:p.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(g.layout[d].rangebreaks=p.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:t,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};f?l=x:(x.mainplot="xy",x.mainplotinfo=l),c.rangePlot(e,x,function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}(u,t))})}function _(t,e,r,n,i){a.ensureSingle(t,"rect",d.maskMinClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(l.fill,d.maskColor),a.ensureSingle(t,"rect",d.maskMaxClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(l.fill,d.maskColor),"match"!==i.rangemode&&(a.ensureSingle(t,"rect",d.maskMinOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).call(l.fill,d.maskOppAxisColor),a.ensureSingle(t,"rect",d.maskMaxOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).style("border-top",d.maskOppBorder).call(l.fill,d.maskOppAxisColor))}function b(t,e,r,n){e._context.staticPlot||a.ensureSingle(t,"rect",d.slideBoxClassName,function(t){t.attr({y:0,cursor:d.slideBoxCursor,"shape-rendering":"crispEdges"})}).attr({height:n._height,fill:d.slideBoxFill})}function w(t,e,r,n){var i=a.ensureSingle(t,"g",d.grabberMinClassName),o=a.ensureSingle(t,"g",d.grabberMaxClassName),s={x:0,width:d.handleWidth,rx:d.handleRadius,fill:l.background,stroke:l.defaultLine,"stroke-width":d.handleStrokeWidth,"shape-rendering":"crispEdges"},u={y:Math.round(n._height/4),height:Math.round(n._height/2)};a.ensureSingle(i,"rect",d.handleMinClassName,function(t){t.attr(s)}).attr(u),a.ensureSingle(o,"rect",d.handleMaxClassName,function(t){t.attr(s)}).attr(u);var c={width:d.grabAreaWidth,x:0,y:0,fill:d.grabAreaFill,cursor:e._context.staticPlot?void 0:d.grabAreaCursor};a.ensureSingle(i,"rect",d.grabAreaMinClassName,function(t){t.attr(c)}).attr("height",n._height),a.ensureSingle(o,"rect",d.grabAreaMaxClassName,function(t){t.attr(c)}).attr("height",n._height)}e.exports=function(t){for(var e=t._fullLayout,i=e._rangeSliderData,s=0;s<i.length;s++){var l=i[s][d.name];l._clipId=l._id+"-"+e._uid}var c=e._infolayer.selectAll("g."+d.containerClassName).data(i,function(t){return t._name});c.exit().each(function(t){var r=t[d.name];e._topdefs.select("#"+r._clipId).remove()}).remove(),0!==i.length&&(c.enter().append("g").classed(d.containerClassName,!0).attr("pointer-events","all"),c.each(function(i){var s=r.select(this),l=i[d.name],c=e[h.id2name(i.anchor)],v=l[h.id2name(i.anchor)];if(l.range){var T,k=a.simpleMap(l.range,i.r2l),A=a.simpleMap(i.range,i.r2l);T=A[0]<A[1]?[Math.min(k[0],A[0]),Math.max(k[1],A[1])]:[Math.max(k[0],A[0]),Math.min(k[1],A[1])],l.range=l._input.range=a.simpleMap(T,i.l2r)}i.cleanRange("rangeslider.range");var M=e._size,S=i.domain;l._width=M.w*(S[1]-S[0]);var E=Math.round(M.l+M.w*S[0]),C=Math.round(M.t+M.h*(1-i._counterDomainMin)+("bottom"===i.side?i._depth:0)+l._offsetShift+d.extraPad);s.attr("transform",o(E,C)),l._rl=a.simpleMap(l.range,i.r2l);var I=l._rl[0],L=l._rl[1],P=L-I;if(l.p2d=function(t){return t/l._width*P+I},l.d2p=function(t){return(t-I)/P*l._width},i.rangebreaks){var z=i.locateBreaks(I,L);if(z.length){var O,D,R=0;for(O=0;O<z.length;O++)R+=(D=z[O]).max-D.min;var F=l._width/(L-I-R),B=[-F*I];for(O=0;O<z.length;O++)D=z[O],B.push(B[B.length-1]-F*(D.max-D.min));for(l.d2p=function(t){for(var e=B[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.max)e=B[r+1];else if(t<n.min)break}return e+F*t},O=0;O<z.length;O++)(D=z[O]).pmin=l.d2p(D.min),D.pmax=l.d2p(D.max);l.p2d=function(t){for(var e=B[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.pmax)e=B[r+1];else if(t<n.pmin)break}return(t-e)/F}}}if("match"!==v.rangemode){var N=c.r2l(v.range[0]),j=c.r2l(v.range[1])-N;l.d2pOppAxis=function(t){return(t-N)/j*l._height}}s.call(g,t,i,l).call(y,t,i,l).call(x,t,i,l).call(_,t,i,l,v).call(b,t,i,l).call(w,t,i,l),function(t,e,i,o){if(!e._context.staticPlot){var s=t.select("rect."+d.slideBoxClassName).node(),l=t.select("rect."+d.grabAreaMinClassName).node(),u=t.select("rect."+d.grabAreaMaxClassName).node();t.on("mousedown",c),t.on("touchstart",c)}function c(){var c=r.event,h=c.target,d=m(c),g=d-t.node().getBoundingClientRect().left,y=o.d2p(i._rl[0]),v=o.d2p(i._rl[1]),x=f.coverSlip();function _(t){var c,f,_,b=+m(t)-d;switch(h){case s:if(_="ew-resize",y+b>i._length||v+b<0)return;c=y+b,f=v+b;break;case l:if(_="col-resize",y+b>i._length)return;c=y+b,f=v;break;case u:if(_="col-resize",v+b<0)return;c=y,f=v+b;break;default:_="ew-resize",c=g,f=g+b}if(f<c){var w=f;f=c,c=w}o._pixelMin=c,o._pixelMax=f,p(r.select(x),_),function(t,e,r,i){function o(t){return r.l2r(a.constrain(t,i._rl[0],i._rl[1]))}var s=o(i.p2d(i._pixelMin)),l=o(i.p2d(i._pixelMax));window.requestAnimationFrame(function(){n.call("_guiRelayout",e,r._name+".range",[s,l])})}(0,e,i,o)}function b(){x.removeEventListener("mousemove",_),x.removeEventListener("mouseup",b),this.removeEventListener("touchmove",_),this.removeEventListener("touchend",b),a.removeElement(x)}this.addEventListener("touchmove",_),this.addEventListener("touchend",b),x.addEventListener("mousemove",_),x.addEventListener("mouseup",b)}}(s,t,i,l),function(t,e,r,n,i,s){var l=d.handleWidth/2;function u(t){return a.constrain(t,0,n._width)}function c(t){return a.constrain(t,0,n._height)}function h(t){return a.constrain(t,-l,n._width+l)}var f=u(n.d2p(r._rl[0])),p=u(n.d2p(r._rl[1]));if(t.select("rect."+d.slideBoxClassName).attr("x",f).attr("width",p-f),t.select("rect."+d.maskMinClassName).attr("width",f),t.select("rect."+d.maskMaxClassName).attr("x",p).attr("width",n._width-p),"match"!==s.rangemode){var m=n._height-c(n.d2pOppAxis(i._rl[1])),g=n._height-c(n.d2pOppAxis(i._rl[0]));t.select("rect."+d.maskMinOppAxisClassName).attr("x",f).attr("height",m).attr("width",p-f),t.select("rect."+d.maskMaxOppAxisClassName).attr("x",f).attr("y",g).attr("height",n._height-g).attr("width",p-f),t.select("rect."+d.slideBoxClassName).attr("y",m).attr("height",g-m)}var y=.5,v=Math.round(h(f-l))-y,x=Math.round(h(p-l))+y;t.select("g."+d.grabberMinClassName).attr("transform",o(v,y)),t.select("g."+d.grabberMaxClassName).attr("transform",o(x,y))}(s,0,i,l,c,v),"bottom"===i.side&&u.draw(t,i._id+"title",{propContainer:i,propName:i._name+".title",placeholder:e._dfltTitle.x,attributes:{x:i._offset+i._length/2,y:C+l._height+l._offsetShift+10+1.5*i.title.font.size,"text-anchor":"middle"}})}))}}),ma=f((t,e)=>{var r=oe(),n=la(),i=ua(),a=ha();e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:r.extendFlat({},n,{yaxis:i})}}},layoutAttributes:la(),handleDefaults:fa(),calcAutorange:pa(),draw:da(),isVisible:a.isVisible,makeData:a.makeData,autoMarginOpts:a.autoMarginOpts}}),ga=f((t,e)=>{var r=R(),n=V(),i=(0,me().templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:r({editType:"plot"}),bgcolor:{valType:"color",dflt:n.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),ya=f((t,e)=>{e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),va=f((t,e)=>{var r=oe(),n=q(),i=me(),a=Fe(),o=ga(),s=ya();function l(t,e,n,i){var a=i.calendar;function s(n,i){return r.coerce(t,e,o.buttons,n,i)}if(s("visible")){var l=s("step");"all"!==l&&(!a||"gregorian"===a||"month"!==l&&"year"!==l?s("stepmode"):e.stepmode="backward",s("count")),s("label")}}e.exports=function(t,e,u,c,h){var f=t.rangeselector||{},p=i.newContainer(e,"rangeselector");function d(t,e){return r.coerce(f,p,o,t,e)}if(d("visible",a(f,p,{name:"buttons",handleItemDefaults:l,calendar:h}).length>0)){var m=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+s.yPad]}(e,u,c);d("x",m[0]),d("y",m[1]),r.noneOrAll(t,e,["x","y"]),d("xanchor"),d("yanchor"),r.coerceFont(d,"font",u.font);var g=d("bgcolor");d("activecolor",n.contrast(g,s.lightAmount,s.darkAmount)),d("bordercolor"),d("borderwidth")}}}),xa=f((t,e)=>{var r=x(),n=oe().titleCase;e.exports=function(t,e){var i=t._name,a={};if("all"===e.step)a[i+".autorange"]=!0;else{var o=function(t,e){var i,a=t.range,o=new Date(t.r2l(a[1])),s=e.step,l=r["utc"+n(s)],u=e.count;switch(e.stepmode){case"backward":i=t.l2r(+l.offset(o,-u));break;case"todate":var c=l.offset(o,-u);i=t.l2r(+l.ceil(c))}var h=a[1];return[i,h]}(t,e);a[i+".range[0]"]=o[0],a[i+".range[1]"]=o[1]}return a}}),_a=f((t,e)=>{var r=v(),n=Ut(),i=we(),a=q(),o=Je(),s=oe(),l=s.strTranslate,u=Ae(),c=ye(),h=ke(),f=h.LINE_SPACING,p=h.FROM_TL,d=h.FROM_BR,m=ya(),g=xa();function y(t){return t._id}function x(t,e,r){var n=s.ensureSingle(t,"rect","selector-rect",function(t){t.attr("shape-rendering","crispEdges")});n.attr({rx:m.rx,ry:m.ry}),n.call(a.stroke,e.bordercolor).call(a.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function _(t,e,r,n){s.ensureSingle(t,"text","selector-text",function(t){t.attr("text-anchor","middle")}).call(o.font,e.font).text(function(t,e){return t.label?e?s.templateString(t.label,e):t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}(r,n._fullLayout._meta)).call(function(t){u.convertToTspans(t,n)})}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=c.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(t),y);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each(function(e){var a=r.select(this),c=e,h=c.rangeselector,y=a.selectAll("g.button").data(s.filterVisible(h.buttons));y.enter().append("g").classed("button",!0),y.exit().remove(),y.each(function(e){var i=r.select(this),a=g(c,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(c,e,a),i.call(x,h,e),i.call(_,h,e,t),i.on("click",function(){t._dragged||n.call("_guiRelayout",t,a)}),i.on("mouseover",function(){e._isHovered=!0,i.call(x,h,e)}),i.on("mouseout",function(){e._isHovered=!1,i.call(x,h,e)})}),function(t,e,n,a,c){var h=0,g=0,y=n.borderwidth;e.each(function(){var t=r.select(this).select(".selector-text"),e=n.font.size*f,i=Math.max(e*u.lineCount(t),16)+3;g=Math.max(g,i)}),e.each(function(){var t=r.select(this),e=t.select(".selector-rect"),i=t.select(".selector-text"),a=i.node()&&o.bBox(i.node()).width,s=n.font.size*f,c=u.lineCount(i),p=Math.max(a+10,m.minButtonWidth);t.attr("transform",l(y+h,y)),e.attr({x:0,y:0,width:p,height:g}),u.positionText(i,p/2,g/2-(c-1)*s/2+3),h+=p+5});var v=t._fullLayout._size,x=v.l+v.w*n.x,_=v.t+v.h*(1-n.y),b="left";s.isRightAnchor(n)&&(x-=h,b="right"),s.isCenterAnchor(n)&&(x-=h/2,b="center");var w="top";s.isBottomAnchor(n)&&(_-=g,w="bottom"),s.isMiddleAnchor(n)&&(_-=g/2,w="middle"),h=Math.ceil(h),g=Math.ceil(g),x=Math.round(x),_=Math.round(_),i.autoMargin(t,a+"-range-selector",{x:n.x,y:n.y,l:h*p[b],r:h*d[b],b:g*d[w],t:g*p[w]}),c.attr("transform",l(x,_))}(t,y,h,c._name,a)})}}),ba=f((t,e)=>{e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:ga()}}},layoutAttributes:ga(),handleDefaults:va(),draw:_a()}}),wa=f(t=>{var e=D().extendFlat;t.attributes=function(t,r){r=r||{};var n={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]};t.name&&t.name,t.trace,r.description&&r.description;var i={x:e({},n,{}),y:e({},n,{}),editType:t.editType};return t.noGridCell||(i.row={valType:"integer",min:0,dflt:0,editType:t.editType},i.column={valType:"integer",min:0,dflt:0,editType:t.editType}),i},t.defaults=function(t,e,r,n){var i=n&&n.x||[0,1],a=n&&n.y||[0,1],o=e.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?i=o._domains.x[s]:delete t.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?a=o._domains.y[l]:delete t.domain.row)}var u=r("domain.x",i),c=r("domain.y",a);u[0]<u[1]||(t.domain.x=i.slice()),c[0]<c[1]||(t.domain.y=a.slice())}}),Ta=f((t,e)=>{var r=oe(),n=G().counter,i=wa().attributes,a=ge().idRegex,o=me(),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[n("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function l(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),u=s[0],c=(s[1]-u)/(i-o),h=c*(1-o),f=0;f<i;f++){var p=u+c*f;l[a?i-1-f:f]=[p,p+h]}return l}function c(t,e,r,n,i){var a,o=new Array(r);function s(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(a=0;a<r;a++)s(a,t[a]);else for(s(0,i),a=1;a<r;a++)s(a,i+(a+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(t,e){var n=t.grid||{},i=l(e,n,"x"),a=l(e,n,"y");if(t.grid||i||a){var c,h,f=Array.isArray(n.subplots)&&Array.isArray(n.subplots[0]),p=Array.isArray(i),d=Array.isArray(a),m=p&&i!==n.xaxes&&d&&a!==n.yaxes;f?(c=n.subplots.length,h=n.subplots[0].length):(d&&(c=a.length),p&&(h=i.length));var g=o.newContainer(e,"grid"),y=k("rows",c),v=k("columns",h);if(y*v>1){f||p||d||"independent"===k("pattern")&&(f=!0),g._hasSubplotGrid=f;var x,_,b="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:u("x",k,w,x,v),y:u("y",k,T,_,y,b)}}else delete e.grid}function k(t,e){return r.coerce(n,g,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,u,h,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var x=f.subplots||[];u=r.subplots=new Array(m);var _=1;for(n=0;n<m;n++){var b=u[n]=new Array(g),w=x[n]||[];for(i=0;i<g;i++)if(y?(s=1===_?"xy":"x"+_+"y"+_,_++):s=w[i],b[i]="",-1!==p.cartesian.indexOf(s)){if(h=s.indexOf("y"),a=s.slice(0,h),o=s.slice(h),void 0!==v[a]&&v[a]!==i||void 0!==v[o]&&v[o]!==n)continue;b[i]=s,v[a]=i,v[o]=n}}}else{var T=l(e,f,"x"),k=l(e,f,"y");r.xaxes=c(T,p.xaxis,g,v,"x"),r.yaxes=c(k,p.yaxis,m,v,"y")}var A=r._anchors={},M="top to bottom"===r.roworder;for(var S in v){var E,C,I,L=S.charAt(0),P=r[L+"side"];if(P.length<8)A[S]="free";else if("x"===L){if("t"===P.charAt(0)===M?(E=0,C=1,I=m):(E=m-1,C=-1,I=-1),d){var z=v[S];for(n=E;n!==I;n+=C)if((s=u[n][z])&&(h=s.indexOf("y"),s.slice(0,h)===S)){A[S]=s.slice(h);break}}else for(n=E;n!==I;n+=C)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(S+o)){A[S]=o;break}}else if("l"===P.charAt(0)?(E=0,C=1,I=g):(E=g-1,C=-1,I=-1),d){var O=v[S];for(n=E;n!==I;n+=C)if((s=u[O][n])&&(h=s.indexOf("y"),s.slice(h)===S)){A[S]=s.slice(0,h);break}}else for(n=E;n!==I;n+=C)if(a=r.xaxes[n],-1!==p.cartesian.indexOf(a+S)){A[S]=a;break}}}}}}),ka=f((t,e)=>{e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}),Aa=f((t,e)=>{var r=T(),n=Ut(),i=oe(),a=me(),o=ka();e.exports=function(t,e,s,l){var u="error_"+l.axis,c=a.newContainer(e,u),h=t[u]||{};function f(t,e){return i.coerce(h,c,o,t,e)}if(!1!==f("visible",void 0!==h.array||void 0!==h.value||"sqrt"===h.type)){var p=f("type","array"in h?"data":"percent"),d=!0;"sqrt"!==p&&(d=f("symmetric",!(("data"===p?"arrayminus":"valueminus")in h))),"data"===p?(f("array"),f("traceref"),d||(f("arrayminus"),f("tracerefminus"))):("percent"===p||"constant"===p)&&(f("value"),d||f("valueminus"));var m="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&f(m,!(h.color||r(h.thickness)||r(h.width))),(!l.inherit||!c[m])&&(f("color",s),f("thickness"),f("width",n.traceIs(e,"gl3d")?0:4))}}}),Ma=f((t,e)=>{function r(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,n=t.symmetric;if("data"===e){var i=t.array||[];if(n)return function(t,e){var r=+i[e];return[r,r]};var a=t.arrayminus||[];return function(t,e){var r=+i[e],n=+a[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=r(e,t.value),s=r(e,t.valueminus);return n||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}}),Sa=f((t,e)=>{var r=T(),n=Ut(),i=rr(),a=oe(),o=Ma();function s(t,e,n,s){var l=e["error_"+s]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(n.type)){for(var c=o(l),h=0;h<t.length;h++){var f=t[h],p=f.i;if(void 0===p)p=h;else if(null===p)continue;var d=f[s];if(r(n.c2l(d))){var m=c(d,p);if(r(m[0])&&r(m[1])){var g=f[s+"s"]=d-m[0],y=f[s+"h"]=d+m[1];u.push(g,y)}}}var v=n._id,x=e._extremes[v],_=i.findExtremes(n,u,a.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(_.min),x.max=x.max.concat(_.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var a=e[r],o=a[0].trace;if(!0===o.visible&&n.traceIs(o,"errorBarsOK")){var l=i.getFromId(t,o.xaxis),u=i.getFromId(t,o.yaxis);s(a,o,l,"x"),s(a,o,u,"y")}}}}),Ea=f((t,e)=>{var r=v(),n=T(),i=Je(),a=Ze();e.exports=function(t,e,o,s){var l=o.xaxis,u=o.yaxis,c=s&&s.duration>0,h=t._context.staticPlot;e.each(function(e){var f,p=e[0].trace,d=p.error_x||{},m=p.error_y||{};p.ids&&(f=function(t){return t.id});var g=a.hasMarkers(p)&&p.marker.maxdisplayed>0;!m.visible&&!d.visible&&(e=[]);var y=r.select(this).selectAll("g.errorbar").data(e,f);if(y.exit().remove(),e.length){d.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,t),y.each(function(t){var e=r.select(this),i=function(t,e,r){var i={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(i.yh=r.c2p(t.yh),i.ys=r.c2p(t.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(i.xh=e.c2p(t.xh),i.xs=e.c2p(t.xs),n(i.xs)||(i.noXS=!0,i.xs=e.c2p(t.xs,!0))),i}(t,l,u);if(!g||t.vis){var a,o=e.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var f=m.width;a="M"+(i.x-f)+","+i.yh+"h"+2*f+"m-"+f+",0V"+i.ys,i.noYS||(a+="m-"+f+",0h"+2*f),o.size()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var p=e.select("path.xerror");if(d.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(d.copy_ystyle?m:d).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),p.size()?c&&(p=p.transition().duration(s.duration).ease(s.easing)):p=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),p.attr("d",a)}else p.remove()}})}})}}),Ca=f((t,e)=>{var r=v(),n=q();e.exports=function(t){t.each(function(t){var e=t[0].trace,i=e.error_y||{},a=e.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)})}}),Ia=f((t,e)=>{var r=oe(),n=Lt().overrideAll,i=ka(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Aa(),calc:Sa(),makeComputeError:Ma(),plot:Ea(),style:Ca(),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}}),La=f((t,e)=>{e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}),Pa=f((t,e)=>{var r=v(),n=O(),i=we(),a=Ut(),o=rr(),s=cr(),l=oe(),u=l.strTranslate,c=D().extendFlat,h=hr(),f=Je(),p=q(),d=Ke(),m=Ae(),g=Me().flipScale,y=bi(),x=wi(),_=Ee(),b=ke(),w=b.LINE_SPACING,T=b.FROM_TL,k=b.FROM_BR,A=La().cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return c(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var h=0;h<o.length;h++){var f=o[h];if((n=f[0].trace)._module){var p=n._module.colorbar;if(!0===n.visible&&p)for(var d=Array.isArray(p),m=d?p:[p],y=0;y<m.length;y++){var v=(i=m[y]).container;(r=v?n[v]:n)&&r.showscale&&((e=l(r.colorbar))._id="cb"+n.uid+(d&&v?"-"+v:""),e._traceIndex=n.index,e._propPrefix=(v?v+".":"")+"colorbar.",e._meta=n._meta,u(),s.push(e))}}}for(var x in a._colorAxes)if((r=a[x]).showscale){var _=a._colorAxes[x];(e=l(r.colorbar))._id="cb"+x,e._propPrefix=x+".colorbar.",e._meta=a._meta,i={min:"cmin",max:"cmax"},"heatmap"!==_[0]&&(n=_[1],i.calc=n._module.colorbar.calc),u(),s.push(e)}return s}(t),function(t){return t._id});e.enter().append("g").attr("class",function(t){return t._id}).classed(A.colorbar,!0),e.each(function(e){var g=r.select(this);l.ensureSingle(g,"rect",A.cbbg),l.ensureSingle(g,"g",A.cbfills),l.ensureSingle(g,"g",A.cblines),l.ensureSingle(g,"g",A.cbaxis,function(t){t.classed(A.crisp,!0)}),l.ensureSingle(g,"g",A.cbtitleunshift,function(t){t.append("g").classed(A.cbtitle,!0)}),l.ensureSingle(g,"rect",A.cboutline);var v=function(t,e,a){var s="v"===e.orientation,h=e.len,g=e.lenmode,v=e.thickness,b=e.thicknessmode,M=e.outlinewidth,S=e.borderwidth,E=e.bgcolor,C=e.xanchor,I=e.yanchor,L=e.xpad,P=e.ypad,z=e.x,O=s?e.y:1-e.y,D="paper"===e.yref,R="paper"===e.xref,F=a._fullLayout,B=F._size,N=e._fillcolor,j=e._line,U=e.title,V=U.side,q=e._zrange||r.extent(("function"==typeof N?N:j.color).domain()),H="function"==typeof j.color?j.color:function(){return j.color},G="function"==typeof N?N:function(){return N},Z=e._levels,W=function(t,e,r){var n,i,a=e._levels,o=[],s=[],l=a.end+a.size/100,u=a.size,c=1.001*r[0]-.001*r[1],h=1.001*r[1]-.001*r[0];for(i=0;i<1e5&&(n=a.start+i*u,!(u>0?n>=l:n<=l));i++)n>c&&n<h&&o.push(n);if(e._fillgradient)s=[0];else if("function"==typeof e._fillcolor){var f=e._filllevels;if(f)for(l=f.end+f.size/100,u=f.size,i=0;i<1e5&&(n=f.start+i*u,!(u>0?n>=l:n<=l));i++)n>r[0]&&n<r[1]&&s.push(n);else s=o.map(function(t){return t-a.size/2}),s.push(s[s.length-1]+a.size)}else e._fillcolor&&"string"==typeof e._fillcolor&&(s=[0]);return a.size<0&&(o.reverse(),s.reverse()),{line:o,fill:s}}(0,e,q),Y=W.fill,X=W.line,$=Math.round(v*("fraction"===b?s?B.w:B.h:1)),J=$/(s?B.w:B.h),K=Math.round(h*("fraction"===g?s?B.h:B.w:1)),Q=K/(s?B.h:B.w),tt=R?B.w:a._fullLayout.width,et=D?B.h:a._fullLayout.height,rt=Math.round(s?z*tt+L:O*et+P),nt={center:.5,right:1}[C]||0,it={top:1,middle:.5}[I]||0,at=s?z-nt*J:O-it*J,ot=s?O-it*Q:z-nt*Q,st=Math.round(s?et*(1-ot):tt*ot);e._lenFrac=Q,e._thickFrac=J,e._uFrac=at,e._vFrac=ot;var lt=e._axis=function(t,e,r){var n=t._fullLayout,i="v"===e.orientation,a={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,labelalias:e.labelalias,ticklabelposition:e.ticklabelposition,ticklabeloverflow:e.ticklabeloverflow,ticklabelstep:e.ticklabelstep,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,minexponent:e.minexponent,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:i?"right":"bottom",position:1},o=i?"y":"x",s={type:"linear",_id:o+e._id},u={letter:o,font:n.font,noAutotickangles:"y"===o,noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:n.calendar};function c(t,e){return l.coerce(a,s,_,t,e)}return y(a,s,c,u,n),x(a,s,c,u),s}(a,e,q);lt.position=J+(s?z+L/B.w:O+P/B.h);var ut=-1!==["top","bottom"].indexOf(V);if(s&&ut&&(lt.title.side=V,lt.titlex=z+L/B.w,lt.titley=ot+("top"===U.side?Q-P/B.h:P/B.h)),!s&&!ut&&(lt.title.side=V,lt.titley=O+P/B.h,lt.titlex=ot+L/B.w),j.color&&"auto"===e.tickmode){lt.tickmode="linear",lt.tick0=Z.start;var ct=Z.size,ht=l.constrain(K/50,4,15)+1,ft=(q[1]-q[0])/((e.nticks||ht)*ct);if(ft>1){var pt=Math.pow(10,Math.floor(Math.log(ft)/Math.LN10));ct*=pt*l.roundUp(ft/pt,[2,5,10]),(Math.abs(Z.start)/Z.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ct}lt.domain=s?[ot+P/B.h,ot+Q-P/B.h]:[ot+L/B.w,ot+Q-L/B.w],lt.setScale(),t.attr("transform",u(Math.round(B.l),Math.round(B.t)));var dt,mt=t.select("."+A.cbtitleunshift).attr("transform",u(-Math.round(B.l),-Math.round(B.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,vt=t.select("."+A.cbaxis),xt=0,_t=0;function bt(r,n){var i={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;t.selectAll("."+o+",."+o+"-math-group").remove(),d.draw(a,r,c(i,n||{}))}function wt(){var t,e;(s&&ut||!s&&!ut)&&("top"===V&&(t=L+B.l+tt*z,e=P+B.t+et*(1-ot-Q)+3+.75*yt),"bottom"===V&&(t=L+B.l+tt*z,e=P+B.t+et*(1-ot)-3-.25*yt),"right"===V&&(e=P+B.t+et*O+3+.75*yt,t=L+B.l+tt*ot),bt(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":s?"start":"middle"}}))}function Tt(){if(s&&!ut||!s&&ut){var t,n,i=lt.position||0,o=lt._offset+lt._length/2;if("right"===V)n=o,t=B.l+tt*i+10+yt*(lt.showticklabels?1:.5);else if(t=o,"bottom"===V&&(n=B.t+et*i+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("inside"!==lt.ticks&&e.ticklen||0)),"top"===V){var l=U.text.split("<br>").length;n=B.t+et*i+10-$-w*yt*l}bt((s?"h":"v")+lt._id+"title",{avoid:{selection:r.select(a).selectAll("g."+lt._id+"tick"),side:V,offsetTop:s?0:B.t,offsetLeft:s?B.l:0,maxShift:s?F.width:F.height},attributes:{x:t,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}}function kt(){if(!s&&!ut||s&&ut){var i,c=t.select("."+A.cbtitle),h=c.select("text"),p=[-M/2,M/2],d=c.select(".h"+lt._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),d?(i=f.bBox(d),_t=i.width,(xt=i.height)>g&&(p[1]-=(xt-g)/2)):h.node()&&!h.classed(A.jsPlaceholder)&&(i=f.bBox(h.node()),_t=i.width,xt=i.height),s){if(xt){if(xt+=5,"top"===V)lt.domain[1]-=xt/B.h,p[1]*=-1;else{lt.domain[0]+=xt/B.h;var y=m.lineCount(h);p[1]+=(1-y)*g}c.attr("transform",u(p[0],p[1])),lt.setScale()}}else _t&&("right"===V&&(lt.domain[0]+=(_t+yt/2)/B.w),c.attr("transform",u(p[0],p[1])),lt.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",s?u(0,Math.round(B.h*(1-lt.domain[1]))):u(Math.round(B.w*lt.domain[0]),0)),vt.attr("transform",s?u(0,Math.round(-B.t)):u(Math.round(-B.l),0));var v=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(Y);v.enter().append("rect").classed(A.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(lt.c2p).map(Math.round).sort(function(t,e){return t-e});v.each(function(t,i){var o=[0===i?q[0]:(Y[i]+Y[i-1])/2,i===Y.length-1?q[1]:(Y[i]+Y[i+1])/2].map(lt.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var u=r.select(this).attr(s?"x":"y",rt).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(e._fillgradient)f.gradient(u,a,e._id,s?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var c=G(t).replace("e-","");u.attr("fill",n(c).toHexString())}});var _=t.select("."+A.cblines).selectAll("path."+A.cbline).data(j.color&&j.width?X:[]);_.enter().append("path").classed(A.cbline,!0),_.exit().remove(),_.each(function(t){var e=rt,n=Math.round(lt.c2p(t))+j.width/2%1;r.select(this).attr("d","M"+(s?e+","+n:n+","+e)+(s?"h":"v")+$).call(f.lineGroupStyle,j.width,H(t),j.dash)}),vt.selectAll("g."+lt._id+"tick,path").remove();var b=rt+$+(M||0)/2-("outside"===e.ticks?1:0),T=o.calcTicks(lt),k=o.getTickSigns(lt)[2];return o.drawTicks(a,lt,{vals:"inside"===lt.ticks?o.clipEnds(lt,T):T,layer:vt,path:o.makeTickPath(lt,b,k),transFn:o.makeTransTickFn(lt)}),o.drawLabels(a,lt,{vals:T,layer:vt,transFn:o.makeTransTickLabelFn(lt),labelFns:o.makeLabelFns(lt,b)})}function At(){var r,o=$+M/2;-1===gt.indexOf("inside")&&(r=f.bBox(vt.node()),o+=s?r.width:r.height),dt=mt.select("text");var l=0,c=s&&"top"===V,d=!s&&"right"===V,m=0;if(dt.node()&&!dt.classed(A.jsPlaceholder)){var y,x=mt.select(".h"+lt._id+"title-math-group").node();x&&(s&&ut||!s&&!ut)?(l=(r=f.bBox(x)).width,y=r.height):(l=(r=f.bBox(mt.node())).right-B.l-(s?rt:st),y=r.bottom-B.t-(s?st:rt),!s&&"top"===V&&(o+=r.height,m=r.height)),d&&(dt.attr("transform",u(l/2+yt/2,0)),l*=2),o=Math.max(o,s?l:y)}var _=2*(s?L:P)+o+S+M/2,w=0;!s&&U.text&&"bottom"===I&&O<=0&&(_+=w=_/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var N=S+M,j=(s?rt:st)-N/2-(s?L:0),q=(s?st:rt)-(s?K:P+m-w);t.select("."+A.cbbg).attr("x",j).attr("y",q).attr(s?"width":"height",Math.max(_-w,2)).attr(s?"height":"width",Math.max(K+N,2)).call(p.fill,E).call(p.stroke,e.bordercolor).style("stroke-width",S);var H=d?Math.max(l-10,0):0;t.selectAll("."+A.cboutline).attr("x",(s?rt:st+L)+H).attr("y",(s?st+P-K:rt)+(c?xt:0)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(K-(s?2*P+xt:2*L+H),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":M});var G=s?nt*_:0,Z=s?0:(1-it)*_-m;if(G=R?B.l-G:-G,Z=D?B.t-Z:-Z,t.attr("transform",u(G,Z)),!s&&(S||n(E).getAlpha()&&!n.equals(F.paper_bgcolor,E))){var W=vt.selectAll("text"),Y=W[0].length,X=t.select("."+A.cbbg).node(),J=f.bBox(X),Q=f.getTranslate(t),tt=2;W.each(function(t,e){var r=0,n=Y-1;if(e===r||e===n){var i,a=f.bBox(this),o=f.getTranslate(this);if(e===n){var s=a.right+o.x;(i=J.right+Q.x+st-S-tt+z-s)>0&&(i=0)}else if(e===r){var l=a.left+o.x;(i=J.left+Q.x+st+S+tt-l)<0&&(i=0)}i&&(Y<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var et={},at=T[C],ot=k[C],ct=T[I],ht=k[I],ft=_-$;s?("pixels"===g?(et.y=O,et.t=K*ct,et.b=K*ht):(et.t=et.b=0,et.yt=O+h*ct,et.yb=O-h*ht),"pixels"===b?(et.x=z,et.l=_*at,et.r=_*ot):(et.l=ft*at,et.r=ft*ot,et.xl=z-v*at,et.xr=z+v*ot)):("pixels"===g?(et.x=z,et.l=K*at,et.r=K*ot):(et.l=et.r=0,et.xl=z+h*at,et.xr=z-h*ot),"pixels"===b?(et.y=1-O,et.t=_*ct,et.b=_*ht):(et.t=ft*ct,et.b=ft*ht,et.yt=O-v*ct,et.yb=O+v*ht));var pt=e.y<.5?"b":"t",_t=e.x<.5?"l":"r";a._fullLayout._reservedMargin[e._id]={};var bt={r:F.width-j-G,l:j+et.r,b:F.height-q-Z,t:q+et.b};R&&D?i.autoMargin(a,e._id,et):R?a._fullLayout._reservedMargin[e._id][pt]=bt[pt]:D||s?a._fullLayout._reservedMargin[e._id][_t]=bt[_t]:a._fullLayout._reservedMargin[e._id][pt]=bt[pt]}return l.syncOrAsync([i.previousPromises,wt,kt,Tt,i.previousPromises,At],a)}(g,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,o,l="v"===e.orientation,c=r._fullLayout,f=c._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,a){t.attr("transform",n+u(r,a)),i=s.align((l?e._uFrac:e._vFrac)+r/f.w,l?e._thickFrac:e._lenFrac,0,1,e.xanchor),o=s.align((l?e._vFrac:1-e._uFrac)-a/f.h,l?e._lenFrac:e._thickFrac,0,1,e.yanchor);var c=s.getCursor(i,o,e.xanchor,e.yanchor);h(t,c)},doneFn:function(){if(h(t),void 0!==i&&void 0!==o){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=o,void 0!==e._traceIndex?a.call("_guiRestyle",r,n,e._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,e,t)}),e.exit().each(function(e){i.autoMargin(t,e._id)}).remove(),e.order()}}}),za=f((t,e)=>{e.exports={moduleType:"component",name:"colorbar",attributes:Ce(),supplyDefaults:je(),draw:Pa().draw,hasColorbar:Pe()}}),Oa=f((t,e)=>{e.exports={moduleType:"component",name:"legend",layoutAttributes:pr(),supplyLayoutDefaults:mr(),draw:Tr(),style:wr()}}),Da=f((t,e)=>{e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}),Ra=f((t,e)=>{e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),Fa=f((t,e)=>{var r=Ut(),n=oe(),i=n.extendFlat,a=n.extendDeep;function o(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function s(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}e.exports=function(t,e){var n,l=t.data,u=t.layout,c=a([],l),h=a({},u,o(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var p=Object.keys(h);for(n=0;n<p.length;n++)s(p[n])&&(h[p[n]].title={text:""});for(n=0;n<c.length;n++){var d=c[n];d.showscale=!1,d.marker&&(d.marker.showscale=!1),r.traceIs(d,"pie-like")&&(d.textposition="none")}}if(Array.isArray(e.annotations))for(n=0;n<e.annotations.length;n++)h.annotations.push(e.annotations[n]);var m=Object.keys(h).filter(function(t){return t.match(/^scene\d*$/)});if(m.length){var g={};for("thumbnail"===e.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<m.length;n++){var y=h[m[n]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),i(y.xaxis,g),i(y.yaxis,g),i(y.zaxis,g),y._scene=null}}var v=document.createElement("div");e.tileClass&&(v.className=e.tileClass);var x={gd:v,td:v,layout:h,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return"transparent"!==e.setBackground&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=o(e.tileClass),x}}),Ba=f((t,e)=>{var r=ce().EventEmitter,n=Ut(),i=oe(),a=zn(),o=Fa(),s=On(),l=Dn();e.exports=function(t,e){var u=new r,c=o(t,{format:"png"}),h=c.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var f=a.getRedrawFunc(h);return n.call("_doPlot",h,c.data,c.layout,c.config).then(f).then(function(){var t=a.getDelay(h._fullLayout);setTimeout(function(){var t=s(h),r=document.createElement("canvas");r.id=i.randstr(),(u=l({format:e.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:r,emitter:u,svg:t})).clean=function(){h&&document.body.removeChild(h)}},t)}).catch(function(t){u.emit("error",t)}),u}}),Na=f((t,e)=>{var r=zn(),n={getDelay:r.getDelay,getRedrawFunc:r.getRedrawFunc,clone:Fa(),toSVG:On(),svgToImg:Dn(),toImage:Ba(),downloadImage:Nn()};e.exports=n}),ja=f(t=>{t.version=g().version,y(),se();var e,r,n=Ut(),i=t.register=n.register,a=Un(),o=Object.keys(a);for(r=0;r<o.length;r++)"_"!==(e=o[r]).charAt(0)&&(t[e]=a[e]),i({moduleType:"apiMethod",name:e,fn:a[e]});i(Mi()),i([Oi(),ji(),Mn(),Gi(),$i(),ra(),sa(),ma(),ba(),Ta(),Ia(),Ge(),za(),Oa(),Pr(),Kr()]),i([Da(),Ra()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(i(window.PlotlyLocales),delete window.PlotlyLocales),t.Icons=Dr();var s=Pr(),l=we();t.Plots={resize:l.resize,graphJson:l.graphJson,sendDataToCloud:l.sendDataToCloud},t.Fx={hover:s.hover,unhover:s.unhover,loneHover:s.loneHover,loneUnhover:s.loneUnhover},t.Snapshot=Na(),t.PlotSchema=de()}),Ua=f((t,e)=>{e.exports=ja()}),Va=f((t,e)=>{e.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),qa=f((t,e)=>{var r=bn(),n=Se().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Ot().texttemplateAttrs,o=Ie(),s=R(),l=Va(),u=Pt().pattern,c=D().extendFlat,h=s({editType:"calc",arrayOk:!0,colorEditType:"style"}),f=c({},r.marker.line.width,{dflt:0}),p=c({width:f,editType:"calc"},o("marker.line")),d=c({line:p,editType:"calc"},o("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:u,cornerradius:{valType:"any",editType:"calc"}});e.exports={x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),text:r.text,texttemplate:a({editType:"plot"},{keys:l.eventDataKeys}),hovertext:r.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:c({},h,{}),insidetextfont:c({},h,{}),outsidetextfont:c({},h,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:c({},r.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:d,offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:{marker:{opacity:r.selected.marker.opacity,color:r.selected.marker.color,editType:"style"},textfont:r.selected.textfont,editType:"style"},unselected:{marker:{opacity:r.unselected.marker.opacity,color:r.unselected.marker.color,editType:"style"},textfont:r.unselected.textfont,editType:"style"},zorder:r.zorder}}),Ha=f((t,e)=>{e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}),Ga=f((t,e)=>{var r=q(),n=Me().hasColorscale,i=Ue(),a=oe().coercePattern;e.exports=function(t,e,o,s,l){var u=o("marker.color",s),c=n(t,"marker");c&&i(t,e,l,o,{prefix:"marker.",cLetter:"c"}),o("marker.line.color",r.defaultLine),n(t,"marker.line")&&i(t,e,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width"),o("marker.opacity"),a(o,"marker.pattern",u,c),o("selected.marker.color"),o("unselected.marker.color")}}),Za=f((t,e)=>{var r=T(),n=oe(),i=q(),a=Ut(),o=Vn(),s=qn(),l=Ga(),u=Jn(),c=qa(),h=n.coerceFont;function f(t){if(r(t)){if((t=+t)>=0)return t}else if("string"==typeof t&&"%"===(t=t.trim()).slice(-1)&&r(t.slice(0,-1))&&(t=+t.slice(0,-1))>=0)return t+"%"}function p(t,e,r,i,a,o){var s=!1!==(o=o||{}).moduleHasSelected,l=!1!==o.moduleHasUnselected,u=!1!==o.moduleHasConstrain,c=!1!==o.moduleHasCliponaxis,f=!1!==o.moduleHasTextangle,p=!1!==o.moduleHasInsideanchor,d=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),_=!(t.textfont&&t.textfont.color);if(_&&delete x.color,h(i,"insidetextfont",x),d){var b=n.extendFlat({},v);_&&delete b.color,h(i,"pathbar.textfont",b)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),u&&i("constraintext"),c&&i("cliponaxis"),f&&i("textangle"),i("texttemplate")}g&&p&&i("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,u){function h(r,i){return n.coerce(t,e,c,r,i)}if(o(t,e,u,h)){s(t,e,u,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",e.x&&!e.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate");var f=h("textposition");p(t,0,u,h,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,h,r,u);var d=(e.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(t,e,d||i.defaultLine,{axis:"y"}),m(t,e,d||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function a(t,e){return n.coerce(i._input,i,c,t,e)}for(var o=0;o<t.length;o++)if("bar"===(i=t[o]).type){r=i._input;var s=a("marker.cornerradius",e.barcornerradius);i.marker&&(i.marker.cornerradius=f(s)),u(r,i,e,a,e.barmode)}},handleText:p,validateCornerradius:f}}),Wa=f((t,e)=>{var r=Ut(),n=rr(),i=oe(),a=Ha(),o=Za().validateCornerradius;e.exports=function(t,e,s){function l(r,n){return i.coerce(t,e,a,r,n)}for(var u=!1,c=!1,h=!1,f={},p=l("barmode"),d="group"===p,m=0;m<s.length;m++){var g=s[m];if(r.traceIs(g,"bar")&&g.visible){u=!0;var y=g.xaxis+g.yaxis;d?(f[y]&&(h=!0),f[y]=!0):(y+=g._input.offsetgroup,f.length>0&&!f[y]&&(h=!0),f[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:e},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}if(u){"overlay"!==p&&l("barnorm"),l("bargap",c&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");e.barcornerradius=o(v)}else delete e.barmode}}),Ya=f((t,e)=>{var r=oe();e.exports=function(t,e){for(var n=0;n<t.length;n++)t[n].i=n;r.mergeArray(e.text,t,"tx"),r.mergeArray(e.hovertext,t,"htx");var i=e.marker;if(i){r.mergeArray(i.opacity,t,"mo",!0),r.mergeArray(i.color,t,"mc");var a=i.line;a&&(r.mergeArray(a.color,t,"mlc"),r.mergeArrayCastPositive(a.width,t,"mlw"))}}}),Xa=f((t,e)=>{var r=rr(),n=ti(),i=Me().hasColorscale,a=He(),o=Ya(),s=ni();e.exports=function(t,e){var l,u,c,h,f,p,d=r.getFromId(t,e.xaxis||"x"),m=r.getFromId(t,e.yaxis||"y"),g={msUTC:!(!e.base&&0!==e.base)};"h"===e.orientation?(l=d.makeCalcdata(e,"x",g),c=m.makeCalcdata(e,"y"),h=n(e,m,"y",c),f=!!e.yperiodalignment,p="y"):(l=m.makeCalcdata(e,"y",g),c=d.makeCalcdata(e,"x"),h=n(e,d,"x",c),f=!!e.xperiodalignment,p="x"),u=h.vals;for(var y=Math.min(u.length,l.length),v=new Array(y),x=0;x<y;x++)v[x]={p:u[x],s:l[x]},f&&(v[x].orig_p=c[x],v[x][p+"End"]=h.ends[x],v[x][p+"Start"]=h.starts[x]),e.ids&&(v[x].id=String(e.ids[x]));return i(e,"marker")&&a(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),i(e,"marker.line")&&a(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),o(v,e),s(v,e),v}}),$a=f((t,e)=>{var r=v(),n=oe();function i(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=i(t),a=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=o<a,r[n]=r[n]||1/0,e.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(t,e){e[i(t)]=void 0},resizeText:function(t,e,i){var a=t._fullLayout,o=a["_"+i+"Text_minsize"];if(o){var s,l="hide"===a.uniformtext.mode;switch(i){case"funnelarea":case"pie":case"sunburst":s="g.slice";break;case"treemap":case"icicle":s="g.slice, g.pathbar";break;default:s="g.points > g.point"}e.selectAll(s).each(function(t){var e=t.transform;if(e){e.scale=l&&e.hide?0:o/e.fontSize;var i=r.select(this).select("text");n.setTransormAndDisplay(i,e)}})}}}}),Ja=f(t=>{var e=T(),r=O(),n=oe().isArrayOrTypedArray;t.coerceString=function(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if(("number"==typeof e||!0===e)&&!t.strict)return String(e);return void 0!==r?r:t.dflt},t.coerceNumber=function(t,r,n){if(e(r)){r=+r;var i=t.min,a=t.max;if(!(void 0!==i&&r<i||void 0!==a&&r>a))return r}return void 0!==n?n:t.dflt},t.coerceColor=function(t,e,n){return r(e).isValid()?e:void 0!==n?n:t.dflt},t.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},t.getValue=function(t,e){var r;return n(t)?e<t.length&&(r=t[e]):r=t,r},t.getLineWidth=function(t,e){return 0<e.mlw?e.mlw:n(t.marker.line.width)?0:t.marker.line.width}}),Ka=f((t,e)=>{var r=v(),n=q(),i=Je(),a=oe(),o=Ut(),s=$a().resizeText,l=qa(),u=l.textfont,c=l.insidetextfont,h=l.outsidetextfont,f=Ja();function p(t,e,r){i.pointStyle(t.selectAll("path"),e,r),d(t,e,r)}function d(t,e,n){t.selectAll("text").each(function(t){var o=r.select(this),s=a.ensureUniformFontSize(n,m(o,t,e,n));i.font(o,s)})}function m(t,e,r,n){var i=n._fullLayout.font,a=r.textfont;if(t.classed("bartext-inside")){var o=b(e,r);a=y(r,e.i,i,o)}else t.classed("bartext-outside")&&(a=x(r,e.i,i));return a}function g(t,e,r){return _(u,t.textfont,e,r)}function y(t,e,r,i){var a=g(t,e,r);return(void 0===t._input.textfont||void 0===t._input.textfont.color||Array.isArray(t.textfont.color)&&void 0===t.textfont.color[e])&&(a={color:n.contrast(i),family:a.family,size:a.size,weight:a.weight,style:a.style,variant:a.variant,textcase:a.textcase,lineposition:a.lineposition,shadow:a.shadow}),_(c,t.insidetextfont,e,a)}function x(t,e,r){var n=g(t,e,r);return _(h,t.outsidetextfont,e,n)}function _(t,e,r,n){e=e||{};var i=f.getValue(e.family,r),a=f.getValue(e.size,r),o=f.getValue(e.color,r),s=f.getValue(e.weight,r),l=f.getValue(e.style,r),u=f.getValue(e.variant,r),c=f.getValue(e.textcase,r),h=f.getValue(e.lineposition,r),p=f.getValue(e.shadow,r);return{family:f.coerceString(t.family,i,n.family),size:f.coerceNumber(t.size,a,n.size),color:f.coerceColor(t.color,o,n.color),weight:f.coerceString(t.weight,s,n.weight),style:f.coerceString(t.style,l,n.style),variant:f.coerceString(t.variant,u,n.variant),textcase:f.coerceString(t.variant,c,n.textcase),lineposition:f.coerceString(t.variant,h,n.lineposition),shadow:f.coerceString(t.variant,p,n.shadow)}}function b(t,e){return"waterfall"===e.type?e[t.dir].marker.color:t.mcc||t.mc||e.marker.color}e.exports={style:function(t){var e=r.select(t).selectAll('g[class^="barlayer"]').selectAll("g.trace");s(t,e,"bar");var n=e.size(),i=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===i.barmode&&n>1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(e){p(r.select(this),e[0].trace,t)}),o.getComponentMethod("errorbars","style")(e)},styleTextPoints:d,styleOnSelect:function(t,e,n){var s=e[0].trace;s.selectedpoints?function(t,e,n){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,n){t.each(function(t){var o,s=r.select(this);if(t.selected){o=a.ensureUniformFontSize(n,m(s,t,e,n));var l=e.selected.textfont&&e.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,e)})}(t.selectAll("text"),e,n)}(n,s,t):(p(n,s,t),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:b,resizeText:s}}),Qa=f((t,e)=>{var r=v(),n=T(),i=oe(),a=Ae(),o=q(),s=Je(),l=Ut(),u=rr().tickText,c=$a(),h=c.recordMinTextSize,f=c.clearMinTextSize,p=Ka(),d=Ja(),m=Va(),g=qa(),y=g.text,x=g.textposition,_=Ye().appendArrayPointValue,b=m.TEXTPAD;function w(t){return t.id}function k(t){return(t>0)-(t<0)}function A(t,e){return t<e?1:-1}function M(t,e,r,n){var i;return!e.uniformtext.mode&&S(r)?(n&&(i=n()),t.transition().duration(r.duration).ease(r.easing).each("end",function(){i&&i()}).each("interrupt",function(){i&&i()})):t}function S(t){return t&&t.duration>0}function E(t,e,r,n,i){return!(t<0||e<0)&&(r<=t&&n<=e||r<=e&&n<=t||(i?t>=r*(e/n):e>=n*(t/r)))}function C(t){return"auto"===t?0:t}function I(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,u=a.anchor,c="end"===u,h="start"===u,f=((a.leftToRight||0)+1)/2,p=1-f,d=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(e-t),_=Math.abs(n-r),w=x>2*b&&_>2*b?b:0;x-=2*w,_-=2*w;var T=C(l);"auto"===l&&!(y<=x&&v<=_)&&(y>x||v>_)&&(!(y>_||v>x)||y<v!=x<_)&&(T+=90);var k,M,S=I(i,T);if(m&&m-g>b){var E=function(t,e,r,n,i,a,o,s,l){var u,c,h,f,p,d=Math.max(0,Math.abs(e-t)-2*b),m=Math.max(0,Math.abs(n-r)-2*b),g=a-b,y=o?g-Math.sqrt(g*g-(g-o)*(g-o)):g,v=l?2*g:s?g-o:2*y,x=l?2*g:s?2*y:g-o;return i.y/i.x>=m/(d-v)?f=m/i.y:i.y/i.x<=(m-x)/d?f=d/i.x:!l&&s?(u=i.x*i.x+i.y*i.y/4,c=-2*i.x*(d-g)-i.y*(m/2-g),h=(d-g)*(d-g)+(m/2-g)*(m/2-g)-g*g,f=(-c+Math.sqrt(c*c-4*u*h))/(2*u)):l?(u=(i.x*i.x+i.y*i.y)/4,c=-i.x*(d/2-g)-i.y*(m/2-g),h=(d/2-g)*(d/2-g)+(m/2-g)*(m/2-g)-g*g,f=(-c+Math.sqrt(c*c-4*u*h))/(2*u)):(u=i.x*i.x/4+i.y*i.y,c=-i.x*(d/2-g)-2*i.y*(m-g),h=(d/2-g)*(d/2-g)+(m-g)*(m-g)-g*g,f=(-c+Math.sqrt(c*c-4*u*h))/(2*u)),f=Math.min(1,f),p=s?Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(m-i.y*f)/2)*(g-(m-i.y*f)/2)))-o):Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(d-i.x*f)/2)*(g-(d-i.x*f)/2)))-o),{scale:f,pad:p}}(t,e,r,n,S,m,g,o,d);k=E.scale,M=E.pad}else k=1,s&&(k=Math.min(1,x/S.x,_/S.y)),M=0;var L=i.left*p+i.right*f,P=(i.top+i.bottom)/2,z=(t+b)*p+(e-b)*f,O=(r+n)/2,D=0,R=0;if(h||c){var F=(o?S.x:S.y)/2;m&&(c||d)&&(w+=M);var B=o?A(t,e):A(r,n);o?h?(z=t+B*w,D=-B*F):(z=e-B*w,D=B*F):h?(O=r+B*w,R=-B*F):(O=n-B*w,R=B*F)}return{textX:L,textY:P,targetX:z,targetY:O,anchorX:D,anchorY:R,scale:k,rotate:T}}e.exports={plot:function(t,e,c,m,g,v){var T=e.xaxis,P=e.yaxis,z=t._fullLayout,O=t._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},f("bar",z));var D=i.makeTraceGroups(m,c,"trace bars").each(function(l){var c=r.select(this),f=l[0].trace,m=l[0].t,D="waterfall"===f.type,R="funnel"===f.type,F="histogram"===f.type,B="bar"===f.type,N=B||R,j=0;D&&f.connector.visible&&"between"===f.connector.mode&&(j=f.connector.line.width/2);var U="h"===f.orientation,V=S(g),q=i.ensureSingle(c,"g","points"),H=function(t){if(t.ids)return w}(f),G=q.selectAll("g.point").data(i.identity,H);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each(function(c,w){var S,D,R=r.select(this),q=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),n?[i,a]:[a,i]}(c,T,P,U),H=q[0][0],G=q[0][1],Z=q[1][0],W=q[1][1],Y=0===(U?G-H:W-Z);if(Y&&N&&d.getLineWidth(f,c)&&(Y=!1),Y||(Y=!(n(H)&&n(G)&&n(Z)&&n(W))),c.isBlank=Y,Y&&(U?G=H:W=Z),j&&!Y&&(U?(H-=A(H,G)*j,G+=A(H,G)*j):(Z-=A(Z,W)*j,W+=A(Z,W)*j)),"waterfall"===f.type){if(!Y){var X=f[c.dir].marker;S=X.line.width,D=X.color}}else S=d.getLineWidth(f,c),D=c.mc||f.marker.color;function $(t){var e=r.round(S/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(t)-e,2):t}var J=o.opacity(D)<1||S>.01?$:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?$(t):t>e?Math.ceil(t):Math.floor(t)};t._context.staticPlot||(H=J(H,G,U),G=J(G,H,U),Z=J(Z,W,!U),W=J(W,Z,!U));var K,Q=U?T.c2p:P.c2p;K=c.s0>0?c._sMax:c.s0<0?c._sMin:c.s1>0?c._sMax:c._sMin;var tt,et,rt=B||F?function(t,e){if(!t)return 0;var r,n=Math.abs(U?W-Z:G-H),i=Math.abs(U?G-H:W-Z),a=J(Math.abs(Q(K,!0)-Q(0,!0))),o=c.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===e?n*(Math.min(50,t)/100):t,J(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,nt="M"+H+","+Z+"V"+W+"H"+G+"V"+Z+"Z",it=0;if(rt&&c.s){var at=0===k(c.s0)||k(c.s)===k(c.s0)?c.s1:c.s0;if((it=J(c.hasB?0:Math.abs(Q(K,!0)-Q(at,!0))))<rt){var ot=A(H,G),st=A(Z,W),lt=ot===-st?1:0;if(U)if(c.hasB)tt="M"+(H+rt*ot)+","+Z+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(Z+rt*st)+"V"+(W-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot)+","+W+"H"+(G-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(W-rt*st)+"V"+(Z+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-rt*ot)+","+Z+"Z";else{var ut=(et=Math.abs(G-H)+it)<rt?rt-Math.sqrt(et*(2*rt-et)):0,ct=it>0?Math.sqrt(it*(2*rt-it)):0,ht=ot>0?Math.max:Math.min;tt="M"+H+","+Z+"V"+(W-ut*st)+"H"+ht(G-(rt-it)*ot,H)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(W-rt*st-ct)+"V"+(Z+rt*st+ct)+"A "+rt+","+rt+" 0 0 "+lt+" "+ht(G-(rt-it)*ot,H)+","+(Z+ut*st)+"Z"}else if(c.hasB)tt="M"+(H+rt*ot)+","+Z+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(Z+rt*st)+"V"+(W-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot)+","+W+"H"+(G-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(W-rt*st)+"V"+(Z+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-rt*ot)+","+Z+"Z";else{var ft=(et=Math.abs(W-Z)+it)<rt?rt-Math.sqrt(et*(2*rt-et)):0,pt=it>0?Math.sqrt(it*(2*rt-it)):0,dt=st>0?Math.max:Math.min;tt="M"+(H+ft*ot)+","+Z+"V"+dt(W-(rt-it)*st,Z)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot-pt)+","+W+"H"+(G-rt*ot+pt)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-ft*ot)+","+dt(W-(rt-it)*st,Z)+"V"+Z+"Z"}}else tt=nt}else tt=nt;var mt=M(i.ensureSingle(R,"path"),z,g,v);if(mt.style("vector-effect",O?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*(W-Z))||Y&&t._context.staticPlot?"M0,0Z":tt).call(s.setClipUrl,e.layerClipId,t),!z.uniformtext.mode&&V){var gt=s.makePointStyleFns(f);s.singlePointStyle(c,mt,f,gt,t)}(function(t,e,r,n,o,l,c,f,m,g,v,w,T){var k,S=e.xaxis,P=e.yaxis,z=t._fullLayout;function O(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+k,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,t)}var D=n[0].trace,R="h"===D.orientation,F=function(t,e,r,n,a){var o,s=e[0].trace,l=s.texttemplate;return o=l?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,c,h,f,p="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(t){return u(c,c.c2l(t),!0).text}function v(t){return u(f,f.c2l(t),!0).text}g?(l="y",c=a,h="x",f=n):(l="x",c=n,h="y",f=a);var x=e[r],b={};b.label=x.p,b.labelLabel=b[l+"Label"]=y(x.p);var w=i.castOption(o,x.i,"text");(0===w||w)&&(b.text=w),b.value=x.s,b.valueLabel=b[h+"Label"]=v(x.s);var T={};_(T,o,x.i),(p||void 0===T.x)&&(T.x=g?b.value:b.label),(p||void 0===T.y)&&(T.y=g?b.label:b.value),(p||void 0===T.xLabel)&&(T.xLabel=g?b.valueLabel:b.labelLabel),(p||void 0===T.yLabel)&&(T.yLabel=g?b.labelLabel:b.valueLabel),d&&(b.delta=+x.rawS||x.s,b.deltaLabel=v(b.delta),b.final=x.v,b.finalLabel=v(b.final),b.initial=b.final-b.delta,b.initialLabel=v(b.initial)),m&&(b.value=x.s,b.valueLabel=v(b.value),b.percentInitial=x.begR,b.percentInitialLabel=i.formatPercent(x.begR),b.percentPrevious=x.difR,b.percentPreviousLabel=i.formatPercent(x.difR),b.percentTotal=x.sumR,b.percenTotalLabel=i.formatPercent(x.sumR));var k=i.castOption(o,x.i,"customdata");return k&&(b.customdata=k),i.texttemplateString(s,b,t._d3locale,T,b,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function c(t){return u(o?n:r,t,!0).text}function h(t){return u(o?r:n,+t,!0).text}var f,p=a.textinfo,d=t[e],m=p.split("+"),g=[],y=function(t){return-1!==m.indexOf(t)};if(y("label")&&g.push(c(t[e].p)),y("text")&&(0===(f=i.castOption(a,d.i,"text"))||f)&&g.push(f),s){var v=+d.rawS||d.s,x=d.v,_=x-v;y("initial")&&g.push(h(_)),y("delta")&&g.push(h(v)),y("final")&&g.push(h(x))}if(l){y("value")&&g.push(h(d.s));var b=0;y("percent initial")&&b++,y("percent previous")&&b++,y("percent total")&&b++;var w=b>1;y("percent initial")&&(f=i.formatPercent(d.begR),w&&(f+=" of initial"),g.push(f)),y("percent previous")&&(f=i.formatPercent(d.difR),w&&(f+=" of previous"),g.push(f)),y("percent total")&&(f=i.formatPercent(d.sumR),w&&(f+=" of total"),g.push(f))}return g.join("<br>")}(e,r,n,a):d.getValue(s.text,r),d.coerceString(y,o)}(z,n,o,S,P);k=function(t,e){var r=d.getValue(t.textposition,e);return d.coerceEnumerated(x,r)}(D,o);var B="stack"===w.mode||"relative"===w.mode,N=n[o],j=!B||N._outmost,U=N.hasB,V=g&&g-v>b;if(F&&"none"!==k&&(!N.isBlank&&l!==c&&f!==m||"auto"!==k&&"inside"!==k)){var q=z.font,H=p.getBarColor(n[o],D),G=p.getInsideTextFont(D,o,q,H),Z=p.getOutsideTextFont(D,o,q),W=D.insidetextanchor||"end",Y=r.datum();R?"log"===S.type&&Y.s0<=0&&(l=S.range[0]<S.range[1]?0:S._length):"log"===P.type&&Y.s0<=0&&(f=P.range[0]<P.range[1]?P._length:0);var X,$,J,K,Q,tt=Math.abs(c-l),et=Math.abs(m-f),rt=tt-2*b,nt=et-2*b;if("outside"===k&&!j&&!N.hasB&&(k="inside"),"auto"===k)if(j){k="inside",X=O(r,F,Q=i.ensureUniformFontSize(t,G)),J=($=s.bBox(X.node())).width,K=$.height;var it,at=J>0&&K>0;it=V?U?E(rt-2*g,nt,J,K,R)||E(rt,nt-2*g,J,K,R):R?E(rt-(g-v),nt,J,K,R)||E(rt,nt-2*(g-v),J,K,R):E(rt,nt-(g-v),J,K,R)||E(rt-2*(g-v),nt,J,K,R):E(rt,nt,J,K,R),at&&it?k="inside":(k="outside",X.remove(),X=null)}else k="inside";if(!X){var ot=(X=O(r,F,Q=i.ensureUniformFontSize(t,"outside"===k?Z:G))).attr("transform");if(X.attr("transform",""),J=($=s.bBox(X.node())).width,K=$.height,X.attr("transform",ot),J<=0||K<=0)return void X.remove()}var st,lt,ut=D.textangle;"outside"===k?(lt="both"===D.constraintext||"outside"===D.constraintext,st=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,u=a.angle||0,c=i.width,h=i.height,f=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*b?b:0:f>2*b?b:0;var d=1;l&&(d=s?Math.min(1,p/h):Math.min(1,f/c));var m=C(u),g=I(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,_=(t+e)/2,w=(r+n)/2,T=0,k=0,M=s?A(e,t):A(r,n);return s?(_=e-M*o,T=M*y):(w=n+M*o,k=-M*y),{textX:v,textY:x,targetX:_,targetY:w,anchorX:T,anchorY:k,scale:d,rotate:m}}(l,c,f,m,$,{isHorizontal:R,constrained:lt,angle:ut})):(lt="both"===D.constraintext||"inside"===D.constraintext,st=L(l,c,f,m,$,{isHorizontal:R,constrained:lt,angle:ut,anchor:W,hasB:U,r:g,overhead:v})),st.fontSize=Q.size,h("histogram"===D.type?"bar":D.type,st,z),N.transform=st;var ct=M(X,z,w,T);i.setTransormAndDisplay(ct,st)}else r.select("text").remove()})(t,e,R,l,w,H,G,Z,W,rt,it,g,v),e.layerClipId&&s.hideOutsideRangePoint(c,R.select("text"),T,P,f.xcalendar,f.ycalendar)});var Z=!1===f.cliponaxis;s.setClipUrl(c,Z?null:e.layerClipId,t)});l.getComponentMethod("errorbars","plot")(t,D,e,g)},toMoveInsideBar:L}}),to=f((t,e)=>{var r=Pr(),n=Ut(),i=q(),a=oe().fillText,o=Ja().getLineWidth,s=rr().hoverLabelText,l=k().BADNUM;function u(t,e,n,i,o){var u,c,h,f,p,d,m,g=t.cd,y=g[0].trace,v=g[0].t,x="closest"===i,_="waterfall"===y.type,b=t.maxHoverDistance,w=t.maxSpikeDistance;"h"===y.orientation?(u=n,c=e,h="y",f="x",p=O,d=P):(u=e,c=n,h="x",f="y",d=O,p=P);var T=y[h+"period"],k=x||T;function A(t){return S(t,-1)}function M(t){return S(t,1)}function S(t,e){var r=t.w;return t[h]+e*r/2}function E(t){return t[h+"End"]-t[h+"Start"]}var C=x?A:T?function(t){return t.p-E(t)/2}:function(t){return Math.min(A(t),t.p-v.bardelta/2)},I=x?M:T?function(t){return t.p+E(t)/2}:function(t){return Math.max(M(t),t.p+v.bardelta/2)};function L(t,e,n){return o.finiteRange&&(n=0),r.inbox(t-u,e-u,n+Math.min(1,Math.abs(e-t)/m)-1)}function P(t){return L(C(t),I(t),b)}function z(t){var e=t[f];if(_){var r=Math.abs(t.rawS)||0;c>0?e+=r:c<0&&(e-=r)}return e}function O(t){var e=c,n=t.b,i=z(t);return r.inbox(n-e,i-e,b+(i-e)/(i-n)-1)}var D=t[h+"a"],R=t[f+"a"];m=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F,B,N,j,U=r.getDistanceFunction(i,p,d,function(t){return(p(t)+d(t))/2});if(r.getClosest(g,U,t),!1!==t.index&&g[t.index].p!==l){k||(C=function(t){return Math.min(A(t),t.p-v.bargroupwidth/2)},I=function(t){return Math.max(M(t),t.p+v.bargroupwidth/2)});var V=g[t.index],q=y.base?V.b+V.s:V.s;t[f+"0"]=t[f+"1"]=R.c2p(V[f],!0),t[f+"LabelVal"]=q;var H=v.extents[v.extents.round(V.p)];t[h+"0"]=D.c2p(x?C(V):H[0],!0),t[h+"1"]=D.c2p(x?I(V):H[1],!0);var G=void 0!==V.orig_p;return t[h+"LabelVal"]=G?V.orig_p:V.p,t.labelLabel=s(D,t[h+"LabelVal"],y[h+"hoverformat"]),t.valueLabel=s(R,t[f+"LabelVal"],y[f+"hoverformat"]),t.baseLabel=s(R,V.b,y[f+"hoverformat"]),t.spikeDistance=(B=c,N=(F=V).b,j=z(F),(r.inbox(N-B,j-B,w+(j-B)/(j-N)-1)+function(t){return L(A(t),M(t),w)}(V))/2),t[h+"Spike"]=D.c2p(V.p,!0),a(V,y,t),t.hovertemplate=y.hovertemplate,t}}function c(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=o(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,i,a){var o=u(t,e,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=c(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:u,getTraceColor:c}}),eo=f((t,e)=>{e.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}}),ro=f((t,e)=>{function r(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var n,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,u="h"===s.orientation,c=[];if(!1===e)for(n=0;n<i.length;n++)i[n].selected=0;else for(n=0;n<i.length;n++){var h=i[n],f="ct"in h?h.ct:r(h,a,o,u,l);e.contains(f,!1,n,t)?(c.push({pointNumber:n,x:a.c2d(h.x),y:o.c2d(h.y)}),h.selected=1):h.selected=0}return c}}),no=f((t,e)=>{e.exports={attributes:qa(),layoutAttributes:Ha(),supplyDefaults:Za().supplyDefaults,crossTraceDefaults:Za().crossTraceDefaults,supplyLayoutDefaults:Wa(),calc:Xa(),crossTraceCalc:oi().crossTraceCalc,colorbar:hi(),arraysToCalcdata:Ya(),plot:Qa().plot,style:Ka().style,styleOnSelect:Ka().styleOnSelect,hoverPoints:to().hoverPoints,eventData:eo(),selectPoints:ro(),moduleType:"trace",name:"bar",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),io=f((t,e)=>{e.exports=no()}),ao=f((t,e)=>{var r=_n(),n=bn(),i=qa(),a=V(),o=Se().axisHoverFormat,s=Ot().hovertemplateAttrs,l=D().extendFlat,u=n.marker,c=u.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},u.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},u.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},u.angle,{arrayOk:!1,editType:"calc"}),size:l({},u.size,{arrayOk:!1,editType:"calc"}),color:l({},u.color,{arrayOk:!1,editType:"style"}),line:{color:l({},c.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:n.zorder}}),oo=f((t,e)=>{e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}),so=f((t,e)=>{var r=oe(),n=Ut(),i=q(),a=qn(),o=Jn(),s=tr(),l=ao();function u(t,e,i,a){function o(t){var e=0;return t&&t.length&&(e+=1,r.isArrayOrTypedArray(t[0])&&t[0].length&&(e+=1)),e}function u(e){return r.validate(t[e],l[e])}var c,h=i("y"),f=i("x");if("box"===e.type){var p=i("q1"),d=i("median"),m=i("q3");e._hasPreCompStats=p&&p.length&&d&&d.length&&m&&m.length,c=Math.min(r.minRowLength(p),r.minRowLength(d),r.minRowLength(m))}var g,y,v=o(h),x=o(f),_=v&&r.minRowLength(h),b=x&&r.minRowLength(f),w=a.calendar,T={autotypenumbers:a.autotypenumbers};if(e._hasPreCompStats)switch(String(x)+String(v)){case"00":var k=u("x0")||u("dx");g=!u("y0")&&!u("dy")||k?"v":"h",y=c;break;case"10":g="v",y=Math.min(c,b);break;case"20":g="h",y=Math.min(c,f.length);break;case"01":g="h",y=Math.min(c,_);break;case"02":g="v",y=Math.min(c,h.length);break;case"12":g="v",y=Math.min(c,b,h.length);break;case"21":g="h",y=Math.min(c,f.length,_);break;case"11":y=0;break;case"22":var A,M=!1;for(A=0;A<f.length;A++)if("category"===s(f[A],w,T)){M=!0;break}if(M)g="v",y=Math.min(c,b,h.length);else{for(A=0;A<h.length;A++)if("category"===s(h[A],w,T)){M=!0;break}M?(g="h",y=Math.min(c,f.length,_)):(g="v",y=Math.min(c,b,h.length))}}else v>0?(g="v",y=x>0?Math.min(b,_):Math.min(_)):x>0?(g="h",y=Math.min(b)):y=0;if(y){e._length=y;var S=i("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(i("x0",0),i("dx",1)):"h"===S&&0===v&&(i("y0",0),i("dy",1)):"v"===S&&0===x?i("x0"):"h"===S&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function c(t,e,n,i){var a=i.prefix,o=r.coerce2(t,e,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),u="outliers";e._hasPreCompStats?u="all":(o||s)&&(u="suspectedoutliers");var c=n(a+"points",u);c?(n("jitter","all"===c?.3:0),n("pointpos","all"===c?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",e.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===c&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete e.marker;var h=n("hoveron");("all"===h||-1!==h.indexOf("points"))&&n("hovertemplate"),r.coerceSelectionMarkerOpacity(e,n)}e.exports={supplyDefaults:function(t,e,n,o){function s(n,i){return r.coerce(t,e,l,n,i)}if(u(t,e,s,o),!1!==e.visible){a(t,e,o,s),s("xhoverformat"),s("yhoverformat");var h=e._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(e.line.color,.5));var f=!1;if(h){var p=s("mean"),d=s("sd");p&&p.length&&(f=!0,d&&d.length&&(f="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",f)),s("showwhiskers","quartiles"===g),("sd"===g||"sd"===m)&&s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(t.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),c(t,e,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(t,e){var n,i;function a(t){return r.coerce(i._input,i,l,t)}for(var s=0;s<t.length;s++){var u=(i=t[s]).type;if("box"===u||"violin"===u){n=i._input;var c=e[u+"mode"];"group"===c&&o(n,i,e,a,c)}}},handleSampleDefaults:u,handlePointsDefaults:c}}),lo=f((t,e)=>{var r=Ut(),n=oe(),i=oo();function a(t,e,n,i,a){for(var o=a+"Layout",s=!1,l=0;l<n.length;l++){var u=n[l];if(r.traceIs(u,o)){s=!0;break}}s&&(i(a+"mode"),i(a+"gap"),i(a+"groupgap"))}e.exports={supplyLayoutDefaults:function(t,e,r){a(0,0,r,function(r,a){return n.coerce(t,e,i,r,a)},"box")},_supply:a}}),uo=f((t,e)=>{var r=T(),n=rr(),i=ti(),a=oe(),o=k().BADNUM,s=a._;e.exports=function(t,e){var l,y,v,x,_,b,w,T=t._fullLayout,k=n.getFromId(t,e.xaxis||"x"),A=n.getFromId(t,e.yaxis||"y"),M=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=k,x="x",_=A,b="y",w=!!e.yperiodalignment):(v=A,x="y",_=k,b="x",w=!!e.xperiodalignment);var E,C,I,L,P,z,O=function(t,e,n,o){var s,l=e in t,u=e+"0"in t,c="d"+e in t;if(l||u&&c){var h=n.makeCalcdata(t,e);return[i(t,n,e,h).vals,h]}s=u?t[e+"0"]:"name"in t&&("category"===n.type||r(t.name)&&-1!==["linear","log"].indexOf(n.type)||a.isDateTime(t.name)&&"date"===n.type)?t.name:o;for(var f="multicategory"===n.type?n.r2c_just_indices(s):n.d2c(s,0,t[e+"calendar"]),p=t._length,d=new Array(p),m=0;m<p;m++)d[m]=f;return[d]}(e,b,_,T[S]),D=O[0],R=O[1],F=a.distinctVals(D,_),B=F.vals,N=F.minDiff/2,j="all"===(e.boxpoints||e.points)?a.identity:function(t){return t.v<E.lf||t.v>E.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return v.d2c((e[t]||[])[l])},q=1/0,H=-1/0;for(l=0;l<e._length;l++){var G=D[l];if(r(G)){if((E={}).pos=E[b]=G,w&&R&&(E.orig_p=R[l]),E.q1=V("q1"),E.med=V("median"),E.q3=V("q3"),C=[],U&&a.isArrayOrTypedArray(U[l]))for(y=0;y<U[l].length;y++)(z=v.d2c(U[l][y]))!==o&&(u(P={v:z,i:[l,y]},e,[l,y]),C.push(P));if(E.pts=C.sort(c),L=(I=E[x]=C.map(h)).length,E.med!==o&&E.q1!==o&&E.q3!==o&&E.med>=E.q1&&E.q3>=E.med){var Z=V("lowerfence");E.lf=Z!==o&&Z<=E.q1?Z:f(E,I,L);var W=V("upperfence");E.uf=W!==o&&W>=E.q3?W:p(E,I,L);var Y=V("mean");E.mean=Y!==o?Y:L?a.mean(I,L):(E.q1+E.q3)/2;var X=V("sd");E.sd=Y!==o&&X>=0?X:L?a.stdev(I,L,E.mean):E.q3-E.q1,E.lo=d(E),E.uo=m(E);var $=V("notchspan");$=$!==o&&$>0?$:g(E,L),E.ln=E.med-$,E.un=E.med+$;var J=E.lf,K=E.uf;e.boxpoints&&I.length&&(J=Math.min(J,I[0]),K=Math.max(K,I[L-1])),e.notched&&(J=Math.min(J,E.ln),K=Math.max(K,E.un)),E.min=J,E.max=K}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=C.filter(j),M.push(E)}}e._extremes[v._id]=n.findExtremes(v,[q,H],{padded:!0})}else{var tt=v.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i<r;i++)n[i]=t[i]-e;return n[r]=t[r-1]+e,n}(B,N),rt=B.length,nt=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}(rt);for(l=0;l<e._length;l++)if(z=tt[l],r(z)){var it=a.findBin(D[l],et);it>=0&&it<rt&&(u(P={v:z,i:l},e,l),nt[it].push(P))}var at=1/0,ot=-1/0,st=e.quartilemethod,lt="exclusive"===st,ut="inclusive"===st;for(l=0;l<rt;l++)if(nt[l].length>0){var ct,ht;(E={}).pos=E[b]=B[l],C=E.pts=nt[l].sort(c),L=(I=E[x]=C.map(h)).length,E.min=I[0],E.max=I[L-1],E.mean=a.mean(I,L),E.sd=a.stdev(I,L,E.mean)*e.sdmultiple,E.med=a.interp(I,.5),L%2&&(lt||ut)?(lt?(ct=I.slice(0,L/2),ht=I.slice(L/2+1)):ut&&(ct=I.slice(0,L/2+1),ht=I.slice(L/2)),E.q1=a.interp(ct,.5),E.q3=a.interp(ht,.5)):(E.q1=a.interp(I,.25),E.q3=a.interp(I,.75)),E.lf=f(E,I,L),E.uf=p(E,I,L),E.lo=d(E),E.uo=m(E);var ft=g(E,L);E.ln=E.med-ft,E.un=E.med+ft,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=C.filter(j),M.push(E)}e.notched&&a.isTypedArray(tt)&&(tt=Array.from(tt)),e._extremes[v._id]=n.findExtremes(v,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r<t.length;r++){for(var n=t[r].pts||[],i={},o=0;o<n.length;o++)i[n[o].i]=o;a.tagSelected(n,e,i)}}(M,e),M.length>0?(M[0].t={num:T[S],dPos:N,posLetter:b,valLetter:x,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean||"sd"===e.sizemode?s(t,"mean ± σ:").replace("σ",1===e.sdmultiple?"σ":e.sdmultiple+"σ"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},T[S]++,M):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function u(t,e,r){for(var n in l)a.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(e[n][r[0]])&&(t[l[n]]=e[n][r[0]][r[1]]):t[l[n]]=e[n][r])}function c(t,e){return t.v-e.v}function h(t){return t.v}function f(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(a.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function p(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(a.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function d(t){return 4*t.q1-3*t.q3}function m(t){return 4*t.q3-3*t.q1}function g(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}}),co=f((t,e)=>{var r=rr(),n=oe(),i=tn().getAxisGroup,a=["v","h"];function o(t,e,a,o){var s,l,u,c=e.calcdata,h=e._fullLayout,f=o._id,p=f.charAt(0),d=[],m=0;for(s=0;s<a.length;s++)for(u=c[a[s]],l=0;l<u.length;l++)d.push(o.c2l(u[l].pos,!0)),m+=(u[l].pts2||[]).length;if(d.length){var g=n.distinctVals(d);("category"===o.type||"multicategory"===o.type)&&(g.minDiff=1);var y=g.minDiff/2;r.minDtick(o,g.minDiff,g.vals[0],!0);var v=h["violin"===t?"_numViolins":"_numBoxes"],x="group"===h[t+"mode"]&&v>1,_=1-h[t+"gap"],b=1-h[t+"groupgap"];for(s=0;s<a.length;s++){var w,T,k,A,M=(u=c[a[s]])[0].trace,S=u[0].t,E=M.width,C=M.side;if(E)w=T=A=E/2,k=0;else if(w=y,x){var I=i(h,o._id)+M.orientation,L=(h._alignmentOpts[I]||{})[M.alignmentgroup]||{},P=Object.keys(L.offsetGroups||{}).length,z=P||v;T=w*_*b/z,k=2*w*(((P?M._offsetIndex:S.num)+.5)/z-.5)*_,A=w*_/z}else T=w*_*b,k=0,A=w;S.dPos=w,S.bPos=k,S.bdPos=T,S.wHover=A;var O,D,R,F,B,N,j,U,V=k+T,q=!!E;if("positive"===C?(O=w*(E?1:.5),R=V,D=R=k):"negative"===C?(O=R=k,D=w*(E?1:.5),F=V):(O=D=w,R=F=V),(M.boxpoints||M.points)&&m>0){var H=M.pointpos,G=M.jitter,Z=M.marker.size/2,W=0;H+G>=0&&((W=V*(H+G))>O?(q=!0,j=Z,B=W):W>R&&(j=Z,B=O)),W<=O&&(B=O);var Y=0;H-G<=0&&((Y=-V*(H-G))>D?(q=!0,U=Z,N=Y):Y>F&&(U=Z,N=D)),Y<=D&&(N=D)}else B=O,N=D;var X=new Array(u.length);for(l=0;l<u.length;l++)X[l]=u[l].pos;M._extremes[f]=r.findExtremes(o,X,{padded:q,vpadminus:N,vpadplus:B,vpadLinearized:!0,ppadminus:{x:U,y:j}[p],ppadplus:{x:j,y:U}[p]})}}}e.exports={crossTraceCalc:function(t,e){for(var r=t.calcdata,n=e.xaxis,i=e.yaxis,s=0;s<a.length;s++){for(var l=a[s],u="h"===l?i:n,c=[],h=0;h<r.length;h++){var f=r[h],p=f[0].t,d=f[0].trace;!0===d.visible&&("box"===d.type||"candlestick"===d.type)&&!p.empty&&(d.orientation||"v")===l&&d.xaxis===n._id&&d.yaxis===i._id&&c.push(h)}o("box",t,c,u)}},setPositionOffset:o}}),ho=f((t,e)=>{var r=v(),n=oe(),i=Je();function a(t,e,i,a,o){var s,l,u="h"===i.orientation,c=e.val,h=e.pos,f=!!h.rangebreaks,p=a.bPos,d=a.wdPos||0,m=a.bPosPxOffset||0,g=i.whiskerwidth||0,y=!1!==i.showwhiskers,v=i.notched||!1,x=v?1-2*i.notchwidth:1;Array.isArray(a.bdPos)?(s=a.bdPos[0],l=a.bdPos[1]):(s=a.bdPos,l=a.bdPos);var _=t.selectAll("path.box").data("violin"!==i.type||i.box.visible?n.identity:[]);_.enter().append("path").style("vector-effect",o?"none":"non-scaling-stroke").attr("class","box"),_.exit().remove(),_.each(function(t){if(t.empty)return r.select(this).attr("d","M0,0Z");var e=h.c2l(t.pos+p,!0),a=h.l2p(e-s)+m,o=h.l2p(e+l)+m,_=f?(a+o)/2:h.l2p(e)+m,b=i.whiskerwidth,w=f?a*b+(1-b)*_:h.l2p(e-d)+m,T=f?o*b+(1-b)*_:h.l2p(e+d)+m,k=h.l2p(e-s*x)+m,A=h.l2p(e+l*x)+m,M="sd"===i.sizemode,S=c.c2p(M?t.mean-t.sd:t.q1,!0),E=M?c.c2p(t.mean+t.sd,!0):c.c2p(t.q3,!0),C=n.constrain(M?c.c2p(t.mean,!0):c.c2p(t.med,!0),Math.min(S,E)+1,Math.max(S,E)-1),I=void 0===t.lf||!1===i.boxpoints||M,L=c.c2p(I?t.min:t.lf,!0),P=c.c2p(I?t.max:t.uf,!0),z=c.c2p(t.ln,!0),O=c.c2p(t.un,!0);u?r.select(this).attr("d","M"+C+","+k+"V"+A+"M"+S+","+a+"V"+o+(v?"H"+z+"L"+C+","+A+"L"+O+","+o:"")+"H"+E+"V"+a+(v?"H"+O+"L"+C+","+k+"L"+z+","+a:"")+"Z"+(y?"M"+S+","+_+"H"+L+"M"+E+","+_+"H"+P+(0===g?"":"M"+L+","+w+"V"+T+"M"+P+","+w+"V"+T):"")):r.select(this).attr("d","M"+k+","+C+"H"+A+"M"+a+","+S+"H"+o+(v?"V"+z+"L"+A+","+C+"L"+o+","+O:"")+"V"+E+"H"+a+(v?"V"+O+"L"+k+","+C+"L"+a+","+z:"")+"Z"+(y?"M"+_+","+S+"V"+L+"M"+_+","+E+"V"+P+(0===g?"":"M"+w+","+L+"H"+T+"M"+w+","+P+"H"+T):""))})}function o(t,e,r,a){var o=e.x,s=e.y,l=a.bdPos,u=a.bPos,c=r.boxpoints||r.points;n.seedPseudoRandom();var h=t.selectAll("g.points").data(c?function(t){return t.forEach(function(t){t.t=a,t.trace=r}),t}:[]);h.enter().append("g").attr("class","points"),h.exit().remove();var f=h.selectAll("path").data(function(t){var e,i,a=t.pts2,o=Math.max((t.max-t.min)/10,t.q3-t.q1),s=1e-9*o,h=.01*o,f=[],p=0;if(r.jitter){if(0===o)for(p=1,f=new Array(a.length),e=0;e<a.length;e++)f[e]=1;else for(e=0;e<a.length;e++){var d=Math.max(0,e-5),m=a[d].v,g=Math.min(a.length-1,e+5),y=a[g].v;"all"!==c&&(a[e].v<t.lf?y=Math.min(y,t.lf):m=Math.max(m,t.uf));var v=Math.sqrt(h*(g-d)/(y-m+s))||0;v=n.constrain(Math.abs(v),0,1),f.push(v),p=Math.max(v,p)}i=2*r.jitter/(p||1)}for(e=0;e<a.length;e++){var x=a[e],_=x.v,b=r.jitter?i*f[e]*(n.pseudoRandom()-.5):0,w=t.pos+u+l*(r.pointpos+b);"h"===r.orientation?(x.y=w,x.x=_):(x.x=w,x.y=_),"suspectedoutliers"===c&&_<t.uo&&_>t.lo&&(x.so=!0)}return a});f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,s)}function s(t,e,i,a){var o,s,l=e.val,u=e.pos,c=!!u.rangebreaks,h=a.bPos,f=a.bPosPxOffset||0,p=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each(function(t){var e=u.c2l(t.pos+h,!0),n=u.l2p(e-o)+f,a=u.l2p(e+s)+f,d=c?(n+a)/2:u.l2p(e)+f,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+n+"L"+y+","+d+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+n+","+m+"L"+d+","+y+"Z":""))})}e.exports={plot:function(t,e,i,l){var u=t._context.staticPlot,c=e.xaxis,h=e.yaxis;n.makeTraceGroups(l,i,"trace boxes").each(function(t){var e,n,i=r.select(this),l=t[0],f=l.t,p=l.trace;f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty?i.remove():("h"===p.orientation?(e=h,n=c):(e=c,n=h),a(i,{pos:e,val:n},p,f,u),o(i,{x:c,y:h},p,f),s(i,{pos:e,val:n},p,f))})},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}),fo=f((t,e)=>{var r=v(),n=q(),i=Je();e.exports={style:function(t,e,a){var o=a||r.select(t).selectAll("g.trace.boxes");o.style("opacity",function(t){return t[0].trace.opacity}),o.each(function(e){var a=r.select(this),o=e[0].trace,s=o.line.width;function l(t,e,r,i){t.style("stroke-width",e+"px").call(n.stroke,r).call(n.fill,i)}var u=a.selectAll("path.box");if("candlestick"===o.type)u.each(function(t){if(!t.empty){var e=r.select(this),n=o[t.dir];l(e,n.line.width,n.line.color,n.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}});else{l(u,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var c=a.selectAll("path.point");i.pointStyle(c,o,t)}})},styleOnSelect:function(t,e,r){var n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}}),po=f((t,e)=>{var r=rr(),n=oe(),i=Pr(),a=q(),o=n.fillText;function s(t,e,o,s){var l,u,c,h,f,p,d,m,g,y,v,x,_,b,w=t.cd,T=t.xa,k=t.ya,A=w[0].trace,M=w[0].t,S="violin"===A.type,E=M.bdPos,C=M.wHover,I=function(t){return c.c2l(t.pos)+M.bPos-c.c2l(p)};S&&"both"!==A.side?("positive"===A.side&&(g=function(t){var e=I(t);return i.inbox(e,e+C,y)},x=E,_=0),"negative"===A.side&&(g=function(t){var e=I(t);return i.inbox(e-C,e,y)},x=0,_=E)):(g=function(t){var e=I(t);return i.inbox(e-C,e+C,y)},x=_=E),b=S?function(t){return i.inbox(t.span[0]-f,t.span[1]-f,y)}:function(t){return i.inbox(t.min-f,t.max-f,y)},"h"===A.orientation?(f=e,p=o,d=b,m=g,l="y",c=k,u="x",h=T):(f=o,p=e,d=g,m=b,l="x",c=T,u="y",h=k);var L=Math.min(1,E/Math.abs(c.r2c(c.range[1])-c.r2c(c.range[0])));function P(t){return(d(t)+m(t))/2}y=t.maxHoverDistance-L,v=t.maxSpikeDistance-L;var z=i.getDistanceFunction(s,d,m,P);if(i.getClosest(w,z,t),!1===t.index)return[];var O=w[t.index],D=A.line.color,R=(A.marker||{}).color;a.opacity(D)&&A.line.width?t.color=D:a.opacity(R)&&A.boxpoints?t.color=R:t.color=A.fillcolor,t[l+"0"]=c.c2p(O.pos+M.bPos-_,!0),t[l+"1"]=c.c2p(O.pos+M.bPos+x,!0),t[l+"LabelVal"]=void 0!==O.orig_p?O.orig_p:O.pos;var F=l+"Spike";t.spikeDistance=P(O)*v/y,t[F]=c.c2p(O.pos,!0);var B=A.boxmean||"sd"===A.sizemode||(A.meanline||{}).visible,N=A.boxpoints||A.points,j=N&&B?["max","uf","q3","med","mean","q1","lf","min"]:N&&!B?["max","uf","q3","med","q1","lf","min"]:!N&&B?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]<h.range[0];A.orientation===(U?"v":"h")&&j.reverse();for(var V=t.spikeDistance,q=t[F],H=[],G=0;G<j.length;G++){var Z=j[G];if(Z in O){var W=O[Z],Y=h.c2p(W,!0),X=n.extendFlat({},t);X.attr=Z,X[u+"0"]=X[u+"1"]=Y,X[u+"LabelVal"]=W,X[u+"Label"]=(M.labels?M.labels[Z]+" ":"")+r.hoverLabelText(h,W,A[u+"hoverformat"]),X.hoverOnBox=!0,"mean"===Z&&"sd"in O&&("sd"===A.boxmean||"sd"===A.sizemode)&&(X[u+"err"]=O.sd),X.hovertemplate=!1,H.push(X)}}t.name="",t.spikeDistance=void 0,t[F]=void 0;for(var $=0;$<H.length;$++)"med"!==H[$].attr?(H[$].name="",H[$].spikeDistance=void 0,H[$][F]=void 0):(H[$].spikeDistance=V,H[$][F]=q);return H}function l(t,e,r){for(var a,s,l,u=t.cd,c=t.xa,h=t.ya,f=u[0].trace,p=c.c2p(e),d=h.c2p(r),m=i.quadrature(function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(c.c2p(t.x)-p)-e,1-3/e)},function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.y)-d)-e,1-3/e)}),g=!1,y=0;y<u.length;y++){s=u[y];for(var v=0;v<(s.pts||[]).length;v++){var x=m(l=s.pts[v]);x<=t.distance&&(t.distance=x,g=[y,v])}}if(!g)return!1;l=(s=u[g[0]]).pts[g[1]];var _=c.c2p(l.x,!0),b=h.c2p(l.y,!0),w=l.mrc||1;a=n.extendFlat({},t,{index:l.i,color:(f.marker||{}).color,name:f.name,x0:_-w,x1:_+w,y0:b-w,y1:b+w,spikeDistance:t.distance,hovertemplate:f.hovertemplate});var T,k=s.orig_p,A=void 0!==k?k:s.pos;return"h"===f.orientation?(T=h,a.xLabelVal=l.x,a.yLabelVal=A):(T=c,a.xLabelVal=A,a.yLabelVal=l.y),a[T._id.charAt(0)+"Spike"]=T.c2p(s.pos,!0),o(l,f,a),a}e.exports={hoverPoints:function(t,e,r,n){var i,a=t.cd[0].trace.hoveron,o=[];return-1!==a.indexOf("boxes")&&(o=o.concat(s(t,e,r,n))),-1!==a.indexOf("points")&&(i=l(t,e,r)),"closest"===n?i?[i]:o:(i&&o.push(i),o)},hoverOnBoxes:s,hoverOnPoints:l}}),mo=f((t,e)=>{e.exports=function(t,e){return e.hoverOnBox&&(t.hoverOnBox=e.hoverOnBox),"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}),go=f((t,e)=>{e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++)i[r].pts[n].selected=0;else for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++){var l=i[r].pts[n],u=a.c2p(l.x),c=o.c2p(l.y);e.contains([u,c],null,l.i,t)?(s.push({pointNumber:l.i,x:a.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s}}),yo=f((t,e)=>{e.exports={attributes:ao(),layoutAttributes:oo(),supplyDefaults:so().supplyDefaults,crossTraceDefaults:so().crossTraceDefaults,supplyLayoutDefaults:lo().supplyLayoutDefaults,calc:uo(),crossTraceCalc:co().crossTraceCalc,plot:ho().plot,style:fo().style,styleOnSelect:fo().styleOnSelect,hoverPoints:po().hoverPoints,eventData:mo(),selectPoints:go(),moduleType:"trace",name:"box",basePlotModule:Ai(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),vo=f((t,e)=>{e.exports=yo()}),xo=f((t,e)=>{var r=bn(),n=j(),i=R(),a=Se().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=Ie(),u=D().extendFlat;e.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},r.x,{impliedEdits:{xtype:"array"}}),x0:u({},r.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},r.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},r.y,{impliedEdits:{ytype:"array"}}),y0:u({},r.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},r.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},r.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},r.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},r.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},r.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},r.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},r.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:o(),texttemplate:s({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},n.showlegend,{dflt:!1}),zorder:r.zorder},l("",{cLetter:"z",autoColorDflt:!1}))}),_o=f((t,e)=>{var r=T(),n=oe(),i=Ut();function a(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}e.exports=function(t,e,o,s,l,u){var c,h,f=o("z");if(l=l||"x",u=u||"y",void 0===f||!f.length)return 0;if(n.isArray1D(f)){c=o(l),h=o(u);var p=n.minRowLength(c),d=n.minRowLength(h);if(0===p||0===d)return 0;e._length=Math.min(p,d,f.length)}else{if(c=a(l,o),h=a(u,o),!function(t){for(var e,i=!0,a=!1,o=!1,s=0;s<t.length;s++){if(e=t[s],!n.isArrayOrTypedArray(e)){i=!1;break}e.length>0&&(a=!0);for(var l=0;l<e.length;l++)if(r(e[l])){o=!0;break}}return i&&a&&o}(f))return 0;o("transpose"),e._length=null}return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,[l,u],s),!0}}),bo=f((t,e)=>{var r=oe();e.exports=function(t,e){t("texttemplate");var n=r.extendFlat({},e.font,{color:"auto",size:"auto"});r.coerceFont(t,"textfont",n)}}),wo=f((t,e)=>{e.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}}),To=f((t,e)=>{var r=oe(),n=_o(),i=bo(),a=qn(),o=wo(),s=Ue(),l=xo();e.exports=function(t,e,u,c){function h(n,i){return r.coerce(t,e,l,n,i)}n(t,e,h,c)?(a(t,e,c,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),i(h,c),o(t,e,h,c),h("hoverongaps"),h("connectgaps",r.isArray1D(e.z)&&!1!==e.zsmooth),s(t,e,c,h,{prefix:"",cLetter:"z"}),h("zorder")):e.visible=!1}}),ko=f((t,e)=>{var r=T();e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,n,i){var a=i[e];return r(a)?(a=Number(a),n[t]+=a,a):0},avg:function(t,e,n,i,a){var o=i[e];return r(o)&&(o=Number(o),n[t]+=o,a[t]++),0},min:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]>a){var o=a-n[t];return n[t]=a,o}}return 0},max:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]<a){var o=a-n[t];return n[t]=a,o}}return 0}}}),Ao=f((t,e)=>{e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;i<r;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;a<i;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;a<i;a++)t[a]*=r[a]/e}}}),Mo=f((t,e)=>{e.exports=function(t,e){for(var r=t.length,n=0,i=0;i<r;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}}),So=f((t,e)=>{var r=k(),n=r.ONEAVGYEAR,i=r.ONEAVGMONTH,a=r.ONEDAY,o=r.ONEHOUR,s=r.ONEMIN,l=r.ONESEC,u=rr().tickIncrement;function c(t,e,r,n){if(t*e<=0)return 1/0;for(var i=Math.abs(e-t),a="date"===r.type,o=h(i,a),s=0;s<10;s++){var l=h(80*o,a);if(o===l)break;if(!f(l,t,e,a,r,n))break;o=l}return o}function h(t,e){return e&&t>l?t>a?t>1.1*n?n:t>1.1*i?i:a:t>o?o:t>s?s:l:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function f(t,e,r,i,o,s){if(i&&t>a){var l=p(e,o,s),u=p(r,o,s),c=t===n?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var i=e.c2d(t,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}e.exports=function(t,e,r,i,o){var s,l,h=-1.1*e,f=-.1*e,p=t-f,d=r[0],m=r[1],g=Math.min(c(d+f,d+p,i,o),c(m+f,m+p,i,o)),y=Math.min(c(d+h,d+f,i,o),c(m+h,m+f,i,o));if(g>y&&y<Math.abs(m-d)/4e3?(s=g,l=!1):(s=Math.min(g,y),l=!0),"date"===i.type&&s>a){var v=s===n?1:6,x=s===n?"M12":"M1";return function(e,r){var a=i.c2d(e,n,o),s=a.indexOf("-",v);s>0&&(a=a.substr(0,s));var c=i.d2c(a,0,o);if(c<e){var h=u(c,x,!1,o);(c+h)/2<e+t&&(c=h)}return r&&l?u(c,x,!0,o):c}}return function(e,r){var n=s*Math.round(e/s);return n+s/10<e&&n+.9*s<e+t&&(n+=s),r&&l&&(n-=s),n}}}),Eo=f((t,e)=>{var r=T(),n=oe(),i=Ut(),a=rr(),{hasColorscale:o}=Me(),s=He(),l=Ya(),u=ko(),c=Ao(),h=Mo(),f=So();function p(t,e,o,s,l){var u,c,h,f,d,m,g,y=s+"bins",v=t._fullLayout,x=e["_"+s+"bingroup"],_=v._histogramBinOpts[x],b="overlay"===v.barmode,w=function(t){return o.r2c(t,0,f)},T=function(t){return o.c2r(t,0,f)},k="date"===o.type?function(t){return t||0===t?n.cleanDate(t,null,f):null}:function(t){return r(t)?Number(t):null};function A(t,e,r){e[t+"Found"]?(e[t]=k(e[t]),null===e[t]&&(e[t]=r[t])):(m[t]=e[t]=r[t],n.nestedProperty(c[0],y+"."+t).set(r[t]))}if(e["_"+s+"autoBinFinished"])delete e["_"+s+"autoBinFinished"];else{c=_.traces;var M=[],S=!0,E=!1,C=!1;for(u=0;u<c.length;u++)if((h=c[u]).visible){var I=_.dirs[u];d=h["_"+I+"pos0"]=o.makeCalcdata(h,I),M=n.concat(M,d),delete h["_"+s+"autoBinFinished"],!0===e.visible&&(S?S=!1:(delete h._autoBin,h["_"+s+"autoBinFinished"]=1),i.traceIs(h,"2dMap")&&(E=!0),"histogram2dcontour"===h.type&&(C=!0))}f=c[0][s+"calendar"];var L=a.autoBin(M,o,_.nbins,E,f,_.sizeFound&&_.size),P=c[0]._autoBin={};if(m=P[_.dirs[0]]={},C&&(_.size||(L.start=T(a.tickIncrement(w(L.start),L.size,!0,f))),void 0===_.end&&(L.end=T(a.tickIncrement(w(L.end),L.size,!1,f)))),b&&!i.traceIs(e,"2dMap")&&0===L._dataSpan&&"category"!==o.type&&"multicategory"!==o.type&&""===e.bingroup&&void 0===e.xbins){if(l)return[L,d,!0];L=function(t,e,r,i,a){var o,s,l,u=t._fullLayout,c=function(t,e){for(var r=e.xaxis,n=e.yaxis,i=e.orientation,a=[],o=t._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&!0===l.visible&&l.orientation===i&&l.xaxis===r&&l.yaxis===n&&a.push(l)}return a}(t,e),h=!1,f=1/0,d=[e];for(o=0;o<c.length;o++)if((s=c[o])===e)h=!0;else if(h){var m=p(t,s,r,i,!0),g=m[0],y=m[2];s["_"+i+"autoBinFinished"]=1,s["_"+i+"pos0"]=m[1],y?d.push(s):f=Math.min(f,g.size)}else l=u._histogramBinOpts[s["_"+i+"bingroup"]],f=Math.min(f,l.size||s[a].size);var v=new Array(d.length);for(o=0;o<d.length;o++)for(var x=d[o]["_"+i+"pos0"],_=0;_<x.length;_++)if(void 0!==x[_]){v[o]=x[_];break}for(isFinite(f)||(f=n.distinctVals(v).minDiff),o=0;o<d.length;o++){var b=(s=d[o])[i+"calendar"],w={start:r.c2r(v[o]-f/2,0,b),end:r.c2r(v[o]+f/2,0,b),size:f};s._input[a]=s[a]=w,(l=u._histogramBinOpts[s["_"+i+"bingroup"]])&&n.extendFlat(l,w)}return e[a]}(t,e,o,s,y)}(g=h.cumulative||{}).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?L.start=T(a.tickIncrement(w(L.start),L.size,!0,f)):L.end=T(a.tickIncrement(w(L.end),L.size,!1,f))),_.size=L.size,_.sizeFound||(m.size=L.size,n.nestedProperty(c[0],y+".size").set(L.size)),A("start",_,L),A("end",_,L)}d=e["_"+s+"pos0"],delete e["_"+s+"pos0"];var z=e._input[y]||{},O=n.extendFlat({},_),D=_.start,R=o.r2l(z.start),F=void 0!==R;if((_.startFound||F)&&R!==o.r2l(D)){var B=F?R:n.aggNums(Math.min,null,d),N={type:"category"===o.type||"multicategory"===o.type?"linear":o.type,r2l:o.r2l,dtick:_.size,tick0:D,calendar:f,range:[B,a.tickIncrement(B,_.size,!1,f)].map(o.l2r)},j=a.tickFirst(N);j>o.r2l(B)&&(j=a.tickIncrement(j,_.size,!0,f)),O.start=o.l2r(j),F||n.nestedProperty(e,y+".start").set(O.start)}var U=_.end,V=o.r2l(z.end),q=void 0!==V;if((_.endFound||q)&&V!==o.r2l(U)){var H=q?V:n.aggNums(Math.max,null,d);O.end=o.l2r(H),q||n.nestedProperty(e,y+".start").set(O.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=n.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[O,d]}e.exports={calc:function(t,e){var i,d,m,g,y=[],v=[],x="h"===e.orientation,_=a.getFromId(t,x?e.yaxis:e.xaxis),b=x?"y":"x",w={x:"y",y:"x"}[b],T=e[b+"calendar"],k=e.cumulative,A=p(t,e,_,b),M=A[0],S=A[1],E="string"==typeof M.size,C=[],I=E?C:M,L=[],P=[],z=[],O=0,D=e.histnorm,R=e.histfunc,F=-1!==D.indexOf("density");k.enabled&&F&&(D=D.replace(/ ?density$/,""),F=!1);var B,N="max"===R||"min"===R?null:0,j=u.count,U=c[D],V=!1,q=function(t){return _.r2c(t,0,T)};for(n.isArrayOrTypedArray(e[w])&&"count"!==R&&(B=e[w],V="avg"===R,j=u[R]),i=q(M.start),m=q(M.end)+(i-a.tickIncrement(i,M.size,!1,T))/1e6;i<m&&y.length<1e6&&(d=a.tickIncrement(i,M.size,!1,T),y.push((i+d)/2),v.push(N),z.push([]),C.push(i),F&&L.push(1/(d-i)),V&&P.push(0),!(d<=i));)i=d;C.push(i),!E&&"date"===_.type&&(I={start:q(I.start),end:q(I.end),size:I.size}),t._fullLayout._roundFnOpts||(t._fullLayout._roundFnOpts={});var H=e["_"+b+"bingroup"],G={leftGap:1/0,rightGap:1/0};H&&(t._fullLayout._roundFnOpts[H]||(t._fullLayout._roundFnOpts[H]=G),G=t._fullLayout._roundFnOpts[H]);var Z,W=v.length,Y=!0,X=G.leftGap,$=G.rightGap,J={};for(i=0;i<S.length;i++){var K=S[i];(g=n.findBin(K,I))>=0&&g<W&&(O+=j(g,i,v,B,P),Y&&z[g].length&&K!==S[z[g][0]]&&(Y=!1),z[g].push(i),J[i]=g,X=Math.min(X,K-C[g]),$=Math.min($,C[g+1]-K))}G.leftGap=X,G.rightGap=$,Y||(Z=function(e,r){return function(){var n=t._fullLayout._roundFnOpts[H];return f(n.leftGap,n.rightGap,C,_,T)(e,r)}}),V&&(O=h(v,P)),U&&U(v,O,L),k.enabled&&function(t,e,r){var n,i,a;function o(e){a=t[e],t[e]/=2}function s(e){i=t[e],t[e]=a+i/2,a+=i}if("half"===r)if("increasing"===e)for(o(0),n=1;n<t.length;n++)s(n);else for(o(t.length-1),n=t.length-2;n>=0;n--)s(n);else if("increasing"===e){for(n=1;n<t.length;n++)t[n]+=t[n-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(n=t.length-2;n>=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,k.direction,k.currentbin);var Q=Math.min(y.length,v.length),tt=[],et=0,rt=Q-1;for(i=0;i<Q;i++)if(v[i]){et=i;break}for(i=Q-1;i>=et;i--)if(v[i]){rt=i;break}for(i=et;i<=rt;i++)if(r(y[i])&&r(v[i])){var nt={p:y[i],s:v[i],b:0};k.enabled||(nt.pts=z[i],Y?nt.ph0=nt.ph1=z[i].length?S[z[i][0]]:y[i]:(e._computePh=!0,nt.ph0=Z(C[i]),nt.ph1=Z(C[i+1],!0))),tt.push(nt)}return 1===tt.length&&(tt[0].width1=a.tickIncrement(tt[0].p,M.size,!1,T)-tt[0].p),o(e,"marker")&&s(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),o(e,"marker.line")&&s(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),l(tt,e),n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(tt,e,J),tt},calcAllAutoBins:p}}),Co=f((t,e)=>{var r=oe(),n=rr(),i=ko(),a=Ao(),o=Mo(),s=So(),l=Eo().calcAllAutoBins;function u(t,e,r,n){var i,a=new Array(t);if(n)for(i=0;i<t;i++)a[i]=1/(e[i+1]-e[i]);else{var o=1/r;for(i=0;i<t;i++)a[i]=o}return a}function c(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function h(t,e,r,n,i,a){var o,l=t.length-1,u=new Array(l),c=s(r,n,t,i,a);for(o=0;o<l;o++){var h=(e||[])[o];u[o]=void 0===h?[c(t[o]),c(t[o+1],!0)]:[h,h]}return u}e.exports=function(t,e){var s,f,p,d,m=n.getFromId(t,e.xaxis),g=n.getFromId(t,e.yaxis),y=e.xcalendar,v=e.ycalendar,x=function(t){return m.r2c(t,0,y)},_=function(t){return g.r2c(t,0,v)},b=l(t,e,m,"x"),w=b[0],T=b[1],k=l(t,e,g,"y"),A=k[0],M=k[1],S=e._length;T.length>S&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],C=[],I=[],L="string"==typeof w.size,P="string"==typeof A.size,z=[],O=[],D=L?z:w,R=P?O:A,F=0,B=[],N=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[j],Z=!1,W=[],Y=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(Z="avg"===U,H=i[U]);var $=w.size,J=x(w.start),K=x(w.end)+(J-n.tickIncrement(J,$,!1,y))/1e6;for(s=J;s<K;s=n.tickIncrement(s,$,!1,y))C.push(q),z.push(s),Z&&I.push(0);z.push(s);var Q,tt=C.length,et=(s-J)/tt,rt=(Q=J+et/2,m.c2r(Q,0,y)),nt=A.size,it=_(A.start),at=_(A.end)+(it-n.tickIncrement(it,nt,!1,v))/1e6;for(s=it;s<at;s=n.tickIncrement(s,nt,!1,v)){E.push(C.slice()),O.push(s);var ot=new Array(tt);for(f=0;f<tt;f++)ot[f]=[];N.push(ot),Z&&B.push(I.slice())}O.push(s);var st=E.length,lt=(s-it)/st,ut=function(t){return g.c2r(t,0,v)}(it+lt/2);V&&(W=u(C.length,D,et,L),Y=u(E.length,R,lt,P)),!L&&"date"===m.type&&(D=c(x,D)),!P&&"date"===g.type&&(R=c(_,R));var ct=!0,ht=!0,ft=new Array(tt),pt=new Array(st),dt=1/0,mt=1/0,gt=1/0,yt=1/0;for(s=0;s<S;s++){var vt=T[s],xt=M[s];p=r.findBin(vt,D),d=r.findBin(xt,R),p>=0&&p<tt&&d>=0&&d<st&&(F+=H(p,s,E[d],X,B[d]),N[d][p].push(s),ct&&(void 0===ft[p]?ft[p]=vt:ft[p]!==vt&&(ct=!1)),ht&&(void 0===pt[d]?pt[d]=xt:pt[d]!==xt&&(ht=!1)),dt=Math.min(dt,vt-z[p]),mt=Math.min(mt,z[p+1]-vt),gt=Math.min(gt,xt-O[d]),yt=Math.min(yt,O[d+1]-xt))}if(Z)for(d=0;d<st;d++)F+=o(E[d],B[d]);if(G)for(d=0;d<st;d++)G(E[d],F,W,Y[d]);return{x:T,xRanges:h(z,ct&&ft,dt,mt,m,y),x0:rt,dx:et,y:M,yRanges:h(O,ht&&pt,gt,yt,g,v),y0:ut,dy:lt,z:E,pts:N}}}),Io=f((t,e)=>{var r=oe(),n=k().BADNUM,i=ti();e.exports=function(t,e,a,o,s,l){var u=t._length,c=e.makeCalcdata(t,o),h=a.makeCalcdata(t,s);c=i(t,e,o,c).vals,h=i(t,a,s,h).vals;var f,p,d,m,g=t.text,y=void 0!==g&&r.isArray1D(g),v=t.hovertext,x=void 0!==v&&r.isArray1D(v),_=r.distinctVals(c),b=_.vals,w=r.distinctVals(h),T=w.vals,k=[],A=T.length,M=b.length;for(f=0;f<l.length;f++)k[f]=r.init2dArray(A,M);y&&(d=r.init2dArray(A,M)),x&&(m=r.init2dArray(A,M));var S=r.init2dArray(A,M);for(f=0;f<u;f++)if(c[f]!==n&&h[f]!==n){var E=r.findBin(c[f]+_.minDiff/2,b),C=r.findBin(h[f]+w.minDiff/2,T);for(p=0;p<l.length;p++){var I=t[l[p]];k[p][C][E]=I[f],S[C][E]=f}y&&(d[C][E]=g[f]),x&&(m[C][E]=v[f])}for(t["_"+o]=b,t["_"+s]=T,p=0;p<l.length;p++)t["_"+l[p]]=k[p];y&&(t._text=d),x&&(t._hovertext=m),e&&"category"===e.type&&(t["_"+o+"CategoryMap"]=b.map(function(t){return e._categories[t]})),a&&"category"===a.type&&(t["_"+s+"CategoryMap"]=T.map(function(t){return a._categories[t]})),t._after2before=S}}),Lo=f((t,e)=>{var r=T(),n=oe(),i=k().BADNUM;e.exports=function(t,e,a,o){var s,l,u,c,h,f;function p(t){if(r(t))return+t}if(e&&e.transpose){for(s=0,h=0;h<t.length;h++)s=Math.max(s,t[h].length);if(0===s)return!1;u=function(t){return t.length},c=function(t,e,r){return(t[r]||[])[e]}}else s=t.length,u=function(t,e){return t[e].length},c=function(t,e,r){return(t[e]||[])[r]};var d=function(t,e,r){return e===i||r===i?i:c(t,e,r)};function m(t){if(e&&"carpet"!==e.type&&"contourcarpet"!==e.type&&t&&"category"===t.type&&e["_"+t._id.charAt(0)].length){var r=t._id.charAt(0),a={},o=e["_"+r+"CategoryMap"]||e[r];for(h=0;h<o.length;h++)a[o[h]]=h;return function(e){var r=a[t._categories[e]];return r+1?r:i}}return n.identity}var g=m(a),y=m(o);o&&"category"===o.type&&(s=o._categories.length);var v=new Array(s);for(h=0;h<s;h++)for(l=a&&"category"===a.type?a._categories.length:u(t,h),v[h]=new Array(l),f=0;f<l;f++)v[h][f]=p(d(t,y(h),g(f)));return v}}),Po=f((t,e)=>{var r=oe(),n=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function a(t,e,r){var i,a,o,s,l,u,c,h,f,p,d,m,g,y=0;for(s=0;s<e.length;s++){for(a=(i=e[s])[0],o=i[1],d=t[a][o],p=0,f=0,l=0;l<4;l++)(c=t[a+(u=n[l])[0]])&&void 0!==(h=c[o+u[1]])&&(0===p?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),f++,p+=h);if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[a][o]=p/f,void 0===d?f<4&&(y=1):(t[a][o]=(1+r)*t[a][o]-r*d,g>m&&(y=Math.max(y,Math.abs(t[a][o]-d)/(g-m))))}return y}e.exports=function(t,e){var n,o=1;for(a(t,e),n=0;n<e.length&&!(e[n][2]<4);n++);for(e=e.slice(n),n=0;n<100&&o>.01;n++)o=a(t,e,i(o));return o>.01&&r.log("interp2d didn't converge quickly",o),t}}),zo=f((t,e)=>{var r=oe().maxRowLength;e.exports=function(t){var e,n,i,a,o,s,l,u,c=[],h={},f=[],p=t[0],d=[],m=[0,0,0],g=r(t);for(n=0;n<t.length;n++)for(e=d,d=p,p=t[n+1]||[],i=0;i<g;i++)void 0===d[i]&&((s=(void 0!==d[i-1]?1:0)+(void 0!==d[i+1]?1:0)+(void 0!==e[i]?1:0)+(void 0!==p[i]?1:0))?(0===n&&s++,0===i&&s++,n===t.length-1&&s++,i===d.length-1&&s++,s<4&&(h[[n,i]]=[n,i,s]),c.push([n,i,s])):f.push([n,i]));for(;f.length;){for(l={},u=!1,o=f.length-1;o>=0;o--)(s=((h[[(n=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],f.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}}),Oo=f((t,e)=>{var r=Ut(),n=oe().isArrayOrTypedArray;e.exports=function(t,e,i,a,o,s){var l,u,c,h=[],f=r.traceIs(t,"contour"),p=r.traceIs(t,"histogram");if(n(e)&&e.length>1&&!p&&"category"!==s.type){var d=e.length;if(!(d<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f)h=Array.from(e).slice(0,o);else if(1===o)h="log"===s.type?[.5*e[0],2*e[0]]:[e[0]-.5,e[0]+.5];else if("log"===s.type){for(h=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],c=1;c<d;c++)h.push(Math.sqrt(e[c-1]*e[c]));h.push(Math.pow(e[d-1],1.5)/Math.pow(e[d-2],.5))}else{for(h=[1.5*e[0]-.5*e[1]],c=1;c<d;c++)h.push(.5*(e[c-1]+e[c]));h.push(1.5*e[d-1]-.5*e[d-2])}if(d<o){var m,g=h[h.length-1];if("log"===s.type)for(m=g/h[h.length-2],c=d;c<o;c++)g*=m,h.push(g);else for(m=g-h[h.length-2],c=d;c<o;c++)g+=m,h.push(g)}}else{var y=t[s._id.charAt(0)+"calendar"];for(l=p?s.r2c(i,0,y):n(e)&&1===e.length?e[0]:void 0===i?0:("log"===s.type?s.d2c:s.r2c)(i,0,y),u=a||1,c=f?0:-.5;c<o;c++)h.push(l+u*c)}return h}}),Do=f((t,e)=>{var r=Ut(),n=oe(),i=rr(),a=ti(),o=Co(),s=He(),l=Io(),u=Lo(),c=Po(),h=zo(),f=Oo(),p=k().BADNUM;function d(t){for(var e=[],r=t.length,n=0;n<r;n++){var i=t[n];i!==p&&e.push(i)}return e}e.exports=function(t,e){var m,g,y,v,x,_,b,w,T,k,A,M=i.getFromId(t,e.xaxis||"x"),S=i.getFromId(t,e.yaxis||"y"),E=r.traceIs(e,"contour"),C=r.traceIs(e,"histogram"),I=E?"best":e.zsmooth;if(M._minDtick=0,S._minDtick=0,C)v=(A=o(t,e)).orig_x,m=A.x,g=A.x0,y=A.dx,w=A.orig_y,x=A.y,_=A.y0,b=A.dy,T=A.z;else{var L=e.z;n.isArray1D(L)?(l(e,M,S,"x","y",["z"]),m=e._x,x=e._y,L=e._z):(v=e.x?M.makeCalcdata(e,"x"):[],w=e.y?S.makeCalcdata(e,"y"):[],m=a(e,M,"x",v).vals,x=a(e,S,"y",w).vals,e._x=m,e._y=x),g=e.x0,y=e.dx,_=e.y0,b=e.dy,T=u(L,e,M,S)}function P(t){I=e._input.zsmooth=e.zsmooth=!1,n.warn('cannot use zsmooth: "fast": '+t)}function z(t){if(t.length>1){var e=(t[t.length-1]-t[0])/(t.length-1),r=Math.abs(e/100);for(k=0;k<t.length-1;k++)if(Math.abs(t[k+1]-t[k]-e)>r)return!1}return!0}(M.rangebreaks||S.rangebreaks)&&(T=function(t,e,r){for(var n=[],i=-1,a=0;a<r.length;a++)if(e[a]!==p){n[++i]=[];for(var o=0;o<r[a].length;o++)t[o]!==p&&n[i].push(r[a][o])}return n}(m,x,T),C||(m=d(m),x=d(x),e._x=m,e._y=x)),!C&&(E||e.connectgaps)&&(e._emptypoints=h(T),c(T,e._emptypoints)),e._islinear=!1,"log"===M.type||"log"===S.type?"fast"===I&&P("log axis found"):z(m)?z(x)?e._islinear=!0:"fast"===I&&P("y scale is not linear"):"fast"===I&&P("x scale is not linear");var O=n.maxRowLength(T),D="scaled"===e.xtype?"":m,R=f(e,D,g,y,O,M),F="scaled"===e.ytype?"":x,B=f(e,F,_,b,T.length,S);e._extremes[M._id]=i.findExtremes(M,R),e._extremes[S._id]=i.findExtremes(S,B);var N={x:R,y:B,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&v&&(N.orig_x=v),e.yperiodalignment&&w&&(N.orig_y=w),D&&D.length===R.length-1&&(N.xCenter=D),F&&F.length===B.length-1&&(N.yCenter=F),C&&(N.xRanges=A.xRanges,N.yRanges=A.yRanges,N.pts=A.pts),E||s(t,e,{vals:T,cLetter:"z"}),E&&e.contours&&"heatmap"===e.contours.coloring){var j={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=f(j,D,g,y,O,M),N.yfill=f(j,F,_,b,T.length,S)}return[N]}}),Ro=f(t=>{t.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],t.STYLE=t.CSS_DECLARATIONS.map(function(t){return t.join(": ")+"; "}).join("")}),Fo=f((t,e)=>{var r=Ro(),n=Je(),i=oe(),a=null;e.exports=function(){if(null!==a)return a;a=!1;var t=i.isSafari()||i.isMacWKWebView()||i.isIOS();if(window.navigator.userAgent&&!t){var e=Array.from(r.CSS_DECLARATIONS).reverse(),o=window.CSS&&window.CSS.supports||window.supportsCSS;if("function"==typeof o)a=e.some(function(t){return o.apply(null,t)});else{var s=n.tester.append("image").attr("style",r.STYLE),l=window.getComputedStyle(s.node()).imageRendering;a=e.some(function(t){var e=t[1];return l===e||l===e.toLowerCase()}),s.remove()}}return a}}),Bo=f((t,e)=>{var r=v(),n=O(),i=Ut(),a=Je(),o=rr(),s=oe(),l=Ae(),u=fi(),c=q(),h=Ge().extractOpts,f=Ge().makeColorScaleFuncFromTrace,p=Te(),d=ke().LINE_SPACING,m=Fo(),g=Ro().STYLE,y="heatmap-label";function x(t){return t.selectAll("g."+y)}function _(t){x(t).remove()}function b(t,e){var r=e.length-2,n=s.constrain(s.findBin(t,e),0,r),i=e[n],a=e[n+1],o=s.constrain(n+(t-i)/(a-i)-.5,0,r),l=Math.round(o),u=Math.abs(o-l);return o&&o!==r&&u?{bin0:l,frac:u,bin1:Math.round(l+u/(o-l))}:{bin0:l,bin1:l,frac:0}}function w(t,e){var r=e.length-1,n=s.constrain(s.findBin(t,e),0,r),i=e[n],a=(t-i)/(e[n+1]-i)||0;return a<=0?{bin0:n,bin1:n,frac:0}:a<.5?{bin0:n,bin1:n+1,frac:a}:{bin0:n+1,bin1:n,frac:1-a}}function T(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}e.exports=function(t,e,v,k){var A=e.xaxis,M=e.yaxis;s.makeTraceGroups(k,v,"hm").each(function(e){var v,k,S,E,C,I,L,P,z=r.select(this),O=e[0],D=O.trace,R=D.xgap||0,F=D.ygap||0,B=O.z,N=O.x,j=O.y,U=O.xCenter,V=O.yCenter,q=i.traceIs(D,"contour"),H=q?"best":D.zsmooth,G=B.length,Z=s.maxRowLength(B),W=!1,Y=!1;for(I=0;void 0===v&&I<N.length-1;)v=A.c2p(N[I]),I++;for(I=N.length-1;void 0===k&&I>0;)k=A.c2p(N[I]),I--;for(k<v&&(S=k,k=v,v=S,W=!0),I=0;void 0===E&&I<j.length-1;)E=M.c2p(j[I]),I++;for(I=j.length-1;void 0===C&&I>0;)C=M.c2p(j[I]),I--;C<E&&(S=E,E=C,C=S,Y=!0),q&&(U=N,V=j,N=O.xfill,j=O.yfill);var X="default";if(H?X="best"===H?"smooth":"fast":D._islinear&&0===R&&0===F&&m()&&(X="fast"),"fast"!==X){var $="best"===H?0:.5;v=Math.max(-$*A._length,v),k=Math.min((1+$)*A._length,k),E=Math.max(-$*M._length,E),C=Math.min((1+$)*M._length,C)}var J,K,Q=Math.round(k-v),tt=Math.round(C-E);if(v>=A._length||k<=0||E>=M._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void _(z);"fast"===X?(J=Z,K=G):(J=Q,K=tt);var et=document.createElement("canvas");et.width=J,et.height=K;var rt,nt,it=et.getContext("2d",{willReadFrequently:!0}),at=f(D,{noNumericCheck:!0,returnArray:!0});"fast"===X?(rt=W?function(t){return Z-1-t}:s.identity,nt=Y?function(t){return G-1-t}:s.identity):(rt=function(t){return s.constrain(Math.round(A.c2p(N[t])-v),0,Q)},nt=function(t){return s.constrain(Math.round(M.c2p(j[t])-E),0,tt)});var ot,st,lt,ut,ct=nt(0),ht=[ct,ct],ft=W?0:1,pt=Y?0:1,dt=0,mt=0,gt=0,yt=0;function vt(t,e){if(void 0!==t){var r=at(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),dt+=e,mt+=r[0]*e,gt+=r[1]*e,yt+=r[2]*e,r}return[0,0,0,0]}function xt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return vt(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,vt(i+r.frac*u+n.frac*(c+r.frac*a))}if("default"!==X){var _t,bt=0;try{_t=new Uint8Array(J*K*4)}catch(t){_t=new Array(J*K*4)}if("smooth"===X){var wt,Tt,kt,At=U||N,Mt=V||j,St=new Array(At.length),Et=new Array(Mt.length),Ct=new Array(Q),It=U?w:b,Lt=V?w:b;for(I=0;I<At.length;I++)St[I]=Math.round(A.c2p(At[I])-v);for(I=0;I<Mt.length;I++)Et[I]=Math.round(M.c2p(Mt[I])-E);for(I=0;I<Q;I++)Ct[I]=It(I,St);for(L=0;L<tt;L++)for(Tt=B[(wt=Lt(L,Et)).bin0],kt=B[wt.bin1],I=0;I<Q;I++,bt+=4)T(_t,bt,ut=xt(Tt,kt,Ct[I],wt))}else for(L=0;L<G;L++)for(lt=B[L],ht=nt(L),I=0;I<Z;I++)ut=vt(lt[I],1),T(_t,bt=4*(ht*Z+rt(I)),ut);var Pt=it.createImageData(J,K);try{Pt.data.set(_t)}catch(t){var zt=Pt.data,Ot=zt.length;for(L=0;L<Ot;L++)zt[L]=_t[L]}it.putImageData(Pt,0,0)}else{var Dt=Math.floor(R/2),Rt=Math.floor(F/2);for(L=0;L<G;L++)if(lt=B[L],ht.reverse(),ht[pt]=nt(L+1),ht[0]!==ht[1]&&void 0!==ht[0]&&void 0!==ht[1])for(ot=[st=rt(0),st],I=0;I<Z;I++)ot.reverse(),ot[ft]=rt(I+1),ot[0]!==ot[1]&&void 0!==ot[0]&&void 0!==ot[1]&&(ut=vt(lt[I],(ot[1]-ot[0])*(ht[1]-ht[0])),it.fillStyle="rgba("+ut.join(",")+")",it.fillRect(ot[0]+Dt,ht[0]+Rt,ot[1]-ot[0]-R,ht[1]-ht[0]-F))}mt=Math.round(mt/dt),gt=Math.round(gt/dt),yt=Math.round(yt/dt);var Ft=n("rgb("+mt+","+gt+","+yt+")");t._hmpixcount=(t._hmpixcount||0)+dt,t._hmlumcount=(t._hmlumcount||0)+dt*Ft.getLuminance();var Bt=z.selectAll("image").data(e);Bt.enter().append("svg:image").attr({xmlns:p.svg,preserveAspectRatio:"none"}),Bt.attr({height:tt,width:Q,x:v,y:E,"xlink:href":et.toDataURL("image/png")}),"fast"===X&&!H&&Bt.attr("style",g),_(z);var Nt=D.texttemplate;if(Nt){var jt=h(D),Ut={type:"linear",range:[jt.min,jt.max],_separators:A._separators,_numFormat:A._numFormat},Vt="histogram2dcontour"===D.type,qt="contour"===D.type,Ht=qt?G-1:G,Gt=qt?1:0,Zt=qt?Z-1:Z,Wt=[];for(I=qt?1:0;I<Ht;I++){var Yt;if(qt)Yt=O.y[I];else if(Vt){if(0===I||I===G-1)continue;Yt=O.y[I]}else if(O.yCenter)Yt=O.yCenter[I];else{if(I+1===G&&void 0===O.y[I+1])continue;Yt=(O.y[I]+O.y[I+1])/2}var Xt=Math.round(M.c2p(Yt));if(!(0>Xt||Xt>M._length))for(L=Gt;L<Zt;L++){var $t;if(qt)$t=O.x[L];else if(Vt){if(0===L||L===Z-1)continue;$t=O.x[L]}else if(O.xCenter)$t=O.xCenter[L];else{if(L+1===Z&&void 0===O.x[L+1])continue;$t=(O.x[L]+O.x[L+1])/2}var Jt=Math.round(A.c2p($t));if(!(0>Jt||Jt>A._length)){var Kt=u({x:$t,y:Yt},D,t._fullLayout);Kt.x=$t,Kt.y=Yt;var Qt=O.z[I][L];void 0===Qt?(Kt.z="",Kt.zLabel=""):(Kt.z=Qt,Kt.zLabel=o.tickText(Ut,Qt,"hover").text);var te=O.text&&O.text[I]&&O.text[I][L];(void 0===te||!1===te)&&(te=""),Kt.text=te;var ee=s.texttemplateString(Nt,Kt,t._fullLayout._d3locale,Kt,D._meta||{});if(ee){var re=ee.split("<br>"),ne=re.length,ie=0;for(P=0;P<ne;P++)ie=Math.max(ie,re[P].length);Wt.push({l:ne,c:ie,t:ee,x:Jt,y:Xt,z:Qt})}}}}var ae=D.textfont,oe=ae.size,se=t._fullLayout.font.size;if(!oe||"auto"===oe){var le=1/0,ue=1/0,ce=0,he=0;for(P=0;P<Wt.length;P++){var fe=Wt[P];if(ce=Math.max(ce,fe.l),he=Math.max(he,fe.c),P<Wt.length-1){var pe=Wt[P+1],de=Math.abs(pe.x-fe.x),me=Math.abs(pe.y-fe.y);de&&(le=Math.min(le,de)),me&&(ue=Math.min(ue,me))}}isFinite(le)&&isFinite(ue)?(le-=R,ue-=F,le/=he,ue/=ce,le/=d/2,ue/=d,oe=Math.min(Math.floor(le),Math.floor(ue),se)):oe=se}if(oe<=0||!isFinite(oe))return;x(z).data(Wt).enter().append("g").classed(y,1).append("text").attr("text-anchor","middle").each(function(e){var n=r.select(this),i=ae.color;(!i||"auto"===i)&&(i=c.contrast(void 0===e.z?t._fullLayout.plot_bgcolor:"rgba("+at(e.z).join()+")")),n.attr("data-notex",1).call(l.positionText,function(t){return t.x}(e),function(t){return t.y-oe*(t.l*d/2-1)}(e)).call(a.font,{family:ae.family,size:oe,color:i,weight:ae.weight,style:ae.style,variant:ae.variant,textcase:ae.textcase,lineposition:ae.lineposition,shadow:ae.shadow}).text(e.t).call(l.convertToTspans,t)})}})}}),No=f((t,e)=>{e.exports={min:"zmin",max:"zmax"}}),jo=f((t,e)=>{var r=v();e.exports=function(t){r.select(t).selectAll(".hm image").style("opacity",function(t){return t.trace.opacity})}}),Uo=f((t,e)=>{var r=Pr(),n=oe(),i=n.isArrayOrTypedArray,a=rr(),o=Ge().extractOpts;e.exports=function(t,e,s,l,u){u||(u={});var c,h,f,p,d=u.isContour,m=t.cd[0],g=m.trace,y=t.xa,v=t.ya,x=m.x,_=m.y,b=m.z,w=m.xCenter,T=m.yCenter,k=m.zmask,A=g.zhoverformat,M=x,S=_;if(!1!==t.index){try{f=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(e){return void n.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=b[0].length||p<0||p>b.length)return}else{if(r.inbox(e-x[0],e-x[x.length-1],0)>0||r.inbox(s-_[0],s-_[_.length-1],0)>0)return;if(d){var E;for(M=[2*x[0]-x[1]],E=1;E<x.length;E++)M.push((x[E]+x[E-1])/2);for(M.push([2*x[x.length-1]-x[x.length-2]]),S=[2*_[0]-_[1]],E=1;E<_.length;E++)S.push((_[E]+_[E-1])/2);S.push([2*_[_.length-1]-_[_.length-2]])}f=Math.max(0,Math.min(M.length-2,n.findBin(e,M))),p=Math.max(0,Math.min(S.length-2,n.findBin(s,S)))}var C,I,L=y.c2p(x[f]),P=y.c2p(x[f+1]),z=v.c2p(_[p]),O=v.c2p(_[p+1]);d?(C=m.orig_x||x,I=m.orig_y||_,P=L,c=C[f],O=z,h=I[p]):(C=m.orig_x||w||x,I=m.orig_y||T||_,c=w?C[f]:(C[f]+C[f+1])/2,h=T?I[p]:(I[p]+I[p+1])/2,y&&"category"===y.type&&(c=x[f]),v&&"category"===v.type&&(h=_[p]),g.zsmooth&&(L=P=y.c2p(c),z=O=v.c2p(h)));var D=b[p][f];if(k&&!k[p][f]&&(D=void 0),void 0!==D||g.hoverongaps){var R;i(m.hovertext)&&i(m.hovertext[p])?R=m.hovertext[p][f]:i(m.text)&&i(m.text[p])&&(R=m.text[p][f]);var F=o(g),B={type:"linear",range:[F.min,F.max],hoverformat:A,_separators:y._separators,_numFormat:y._numFormat},N=a.tickText(B,D,"hover").text;return[n.extendFlat(t,{index:g._after2before?g._after2before[p][f]:[p,f],distance:t.maxHoverDistance,spikeDistance:t.maxSpikeDistance,x0:L,x1:P,y0:z,y1:O,xLabelVal:c,yLabelVal:h,zLabelVal:D,zLabel:N,text:R})]}}}),Vo=f((t,e)=>{e.exports={attributes:xo(),supplyDefaults:To(),calc:Do(),plot:Bo(),colorbar:No(),style:jo(),hoverPoints:Uo(),moduleType:"trace",name:"heatmap",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),qo=f((t,e)=>{e.exports=Vo()}),Ho=f((t,e)=>{e.exports=function(t,e){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),Go=f((t,e)=>{e.exports={eventDataKeys:["binNumber"]}}),Zo=f((t,e)=>{var r=qa(),n=Se().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Ot().texttemplateAttrs,o=R(),s=Ho(),l=Go(),u=D().extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:n("x"),yhoverformat:n("y"),text:u({},r.text,{}),hovertext:u({},r.hovertext,{}),orientation:r.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:s("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:s("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:l.eventDataKeys}),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:u({},r.textposition,{arrayOk:!1}),textfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:r.insidetextanchor,textangle:r.textangle,cliponaxis:r.cliponaxis,constraintext:r.constraintext,marker:r.marker,offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,zorder:r.zorder}}),Wo=f((t,e)=>{var r=Ut(),n=oe(),i=q(),a=Za().handleText,o=Ga(),s=Zo();e.exports=function(t,e,l,u){function c(r,i){return n.coerce(t,e,s,r,i)}var h=c("x"),f=c("y");c("cumulative.enabled")&&(c("cumulative.direction"),c("cumulative.currentbin")),c("text");var p=c("textposition");a(t,e,u,c,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),c("hovertext"),c("hovertemplate"),c("xhoverformat"),c("yhoverformat");var d=c("orientation",f&&!h?"h":"v"),m="v"===d?"x":"y",g="v"===d?"y":"x",y=h&&f?Math.min(n.minRowLength(h)&&n.minRowLength(f)):n.minRowLength(e[m]||[]);if(y){e._length=y,r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u),e[g]&&c("histfunc"),c("histnorm"),c("autobin"+m),o(t,e,c,l,u),n.coerceSelectionMarkerOpacity(e,c);var v=(e.marker.line||{}).color,x=r.getComponentMethod("errorbars","supplyDefaults");x(t,e,v||i.defaultLine,{axis:"y"}),x(t,e,v||i.defaultLine,{axis:"x",inherit:"y"}),c("zorder")}else e.visible=!1}}),Yo=f((t,e)=>{var r=oe(),n=ye(),i=Ut().traceIs,a=Jn(),o=Za().validateCornerradius,s=r.nestedProperty,l=tn().getAxisGroup,u=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],c=["x","y"];e.exports=function(t,e){var h,f,p,d,m,g,y,v=e._histogramBinOpts={},x=[],_={},b=[];function w(t,e){return r.coerce(h._input,h,h._module.attributes,t,e)}function T(t){return"v"===t.orientation?"x":"y"}function k(t,i,a){var o=t.uid+"__"+a;i||(i=o);var s=function(t,r){return n.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",u=v[i],c=!0;u&&(s===u.axType&&l===u.calendar?(c=!1,u.traces.push(t),u.dirs.push(a)):(i=o,s!==u.axType&&r.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+u.axType,"axis."].join(" ")),l!==u.calendar&&r.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",u.calendar?"on a "+u.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(v[i]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=i}for(m=0;m<t.length;m++)if(h=t[m],i(h,"histogram")){if(x.push(h),delete h._xautoBinFinished,delete h._yautoBinFinished,"histogram"===h.type){var A=w("marker.cornerradius",e.barcornerradius);h.marker&&(h.marker.cornerradius=o(A))}i(h,"2dMap")||a(h._input,h,e,w,e.barmode)}var M=e._alignmentOpts||{};for(m=0;m<x.length;m++){if(h=x[m],p="",!i(h,"2dMap")){if(d=T(h),"group"===e.barmode&&h.alignmentgroup){var S=h[d+"axis"],E=l(e,S)+h.orientation;(M[E]||{})[h.alignmentgroup]&&(p=E)}!p&&"overlay"!==e.barmode&&(p=l(e,h.xaxis)+l(e,h.yaxis)+T(h))}p?(_[p]||(_[p]=[]),_[p].push(h)):b.push(h)}for(p in _)if(1!==(f=_[p]).length){var C=!1;for(f.length&&(h=f[0],C=w("bingroup")),p=C||p,m=0;m<f.length;m++){var I=(h=f[m])._input.bingroup;I&&I!==p&&r.warn(["Trace",h.index,"must match","within bingroup",p+".","Ignoring its bingroup:",I,"setting."].join(" ")),h.bingroup=p,k(h,p,T(h))}}else b.push(f[0]);for(m=0;m<b.length;m++){h=b[m];var L=w("bingroup");if(i(h,"2dMap"))for(y=0;y<2;y++){var P=w((d=c[y])+"bingroup",L?L+"__"+d:null);k(h,P,d)}else k(h,L,T(h))}for(p in v){var z=v[p];for(f=z.traces,g=0;g<u.length;g++){var O,D,R=u[g],F=R.name;if("nbins"!==F||!z.sizeFound){for(m=0;m<f.length;m++){if(h=f[m],d=z.dirs[m],O=R.aStr[d],void 0!==s(h._input,O).get()){z[F]=w(O),z[F+"Found"]=!0;break}(D=(h._autoBin||{})[d]||{})[F]&&s(h,O).set(D[F])}if("start"===F||"end"===F)for(;m<f.length;m++)(h=f[m])["_"+d+"bingroup"]&&w(O,(D=(h._autoBin||{})[d]||{})[F]);"nbins"===F&&!z.sizeFound&&!z.nbinsFound&&(h=f[0],z[F]=w(O))}}}}}),Xo=f((t,e)=>{var r=to().hoverPoints,n=rr().hoverLabelText;e.exports=function(t,e,i,a,o){var s=r(t,e,i,a,o);if(s){var l=(t=s[0]).cd[t.index],u=t.cd[0].trace;if(!u.cumulative.enabled){var c="h"===u.orientation?"y":"x";t[c+"Label"]=n(t[c+"a"],[l.ph0,l.ph1],u[c+"hoverformat"])}return s}}}),$o=f((t,e)=>{e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"zLabelVal"in e&&(t.z=e.zLabelVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a,o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){a=[];for(var s=0;s<o.length;s++)a=a.concat(r._indexToPoints[o[s]])}else a=o;t.pointIndices=a}return t}}),Jo=f((t,e)=>{e.exports={attributes:Zo(),layoutAttributes:Ha(),supplyDefaults:Wo(),crossTraceDefaults:Yo(),supplyLayoutDefaults:Wa(),calc:Eo().calc,crossTraceCalc:oi().crossTraceCalc,plot:Qa().plot,layerName:"barlayer",style:Ka().style,styleOnSelect:Ka().styleOnSelect,colorbar:hi(),hoverPoints:Xo(),selectPoints:ro(),eventData:$o(),moduleType:"trace",name:"histogram",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),Ko=f((t,e)=>{e.exports=Jo()}),Qo=f((t,e)=>{var r=Zo(),n=Ho(),i=xo(),a=j(),o=Se().axisHoverFormat,s=Ot().hovertemplateAttrs,l=Ot().texttemplateAttrs,u=Ie(),c=D().extendFlat;e.exports=c({x:r.x,y:r.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:n("x"),nbinsy:r.nbinsy,ybins:n("y"),autobinx:r.autobinx,autobiny:r.autobiny,bingroup:c({},r.bingroup,{}),xbingroup:c({},r.bingroup,{}),ybingroup:c({},r.bingroup,{}),xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s({},{keys:"z"}),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:"z"}),textfont:i.textfont,showlegend:c({},a.showlegend,{dflt:!1})},u("",{cLetter:"z",autoColorDflt:!1}))}),ts=f((t,e)=>{var r=Ut(),n=oe();e.exports=function(t,e,i,a){var o=i("x"),s=i("y"),l=n.minRowLength(o),u=n.minRowLength(s);l&&u?(e._length=Math.min(l,u),r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a),(i("z")||i("marker.color"))&&i("histfunc"),i("histnorm"),i("autobinx"),i("autobiny")):e.visible=!1}}),es=f((t,e)=>{var r=oe(),n=ts(),i=wo(),a=Ue(),o=bo(),s=Qo();e.exports=function(t,e,l,u){function c(n,i){return r.coerce(t,e,s,n,i)}n(t,e,c,u),!1!==e.visible&&(i(t,e,c,u),a(t,e,u,c,{prefix:"",cLetter:"z"}),c("hovertemplate"),o(c,u),c("xhoverformat"),c("yhoverformat"))}}),rs=f((t,e)=>{var r=Uo(),n=rr().hoverLabelText;e.exports=function(t,e,i,a,o){var s=r(t,e,i,a,o);if(s){var l=(t=s[0]).index,u=l[0],c=l[1],h=t.cd[0],f=h.trace,p=h.xRanges[c],d=h.yRanges[u];return t.xLabel=n(t.xa,[p[0],p[1]],f.xhoverformat),t.yLabel=n(t.ya,[d[0],d[1]],f.yhoverformat),s}}}),ns=f((t,e)=>{e.exports={attributes:Qo(),supplyDefaults:es(),crossTraceDefaults:Yo(),calc:Do(),plot:Bo(),layerName:"heatmaplayer",colorbar:No(),style:jo(),hoverPoints:rs(),eventData:$o(),moduleType:"trace",name:"histogram2d",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),is=f((t,e)=>{e.exports=ns()}),as=f((t,e)=>{e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),os=f((t,e)=>{var r=xo(),n=bn(),i=Se(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Ie(),l=Pt().dash,u=R(),c=D().extendFlat,h=as(),f=h.COMPARISON_OPS2,p=h.INTERVAL_OPS,d=n.line;e.exports=c({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:c({},r.texttemplate,{}),textfont:c({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:c({},r.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:u({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(f).concat(p),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:c({},d.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),ss=f((t,e)=>{var r=Qo(),n=os(),i=Ie(),a=Se().axisHoverFormat,o=D().extendFlat;e.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:n.texttemplate,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}),ls=f((t,e)=>{e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");((o?e.autocontour=!0:r("autocontour",!1))||!s)&&r("ncontours")}}),us=f((t,e)=>{var r=oe();e.exports=function(t,e,n,i){if(i||(i={}),t("contours.showlabels")){var a=e.font;r.coerceFont(t,"contours.labelfont",a,{overrideDflt:{color:n}}),t("contours.labelformat")}!1!==i.hasHover&&t("zhoverformat")}}),cs=f((t,e)=>{var r=Ue(),n=us();e.exports=function(t,e,i,a,o){var s,l=i("contours.coloring"),u="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(u=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,r(t,e,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,u,o)}}),hs=f((t,e)=>{var r=oe(),n=ts(),i=ls(),a=cs(),o=bo(),s=ss();e.exports=function(t,e,l,u){function c(n,i){return r.coerce(t,e,s,n,i)}n(t,e,c,u),!1!==e.visible&&(i(t,e,c,function(n){return r.coerce2(t,e,s,n)}),a(t,e,c,u),c("xhoverformat"),c("yhoverformat"),c("hovertemplate"),e.contours&&"heatmap"===e.contours.coloring&&o(c,u))}}),fs=f((t,e)=>{var r=rr(),n=oe();function i(t,e,n){var i={type:"linear",range:[t,e]};return r.autoTicks(i,(e-t)/(n||15)),i}e.exports=function(t,e){var a=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,e));var l=i(o,s,t.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),t._input.contours||(t._input.contours={}),n.extendFlat(t._input.contours,{start:a.start,end:a.end,size:a.size}),t._input.autocontour=!0}else if("constraint"!==a.type){var u,c=a.start,h=a.end,f=t._input.contours;c>h&&(a.start=f.start=h,h=a.end=f.end=c,c=a.start),a.size>0||(u=c===h?1:i(c,h,t.ncontours).dtick,f.size=a.size=u)}}}),ps=f((t,e)=>{e.exports=function(t){return t.end+t.size/1e6}}),ds=f((t,e)=>{var r=Ge(),n=Do(),i=fs(),a=ps();e.exports=function(t,e){var o=n(t,e),s=o[0].z;i(e,s);var l,u=e.contours,c=r.extractOpts(e);if("heatmap"===u.coloring&&c.auto&&!1===e.autocontour){var h=u.start,f=a(u),p=u.size||1,d=Math.floor((f-h)/p)+1;isFinite(p)||(p=1,d=1);var m=h-p/2;l=[m,m+d*p]}else l=s;return r.calc(t,e,{vals:l,cLetter:"z"}),o}}),ms=f((t,e)=>{e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}),gs=f((t,e)=>{var r=ms();function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,i,a,o,s,l,u,c,h,f=t[0].z,p=f.length,d=f[0].length,m=2===p||2===d;for(i=0;i<p-1;i++)for(o=[],0===i&&(o=o.concat(r.BOTTOMSTART)),i===p-2&&(o=o.concat(r.TOPSTART)),e=0;e<d-1;e++)for(a=o.slice(),0===e&&(a=a.concat(r.LEFTSTART)),e===d-2&&(a=a.concat(r.RIGHTSTART)),s=e+","+i,l=[[f[i][e],f[i][e+1]],[f[i+1][e],f[i+1][e+1]]],h=0;h<t.length;h++)(u=n((c=t[h]).level,l))&&(c.crossings[s]=u,-1!==a.indexOf(u)&&(c.starts.push([e,i]),m&&-1!==a.indexOf(u,a.indexOf(u)+1)&&c.starts.push([e,i])))}}),ys=f((t,e)=>{var r=oe(),n=ms();function i(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function a(t,e){var r=t[2]-e[2],n=t[3]-e[3];return Math.sqrt(r*r+n*n)}function o(t,e,o,l,u){var c,h=e.join(","),f=t.crossings[h],p=function(t,e,r){var i=0,a=0;return t>20&&e?208===t||1114===t?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(t)?a=1:-1!==n.LEFTSTART.indexOf(t)?i=1:-1!==n.TOPSTART.indexOf(t)?a=-1:i=-1,[i,a]}(f,o,e),d=[s(t,e,[-p[0],-p[1]])],m=t.z.length,g=t.z[0].length,y=e.slice(),v=p.slice();for(c=0;c<1e4;c++){if(f>20?(f=n.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],t.crossings[h]=n.SADDLEREMAINDER[f]):delete t.crossings[h],!(p=n.NEWDELTA[f])){r.log("Found bad marching index:",f,e,t.level);break}d.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],h=e.join(","),i(d[d.length-1],d[d.length-2],l,u)&&d.pop();var x=p[0]&&(e[0]<0||e[0]>g-2)||p[1]&&(e[1]<0||e[1]>m-2);if(e[0]===y[0]&&e[1]===y[1]&&p[0]===v[0]&&p[1]===v[1]||o&&x)break;f=t.crossings[h]}1e4===c&&r.log("Infinite loop in contour?");var _,b,w,T,k,A,M,S,E,C,I,L=i(d[0],d[d.length-1],l,u),P=0,z=.2*t.smoothing,O=[],D=0;for(c=1;c<d.length;c++)P+=M=a(d[c],d[c-1]),O.push(M);var R=P/O.length*z;function F(t){return d[t%d.length]}for(c=d.length-2;c>=D;c--)if((_=O[c])<R){for(w=0,b=c-1;b>=D&&_+O[b]<R;b--)_+=O[b];if(L&&c===d.length-2)for(w=0;w<b&&_+O[w]<R;w++)_+=O[w];k=c-b+w+1,A=Math.floor((c+b+w+2)/2),T=L||c!==d.length-2?L||-1!==b?k%2?F(A):[(F(A)[0]+F(A+1)[0])/2,(F(A)[1]+F(A+1)[1])/2]:d[0]:d[d.length-1],d.splice(b+1,c-b+1,T),c=b+1,w&&(D=w),L&&(c===d.length-2?d[w]=d[d.length-1]:0===c&&(d[d.length-1]=d[0]))}for(d.splice(0,D),c=0;c<d.length;c++)d[c].length=2;if(!(d.length<2))if(L)d.pop(),t.paths.push(d);else{o||r.log("Unclosed interior contour?",t.level,y.join(","),d.join("L"));var B=!1;for(S=0;S<t.edgepaths.length;S++)if(C=t.edgepaths[S],!B&&i(C[0],d[d.length-1],l,u)){d.pop(),B=!0;var N=!1;for(E=0;E<t.edgepaths.length;E++)if(i((I=t.edgepaths[E])[I.length-1],d[0],l,u)){N=!0,d.shift(),t.edgepaths.splice(S,1),E===S?t.paths.push(d.concat(I)):(E>S&&E--,t.edgepaths[E]=I.concat(d,C));break}N||(t.edgepaths[S]=d.concat(C))}for(S=0;S<t.edgepaths.length&&!B;S++)i((C=t.edgepaths[S])[C.length-1],d[0],l,u)&&(d.shift(),t.edgepaths[S]=C.concat(d),B=!0);B||t.edgepaths.push(d)}}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a),u=(1!==l?(1-l)*o.c2l(t.x[n]):0)+(0!==l?l*o.c2l(t.x[n+1]):0);return[o.c2p(o.l2c(u),!0),s.c2p(t.y[i],!0),n+l,i]}var c=(t.level-a)/(t.z[i+1][n]-a),h=(1!==c?(1-c)*s.c2l(t.y[i]):0)+(0!==c?c*s.c2l(t.y[i+1]):0);return[o.c2p(t.x[n],!0),s.c2p(s.l2c(h),!0),n,i+c]}e.exports=function(t,e,n){var i,a,s,l;for(e=e||.01,n=n||.01,a=0;a<t.length;a++){for(s=t[a],l=0;l<s.starts.length;l++)o(s,s.starts[l],"edge",e,n);for(i=0;Object.keys(s.crossings).length&&i<1e4;)i++,o(s,Object.keys(s.crossings)[0].split(",").map(Number),void 0,e,n);1e4===i&&r.log("Infinite loop in contour?")}}}),vs=f((t,e)=>{var r=as(),n=T();function i(t,e){var i,a=Array.isArray(e);function o(t){return n(t)?+t:null}return-1!==r.COMPARISON_OPS2.indexOf(t)?i=o(a?e[0]:e):-1!==r.INTERVAL_OPS.indexOf(t)?i=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==r.SET_OPS.indexOf(t)&&(i=a?e.map(o):[o(e)]),i}function a(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function o(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":a("[]"),"][":a("]["),">":o(">"),"<":o("<"),"=":o("=")}}),xs=f((t,e)=>{var r=oe(),n=vs(),i=ps();e.exports=function(t,e,a){for(var o="constraint"===t.type?n[t._operation](t.value):t,s=o.size,l=[],u=i(o),c=a.trace._carpetTrace,h=c?{xaxis:c.aaxis,yaxis:c.baxis,x:a.a,y:a.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y},f=o.start;f<u;f+=s)if(l.push(r.extendFlat({level:f,crossings:{},starts:[],edgepaths:[],paths:[],z:a.z,smoothing:a.trace.line.smoothing},h)),l.length>1e3){r.warn("Too many contours, clipping at 1000",t);break}return l}}),_s=f((t,e)=>{var r=oe();function n(t){return r.extendFlat({},t,{edgepaths:r.extendDeep([],t.edgepaths),paths:r.extendDeep([],t.paths),starts:r.extendDeep([],t.starts)})}e.exports=function(t,e){var i,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&r.warn("Contour data invalid for the specified inequality operation."),a=t[0],i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);return t;case"][":var u=s;s=l,l=u;case"[]":for(2!==t.length&&r.warn("Contour data invalid for the specified inequality range operation."),a=n(t[0]),o=n(t[1]),i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);for(;o.edgepaths.length;)a.edgepaths.push(l(o.edgepaths.shift()));for(;o.paths.length;)a.paths.push(l(o.paths.shift()));for(;o.starts.length;)a.starts.push(l(o.starts.shift()));return[a]}}}),bs=f((t,e)=>{e.exports=function(t,e){var r,n=t[0],i=n.z;switch(e.type){case"levels":var a=Math.min(i[0][0],i[0][1]);for(r=0;r<t.length;r++){var o=t[r];o.prefixBoundary=!o.edgepaths.length&&(a>o.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,u=-1/0,c=1/0;for(r=0;r<l;r++)c=Math.min(c,i[r][0]),c=Math.min(c,i[r][s-1]),u=Math.max(u,i[r][0]),u=Math.max(u,i[r][s-1]);for(r=1;r<s-1;r++)c=Math.min(c,i[0][r]),c=Math.min(c,i[l-1][r]),u=Math.max(u,i[0][r]),u=Math.max(u,i[l-1][r]);var h,f,p=e.value;switch(e._operation){case">":p>u&&(n.prefixBoundary=!0);break;case"<":(p<c||n.starts.length&&p===c)&&(n.prefixBoundary=!0);break;case"[]":h=Math.min(p[0],p[1]),((f=Math.max(p[0],p[1]))<c||h>u||n.starts.length&&f===c)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),h<c&&f>u&&(n.prefixBoundary=!0)}}}}),ws=f(t=>{var e=v(),r=oe(),n=Je(),i=Ge(),a=Ae(),o=rr(),s=Qe(),l=Bo(),u=gs(),c=ys(),h=xs(),f=_s(),p=bs(),d=ms(),m=d.LABELOPTIMIZER;function g(t,e){var i,a,o,s,l,u,c="",h=0,f=t.edgepaths.map(function(t,e){return e}),p=!0;function d(t){return Math.abs(t[1]-e[0][1])<.01}function m(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;f.length;){for(u=n.smoothopen(t.edgepaths[h],t.smoothing),c+=p?u:u.replace(/^M/,"L"),f.splice(f.indexOf(h),1),i=t.edgepaths[h][t.edgepaths[h].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",h,t);break}for(d(i)&&!y(i)?a=e[1]:g(i)?a=e[0]:m(i)?a=e[3]:y(i)&&(a=e[2]),l=0;l<t.edgepaths.length;l++){var v=t.edgepaths[l][0];Math.abs(i[0]-a[0])<.01?Math.abs(i[0]-v[0])<.01&&(v[1]-i[1])*(a[1]-v[1])>=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;c+="L"+a}if(s===t.edgepaths.length){r.log("unclosed perimeter path");break}h=s,(p=-1===f.indexOf(h))&&(h=f[0],c+="Z")}for(h=0;h<t.paths.length;h++)c+=n.smoothclosed(t.paths[h],t.smoothing);return c}function y(t,e,n,i){var a=e.width/2,o=e.height/2,s=t.x,l=t.y,u=t.theta,c=Math.cos(u)*a,h=Math.sin(u)*a,f=(s>i.center?i.right-s:s-i.left)/(c+Math.abs(Math.sin(u)*o)),p=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(u)*o);if(f<1||p<1)return 1/0;var d=m.EDGECOST*(1/(f-1)+1/(p-1));d+=m.ANGLECOST*u*u;for(var g=s-c,y=l-h,v=s+c,x=l+h,_=0;_<n.length;_++){var b=n[_],w=Math.cos(b.theta)*b.width/2,T=Math.sin(b.theta)*b.width/2,k=2*r.segmentDistance(g,y,v,x,b.x-w,b.y-T,b.x+w,b.y+T)/(e.height+b.height),A=b.level===e.level,M=A?m.SAMELEVELDISTANCE:1;if(k<=M)return 1/0;d+=m.NEIGHBORCOST*(A?m.SAMELEVELFACTOR:1)/(k-M)}return d}function x(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)i[(r=n[e])[0]][r[1]]=0;return t.zmask=i,i}t.plot=function(i,a,o,s){var m=a.xaxis,y=a.yaxis;r.makeTraceGroups(s,o,"contour").each(function(o){var s=e.select(this),v=o[0],_=v.trace,b=v.x,w=v.y,T=_.contours,k=h(T,a,v),A=r.ensureSingle(s,"g","heatmapcoloring"),M=[];"heatmap"===T.coloring&&(M=[o]),l(i,a,M,A),u(k),c(k);var S=m.c2p(b[0],!0),E=m.c2p(b[b.length-1],!0),C=y.c2p(w[0],!0),I=y.c2p(w[w.length-1],!0),L=[[S,I],[E,I],[E,C],[S,C]],P=k;"constraint"===T.type&&(P=f(k,T._operation)),function(t,e,n){var i=r.ensureSingle(t,"g","contourbg"),a=i.selectAll("path").data("fill"===n.coloring?[0]:[]);a.enter().append("path"),a.exit().remove(),a.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(s,L,T),function(t,n,i,a){var o="fill"===a.coloring||"constraint"===a.type&&"="!==a._operation,s="M"+i.join("L")+"Z";o&&p(n,a);var l=r.ensureSingle(t,"g","contourfill"),u=l.selectAll("path").data(o?n:[]);u.enter().append("path"),u.exit().remove(),u.each(function(t){var r=(t.prefixBoundary?s:"")+g(t,i);r?e.select(this).attr("d",r).style("stroke","none"):e.select(this).remove()})}(s,P,L,T),function(i,a,o,s,l){var u=o._context.staticPlot,c=r.ensureSingle(i,"g","contourlines"),h=!1!==l.showlines,f=l.showlabels,p=h&&f,m=t.createLines(c,h||f,a,u),g=t.createLineClip(c,p,o,s.trace.uid),y=i.selectAll("g.contourlabels").data(f?[0]:[]);if(y.exit().remove(),y.enter().append("g").classed("contourlabels",!0),f){var v=[],x=[];r.clearLocationCache();var _=t.labelFormatter(o,s),b=n.tester.append("text").attr("data-notex",1).call(n.font,l.labelfont),w=a[0].xaxis,T=a[0].yaxis,k=w._length,A=T._length,M=w.range,S=T.range,E=r.aggNums(Math.min,null,s.x),C=r.aggNums(Math.max,null,s.x),I=r.aggNums(Math.min,null,s.y),L=r.aggNums(Math.max,null,s.y),P=Math.max(w.c2p(E,!0),0),z=Math.min(w.c2p(C,!0),k),O=Math.max(T.c2p(L,!0),0),D=Math.min(T.c2p(I,!0),A),R={};M[0]<M[1]?(R.left=P,R.right=z):(R.left=z,R.right=P),S[0]<S[1]?(R.top=O,R.bottom=D):(R.top=D,R.bottom=O),R.middle=(R.top+R.bottom)/2,R.center=(R.left+R.right)/2,v.push([[R.left,R.top],[R.right,R.top],[R.right,R.bottom],[R.left,R.bottom]]);var F=Math.sqrt(k*k+A*A),B=d.LABELDISTANCE*F/Math.max(1,a.length/d.LABELINCREASE);m.each(function(n){var i=t.calcTextOpts(n.level,_,b,o);e.select(this).selectAll("path").each(function(){var e=this,n=r.getVisibleSegment(e,R,i.height/2);if(n&&!(n.len<(i.width+i.height)*d.LABELMIN))for(var a=Math.min(Math.ceil(n.len/B),d.LABELMAX),o=0;o<a;o++){var s=t.findBestTextLocation(e,n,i,x,R);if(!s)break;t.addLabelData(s,i,x,v)}})}),b.remove(),t.drawLabels(y,x,o,g,p?v:null)}f&&!h&&m.remove()}(s,k,i,v,T),function(t,e,i,a,o){var s=a.trace,l=i._fullLayout._clips,h="clip"+s.uid,f=l.selectAll("#"+h).data(s.connectgaps?[]:[0]);if(f.enter().append("clipPath").classed("contourclip",!0).attr("id",h),f.exit().remove(),!1===s.connectgaps){var d={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y,z:x(a),smoothing:0};u([d]),c([d]),p([d],{type:"levels"}),r.ensureSingle(f,"path","").attr("d",(d.prefixBoundary?"M"+o.join("L")+"Z":"")+g(d,o))}else h=null;n.setClipUrl(t,h,i)}(s,a,i,v,L)})},t.createLines=function(t,e,r,i){var a=r[0].smoothing,o=t.selectAll("g.contourlevel").data(e?r:[]);if(o.exit().remove(),o.enter().append("g").classed("contourlevel",!0),e){var s=o.selectAll("path.openline").data(function(t){return t.pedgepaths||t.edgepaths});s.exit().remove(),s.enter().append("path").classed("openline",!0),s.attr("d",function(t){return n.smoothopen(t,a)}).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke");var l=o.selectAll("path.closedline").data(function(t){return t.ppaths||t.paths});l.exit().remove(),l.enter().append("path").classed("closedline",!0),l.attr("d",function(t){return n.smoothclosed(t,a)}).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke")}return o},t.createLineClip=function(t,e,r,i){var a=e?"clipline"+i:null,o=r._fullLayout._clips.selectAll("#"+a).data(e?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),n.setClipUrl(t,a,r),o},t.labelFormatter=function(t,e){var n=t._fullLayout,a=e.trace,l=a.contours,u={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(l.labelformat)u.tickformat=l.labelformat,s(u,n);else{var c=i.extractOpts(a);if(c&&c.colorbar&&c.colorbar._axis)u=c.colorbar._axis;else{if("constraint"===l.type){var h=l.value;r.isArrayOrTypedArray(h)?u.range=[h[0],h[h.length-1]]:u.range=[h,h]}else u.range=[l.start,l.end],u.nticks=(l.end-l.start)/l.size;u.range[0]===u.range[1]&&(u.range[1]+=u.range[0]||1),u.nticks||(u.nticks=1e3),s(u,n),o.prepTicks(u),u._tmin=null,u._tmax=null}}return function(t){return o.tickText(u,t).text}},t.calcTextOpts=function(t,e,r,i){var o=e(t);r.text(o).call(a.convertToTspans,i);var s=r.node(),l=n.bBox(s,!0);return{text:o,width:l.width,height:l.height,fontSize:+s.style["font-size"].replace("px",""),level:t,dy:(l.top+l.bottom)/2}},t.findBestTextLocation=function(t,e,n,i,a){var o,s,l,u,c,h=n.width;e.isClosed?(s=e.len/m.INITIALSEARCHPOINTS,o=e.min+s/2,l=e.max):(s=(e.len-h)/(m.INITIALSEARCHPOINTS+1),o=e.min+s+h/2,l=e.max-(s+h)/2);for(var f=1/0,p=0;p<m.ITERATIONS;p++){for(var d=o;d<l;d+=s){var g=r.getTextLocation(t,e.total,d,h),v=y(g,n,i,a);v<f&&(f=v,c=g,u=d)}if(f>2*m.MAXCOST)break;p&&(s/=2),l=(o=u-s/2)+1.5*s}if(f<=m.MAXCOST)return c},t.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,u=t.theta,c=Math.sin(u),h=Math.cos(u),f=function(t,e){return[s+t*h-e*c,l+t*c+e*h]},p=[f(-a/2,-o/2),f(-a/2,o/2),f(a/2,o/2),f(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:u,level:e.level,width:a,height:o}),n.push(p)},t.drawLabels=function(t,n,i,o,s){var l=t.selectAll("text").data(n,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var r=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;e.select(this).text(t.text).attr({x:r,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)}),s){for(var u="",c=0;c<s.length;c++)u+="M"+s[c].join("L")+"Z";r.ensureSingle(o,"path","").attr("d",u)}}}),Ts=f((t,e)=>{var r=v(),n=Ge(),i=ps();e.exports=function(t){var e=t.contours,a=e.start,o=i(e),s=e.size||1,l=Math.floor((o-a)/s)+1,u="lines"===e.coloring?0:1,c=n.extractOpts(t);isFinite(s)||(s=1,l=1);var h,f,p=c.reversescale?n.flipScale(c.colorscale):c.colorscale,d=p.length,m=new Array(d),g=new Array(d),y=c.min,v=c.max;if("heatmap"===e.coloring){for(f=0;f<d;f++)h=p[f],m[f]=h[0]*(v-y)+y,g[f]=h[1];var x=r.extent([y,v,e.start,e.start+s*(l-1)]),_=x[y<v?0:1],b=x[y<v?1:0];_!==y&&(m.splice(0,0,_),g.splice(0,0,g[0])),b!==v&&(m.push(b),g.push(g[g.length-1]))}else{var w=t._input&&"number"==typeof t._input.zmin&&"number"==typeof t._input.zmax;for(w&&(a<=y||o>=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,u=0),f=0;f<d;f++)h=p[f],m[f]=(h[0]*(l+u-1)-u/2)*s+a,g[f]=h[1];(w||t.autocontour)&&(m[0]>y&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]<v&&(m.push(v),g.push(g[g.length-1])))}return n.makeColorScaleFunc({domain:m,range:g},{noNumericCheck:!0})}}),ks=f((t,e)=>{var r=v(),n=Je(),i=jo(),a=Ts();e.exports=function(t){var e=r.select(t).selectAll("g.contour");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(t){var e=r.select(this),i=t[0].trace,o=i.contours,s=i.line,l=o.size||1,u=o.start,c="constraint"===o.type,h=!c&&"lines"===o.coloring,f=!c&&"fill"===o.coloring,p=h||f?a(i):null;e.selectAll("g.contourlevel").each(function(t){r.select(this).selectAll("path").call(n.lineGroupStyle,s.width,h?p(t.level):s.color,s.dash)});var d=o.labelfont;if(e.selectAll("g.contourlabels text").each(function(t){n.font(r.select(this),{weight:d.weight,style:d.style,variant:d.variant,textcase:d.textcase,lineposition:d.lineposition,shadow:d.shadow,family:d.family,size:d.size,color:d.color||(h?p(t.level):s.color)})}),c)e.selectAll("g.contourfill path").style("fill",i.fillcolor);else if(f){var m;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===m&&(m=t.level),p(t.level+.5*l)}),void 0===m&&(m=u),e.selectAll("g.contourbg path").style("fill",p(m-.5*l))}}),i(t)}}),As=f((t,e)=>{var r=Ge(),n=Ts(),i=ps();e.exports={min:"zmin",max:"zmax",calc:function(t,e,a){var o=e.contours,s=e.line,l=o.size||1,u=o.coloring,c=n(e,{isColorbar:!0});if("heatmap"===u){var h=r.extractOpts(e);a._fillgradient=h.reversescale?r.flipScale(h.colorscale):h.colorscale,a._zrange=[h.min,h.max]}else"fill"===u&&(a._fillcolor=c);a._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},a._levels={start:o.start,end:i(o),size:l}}}}),Ms=f((t,e)=>{var r=q(),n=Uo();e.exports=function(t,e,i,a,o){o||(o={}),o.isContour=!0;var s=n(t,e,i,a,o);return s&&s.forEach(function(t){var e=t.trace;"constraint"===e.contours.type&&(e.fillcolor&&r.opacity(e.fillcolor)?t.color=r.addOpacity(e.fillcolor,1):e.contours.showlines&&r.opacity(e.line.color)&&(t.color=r.addOpacity(e.line.color,1)))}),s}}),Ss=f((t,e)=>{e.exports={attributes:ss(),supplyDefaults:hs(),crossTraceDefaults:Yo(),calc:ds(),plot:ws().plot,layerName:"contourlayer",style:ks(),colorbar:As(),hoverPoints:Ms(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),Es=f((t,e)=>{e.exports=Ss()}),Cs=f((t,e)=>{var r=T(),n=us(),i=q(),a=i.addOpacity,o=i.opacity,s=as(),l=oe().isArrayOrTypedArray,u=s.CONSTRAINT_REDUCTION,c=s.COMPARISON_OPS2;e.exports=function(t,e,i,s,h,f){var p,d,m,g=e.contours,y=i("contours.operation");g._operation=u[y],function(t,e){var n;-1===c.indexOf(e.operation)?(t("contours.value",[0,1]),l(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(n=parseFloat(e.value[0]),e.value=[n,n+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:r(e.value)&&(n=parseFloat(e.value),e.value=[n,n+1])):(t("contours.value",0),r(e.value)||(l(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(i,g),"="===y?p=g.showlines=!0:(p=i("contours.showlines"),m=i("fillcolor",a((t.line||{}).color||h,.5))),p&&(d=i("line.color",m&&o(m)?a(e.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,d,f)}}),Is=f((t,e)=>{var r=oe(),n=_o(),i=qn(),a=Cs(),o=ls(),s=cs(),l=bo(),u=os();e.exports=function(t,e,c,h){function f(n,i){return r.coerce(t,e,u,n,i)}if(n(t,e,f,h)){i(t,e,h,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate");var p="constraint"===f("contours.type");f("connectgaps",r.isArray1D(e.z)),p?a(t,e,f,h,c):(o(t,e,f,function(n){return r.coerce2(t,e,u,n)}),s(t,e,f,h)),e.contours&&"heatmap"===e.contours.coloring&&l(f,h),f("zorder")}else e.visible=!1}}),Ls=f((t,e)=>{e.exports={attributes:os(),supplyDefaults:Is(),calc:ds(),plot:ws().plot,style:ks(),colorbar:As(),hoverPoints:Ms(),moduleType:"trace",name:"contour",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),Ps=f((t,e)=>{e.exports=Ls()}),zs=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=bn(),o=j(),s=Ie(),l=Pt().dash,u=D().extendFlat,c=a.marker,h=a.line,f=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:u({},a.mode,{dflt:"markers"}),text:u({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:u({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:u({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:u({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:u({symbol:c.symbol,opacity:c.opacity,angle:c.angle,angleref:c.angleref,standoff:c.standoff,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:u({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:u({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}),Os=f((t,e)=>{var r=oe(),n=xn(),i=Ze(),a=Gn(),o=Zn(),s=Wn(),l=Yn(),u=Xn(),c=zs();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,c,n,i)}var d,m=p("a"),g=p("b"),y=p("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),y&&(d=Math.min(d,y.length))):d=y?Math.min(d,y.length):0):g&&y&&(d=Math.min(g.length,y.length)),d){e._length=d,p("sum"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),p("mode",d<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(e)&&a(t,e,h,f,p,{gradient:!0}),i.hasLines(e)&&(o(t,e,h,f,p,{backoff:!0}),s(t,e,p),p("connectgaps")),i.hasText(e)&&(p("texttemplate"),l(t,e,f,p));var v=[];(i.hasMarkers(e)||i.hasText(e))&&(p("cliponaxis"),p("marker.maxdisplayed"),v.push("points")),p("fill"),"none"!==e.fill&&(u(t,e,h,p),i.hasLines(e)||s(t,e,p)),("tonext"===e.fill||"toself"===e.fill)&&v.push("fills"),p("hoveron",v.join("+")||"points"),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}),Ds=f((t,e)=>{var r=rr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot;return i.aLabel=r.tickText(a.aaxis,t.a,!0).text,i.bLabel=r.tickText(a.baxis,t.b,!0).text,i.cLabel=r.tickText(a.caxis,t.c,!0).text,i}}),Rs=f((t,e)=>{var r=T(),n=ei(),i=ri(),a=ni(),o=ii().calcMarkerSize,s=["a","b","c"],l={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var u,c,h,f,p,d,m=t._fullLayout[e.subplot].sum,g=e.sum||m,y={a:e.a,b:e.b,c:e.c},v=e.ids;for(u=0;u<s.length;u++)if(!y[h=s[u]]){for(p=y[l[h][0]],d=y[l[h][1]],f=new Array(p.length),c=0;c<p.length;c++)f[c]=g-p[c]-d[c];y[h]=f}var x,_,b,w,T,k,A=e._length,M=new Array(A);for(u=0;u<A;u++)x=y.a[u],_=y.b[u],b=y.c[u],r(x)&&r(_)&&r(b)?(1!==(w=m/((x=+x)+(_=+_)+(b=+b)))&&(x*=w,_*=w,b*=w),k=x,T=b-_,M[u]={x:T,y:k,a:x,b:_,c:b},v&&(M[u].id=v[u])):M[u]={x:!1,y:!1};return o(e,A),n(t,e),i(M,e),a(M,e),M}}),Fs=f((t,e)=>{var r=ci();e.exports=function(t,e,n){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=e.xaxis,o=e.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},l=e.layers.frontplot.select("g.scatterlayer"),u=0;u<n.length;u++){var c=n[u];c.length&&(c[0].trace._xA=a,c[0].trace._yA=o)}r(t,s,n,l)}}),Bs=f((t,e)=>{var r=mi();e.exports=function(t,e,n,i){var a=r(t,e,n,i);if(a&&!1!==a[0].index){var o=a[0];if(void 0===o.index){var s=1-o.y0/t.ya._length,l=t.xa._length,u=l*s/2,c=l-u;return o.x0=Math.max(Math.min(o.x0,c),u),o.x1=Math.max(Math.min(o.x1,c),u),a}var h=o.cd[o.index],f=o.trace,p=o.subplot;o.a=h.a,o.b=h.b,o.c=h.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var d={};d[f.subplot]={_subplot:p};var m=f._module.formatLabels(h,f,d);o.aLabel=m.aLabel,o.bLabel=m.bLabel,o.cLabel=m.cLabel;var g=h.hi||f.hoverinfo,y=[];if(!f.hovertemplate){var v=g.split("+");-1!==v.indexOf("all")&&(v=["a","b","c"]),-1!==v.indexOf("a")&&x(p.aaxis,o.aLabel),-1!==v.indexOf("b")&&x(p.baxis,o.bLabel),-1!==v.indexOf("c")&&x(p.caxis,o.cLabel)}return o.extraText=y.join("<br>"),o.hovertemplate=f.hovertemplate,a}function x(t,e){y.push(t._hovertitle+": "+e)}}}),Ns=f((t,e)=>{e.exports=function(t,e,r,n,i){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[i]){var a=n[i];t.a=a.a,t.b=a.b,t.c=a.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}}),js=f((t,e)=>{var r=v(),n=O(),i=Ut(),a=oe(),o=a.strTranslate,s=a._,l=q(),u=Je(),c=Qe(),h=D().extendFlat,f=we(),p=rr(),d=cr(),m=Pr(),g=zr(),y=g.freeMode,x=g.rectMode,_=Ke(),b=Mn().prepSelect,w=Mn().selectOnClick,T=Mn().clearOutline,k=Mn().clearSelectionsCache,A=ge();function M(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.updateFx(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;a<t.length;a++)if(!1===t[a][0].trace.cliponaxis){r._hasClipOnAxisFalse=!0;break}r.updateLayers(n),r.adjustLayout(n,i),f.generalUpdatePerTraceModule(r.graphDiv,r,t,n),r.layers.plotbg.select("path").call(l.fill,n.bgcolor)},S.makeFramework=function(t){var e=this,r=e.graphDiv,n=t[e.id],i=e.clipId="clip"+e.layoutId+e.id,o=e.clipIdRelative="clip-relative"+e.layoutId+e.id;e.clipDef=a.ensureSingleById(t._clips,"clipPath",i,function(t){t.append("path").attr("d","M0,0Z")}),e.clipDefRelative=a.ensureSingleById(t._clips,"clipPath",o,function(t){t.append("path").attr("d","M0,0Z")}),e.plotContainer=a.ensureSingle(e.container,"g",e.id),e.updateLayers(n),u.setClipUrl(e.layers.backplot,i,r),u.setClipUrl(e.layers.grids,i,r)},S.updateFx=function(t){t._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===t.dragmode?"move":"crosshair")},S.updateLayers=function(t){var e=this.layers,n=["draglayer","plotbg","backplot","grids"];"below traces"===t.aaxis.layer&&n.push("aaxis","aline"),"below traces"===t.baxis.layer&&n.push("baxis","bline"),"below traces"===t.caxis.layer&&n.push("caxis","cline"),n.push("frontplot"),"above traces"===t.aaxis.layer&&n.push("aaxis","aline"),"above traces"===t.baxis.layer&&n.push("baxis","bline"),"above traces"===t.caxis.layer&&n.push("caxis","cline");var i=this.plotContainer.selectAll("g.toplevel").data(n,String),a=["agrid","bgrid","cgrid"];i.enter().append("g").attr("class",function(t){return"toplevel "+t}).each(function(t){var n=r.select(this);e[t]=n,"frontplot"===t?n.append("g").classed("scatterlayer",!0):"backplot"===t?n.append("g").classed("maplayer",!0):"plotbg"===t?n.append("path").attr("d","M0,0Z"):"aline"===t||"bline"===t||"cline"===t?n.append("path"):"grids"===t&&a.forEach(function(t){e[t]=n.append("g").classed("grid "+t,!0)})}),i.order()};var E=Math.sqrt(4/3);S.adjustLayout=function(t,e){var r,n,i,a,s,f,p=this,d=t.domain,m=(d.x[0]+d.x[1])/2,g=(d.y[0]+d.y[1])/2,y=d.x[1]-d.x[0],v=d.y[1]-d.y[0],x=y*e.w,_=v*e.h,b=t.sum,w=t.aaxis.min,T=t.baxis.min,k=t.caxis.min;x>E*_?i=(a=_)*E:a=(i=x)/E,s=y*i/x,f=v*a/_,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=b,p.xaxis={type:"linear",range:[w+2*k-b,b-w-2*T],domain:[m-s/2,m+s/2],_id:"x"},c(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,b-T-k],domain:[g-f/2,g+f/2],_id:"y"},c(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,b-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});c(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[b-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});c(S,p.graphDiv._fullLayout),S.setScale();var C=p.caxis=h({},t.caxis,{range:[b-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});c(C,p.graphDiv._fullLayout),C.setScale();var I="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",I),p.layers.plotbg.select("path").attr("d",I);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",L);var P=o(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),p.clipDefRelative.select("path").attr("transform",null);var z=o(r-S._offset,n+a);p.layers.baxis.attr("transform",z),p.layers.bgrid.attr("transform",z);var O=o(r+i/2,n)+"rotate(30)"+o(0,-M._offset);p.layers.aaxis.attr("transform",O),p.layers.agrid.attr("transform",O);var D=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",C.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.layers,a=e.aaxis,o=e.baxis,l=e.caxis;if(e.drawAx(a),e.drawAx(o),e.drawAx(l),t){var u=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),c=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=_.draw(r,"a"+n,{propContainer:a,propName:e.id+".aaxis.title",placeholder:s(r,"Click to enter Component A title"),attributes:{x:e.x0+e.w/2,y:e.y0-a.title.font.size/3-u,"text-anchor":"middle"}}),i["b-title"]=_.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",placeholder:s(r,"Click to enter Component B title"),attributes:{x:e.x0-c,y:e.y0+e.h+.83*o.title.font.size+c,"text-anchor":"middle"}}),i["c-title"]=_.draw(r,"c"+n,{propContainer:l,propName:e.id+".caxis.title",placeholder:s(r,"Click to enter Component C title"),attributes:{x:e.x0+e.w+c,y:e.y0+e.h+.83*l.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(t){var e=this,r=e.graphDiv,n=t._name,i=n.charAt(0),o=t._id,s=e.layers[n],l=i+"tickLayout",u=function(t){return t.ticks+String(t.ticklen)+String(t.showticklabels)}(t);e[l]!==u&&(s.selectAll("."+o+"tick").remove(),e[l]=u),t.setScale();var c=p.calcTicks(t),h=p.clipEnds(t,c),f=p.makeTransTickFn(t),d=p.getTickSigns(t)[2],m=a.deg2rad(30),g=d*(t.linewidth||1)/2,y=d*t.ticklen,v=e.w,x=e.h,_="b"===i?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,b={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[i];p.drawTicks(r,t,{vals:"inside"===t.ticks?h:c,layer:s,path:_,transFn:f,crisp:!1}),p.drawGrid(r,t,{vals:h,layer:e.layers[i+"grid"],path:b,transFn:f,crisp:!1}),p.drawLabels(r,t,{vals:c,layer:s,transFn:f,labelFns:p.makeLabelFns(t,0,30)})};var C=A.MINZOOM/2+.87,I="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",L="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",P="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",z=!0;function R(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,c,h,f,p,g,v,_,T,k,M=this,S=M.layers.plotbg.select("path").node(),C=M.graphDiv,O=C._fullLayout._zoomlayer;function D(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=C._fullLayout.clickmode;R(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,D({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,C,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&m.click(C,e,M.id)}function B(t,e){return 1-e/M.h}function N(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function j(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(n,i){var a=r+n*t,o=c+i*e,s=Math.max(0,Math.min(1,B(0,c),B(0,o))),l=Math.max(0,Math.min(1,N(r,c),N(a,o))),u=Math.max(0,Math.min(1,j(r,c),j(a,o))),d=(s/2+u)*M.w,m=(1-s/2-l)*M.w,y=(d+m)/2,x=m-d,b=(1-s)*M.h,w=b-x/E;x<A.MINZOOM?(p=h,T.attr("d",v),k.attr("d","M0,0Z")):(p={a:h.a+s*f,b:h.b+l*f,c:h.c+u*f},T.attr("d",v+"M"+d+","+b+"H"+m+"L"+y+","+w+"L"+d+","+b+"Z"),k.attr("d","M"+r+","+c+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+d+","+b+I+"M"+m+","+b+L+"M"+y+","+w+P)),_||(T.transition().style("fill",g>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),_=!0),C.emit("plotly_relayouting",D(p))}function V(){R(C),p!==h&&(i.call("_guiRelayout",C,D(p)),z&&C.data&&C._context.showTips&&(a.notifier(s(C,"Double-click to zoom back out"),"long"),z=!1))}function q(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(p={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,p.b,p.c].sort(a.sorterAsc),s=i.indexOf(p.a),l=i.indexOf(p.b),c=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[s],b:i[l],c:i[c]},e=(h.a-p.a)*M.yaxis._m,t=(h.c-p.c-h.b+p.b)*M.xaxis._m);var f=o(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d=o(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,M),C.emit("plotly_relayouting",D(p))}function H(){i.call("_guiRelayout",C,D(p))}this.dragOptions={element:S,gd:C,plotinfo:{id:M.id,domain:C._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(i,s,u){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=C._fullLayout._invScaleX,e=C._fullLayout._invScaleY;var d=M.dragOptions.dragmode=C._fullLayout.dragmode;y(d)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===d?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,i){var s=S.getBoundingClientRect();r=e-s.left,c=i-s.top,C._fullLayout._calcInverseTransform(C);var u=C._fullLayout._invTransform,d=a.apply3DTransform(u)(r,c);r=d[0],c=d[1],h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,f=M.aaxis.range[1]-h.a,g=n(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),v="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",_=!1,T=O.append("path").attr("class","zoombox").attr("transform",o(M.x0,M.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=O.append("path").attr("class","zoombox-corners").attr("transform",o(M.x0,M.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(C)}(0,s,u)):"pan"===d?(M.dragOptions.moveFn=q,M.dragOptions.clickFn=F,M.dragOptions.doneFn=H,h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,M.clearOutline(C)):(x(d)||y(d))&&b(i,s,u,M.dragOptions,d)}},S.onmousemove=function(t){m.hover(C,t,M.id),C._fullLayout._lasthover=S,C._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){C._dragging||d.unhover(C,t)},d.init(this.dragOptions)}}),Us=f((t,e)=>{var r=V(),n=wa().attributes,i=Ee(),a=Lt().overrideAll,o=D().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:"number",dflt:0,min:0}},l=e.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}),Vs=f((t,e)=>{var r=oe(),n=me(),i=wa().defaults;e.exports=function(t,e,a,o){var s,l,u=o.type,c=o.attributes,h=o.handleDefaults,f=o.partition||"x",p=e._subplots[u],d=p.length,m=d&&p[0].replace(/\d+$/,"");function g(t,e){return r.coerce(s,l,c,t,e)}for(var y=0;y<d;y++){var v=p[y];s=t[v]?t[v]:t[v]={},l=n.newContainer(e,v,m),o.noUirevision||g("uirevision",e.uirevision);var x={};x[f]=[y/d,(y+1)/d],i(l,e,g,x),o.id=v,h(s,l,g,o)}}}),qs=f((t,e)=>{var r=q(),n=me(),i=oe(),a=Vs(),o=Be(),s=Ne(),l=De(),u=Oe(),c=_i(),h=Us(),f=["aaxis","baxis","caxis"];function p(t,e,i,a){var o=i("bgcolor"),s=i("sum");a.bgColor=r.combine(o,a.paper_bgcolor);for(var l,u,c,h=0;h<f.length;h++)u=t[l=f[h]]||{},(c=n.newContainer(e,l))._name=l,d(u,c,a,e);var p=e.aaxis,m=e.baxis,g=e.caxis;p.min+m.min+g.min>=s&&(p.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var a=h[e._name];function f(r,n){return i.coerce(t,e,a,r,n)}f("uirevision",n.uirevision),e.type="linear";var p=f("color"),d=p!==a.color.dflt?p:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,y=f("title.text",g);e._hovertitle=y===g?y:m,i.coerceFont(f,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:d}}),f("min"),u(t,e,f,"linear"),s(t,e,f,"linear"),o(t,e,f,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(t,e,f,{outerTicks:!0}),f("showticklabels")&&(i.coerceFont(f,"tickfont",r.font,{overrideDflt:{color:d}}),f("tickangle"),f("tickformat")),c(t,e,f,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),f("hoverformat"),f("layer")}e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:h,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}}),Hs=f(t=>{var e=js(),r=_e().getSubplotCalcData,n=oe().counterRegex,i="ternary";t.name=i;var a=t.attr="subplot";t.idRoot=i,t.idRegex=t.attrRegex=n(i),(t.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},t.layoutAttributes=Us(),t.supplyLayoutDefaults=qs(),t.plot=function(t){for(var n=t._fullLayout,a=t.calcdata,o=n._subplots[i],s=0;s<o.length;s++){var l=o[s],u=r(a,i,l),c=n[l]._subplot;c||(c=new e({id:l,graphDiv:t,container:n._ternarylayer.node()},n),n[l]._subplot=c),c.plot(u,n,t._promises)}},t.clean=function(t,e,r,n){for(var a=n._subplots[i]||[],o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove(),l.clipDefRelative.remove(),l.layers["a-title"].remove(),l.layers["b-title"].remove(),l.layers["c-title"].remove())}},t.updateFx=function(t){var e=t._fullLayout;e._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===e.dragmode?"move":"crosshair")}}),Gs=f((t,e)=>{e.exports={attributes:zs(),supplyDefaults:Os(),colorbar:hi(),formatLabels:Ds(),calc:Rs(),plot:Fs(),style:pi().style,styleOnSelect:pi().styleOnSelect,hoverPoints:Bs(),selectPoints:gi(),eventData:Ns(),moduleType:"trace",name:"scatterternary",basePlotModule:Hs(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),Zs=f((t,e)=>{e.exports=Gs()}),Ws=f((t,e)=>{var r=ao(),n=D().extendFlat,i=Se().axisHoverFormat;e.exports={y:r.y,x:r.x,x0:r.x0,y0:r.y0,xhoverformat:i("x"),yhoverformat:i("y"),name:n({},r.name,{}),orientation:n({},r.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r.fillcolor,points:n({},r.boxpoints,{}),jitter:n({},r.jitter,{}),pointpos:n({},r.pointpos,{}),width:n({},r.width,{}),marker:r.marker,text:r.text,hovertext:r.hovertext,hovertemplate:r.hovertemplate,quartilemethod:r.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:r.zorder}}),Ys=f((t,e)=>{var r=oo(),n=oe().extendFlat;e.exports={violinmode:n({},r.boxmode,{}),violingap:n({},r.boxgap,{}),violingroupgap:n({},r.boxgroupgap,{})}}),Xs=f((t,e)=>{var r=oe(),n=q(),i=so(),a=Ws();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}function u(n,i){return r.coerce2(t,e,a,n,i)}if(i.handleSampleDefaults(t,e,l,s),!1!==e.visible){l("bandwidth"),l("side"),l("width")||(l("scalegroup",e.name),l("scalemode"));var c,h=l("span");Array.isArray(h)&&(c="manual"),l("spanmode",c);var f=l("line.color",(t.marker||{}).color||o),p=l("line.width"),d=l("fillcolor",n.addOpacity(e.line.color,.5));i.handlePointsDefaults(t,e,l,{prefix:""});var m=u("box.width"),g=u("box.fillcolor",d),y=u("box.line.color",f),v=u("box.line.width",p);l("box.visible",!!(m||g||y||v))||(e.box={visible:!1});var x=u("meanline.color",f),_=u("meanline.width",p);l("meanline.visible",!(!x&&!_))||(e.meanline={visible:!1}),l("quartilemethod"),l("zorder")}}}),$s=f((t,e)=>{var r=oe(),n=Ys(),i=lo();e.exports=function(t,e,a){i._supply(t,e,a,function(i,a){return r.coerce(t,e,n,i,a)},"violin")}}),Js=f(t=>{var e=oe(),r=function(t){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*t*t)};t.makeKDE=function(t,e,n){var i=n.length,a=r,o=t.bandwidth,s=1/(i*o);return function(t){for(var e=0,r=0;r<i;r++)e+=a((t-n[r])/o);return s*e}},t.getPositionOnKdePath=function(t,r,n){var i,a;"h"===r.orientation?(i="y",a="x"):(i="x",a="y");var o=e.findPointOnPath(t.path,n,a,{pathLength:t.pathLength}),s=t.posCenterPx,l=o[i];return[l,"both"===r.side?2*s-l:s]},t.getKdeValue=function(e,r,n){var i=e.pts.map(t.extractVal);return t.makeKDE(e,r,i)(n)/e.posDensityScale},t.extractVal=function(t){return t.v}}),Ks=f((t,e)=>{var r=oe(),n=rr(),i=uo(),a=Js(),o=k().BADNUM;function s(t,e,n){var i=e.max-e.min;if(!i)return t.bandwidth?t.bandwidth:0;if(t.bandwidth)return Math.max(t.bandwidth,i/1e4);var a=n.length,o=r.stdev(n,a-1,e.mean);return Math.max(function(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t,-.2)}(a,o,e.q3-e.q1),i/100)}function l(t,e,r,i){var a,s=t.spanmode,l=t.span||[],u=[e.min,e.max],c=[e.min-2*i,e.max+2*i];function h(n){var i=l[n],a="multicategory"===r.type?r.r2c(i):r.d2c(i,0,t[e.valLetter+"calendar"]);return a===o?c[n]:a}var f={type:"linear",range:a="soft"===s?c:"hard"===s?u:[h(0),h(1)]};return n.setConvert(f),f.cleanRange(),a}e.exports=function(t,e){var o=i(t,e);if(o[0].t.empty)return o;for(var u=t._fullLayout,c=n.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),h=1/0,f=-1/0,p=0,d=0,m=0;m<o.length;m++){var g=o[m],y=g.pts.map(a.extractVal),v=g.bandwidth=s(e,g,y),x=g.span=l(e,g,c,v);if(g.min===g.max&&0===v)x=g.span=[g.min,g.max],g.density=[{v:1,t:x[0]}],g.bandwidth=v,p=Math.max(p,1);else{var _=x[1]-x[0],b=Math.ceil(_/(v/3)),w=_/b;if(!isFinite(w)||!isFinite(b))return r.error("Something went wrong with computing the violin span"),o[0].t.empty=!0,o;var T=a.makeKDE(g,e,y);g.density=new Array(b);for(var k=0,A=x[0];A<x[1]+w/2;k++,A+=w){var M=T(A);g.density[k]={v:M,t:A},p=Math.max(p,M)}}d=Math.max(d,y.length),h=Math.min(h,x[0]),f=Math.max(f,x[1])}var S=n.findExtremes(c,[h,f],{padded:!0});if(e._extremes[c._id]=S,e.width)o[0].t.maxKDE=p;else{var E=u._violinScaleGroupStats,C=e.scalegroup,I=E[C];I?(I.maxKDE=Math.max(I.maxKDE,p),I.maxCount=Math.max(I.maxCount,d)):E[C]={maxKDE:p,maxCount:d}}return o[0].t.labels.kde=r._(t,"kde:"),o}}),Qs=f((t,e)=>{var r=co().setPositionOffset,n=["v","h"];e.exports=function(t,e){for(var i=t.calcdata,a=e.xaxis,o=e.yaxis,s=0;s<n.length;s++){for(var l=n[s],u="h"===l?o:a,c=[],h=0;h<i.length;h++){var f=i[h],p=f[0].t,d=f[0].trace;!0===d.visible&&"violin"===d.type&&!p.empty&&d.orientation===l&&d.xaxis===a._id&&d.yaxis===o._id&&c.push(h)}r("violin",t,c,u)}}}),tl=f((t,e)=>{var r=v(),n=oe(),i=Je(),a=ho(),o=li(),s=Js();e.exports=function(t,e,l,u){var c=t._context.staticPlot,h=t._fullLayout,f=e.xaxis,p=e.yaxis;function d(t,e){var r=o(t,{xaxis:f,yaxis:p,trace:e,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(r[0],1)}n.makeTraceGroups(u,l,"trace violins").each(function(t){var i=r.select(this),o=t[0],l=o.t,u=o.trace;if(!0!==u.visible||l.empty)i.remove();else{var m=l.bPos,g=l.bdPos,y=e[l.valLetter+"axis"],v=e[l.posLetter+"axis"],x="both"===u.side,_=x||"positive"===u.side,b=x||"negative"===u.side,w=i.selectAll("path.violin").data(n.identity);w.enter().append("path").style("vector-effect",c?"none":"non-scaling-stroke").attr("class","violin"),w.exit().remove(),w.each(function(t){var e,n,i,a,o,s,c,f,p=r.select(this),w=t.density,T=w.length,k=v.c2l(t.pos+m,!0),A=v.l2p(k);if(u.width)e=l.maxKDE/g;else{var M=h._violinScaleGroupStats[u.scalegroup];e="count"===u.scalemode?M.maxKDE/g*(M.maxCount/t.pts.length):M.maxKDE/g}if(_){for(c=new Array(T),o=0;o<T;o++)(f=c[o]={})[l.posLetter]=k+w[o].v/e,f[l.valLetter]=y.c2l(w[o].t,!0);n=d(c,u)}if(b){for(c=new Array(T),s=0,o=T-1;s<T;s++,o--)(f=c[s]={})[l.posLetter]=k-w[o].v/e,f[l.valLetter]=y.c2l(w[o].t,!0);i=d(c,u)}if(x)a=n+"L"+i.substr(1)+"Z";else{var S=[A,y.c2p(w[0].t)],E=[A,y.c2p(w[T-1].t)];"h"===u.orientation&&(S.reverse(),E.reverse()),a=_?"M"+S+"L"+n.substr(1)+"L"+E:"M"+E+"L"+i.substr(1)+"L"+S}p.attr("d",a),t.posCenterPx=A,t.posDensityScale=e*g,t.path=p.node(),t.pathLength=t.path.getTotalLength()/(x?2:1)});var T,k,A,M=u.box,S=M.width,E=(M.line||{}).width;x?(T=g*S,k=0):_?(T=[0,g*S/2],k=E*{x:1,y:-1}[l.posLetter]):(T=[g*S/2,0],k=E*{x:-1,y:1}[l.posLetter]),a.plotBoxAndWhiskers(i,{pos:v,val:y},u,{bPos:m,bdPos:T,bPosPxOffset:k}),a.plotBoxMean(i,{pos:v,val:y},u,{bPos:m,bdPos:T,bPosPxOffset:k}),!u.box.visible&&u.meanline.visible&&(A=n.identity);var C=i.selectAll("path.meanline").data(A||[]);C.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",c?"none":"non-scaling-stroke"),C.exit().remove(),C.each(function(t){var e=y.c2p(t.mean,!0),n=s.getPositionOnKdePath(t,u,e);r.select(this).attr("d","h"===u.orientation?"M"+e+","+n[0]+"V"+n[1]:"M"+n[0]+","+e+"H"+n[1])}),a.plotPoints(i,{x:f,y:p},u,l)}})}}),el=f((t,e)=>{var r=v(),n=q(),i=pi().stylePoints;e.exports=function(t){var e=r.select(t).selectAll("g.trace.violins");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(e){var a=e[0].trace,o=r.select(this),s=a.box||{},l=s.line||{},u=a.meanline||{},c=u.width;o.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(n.stroke,a.line.color).call(n.fill,a.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(n.stroke,l.color).call(n.fill,s.fillcolor);var h={"stroke-width":c+"px","stroke-dasharray":2*c+"px,"+c+"px"};o.selectAll("path.mean").style(h).call(n.stroke,u.color),o.selectAll("path.meanline").style(h).call(n.stroke,u.color),i(o,a,t)})}}),rl=f((t,e)=>{var r=q(),n=oe(),i=rr(),a=po(),o=Js();e.exports=function(t,e,s,l,u){u||(u={});var c,h,f=u.hoverLayer,p=t.cd,d=p[0].trace,m=d.hoveron,g=-1!==m.indexOf("violins"),y=-1!==m.indexOf("kde"),v=[];if(g||y){var x=a.hoverOnBoxes(t,e,s,l);if(y&&x.length>0){var _,b,w,T,k,A=t.xa,M=t.ya;"h"===d.orientation?(k=e,_="y",w=M,b="x",T=A):(k=s,_="x",w=A,b="y",T=M);var S=p[t.index];if(k>=S.span[0]&&k<=S.span[1]){var E=n.extendFlat({},t),C=T.c2p(k,!0),I=o.getKdeValue(S,d,k),L=o.getPositionOnKdePath(S,d,C),P=w._offset,z=w._length;E[_+"0"]=L[0],E[_+"1"]=L[1],E[b+"0"]=E[b+"1"]=C,E[b+"Label"]=b+": "+i.hoverLabelText(T,k,d[b+"hoverformat"])+", "+p[0].t.labels.kde+" "+I.toFixed(3);for(var O=0,D=0;D<x.length;D++)if("med"===x[D].attr){O=D;break}E.spikeDistance=x[O].spikeDistance;var R=_+"Spike";E[R]=x[O][R],x[O].spikeDistance=void 0,x[O][R]=void 0,E.hovertemplate=!1,v.push(E),(h={})[_+"1"]=n.constrain(P+L[0],P,P+z),h[_+"2"]=n.constrain(P+L[1],P,P+z),h[b+"1"]=h[b+"2"]=T._offset+C}}g&&(v=v.concat(x))}-1!==m.indexOf("points")&&(c=a.hoverOnPoints(t,e,s));var F=f.selectAll(".violinline-"+d.uid).data(h?[0]:[]);return F.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),F.exit().remove(),F.attr(h).call(r.stroke,t.color),"closest"===l?c?[c]:v:(c&&v.push(c),v)}}),nl=f((t,e)=>{e.exports={attributes:Ws(),layoutAttributes:Ys(),supplyDefaults:Xs(),crossTraceDefaults:so().crossTraceDefaults,supplyLayoutDefaults:$s(),calc:Ks(),crossTraceCalc:Qs(),plot:tl(),style:el(),styleOnSelect:pi().styleOnSelect,hoverPoints:rl(),selectPoints:go(),moduleType:"trace",name:"violin",basePlotModule:Ai(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),il=f((t,e)=>{e.exports=nl()}),al=f((t,e)=>{e.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),ol=f((t,e)=>{var r,n=qa(),i=bn().line,a=j(),o=Se().axisHoverFormat,s=Ot().hovertemplateAttrs,l=Ot().texttemplateAttrs,u=al(),c=D().extendFlat,h=q();e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),hovertext:n.hovertext,hovertemplate:s({},{keys:u.eventDataKeys}),hoverinfo:c({},a.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),text:n.text,textposition:n.textposition,insidetextanchor:c({},n.insidetextanchor,{dflt:"middle"}),textangle:c({},n.textangle,{dflt:0}),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:c({},n.orientation,{}),offset:c({},n.offset,{arrayOk:!1}),width:c({},n.width,{arrayOk:!1}),marker:(r=c({},n.marker),delete r.pattern,delete r.cornerradius,r),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:c({},i.color,{dflt:h.defaultLine}),width:c({},i.width,{dflt:0,editType:"plot"}),dash:i.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,zorder:n.zorder}}),sl=f((t,e)=>{e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),ll=f((t,e)=>{var r=oe(),n=Jn(),i=Za().handleText,a=Vn(),o=qn(),s=ol(),l=q();e.exports={supplyDefaults:function(t,e,n,u){function c(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,u,c)){o(t,e,u,c),c("xhoverformat"),c("yhoverformat"),c("orientation",e.y&&!e.x?"v":"h"),c("offset"),c("width");var h=c("text");c("hovertext"),c("hovertemplate");var f=c("textposition");i(t,e,u,c,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&!e.texttemplate&&c("textinfo",r.isArrayOrTypedArray(h)?"text+value":"value");var p=c("marker.color",n);c("marker.line.color",l.defaultLine),c("marker.line.width"),c("connector.visible")&&(c("connector.fillcolor",function(t){var e=r.isArrayOrTypedArray(t)?"#000":t;return l.addOpacity(e,.5*l.opacity(e))}(p)),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else e.visible=!1},crossTraceDefaults:function(t,e){var i,a;function o(t){return r.coerce(a._input,a,s,t)}for(var l=0;l<t.length;l++)"funnel"===(a=t[l]).type&&(i=a._input,n(i,a,e,o,e.funnelmode))}}}),ul=f((t,e)=>{var r=oe(),n=sl();e.exports=function(t,e,i){var a=!1;function o(i,a){return r.coerce(t,e,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"funnel"===l.type){a=!0;break}}a&&(o("funnelmode"),o("funnelgap",.2),o("funnelgroupgap"))}}),cl=f((t,e)=>{var r=oe();e.exports=function(t,e){for(var n=0;n<t.length;n++)t[n].i=n;r.mergeArray(e.text,t,"tx"),r.mergeArray(e.hovertext,t,"htx");var i=e.marker;if(i){r.mergeArray(i.opacity,t,"mo"),r.mergeArray(i.color,t,"mc");var a=i.line;a&&(r.mergeArray(a.color,t,"mlc"),r.mergeArrayCastPositive(a.width,t,"mlw"))}}}),hl=f((t,e)=>{var r=rr(),n=ti(),i=cl(),a=ni(),o=k().BADNUM;function s(t){return t===o?0:t}e.exports=function(t,e){var l,u,c,h,f,p,d,m,g=r.getFromId(t,e.xaxis||"x"),y=r.getFromId(t,e.yaxis||"y");"h"===e.orientation?(l=g.makeCalcdata(e,"x"),c=y.makeCalcdata(e,"y"),h=n(e,y,"y",c),f=!!e.yperiodalignment,p="y"):(l=y.makeCalcdata(e,"y"),c=g.makeCalcdata(e,"x"),h=n(e,g,"x",c),f=!!e.xperiodalignment,p="x"),u=h.vals;var v,x=Math.min(u.length,l.length),_=new Array(x);for(e._base=[],d=0;d<x;d++){l[d]<0&&(l[d]=o);var b=!1;l[d]!==o&&d+1<x&&l[d+1]!==o&&(b=!0),m=_[d]={p:u[d],s:l[d],cNext:b},e._base[d]=-.5*m.s,f&&(_[d].orig_p=c[d],_[d][p+"End"]=h.ends[d],_[d][p+"Start"]=h.starts[d]),e.ids&&(m.id=String(e.ids[d])),0===d&&(_[0].vTotal=0),_[0].vTotal+=s(m.s),m.begR=s(m.s)/s(_[0].s)}for(d=0;d<x;d++)(m=_[d]).s!==o&&(m.sumR=m.s/_[0].vTotal,m.difR=void 0!==v?m.s/v:1,v=m.s);return i(_,e),a(_,e),_}}),fl=f((t,e)=>{var r=oi().setGroupPositions;e.exports=function(t,e){var n,i,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,u=e.yaxis,c=[],h=[],f=[];for(i=0;i<o.length;i++){var p=o[i],d="h"===p.orientation;!0===p.visible&&p.xaxis===l._id&&p.yaxis===u._id&&"funnel"===p.type&&(n=s[i],d?f.push(n):h.push(n),c.push(n))}var m={mode:a.funnelmode,norm:a.funnelnorm,gap:a.funnelgap,groupgap:a.funnelgroupgap};for(r(t,l,u,h,m),r(t,u,l,f,m),i=0;i<c.length;i++){n=c[i];for(var g=0;g<n.length;g++)g+1<n.length&&(n[g].nextP0=n[g+1].p0,n[g].nextS0=n[g+1].s0,n[g].nextP1=n[g+1].p1,n[g].nextS1=n[g+1].s1)}}}),pl=f((t,e)=>{var r=v(),n=oe(),i=Je(),a=k().BADNUM,o=Qa(),s=$a().clearMinTextSize;function l(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),i[2]=o.c2p(t.nextS0,!0),a[2]=s.c2p(t.nextP0,!0),i[3]=o.c2p(t.nextS1,!0),a[3]=s.c2p(t.nextP1,!0),n?[i,a]:[a,i]}e.exports=function(t,e,u,c){var h=t._fullLayout;s("funnel",h),function(t,e,o,s){var u=e.xaxis,c=e.yaxis;n.makeTraceGroups(s,o,"trace bars").each(function(o){var s=r.select(this),h=o[0].trace,f=n.ensureSingle(s,"g","regions");if(h.connector&&h.connector.visible){var p="h"===h.orientation,d=f.selectAll("g.region").data(n.identity);d.enter().append("g").classed("region",!0),d.exit().remove();var m=d.size();d.each(function(o,s){if(s===m-1||o.cNext){var h=l(o,u,c,p),f=h[0],d=h[1],g="";f[0]!==a&&d[0]!==a&&f[1]!==a&&d[1]!==a&&f[2]!==a&&d[2]!==a&&f[3]!==a&&d[3]!==a&&(g+=p?"M"+f[0]+","+d[1]+"L"+f[2]+","+d[2]+"H"+f[3]+"L"+f[1]+","+d[1]+"Z":"M"+f[1]+","+d[1]+"L"+f[2]+","+d[3]+"V"+d[2]+"L"+f[1]+","+d[0]+"Z"),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,e.layerClipId,t)}})}else f.remove()})}(t,e,u,c),function(t,e,a,o){var s=e.xaxis,u=e.yaxis;n.makeTraceGroups(o,a,"trace bars").each(function(a){var o=r.select(this),c=a[0].trace,h=n.ensureSingle(o,"g","lines");if(c.connector&&c.connector.visible&&c.connector.line.width){var f="h"===c.orientation,p=h.selectAll("g.line").data(n.identity);p.enter().append("g").classed("line",!0),p.exit().remove();var d=p.size();p.each(function(a,o){if(o===d-1||a.cNext){var c=l(a,s,u,f),h=c[0],p=c[1],m="";void 0!==h[3]&&void 0!==p[3]&&(f?(m+="M"+h[0]+","+p[1]+"L"+h[2]+","+p[2],m+="M"+h[1]+","+p[1]+"L"+h[3]+","+p[2]):(m+="M"+h[1]+","+p[1]+"L"+h[2]+","+p[3],m+="M"+h[1]+","+p[0]+"L"+h[2]+","+p[2])),""===m&&(m="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",m).call(i.setClipUrl,e.layerClipId,t)}})}else h.remove()})}(t,e,u,c),o.plot(t,e,u,c,{mode:h.funnelmode,norm:h.funnelmode,gap:h.funnelgap,groupgap:h.funnelgroupgap})}}),dl=f((t,e)=>{var r=v(),n=Je(),i=q(),a=H().DESELECTDIM,o=Ka(),s=$a().resizeText,l=o.styleTextPoints;e.exports={style:function(t,e,o){var u=o||r.select(t).selectAll('g[class^="funnellayer"]').selectAll("g.trace");s(t,u,"funnel"),u.style("opacity",function(t){return t[0].trace.opacity}),u.each(function(e){var o=r.select(this),s=e[0].trace;o.selectAll(".point > path").each(function(t){if(!t.isBlank){var e=s.marker;r.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(n.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}}),l(o,s,t),o.selectAll(".regions").each(function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)}),o.selectAll(".lines").each(function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}}),ml=f((t,e)=>{var r=q().opacity,n=to().hoverOnBars,i=oe().formatPercent;e.exports=function(t,e,a,o,s){var l=n(t,e,a,o,s);if(l){var u=l.cd,c=u[0].trace,h="h"===c.orientation,f=u[l.index];l[(h?"x":"y")+"LabelVal"]=f.s,l.percentInitial=f.begR,l.percentInitialLabel=i(f.begR,1),l.percentPrevious=f.difR,l.percentPreviousLabel=i(f.difR,1),l.percentTotal=f.sumR,l.percentTotalLabel=i(f.sumR,1);var p=f.hi||c.hoverinfo,d=[];if(p&&"none"!==p&&"skip"!==p){var m="all"===p,g=p.split("+"),y=function(t){return m||-1!==g.indexOf(t)};y("percent initial")&&d.push(l.percentInitialLabel+" of initial"),y("percent previous")&&d.push(l.percentPreviousLabel+" of previous"),y("percent total")&&d.push(l.percentTotalLabel+" of total")}return l.extraText=d.join("<br>"),l.color=function(t,e){var n=t.marker,i=e.mc||n.color,a=e.mlc||n.line.color,o=e.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(c,f),[l]}}}),yl=f((t,e)=>{e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"percentInitial"in e&&(t.percentInitial=e.percentInitial),"percentPrevious"in e&&(t.percentPrevious=e.percentPrevious),"percentTotal"in e&&(t.percentTotal=e.percentTotal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}),vl=f((t,e)=>{e.exports={attributes:ol(),layoutAttributes:sl(),supplyDefaults:ll().supplyDefaults,crossTraceDefaults:ll().crossTraceDefaults,supplyLayoutDefaults:ul(),calc:hl(),crossTraceCalc:fl(),plot:pl(),style:dl().style,hoverPoints:ml(),eventData:yl(),selectPoints:ro(),moduleType:"trace",name:"funnel",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),xl=f((t,e)=>{e.exports=vl()}),_l=f((t,e)=>{e.exports={eventDataKeys:["initial","delta","final"]}}),bl=f((t,e)=>{var r=qa(),n=bn().line,i=j(),a=Se().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=_l(),u=D().extendFlat,c=q();function h(t){return{marker:{color:u({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:u({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:u({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}e.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:u({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:u({},n.color,{dflt:c.defaultLine}),width:u({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}),wl=f((t,e)=>{e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),Tl=f((t,e)=>{e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),kl=f((t,e)=>{var r=oe(),n=Jn(),i=Za().handleText,a=Vn(),o=qn(),s=bl(),l=q(),u=Tl(),c=u.INCREASING.COLOR,h=u.DECREASING.COLOR;function f(t,e,r){t(e+".marker.color",r),t(e+".marker.line.color",l.defaultLine),t(e+".marker.line.width")}e.exports={supplyDefaults:function(t,e,n,l){function u(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,l,u)){o(t,e,l,u),u("xhoverformat"),u("yhoverformat"),u("measure"),u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext"),u("hovertemplate");var p=u("textposition");i(t,e,l,u,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&(u("texttemplate"),e.texttemplate||u("textinfo")),f(u,"increasing",c),f(u,"decreasing",h),f(u,"totals","#4499FF"),u("connector.visible")&&(u("connector.mode"),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash"))),u("zorder")}else e.visible=!1},crossTraceDefaults:function(t,e){var i,a;function o(t){return r.coerce(a._input,a,s,t)}if("group"===e.waterfallmode)for(var l=0;l<t.length;l++)i=(a=t[l])._input,n(i,a,e,o,e.waterfallmode)}}}),Al=f((t,e)=>{var r=oe(),n=wl();e.exports=function(t,e,i){var a=!1;function o(i,a){return r.coerce(t,e,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"waterfall"===l.type){a=!0;break}}a&&(o("waterfallmode"),o("waterfallgap",.2),o("waterfallgroupgap"))}}),Ml=f((t,e)=>{var r=rr(),n=ti(),i=oe().mergeArray,a=ni(),o=k().BADNUM;function s(t){return"a"===t||"absolute"===t}function l(t){return"t"===t||"total"===t}e.exports=function(t,e){var u,c,h,f,p,d,m=r.getFromId(t,e.xaxis||"x"),g=r.getFromId(t,e.yaxis||"y");"h"===e.orientation?(u=m.makeCalcdata(e,"x"),h=g.makeCalcdata(e,"y"),f=n(e,g,"y",h),p=!!e.yperiodalignment,d="y"):(u=g.makeCalcdata(e,"y"),h=m.makeCalcdata(e,"x"),f=n(e,m,"x",h),p=!!e.xperiodalignment,d="x"),c=f.vals;for(var y,v=Math.min(c.length,u.length),x=new Array(v),_=0,b=!1,w=0;w<v;w++){var T=u[w]||0,k=!1;(u[w]!==o||l(e.measure[w])||s(e.measure[w]))&&w+1<v&&(u[w+1]!==o||l(e.measure[w+1])||s(e.measure[w+1]))&&(k=!0);var A=x[w]={i:w,p:c[w],s:T,rawS:T,cNext:k};s(e.measure[w])?(_=A.s,A.isSum=!0,A.dir="totals",A.s=_):l(e.measure[w])?(A.isSum=!0,A.dir="totals",A.s=_):(A.isSum=!1,A.dir=A.rawS<0?"decreasing":"increasing",y=A.s,A.s=_+y,_+=y),"totals"===A.dir&&(b=!0),p&&(x[w].orig_p=h[w],x[w][d+"End"]=f.ends[w],x[w][d+"Start"]=f.starts[w]),e.ids&&(A.id=String(e.ids[w])),A.v=(e.base||0)+_}return x.length&&(x[0].hasTotals=b),i(e.text,x,"tx"),i(e.hovertext,x,"htx"),a(x,e),x}}),Sl=f((t,e)=>{var r=oi().setGroupPositions;e.exports=function(t,e){var n,i,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,u=e.yaxis,c=[],h=[],f=[];for(i=0;i<o.length;i++){var p=o[i];!0===p.visible&&p.xaxis===l._id&&p.yaxis===u._id&&"waterfall"===p.type&&(n=s[i],"h"===p.orientation?f.push(n):h.push(n),c.push(n))}var d={mode:a.waterfallmode,norm:a.waterfallnorm,gap:a.waterfallgap,groupgap:a.waterfallgroupgap};for(r(t,l,u,h,d),r(t,u,l,f,d),i=0;i<c.length;i++){n=c[i];for(var m=0;m<n.length;m++){var g=n[m];!1===g.isSum&&(g.s0+=0===m?0:n[m-1].s),m+1<n.length&&(n[m].nextP0=n[m+1].p0,n[m].nextS0=n[m+1].s0)}}}}),El=f((t,e)=>{var r=v(),n=oe(),i=Je(),a=k().BADNUM,o=Qa(),s=$a().clearMinTextSize;e.exports=function(t,e,l,u){var c=t._fullLayout;s("waterfall",c),o.plot(t,e,l,u,{mode:c.waterfallmode,norm:c.waterfallmode,gap:c.waterfallgap,groupgap:c.waterfallgroupgap}),function(t,e,o,s){var l=e.xaxis,u=e.yaxis;n.makeTraceGroups(s,o,"trace bars").each(function(o){var s=r.select(this),c=o[0].trace,h=n.ensureSingle(s,"g","lines");if(c.connector&&c.connector.visible){var f="h"===c.orientation,p=c.connector.mode,d=h.selectAll("g.line").data(n.identity);d.enter().append("g").classed("line",!0),d.exit().remove();var m=d.size();d.each(function(o,s){if(s===m-1||o.cNext){var c=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),i[2]=o.c2p(t.nextS0,!0),a[2]=s.c2p(t.nextP0,!0),n?[i,a]:[a,i]}(o,l,u,f),h=c[0],d=c[1],g="";h[0]!==a&&d[0]!==a&&h[1]!==a&&d[1]!==a&&("spanning"===p&&!o.isSum&&s>0&&(g+=f?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==p&&(o.isSum||s<m-1)&&(g+=f?"M"+h[1]+","+d[0]+"V"+d[1]:"M"+h[0]+","+d[1]+"H"+h[1]),h[2]!==a&&d[2]!==a&&(g+=f?"M"+h[1]+","+d[1]+"V"+d[2]:"M"+h[1]+","+d[1]+"H"+h[2])),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,e.layerClipId,t)}})}else h.remove()})}(t,e,l,u)}}),Cl=f((t,e)=>{var r=v(),n=Je(),i=q(),a=H().DESELECTDIM,o=Ka(),s=$a().resizeText,l=o.styleTextPoints;e.exports={style:function(t,e,o){var u=o||r.select(t).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");s(t,u,"waterfall"),u.style("opacity",function(t){return t[0].trace.opacity}),u.each(function(e){var o=r.select(this),s=e[0].trace;o.selectAll(".point > path").each(function(t){if(!t.isBlank){var e=s[t.dir].marker;r.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(n.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}}),l(o,s,t),o.selectAll(".lines").each(function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}}),Il=f((t,e)=>{var r=rr().hoverLabelText,n=q().opacity,i=to().hoverOnBars,a=Tl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;e.exports=function(t,e,a,l,u){var c=i(t,e,a,l,u);if(c){var h=c.cd,f=h[0].trace,p="h"===f.orientation,d=p?"x":"y",m=p?t.xa:t.ya,g=h[c.index],y=g.isSum?g.b+g.s:g.rawS;c.initial=g.b+g.s-y,c.delta=y,c.final=c.initial+c.delta;var v=k(Math.abs(c.delta));c.deltaLabel=y<0?"("+v+")":v,c.finalLabel=k(c.final),c.initialLabel=k(c.initial);var x=g.hi||f.hoverinfo,_=[];if(x&&"none"!==x&&"skip"!==x){var b="all"===x,w=x.split("+"),T=function(t){return b||-1!==w.indexOf(t)};g.isSum||(T("final")&&(p?!T("x"):!T("y"))&&_.push(c.finalLabel),T("delta")&&(y<0?_.push(c.deltaLabel+" "+s):_.push(c.deltaLabel+" "+o)),T("initial")&&_.push("Initial: "+c.initialLabel))}return _.length&&(c.extraText=_.join("<br>")),c.color=function(t,e){var r=t[e.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(f,g),[c]}function k(t){return r(m,t,f[d+"hoverformat"])}}}),Ll=f((t,e)=>{e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"initial"in e&&(t.initial=e.initial),"delta"in e&&(t.delta=e.delta),"final"in e&&(t.final=e.final),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}),Pl=f((t,e)=>{e.exports={attributes:bl(),layoutAttributes:wl(),supplyDefaults:kl().supplyDefaults,crossTraceDefaults:kl().crossTraceDefaults,supplyLayoutDefaults:Al(),calc:Ml(),crossTraceCalc:Sl(),plot:El(),style:Cl().style,hoverPoints:Il(),eventData:Ll(),selectPoints:ro(),moduleType:"trace",name:"waterfall",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),zl=f((t,e)=>{e.exports=Pl()}),Ol=f((t,e)=>{e.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var e=t.slice(0,3);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var e=t.slice(0,4);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%",""]}}}}),Dl=f((t,e)=>{var r,n,i=j(),a=bn().zorder,o=Ot().hovertemplateAttrs,s=D().extendFlat,l=Ol().colormodel,u=["rgb","rgba","rgba256","hsl","hsla"],c=[],h=[];for(n=0;n<u.length;n++)r=l[u[n]],c.push("For the `"+u[n]+"` colormodel, it is ["+(r.zminDflt||r.min).join(", ")+"]."),h.push("For the `"+u[n]+"` colormodel, it is ["+(r.zmaxDflt||r.max).join(", ")+"].");e.exports=s({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:u,editType:"calc"},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:s({},i.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:o({},{keys:["z","color","colormodel"]}),zorder:a})}),Rl=f((t,e)=>{var r=oe(),n=Dl(),i=Ol(),a=zn().IMAGE_URL_PREFIX;e.exports=function(t,e){function o(i,a){return r.coerce(t,e,n,i,a)}o("source"),e.source&&!e.source.match(a)&&delete e.source,e._hasSource=!!e.source;var s,l=o("z");e._hasZ=!(void 0===l||!l.length||!l[0]||!l[0].length),e._hasZ||e._hasSource?(o("x0"),o("y0"),o("dx"),o("dy"),e._hasZ?(o("colormodel","rgb"),o("zmin",(s=i.colormodel[e.colormodel]).zminDflt||s.min),o("zmax",s.zmaxDflt||s.max)):e._hasSource&&(e.colormodel="rgba256",s=i.colormodel[e.colormodel],e.zmin=s.zminDflt,e.zmax=s.zmaxDflt),o("zsmooth"),o("text"),o("hovertext"),o("hovertemplate"),e._length=null,o("zorder")):e.visible=!1}}),Fl=f((t,e)=>{"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}}),Bl=f((t,e)=>{e.exports=ce().EventEmitter}),Nl=f(t=>{t.byteLength=function(t){var e=o(t),r=e[0],n=e[1];return 3*(r+n)/4-n},t.toByteArray=function(t){var e,r,a=o(t),s=a[0],l=a[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,l)),c=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},t.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,u=n-i;s<u;s+=o)a.push(l(t,s,s+o>u?u:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};var e,r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(e=0;e<64;++e)r[e]=a[e],n[a.charCodeAt(e)]=e;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function l(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),i.push(s(n));return i.join("")}n[45]=62,n[95]=63}),jl=f(t=>{t.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*m}}),Ul=f(t=>{var e=Nl(),r=jl(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},t.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=0|p(t,e),n=a(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){let e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);let i=function(t){if(o.isBuffer(t)){let e=0|f(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),a(t<0?0:0|f(t))}function c(t){let e=t.length<0?0:0|f(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,o.prototype),n}function f(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:H(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){let a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(a=r;a<s;a++)if(u(t,a)===u(e,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===l)return n*o}else-1!==n&&(a-=a-n),n=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;n<l;n++)if(u(t,a+n)!==u(e,n)){r=!1;break}if(r)return a}return-1}function v(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;let a,o=e.length;for(n>o/2&&(n=o/2),a=0;a<n;++a){let n=parseInt(e.substr(2*a,2),16);if(Y(n))return a;t[r+a]=n}return a}function x(t,e,r,n){return Z(H(e,t.length-r),t,r,n)}function _(t,e,r,n){return Z(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function b(t,e,r,n){return Z(G(e),t,r,n)}function w(t,e,r,n){return Z(function(t,e){let r,n,i,a=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function T(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function k(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let e=t[i],a=null,o=e>239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:e<128&&(a=e);break;case 2:r=t[i+1],128==(192&r)&&(l=(31&e)<<6|63&r,l>127&&(a=l));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(t){let e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));return r}(n)}t.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},o.allocUnsafe=function(t){return u(t)},o.allocUnsafeSlow=function(t){return u(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(W(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;let n=o.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))i+e.length>n.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},o.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},o.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},o.prototype.toString=function(){let t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):d.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){let e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(W(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(a,s),u=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<l;++t)if(u[t]!==c[t]){a=u[t],s=c[t];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function M(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function S(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function E(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=X[t[n]];return i}function C(t,e,r){let n=t.slice(e,r),i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i){j(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function z(t,e,r,n,i){j(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function O(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,n,i,a){return e=+e,n>>>=0,a||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function R(t,e,n,i,a){return e=+e,n>>>=0,a||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}o.prototype.slice=function(t,e){let r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a<e&&(i*=256);)n+=this[t+a]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=$(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),o.prototype.readBigUInt64BE=$(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=e,i=1,a=this[t+--n];for(;n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=$(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),o.prototype.readBigInt64BE=$(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),o.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),r.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),r.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=$(function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=$(function(t,e=0){return z(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=0,a=1,o=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/a|0)-o&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/a|0)-o&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=$(function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=$(function(t,e=0){return z(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{let a=o.isBuffer(t)?t:o.from(t,n),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this};var F={};function B(t,e,r){F[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function N(t){let e="",r=t.length,n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function j(t,e,r,n,i,a){if(t>r||t<e){let r,n="bigint"==typeof e?"n":"";throw r=0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`,new F.ERR_OUT_OF_RANGE("value",r,t)}!function(t,e,r){U(e,"offset"),(void 0===t[e]||void 0===t[e+r])&&V(e,t.length-(r+1))}(n,i,a)}function U(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,r){throw Math.floor(t)!==t?(U(t,r),new F.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),B("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=N(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=N(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);var q=/[^+/0-9A-Za-z-_]/g;function H(t,e){e=e||1/0;let r,n=t.length,i=null,a=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}var X=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function $(t){return"undefined"==typeof BigInt?J:t}function J(){throw new Error("BigInt not supported")}}),Vl=f((t,e)=>{e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(t,e);if(42!==a.value||!0!==a.enumerable)return!1}return!0}}),ql=f((t,e)=>{var r=Vl();e.exports=function(){return r()&&!!Symbol.toStringTag}}),Hl=f((t,e)=>{e.exports=Object}),Gl=f((t,e)=>{e.exports=Error}),Zl=f((t,e)=>{e.exports=EvalError}),Wl=f((t,e)=>{e.exports=RangeError}),Yl=f((t,e)=>{e.exports=ReferenceError}),Xl=f((t,e)=>{e.exports=SyntaxError}),$l=f((t,e)=>{e.exports=TypeError}),Jl=f((t,e)=>{e.exports=URIError}),Kl=f((t,e)=>{e.exports=Math.abs}),Ql=f((t,e)=>{e.exports=Math.floor}),tu=f((t,e)=>{e.exports=Math.max}),eu=f((t,e)=>{e.exports=Math.min}),ru=f((t,e)=>{e.exports=Math.pow}),nu=f((t,e)=>{e.exports=Math.round}),iu=f((t,e)=>{e.exports=Number.isNaN||function(t){return t!=t}}),au=f((t,e)=>{var r=iu();e.exports=function(t){return r(t)||0===t?t:t<0?-1:1}}),ou=f((t,e)=>{e.exports=Object.getOwnPropertyDescriptor}),su=f((t,e)=>{var r=ou();if(r)try{r([],"length")}catch(t){r=null}e.exports=r}),lu=f((t,e)=>{var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch(t){r=!1}e.exports=r}),uu=f((t,e)=>{var r="undefined"!=typeof Symbol&&Symbol,n=Vl();e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}}),cu=f((t,e)=>{e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null}),hu=f((t,e)=>{var r=Hl();e.exports=r.getPrototypeOf||null}),fu=f((t,e)=>{var r=Object.prototype.toString,n=Math.max,i=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var i=0;i<e.length;i+=1)r[i+t.length]=e[i];return r};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==r.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var a,o=function(t,e){for(var r=[],n=e,i=0;n<t.length;n+=1,i+=1)r[i]=t[n];return r}(arguments,1),s=n(0,e.length-o.length),l=[],u=0;u<s;u++)l[u]="$"+u;if(a=Function("binder","return function ("+function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var r=e.apply(this,i(o,arguments));return Object(r)===r?r:this}return e.apply(t,i(o,arguments))}),e.prototype){var c=function(){};c.prototype=e.prototype,a.prototype=new c,c.prototype=null}return a}}),pu=f((t,e)=>{var r=fu();e.exports=Function.prototype.bind||r}),du=f((t,e)=>{e.exports=Function.prototype.call}),mu=f((t,e)=>{e.exports=Function.prototype.apply}),gu=f((t,e)=>{e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply}),yu=f((t,e)=>{var r=pu(),n=mu(),i=du(),a=gu();e.exports=a||r.call(i,n)}),vu=f((t,e)=>{var r=pu(),n=$l(),i=du(),a=yu();e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return a(r,i,t)}}),xu=f((t,e)=>{var r,n=vu(),i=su();try{r=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var a=!!r&&i&&i(Object.prototype,"__proto__"),o=Object,s=o.getPrototypeOf;e.exports=a&&"function"==typeof a.get?n([a.get]):"function"==typeof s&&function(t){return s(null==t?t:o(t))}}),_u=f((t,e)=>{var r=cu(),n=hu(),i=xu();e.exports=r?function(t){return r(t)}:n?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return n(t)}:i?function(t){return i(t)}:null}),bu=f((t,e)=>{var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,i=pu();e.exports=i.call(r,n)}),wu=f((t,e)=>{var r,n=Hl(),i=Gl(),a=Zl(),o=Wl(),s=Yl(),l=Xl(),u=$l(),c=Jl(),h=Kl(),f=Ql(),p=tu(),d=eu(),m=ru(),g=nu(),y=au(),v=Function,x=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},_=su(),b=lu(),w=function(){throw new u},T=_?function(){try{return w}catch(t){try{return _(arguments,"callee").get}catch(t){return w}}}():w,k=uu()(),A=_u(),M=hu(),S=cu(),E=mu(),C=du(),I={},L="undefined"!=typeof Uint8Array&&A?A(Uint8Array):r,P={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":k&&A?A([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&A?A(A([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&A?A((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&A?A((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&A?A(""[Symbol.iterator]()):r,"%Symbol%":k?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":T,"%TypedArray%":L,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":E,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":M,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":d,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":y,"%Reflect.getPrototypeOf%":S};if(A)try{null.error}catch(t){z=A(A(t)),P["%Error.prototype%"]=z}var z,O=function t(e){var r;if("%AsyncFunction%"===e)r=x("async function () {}");else if("%GeneratorFunction%"===e)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=x("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&A&&(r=A(i.prototype))}return P[e]=r,r},D={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=pu(),F=bu(),B=R.call(C,Array.prototype.concat),N=R.call(E,Array.prototype.splice),j=R.call(C,String.prototype.replace),U=R.call(C,String.prototype.slice),V=R.call(C,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,G=function(t,e){var r,n=t;if(F(D,n)&&(n="%"+(r=D[n])[0]+"%"),F(P,n)){var i=P[n];if(i===I&&(i=O(n)),void 0===i&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=U(t,0,1),r=U(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,q,function(t,e,r,i){n[n.length]=r?j(i,H,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",i=G("%"+n+"%",e),a=i.name,o=i.value,s=!1,c=i.alias;c&&(n=c[0],N(r,B([0,1],c)));for(var h=1,f=!0;h<r.length;h+=1){var p=r[h],d=U(p,0,1),m=U(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new l("property names with quotes must have matching quotes");if(("constructor"===p||!f)&&(s=!0),F(P,a="%"+(n+="."+p)+"%"))o=P[a];else if(null!=o){if(!(p in o)){if(!e)throw new u("base intrinsic for "+t+" exists, but the property is not available.");return}if(_&&h+1>=r.length){var g=_(o,p);o=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[p]}else f=F(o,p),o=o[p];f&&!s&&(P[a]=o)}}return o}}),Tu=f((t,e)=>{var r=lu(),n=Xl(),i=$l(),a=su();e.exports=function(t,e,o){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(r)r(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!c&&(s||l||u))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=o}}}),ku=f((t,e)=>{var r=lu(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},e.exports=n}),Au=f((t,e)=>{var r=wu(),n=Tu(),i=ku()(),a=su(),o=$l(),s=r("%Math.floor%");e.exports=function(t,e){if("function"!=typeof t)throw new o("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||s(e)!==e)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in t&&a){var c=a(t,"length");c&&!c.configurable&&(l=!1),c&&!c.writable&&(u=!1)}return(l||u||!r)&&(i?n(t,"length",e,!0,!0):n(t,"length",e)),t}}),Mu=f((t,e)=>{var r=pu(),n=wu(),i=Au(),a=$l(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),u=lu(),c=n("%Math.max%");e.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=l(r,s,arguments);return i(e,1+c(0,t.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h}),Su=f((t,e)=>{var r=wu(),n=Mu(),i=n(r("String.prototype.indexOf"));e.exports=function(t,e){var a=r(t,!!e);return"function"==typeof a&&i(t,".prototype.")>-1?n(a):a}}),Eu=f((t,e)=>{var r=ql()(),n=Su()("Object.prototype.toString"),i=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=o?i:a}),Cu=f((t,e)=>{var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=ql()(),s=Object.getPrototypeOf;e.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(t);if(!s)return!1;if(void 0===r){var e=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&s(e)}return s(t)===r}}),Iu=f((t,e)=>{var r,n,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a(function(){throw 42},null,r)}catch(t){t!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(t){try{var e=i.call(t);return s.test(e)}catch(t){return!1}},u=function(t){try{return!l(t)&&(i.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),p=function(){return!1};"object"==typeof document&&(o=document.all,c.call(o)===c.call(document.all)&&(p=function(t){if((f||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})),e.exports=a?function(t){if(p(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;try{a(t,null,r)}catch(t){if(t!==n)return!1}return!l(t)&&u(t)}:function(t){if(p(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;if(h)return u(t);if(l(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}}),Lu=f((t,e)=>{var r=Iu(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(t,e,a){if(!r(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(t)?function(t,e,r){for(var n=0,a=t.length;n<a;n++)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o):"string"==typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,o):function(t,e,r){for(var n in t)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o)}}),Pu=f((t,e)=>{var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?window:globalThis;e.exports=function(){for(var t=[],e=0;e<r.length;e++)"function"==typeof n[r[e]]&&(t[t.length]=r[e]);return t}}),zu=f((t,e)=>{var r=Lu(),n=Pu(),i=Mu(),a=Su(),o=su(),s=a("Object.prototype.toString"),l=ql()(),u="undefined"==typeof globalThis?window:globalThis,c=n(),h=a("String.prototype.slice"),f=Object.getPrototypeOf,p=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},d={__proto__:null};r(c,l&&o&&f?function(t){var e=new u[t];if(Symbol.toStringTag in e){var r=f(e),n=o(r,Symbol.toStringTag);if(!n){var a=f(r);n=o(a,Symbol.toStringTag)}d["$"+t]=i(n.get)}}:function(t){var e=new u[t],r=e.slice||e.set;r&&(d["$"+t]=i(r))}),e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!l){var e=h(s(t),8,-1);return p(c,e)>-1?e:"Object"===e&&function(t){var e=!1;return r(d,function(r,n){if(!e)try{r(t),e=h(n,1)}catch(t){}}),e}(t)}return o?function(t){var e=!1;return r(d,function(r,n){if(!e)try{"$"+r(t)===n&&(e=h(n,1))}catch(t){}}),e}(t):null}}),Ou=f((t,e)=>{var r=Lu(),n=Pu(),i=Su(),a=i("Object.prototype.toString"),o=ql()(),s=su(),l="undefined"==typeof globalThis?window:globalThis,u=n(),c=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},h=i("String.prototype.slice"),f={},p=Object.getPrototypeOf;o&&s&&p&&r(u,function(t){var e=new l[t];if(Symbol.toStringTag in e){var r=p(e),n=s(r,Symbol.toStringTag);if(!n){var i=p(r);n=s(i,Symbol.toStringTag)}f[t]=n.get}}),e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!o||!(Symbol.toStringTag in t)){var e=h(a(t),8,-1);return c(u,e)>-1}return!!s&&function(t){var e=!1;return r(f,function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}}),e}(t)}}),Du=f(t=>{var e=Eu(),r=Cu(),n=zu(),i=Ou();function a(t){return t.call.bind(t)}var o,s,l="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,c=a(Object.prototype.toString),h=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);function d(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===c(t)}function g(t){return"[object Set]"===c(t)}function y(t){return"[object WeakMap]"===c(t)}function v(t){return"[object WeakSet]"===c(t)}function x(t){return"[object ArrayBuffer]"===c(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function b(t){return"[object DataView]"===c(t)}function w(t){return"undefined"!=typeof DataView&&(b.working?b(t):t instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),u&&(s=a(Symbol.prototype.valueOf)),t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i,t.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},t.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):i(t)||w(t)},t.isUint8Array=function(t){return"Uint8Array"===n(t)},t.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===n(t)},t.isUint16Array=function(t){return"Uint16Array"===n(t)},t.isUint32Array=function(t){return"Uint32Array"===n(t)},t.isInt8Array=function(t){return"Int8Array"===n(t)},t.isInt16Array=function(t){return"Int16Array"===n(t)},t.isInt32Array=function(t){return"Int32Array"===n(t)},t.isFloat32Array=function(t){return"Float32Array"===n(t)},t.isFloat64Array=function(t){return"Float64Array"===n(t)},t.isBigInt64Array=function(t){return"BigInt64Array"===n(t)},t.isBigUint64Array=function(t){return"BigUint64Array"===n(t)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(t){return"undefined"!=typeof Set&&(g.working?g(t):t instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),t.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(y.working?y(t):t instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),t.isWeakSet=function(t){return v(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,b.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&b(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(t){return"[object SharedArrayBuffer]"===c(t)}function A(t){return void 0!==T&&(void 0===k.working&&(k.working=k(new T)),k.working?k(t):t instanceof T)}function M(t){return d(t,h)}function S(t){return d(t,f)}function E(t){return d(t,p)}function C(t){return l&&d(t,o)}function I(t){return u&&d(t,s)}t.isSharedArrayBuffer=A,t.isAsyncFunction=function(t){return"[object AsyncFunction]"===c(t)},t.isMapIterator=function(t){return"[object Map Iterator]"===c(t)},t.isSetIterator=function(t){return"[object Set Iterator]"===c(t)},t.isGeneratorObject=function(t){return"[object Generator]"===c(t)},t.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===c(t)},t.isNumberObject=M,t.isStringObject=S,t.isBooleanObject=E,t.isBigIntObject=C,t.isSymbolObject=I,t.isBoxedPrimitive=function(t){return M(t)||S(t)||E(t)||C(t)||I(t)},t.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||A(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})}),Ru=f((t,e)=>{e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}}),Fu=f(t=>{var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},r=/%[sdj%]/g;t.format=function(t){if(!g(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(o(arguments[n]));return e.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(t).replace(r,function(t){if("%%"===t)return"%";if(n>=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}}),l=i[n];n<a;l=i[++n])d(l)||!x(l)?s+=" "+l:s+=" "+o(l);return s},t.deprecate=function(e,r){if("undefined"!=typeof process&&!0===process.noDeprecation)return e;if("undefined"==typeof process)return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var n,i={},a=/^$/;function o(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function u(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=u(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return c(r)}var x,T="",k=!1,A=["{","}"];return f(r)&&(k=!0,A=["[","]"]),w(r)&&(T=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(T=" "+RegExp.prototype.toString.call(r)),_(r)&&(T=" "+Date.prototype.toUTCString.call(r)),b(r)&&(T=" "+c(r)),0!==o.length||k&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)M(e,String(o))?a.push(h(t,e,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(h(t,e,r,n,i,!0))}),a}(e,r,n,s,o):o.map(function(t){return h(e,r,n,s,t,k)}),e.seen.pop(),function(t,e,r){var n=t.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,T,A)):A[0]+T+A[1]}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=d(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function d(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function b(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=Du(),t.isArray=f,t.isBoolean=p,t.isNull=d,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=_,t.types.isDate=_,t.isError=b,t.types.isNativeError=b,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},t.isBuffer=Ru();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=Fl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(S&&t[S]){var r;if("function"!=typeof(r=t[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push(function(t,n){t?r(t):e(n)});try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),S&&Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,e(t))},t.promisify.custom=S,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};t.apply(this,e).then(function(t){process.nextTick(a.bind(null,null,t))},function(t){process.nextTick(E.bind(null,t,a))})}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,e(t)),r}}),Bu=f((t,e)=>{function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}var a=Ul().Buffer,o=Fu().inspect,s=o&&o.custom||"inspect";function l(t,e,r){a.prototype.copy.call(t,e,r)}e.exports=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.head=null,this.tail=null,this.length=0}return i(t,[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e=a.allocUnsafe(t>>>0),r=this.head,n=0;r;)l(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,a=t>i.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0===(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:s,value:function(t,e){return o(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach(function(e){n(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({},e,{depth:0,customInspect:!1}))}}]),t}()}),Nu=f((t,e)=>{function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var a=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,t)):process.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?a._writableState?a._writableState.errorEmitted?process.nextTick(n,a):(a._writableState.errorEmitted=!0,process.nextTick(r,a,t)):process.nextTick(r,a,t):e?(process.nextTick(n,a),e(t)):process.nextTick(n,a)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}),ju=f((t,e)=>{var r={};function n(t,e,n){n||(n=Error);var i=function(t){function r(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(r,t),r}(n);i.prototype.name=n.name,i.prototype.code=t,r[t]=i}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(t,e,r){var n,a;if("string"==typeof e&&function(t,e){return t.substr(0,e.length)===e}(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var o=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(i(e,"type"))}return a+=". Received type ".concat(typeof r)},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r}),Uu=f((t,e)=>{var r=ju().codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}}),Vu=f((t,e)=>{function r(t){try{if(!window.localStorage)return!1}catch(t){return!1}var e=window.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}),qu=f((t,e)=>{function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var n;e.exports=T,T.WritableState=w;var i,a={deprecate:Vu()},o=Bl(),s=Ul().Buffer,l=window.Uint8Array||function(){},u=Nu(),c=Uu().getHighWaterMark,h=ju().codes,f=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,d=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,_=u.errorOrDestroy;function b(){}function w(t,e,i){n=n||Hu(),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=c(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new d;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(C,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),C(t,e))}(t,r,n,e,i);else{var a=S(r)||t.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&M(t,r),n?process.nextTick(A,t,r,a,i):A(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function T(t){var e=this instanceof(n=n||Hu());if(!e&&!i.call(T,this))return new T(t);this._writableState=new w(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function k(t,e,r,n,i,a,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):r?t._writev(i,e.onwrite):t._write(i,a,e.onwrite),e.sync=!1}function A(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),C(t,e)}function M(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,a=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,k(t,e,!0,e.length,a,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,h=n.callback;if(k(t,e,!1,e.objectMode?1:u.length,u,c,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final(function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),C(t,e)})}function C(t,e){var r=S(e);if(r&&(function(t,e){!e.prefinished&&!e.finalCalled&&("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(E,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}Fl()(T,o),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!i.call(this,t)||this===T&&t&&t._writableState instanceof w}})):i=function(t){return t instanceof this},T.prototype.pipe=function(){_(this,new m)},T.prototype.write=function(t,e,r){var n=this._writableState,i=!1,a=!n.objectMode&&function(t){return s.isBuffer(t)||t instanceof l}(t);return a&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=b),n.ending?function(t,e){var r=new v;_(t,r),process.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i;return null===r?i=new y:"string"!=typeof r&&!e.objectMode&&(i=new f("chunk",["string","Buffer"],r)),!i||(_(t,i),process.nextTick(n,i),!1)}(this,n,t,r))&&(n.pendingcb++,i=function(t,e,r,n,i,a){if(!r){var o=function(t,e,r){return!t.objectMode&&!1!==t.decodeStrings&&"string"==typeof e&&(e=s.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=e.objectMode?1:n.length;e.length+=l;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else k(t,e,!1,l,n,i,a);return u}(this,n,a,t,e,r)),i},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&M(this,t))},T.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new p("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,C(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=u.destroy,T.prototype._undestroy=u.undestroy,T.prototype._destroy=function(t,e){e(t)}}),Hu=f((t,e)=>{var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=l;var n,i,a,o=$u(),s=qu();for(Fl()(l,o),n=r(s.prototype),a=0;a<n.length;a++)i=n[a],l.prototype[i]||(l.prototype[i]=s.prototype[i]);function l(t){if(!(this instanceof l))return new l(t);o.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||process.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}),Gu=f((t,e)=>{var r=Ul(),n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(n.prototype),i(n,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}),Zu=f(t=>{var e=Gu().Buffer,r=e.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(t){var n;switch(this.encoding=function(t){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof n&&(e.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return n||t}(t),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=a,n=4;break;case"base64":this.text=l,this.end=u,n=3;break;default:return this.write=c,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function i(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"<22>";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"<22>";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"<22>"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}t.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"<22>":e},n.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var a=i(e[n]);return a>=0?(a>0&&(t.lastNeed=a-1),a):--n<r||-2===a?0:(a=i(e[n]))>=0?(a>0&&(t.lastNeed=a-2),a):--n<r||-2===a?0:(a=i(e[n]))>=0?(a>0&&(2===a?a=0:t.lastNeed=a-3),a):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}),Wu=f((t,e)=>{var r=ju().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function t(e,i,a){if("function"==typeof i)return t(e,null,i);i||(i={}),a=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(a||n);var o=i.readable||!1!==i.readable&&e.readable,s=i.writable||!1!==i.writable&&e.writable,l=function(){e.writable||c()},u=e._writableState&&e._writableState.finished,c=function(){s=!1,u=!0,o||a.call(e)},h=e._readableState&&e._readableState.endEmitted,f=function(){o=!1,h=!0,s||a.call(e)},p=function(t){a.call(e,t)},d=function(){var t;return o&&!h?((!e._readableState||!e._readableState.ended)&&(t=new r),a.call(e,t)):s&&!u?((!e._writableState||!e._writableState.ended)&&(t=new r),a.call(e,t)):void 0},m=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",d),e.req?m():e.on("request",m)):s&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",f),e.on("finish",c),!1!==i.error&&e.on("error",p),e.on("close",d),function(){e.removeListener("complete",c),e.removeListener("abort",d),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("end",f),e.removeListener("error",p),e.removeListener("close",d)}}}),Yu=f((t,e)=>{var r;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=Wu(),a=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),h=Symbol("stream");function f(t,e){return{value:t,done:e}}function p(t){var e=t[a];if(null!==e){var r=t[h].read();null!==r&&(t[u]=null,t[a]=null,t[o]=null,e(f(r,!1)))}}function d(t){process.nextTick(p,t)}var m=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((n(r={get stream(){return this[h]},next:function(){var t=this,e=this[s];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise(function(e,r){process.nextTick(function(){t[s]?r(t[s]):e(f(void 0,!0))})});var r,n=this[u];if(n)r=new Promise(function(t,e){return function(r,n){t.then(function(){e[l]?r(f(void 0,!0)):e[c](r,n)},n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(f(i,!1));r=new Promise(this[c])}return this[u]=r,r}},Symbol.asyncIterator,function(){return this}),n(r,"return",function(){var t=this;return new Promise(function(e,r){t[h].destroy(null,function(t){t?r(t):e(f(void 0,!0))})})}),r),m);e.exports=function(t){var e,r=Object.create(g,(n(e={},h,{value:t,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,o,{value:null,writable:!0}),n(e,s,{value:null,writable:!0}),n(e,l,{value:t._readableState.endEmitted,writable:!0}),n(e,c,{value:function(t,e){var n=r[h].read();n?(r[u]=null,r[a]=null,r[o]=null,t(f(n,!1))):(r[a]=t,r[o]=e)},writable:!0}),e));return r[u]=null,i(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[o];return null!==e&&(r[u]=null,r[a]=null,r[o]=null,e(t)),void(r[s]=t)}var n=r[a];null!==n&&(r[u]=null,r[a]=null,r[o]=null,n(f(void 0,!0))),r[l]=!0}),t.on("readable",d.bind(null,r)),r}}),Xu=f((t,e)=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}}),$u=f((t,e)=>{var r;e.exports=T,T.ReadableState=w,ce().EventEmitter;var n,i=function(t,e){return t.listeners(e).length},a=Bl(),o=Ul().Buffer,s=window.Uint8Array||function(){},l=Fu();n=l&&l.debuglog?l.debuglog("stream"):function(){};var u,c,h,f=Bu(),p=Nu(),d=Uu().getHighWaterMark,m=ju().codes,g=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,v=m.ERR_METHOD_NOT_IMPLEMENTED,x=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Fl()(T,a);var _=p.errorOrDestroy,b=["error","close","destroy","pause","resume"];function w(t,e,n){r=r||Hu(),t=t||{},"boolean"!=typeof n&&(n=e instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=d(this,t,"readableHighWaterMark",n),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=Zu().StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function T(t){if(r=r||Hu(),!(this instanceof T))return new T(t);var e=this instanceof r;this._readableState=new w(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function k(t,e,r,i,a){n("readableAddChunk",e);var l,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?E(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,C(t)))}}(t,u);else if(a||(l=function(t,e){var r;return!function(t){return o.isBuffer(t)||t instanceof s}(e)&&"string"!=typeof e&&void 0!==e&&!t.objectMode&&(r=new g("chunk",["string","Buffer","Uint8Array"],e)),r}(u,e)),l)_(t,l);else if(u.objectMode||e&&e.length>0)if("string"!=typeof e&&!u.objectMode&&Object.getPrototypeOf(e)!==o.prototype&&(e=function(t){return o.from(t)}(e)),i)u.endEmitted?_(t,new x):A(t,u,e,!0);else if(u.ended)_(t,new y);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?A(t,u,e,!1):I(t,u)):A(t,u,e,!1)}else i||(u.reading=!1,I(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function A(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&E(t)),I(t,e)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(t,e){e(t)},T.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=o.from(t,e),e=""),r=!0),k(this,t,e,!1,r)},T.prototype.unshift=function(t){return k(this,t,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){u||(u=Zu().StringDecoder);var e=new u(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var M=1073741824;function S(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(C,t))}function C(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function I(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(L,t,e))}function L(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(n("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function P(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){n("readable nexttick read 0"),t.read(0)}function O(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function R(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function F(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(B,e,t))}function B(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function N(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}T.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?F(this):E(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&F(this),null;var i,a=e.needReadable;return n("need readable",a),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",a=!0),e.ended||e.reading?n("reading or ended",a=!1):a&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=S(r,e))),null===(i=t>0?R(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&F(this)),null!==i&&this.emit("data",i),i},T.prototype._read=function(t){_(this,new v("_read()"))},T.prototype.pipe=function(t,e){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,e);var o=e&&!1===e.end||t===process.stdout||t===process.stderr?m:l;function s(e,i){n("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),c=!0,a.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u())}function l(){n("onend"),t.end()}a.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",u);var c=!1;function h(e){n("ondata");var i=t.write(e);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==N(a.pipes,t))&&!c&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function f(e){n("onerror",e),m(),t.removeListener("error",f),0===i(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),m()}function d(){n("onfinish"),t.removeListener("close",p),m()}function m(){n("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",f),t.once("close",p),t.once("finish",d),t.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=N(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},T.prototype.on=function(t,e){var r=a.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?E(this):i.reading||process.nextTick(z,this)),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(P,this),r},T.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&process.nextTick(P,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(O,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var a in t.on("end",function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||!(r.objectMode||a&&a.length)||e.push(a)||(i=!0,t.pause())}),t)void 0===this[a]&&"function"==typeof t[a]&&(this[a]=function(e){return function(){return t[e].apply(t,arguments)}}(a));for(var o=0;o<b.length;o++)t.on(b[o],this.emit.bind(this,b[o]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=Yu()),c(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),T._fromList=R,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,e){return void 0===h&&(h=Xu()),h(T,t,e)})}),Ju=f((t,e)=>{e.exports=u;var r=ju().codes,n=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,s=Hu();function l(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);s.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(e,r){h(t,e,r)})}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new o;if(t._transformState.transforming)throw new a;return t.push(null)}Fl()(u,s),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,r){r(new n("_transform()"))},u.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){s.prototype._destroy.call(this,t,function(t){e(t)})}}),Ku=f((t,e)=>{e.exports=n;var r=Ju();function n(t){if(!(this instanceof n))return new n(t);r.call(this,t)}Fl()(n,r),n.prototype._transform=function(t,e,r){r(null,t)}}),Qu=f((t,e)=>{var r,n=ju().codes,i=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function o(t){if(t)throw t}function s(t){t()}function l(t,e){return t.pipe(e)}e.exports=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var u=function(t){return t.length&&"function"==typeof t[t.length-1]?t.pop():o}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new i("streams");var c,h=e.map(function(t,n){var i=n<e.length-1;return function(t,e,n,i){i=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(i);var o=!1;t.on("close",function(){o=!0}),void 0===r&&(r=Wu()),r(t,{readable:e,writable:n},function(t){if(t)return i(t);o=!0,i()});var s=!1;return function(e){if(!o&&!s){if(s=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t))return t.abort();if("function"==typeof t.destroy)return t.destroy();i(e||new a("pipe"))}}}(t,i,n>0,function(t){c||(c=t),t&&h.forEach(s),!i&&(h.forEach(s),u(c))})});return e.reduce(l)}}),tc=f((t,e)=>{e.exports=n;var r=ce().EventEmitter;function n(){r.call(this)}Fl()(n,r),n.Readable=$u(),n.Writable=qu(),n.Duplex=Hu(),n.Transform=Ju(),n.PassThrough=Ku(),n.finished=Wu(),n.pipeline=Qu(),n.Stream=n,n.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",a),!t._isStdio&&(!e||!1!==e.end)&&(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(c(),0===r.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",i),t.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",u),t.removeListener("error",u),n.removeListener("end",c),n.removeListener("close",c),t.removeListener("close",c)}return n.on("error",u),t.on("error",u),n.on("end",c),n.on("close",c),t.on("close",c),t.emit("pipe",n),t}}),ec=f(t=>{var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},r=/%[sdj%]/g;t.format=function(t){if(!g(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(o(arguments[n]));return e.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(t).replace(r,function(t){if("%%"===t)return"%";if(n>=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}}),l=i[n];n<a;l=i[++n])d(l)||!x(l)?s+=" "+l:s+=" "+o(l);return s},t.deprecate=function(e,r){if("undefined"!=typeof process&&!0===process.noDeprecation)return e;if("undefined"==typeof process)return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var n,i={},a=/^$/;function o(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function u(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=u(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return c(r)}var x,T="",k=!1,A=["{","}"];return f(r)&&(k=!0,A=["[","]"]),w(r)&&(T=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(T=" "+RegExp.prototype.toString.call(r)),_(r)&&(T=" "+Date.prototype.toUTCString.call(r)),b(r)&&(T=" "+c(r)),0!==o.length||k&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)M(e,String(o))?a.push(h(t,e,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(h(t,e,r,n,i,!0))}),a}(e,r,n,s,o):o.map(function(t){return h(e,r,n,s,t,k)}),e.seen.pop(),function(t,e,r){var n=t.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,T,A)):A[0]+T+A[1]}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=d(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function d(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function b(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=Du(),t.isArray=f,t.isBoolean=p,t.isNull=d,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=_,t.types.isDate=_,t.isError=b,t.types.isNativeError=b,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},t.isBuffer=Ru();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=Fl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(S&&t[S]){var r;if("function"!=typeof(r=t[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push(function(t,n){t?r(t):e(n)});try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),S&&Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,e(t))},t.promisify.custom=S,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};t.apply(this,e).then(function(t){process.nextTick(a.bind(null,null,t))},function(t){process.nextTick(E.bind(null,t,a))})}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,e(t)),r}}),rc=f((t,e)=>{function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){return(n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,i=a(t);if(e){var o=a(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var o,s,l={};function u(t,e,r){r||(r=Error);var a=function(r){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)}(o,r);var a=i(o);function o(r,n,i){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),s=a.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i)),s.code=t,s}return function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}(o)}(r);l[t]=a}function c(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(t,e,n){var i,a;if(void 0===o&&(o=xc()),o("string"==typeof t,"'name' must be a string"),"string"==typeof e&&function(t,e){return t.substr(0,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(c(e,"type"));else{var s=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(c(e,"type"))}return a+=". Received type ".concat(r(n))},TypeError),u("ERR_INVALID_ARG_VALUE",function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=ec());var n=s.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)},TypeError),u("ERR_INVALID_RETURN_VALUE",function(t,e,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];void 0===o&&(o=xc()),o(e.length>0,"At least one arg needs to be specified");var n="The ",i=e.length;switch(e=e.map(function(t){return'"'.concat(t,'"')}),i){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,i-1).join(", "),n+=", and ".concat(e[i-1]," arguments")}return"".concat(n," must be specified")},TypeError),e.exports.codes=l}),nc=f((t,e)=>{function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function i(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t){var e=function(t,e){if("object"!==d(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!==d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===d(e)?e:String(e)}function s(t,e){if(e&&("object"===d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return c(t,arguments,p(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,t)},u(t)}function c(t,e,r){return(c=h()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&f(i,r.prototype),i}).apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function f(t,e){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=ec().inspect,g=rc().codes.ERR_INVALID_ARG_TYPE;function y(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var v="",x="",_="",b="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function T(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach(function(e){r[e]=t[e]}),Object.defineProperty(r,"message",{value:t.message}),r}function k(t){return m(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function A(t,e,r){var n="",i="",a=0,o="",s=!1,l=k(t),u=l.split("\n"),c=k(e).split("\n"),h=0,f="";if("strictEqual"===r&&"object"===d(t)&&"object"===d(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===u.length&&1===c.length&&u[0]!==c[0]){var p=u[0].length+c[0].length;if(p<=10){if(!("object"===d(t)&&null!==t||"object"===d(e)&&null!==e||0===t&&0===e))return"".concat(w[r],"\n\n")+"".concat(u[0]," !== ").concat(c[0],"\n")}else if("strictEqualObject"!==r&&p<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;u[0][h]===c[0][h];)h++;h>2&&(f="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",h),"^"),h=0)}}for(var m=u[u.length-1],g=c[c.length-1];m===g&&(h++<2?o="\n ".concat(m).concat(o):n=m,u.pop(),c.pop(),0!==u.length&&0!==c.length);)m=u[u.length-1],g=c[c.length-1];var T=Math.max(u.length,c.length);if(0===T){var A=l.split("\n");if(A.length>30)for(A[26]="".concat(v,"...").concat(b);A.length>27;)A.pop();return"".concat(w.notIdentical,"\n\n").concat(A.join("\n"),"\n")}h>3&&(o="\n".concat(v,"...").concat(b).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var M=0,S=w[r]+"\n".concat(x,"+ actual").concat(b," ").concat(_,"- expected").concat(b),E=" ".concat(v,"...").concat(b," Lines skipped");for(h=0;h<T;h++){var C=h-a;if(u.length<h+1)C>1&&h>2&&(C>4?(i+="\n".concat(v,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(c[h-2]),M++),i+="\n ".concat(c[h-1]),M++),a=h,n+="\n".concat(_,"-").concat(b," ").concat(c[h]),M++;else if(c.length<h+1)C>1&&h>2&&(C>4?(i+="\n".concat(v,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(u[h-2]),M++),i+="\n ".concat(u[h-1]),M++),a=h,i+="\n".concat(x,"+").concat(b," ").concat(u[h]),M++;else{var I=c[h],L=u[h],P=L!==I&&(!y(L,",")||L.slice(0,-1)!==I);P&&y(I,",")&&I.slice(0,-1)===L&&(P=!1,L+=","),P?(C>1&&h>2&&(C>4?(i+="\n".concat(v,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(u[h-2]),M++),i+="\n ".concat(u[h-1]),M++),a=h,i+="\n".concat(x,"+").concat(b," ").concat(L),n+="\n".concat(_,"-").concat(b," ").concat(I),M+=2):(i+=n,n="",(1===C||0===h)&&(i+="\n ".concat(L),M++))}if(M>20&&h<T-2)return"".concat(S).concat(E,"\n").concat(i,"\n").concat(v,"...").concat(b).concat(n,"\n")+"".concat(v,"...").concat(b)}return"".concat(S).concat(s?E:"","\n").concat(i).concat(n).concat(o).concat(f)}var M=function(t,e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(i,t);var r=function(t){var e=h();return function(){var r,n=p(t);if(e){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return s(this,r)}}(i);function i(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),"object"!==d(t)||null===t)throw new g("options","Object",t);var n=t.message,a=t.operator,o=t.stackStartFn,u=t.actual,c=t.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)e=r.call(this,String(n));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(v="",x="",b="",_=""):(v="",x="",b="",_="")),"object"===d(u)&&null!==u&&"object"===d(c)&&null!==c&&"stack"in u&&u instanceof Error&&"stack"in c&&c instanceof Error&&(u=T(u),c=T(c)),"deepStrictEqual"===a||"strictEqual"===a)e=r.call(this,A(u,c,a));else if("notDeepStrictEqual"===a||"notStrictEqual"===a){var f=w[a],p=k(u).split("\n");if("notStrictEqual"===a&&"object"===d(u)&&null!==u&&(f=w.notStrictEqualObject),p.length>30)for(p[26]="".concat(v,"...").concat(b);p.length>27;)p.pop();e=1===p.length?r.call(this,"".concat(f," ").concat(p[0])):r.call(this,"".concat(f,"\n\n").concat(p.join("\n"),"\n"))}else{var m=k(u),y="",M=w[a];"notDeepEqual"===a||"notEqual"===a?(m="".concat(w[a],"\n\n").concat(m)).length>1024&&(m="".concat(m.slice(0,1021),"...")):(y="".concat(k(c)),m.length>512&&(m="".concat(m.slice(0,509),"...")),y.length>512&&(y="".concat(y.slice(0,509),"...")),"deepEqual"===a||"equal"===a?m="".concat(M,"\n\n").concat(m,"\n\nshould equal\n\n"):y=" ".concat(a," ").concat(y)),e=r.call(this,"".concat(m).concat(y))}return Error.stackTraceLimit=h,e.generatedMessage=!n,Object.defineProperty(l(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=u,e.expected=c,e.operator=a,Error.captureStackTrace&&Error.captureStackTrace(l(e),o),e.stack,e.name="AssertionError",s(e)}return a(i,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return m(this,n(n({},e),{},{customInspect:!1,depth:0}))}}]),i}(u(Error),m.custom);e.exports=M}),ic=f((t,e)=>{var r=Object.prototype.toString;e.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}}),ac=f((t,e)=>{var r,n,i,a,o,s,l,u,c,h,f,p;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=ic(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{c(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){if("undefined"==typeof window||!f)return c(t);try{return c(t)}catch(t){return!1}},r=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=a(t),c=e&&"[object String]"===i.call(t),h=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var f=l&&r;if(c&&t.length>0&&!n.call(t,0))for(var d=0;d<t.length;++d)h.push(String(d));if(o&&t.length>0)for(var m=0;m<t.length;++m)h.push(String(m));else for(var g in t)(!f||"prototype"!==g)&&n.call(t,g)&&h.push(String(g));if(s)for(var y=p(t),v=0;v<u.length;++v)(!y||"constructor"!==u[v])&&n.call(t,u[v])&&h.push(u[v]);return h}),e.exports=r}),oc=f((t,e)=>{var r=Array.prototype.slice,n=ic(),i=Object.keys,a=i?function(t){return i(t)}:ac(),o=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return n(t)?o(r.call(t)):o(t)})}else Object.keys=a;return Object.keys||a},e.exports=a}),sc=f((t,e)=>{var r=oc(),n=Vl()(),i=Su(),a=Object,o=i("Array.prototype.push"),s=i("Object.prototype.propertyIsEnumerable"),l=n?Object.getOwnPropertySymbols:null;e.exports=function(t,e){if(null==t)throw new TypeError("target must be an object");var i=a(t);if(1===arguments.length)return i;for(var u=1;u<arguments.length;++u){var c=a(arguments[u]),h=r(c),f=n&&(Object.getOwnPropertySymbols||l);if(f)for(var p=f(c),d=0;d<p.length;++d){var m=p[d];s(c,m)&&o(h,m)}for(var g=0;g<h.length;++g){var y=h[g];if(s(c,y)){var v=c[y];i[y]=v}}}return i}}),lc=f((t,e)=>{var r=sc();e.exports=function(){return!Object.assign||function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n<e.length;++n)r[e[n]]=e[n];var i=Object.assign({},r),a="";for(var o in i)a+=o;return t!==a}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch(e){return"y"===t[1]}return!1}()?r:Object.assign}}),uc=f((t,e)=>{var r=function(t){return t!=t};e.exports=function(t,e){return 0===t&&0===e?1/t==1/e:!!(t===e||r(t)&&r(e))}}),cc=f((t,e)=>{var r=uc();e.exports=function(){return"function"==typeof Object.is?Object.is:r}}),hc=f((t,e)=>{var r=oc(),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,o=Object.defineProperty,s=ku()(),l=o&&s,u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if(!function(t){return"function"==typeof t&&"[object Function]"===i.call(t)}(n)||!n())return;l?o(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r},c=function(t,e){var i=arguments.length>2?arguments[2]:{},o=r(e);n&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s<o.length;s+=1)u(t,o[s],e[o[s]],i[o[s]])};c.supportsDescriptors=!!l,e.exports=c}),fc=f((t,e)=>{var r=cc(),n=hc();e.exports=function(){var t=r();return n(Object,{is:t},{is:function(){return Object.is!==t}}),t}}),pc=f((t,e)=>{var r=hc(),n=Mu(),i=uc(),a=cc(),o=fc(),s=n(a(),Object);r(s,{getPolyfill:a,implementation:i,shim:o}),e.exports=s}),dc=f((t,e)=>{e.exports=function(t){return t!=t}}),mc=f((t,e)=>{var r=dc();e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}}),gc=f((t,e)=>{var r=hc(),n=mc();e.exports=function(){var t=n();return r(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}}),yc=f((t,e)=>{var r=Mu(),n=hc(),i=dc(),a=mc(),o=gc(),s=r(a(),Number);n(s,{getPolyfill:a,implementation:i,shim:o}),e.exports=s}),vc=f((t,e)=>{function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e);else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){u=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=void 0!==/a/g.flags,o=function(t){var e=[];return t.forEach(function(t){return e.push(t)}),e},s=function(t){var e=[];return t.forEach(function(t,r){return e.push([r,t])}),e},l=Object.is?Object.is:pc(),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:yc();function h(t){return t.call.bind(t)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),m=ec().types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,x=m.isMap,_=m.isRegExp,b=m.isSet,w=m.isNativeError,T=m.isBoxedPrimitive,k=m.isNumberObject,A=m.isStringObject,M=m.isBooleanObject,S=m.isBigIntObject,E=m.isSymbolObject,C=m.isFloat32Array,I=m.isFloat64Array;function L(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function P(t){return Object.keys(t).filter(L).concat(u(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function z(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function O(t,e,r,n){if(t===e)return 0!==t||!r||l(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&c(t)&&c(e);if("object"!==i(e)||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var o=d(t);if(o!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var s=P(t),u=P(e);return s.length===u.length&&R(t,e,r,n,1,s)}if("[object Object]"===o&&(!x(t)&&x(e)||!b(t)&&b(e)))return!1;if(v(t)){if(!v(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(_(t)){if(!_(e)||!function(t,e){return a?t.source===e.source&&t.flags===e.flags:RegExp.prototype.toString.call(t)===RegExp.prototype.toString.call(e)}(t,e))return!1}else if(w(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(y(t)){if(r||!C(t)&&!I(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===z(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var h=P(t),f=P(e);return h.length===f.length&&R(t,e,r,n,0,h)}if(b(t))return!(!b(e)||t.size!==e.size)&&R(t,e,r,n,2);if(x(t))return!(!x(e)||t.size!==e.size)&&R(t,e,r,n,3);if(g(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===z(new Uint8Array(t),new Uint8Array(e))}(t,e))return!1}else if(T(t)&&!function(t,e){return k(t)?k(e)&&l(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):A(t)?A(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):M(t)?M(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):S(t)?S(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):E(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return R(t,e,r,n,0)}function D(t,e){return e.filter(function(e){return p(t,e)})}function R(t,e,n,a,l,c){if(5===arguments.length){c=Object.keys(t);var h=Object.keys(e);if(c.length!==h.length)return!1}for(var d=0;d<c.length;d++)if(!f(e,c[d]))return!1;if(n&&5===arguments.length){var m=u(t);if(0!==m.length){var g=0;for(d=0;d<m.length;d++){var y=m[d];if(p(t,y)){if(!p(e,y))return!1;c.push(y),g++}else if(p(e,y))return!1}var v=u(e);if(m.length!==v.length&&D(e,v).length!==g)return!1}else{var x=u(e);if(0!==x.length&&0!==D(e,x).length)return!1}}if(0===c.length&&(0===l||1===l&&0===t.length||0===t.size))return!0;if(void 0===a)a={val1:new Map,val2:new Map,position:0};else{var _=a.val1.get(t);if(void 0!==_){var b=a.val2.get(e);if(void 0!==b)return _===b}a.position++}a.val1.set(t,a.position),a.val2.set(e,a.position);var w=function(t,e,n,a,l,u){var c=0;if(2===u){if(!function(t,e,r,n){for(var a=null,s=o(t),l=0;l<s.length;l++){var u=s[l];if("object"===i(u)&&null!==u)null===a&&(a=new Set),a.add(u);else if(!e.has(u)){if(r||!N(t,e,u))return!1;null===a&&(a=new Set),a.add(u)}}if(null!==a){for(var c=o(e),h=0;h<c.length;h++){var f=c[h];if("object"===i(f)&&null!==f){if(!F(a,f,r,n))return!1}else if(!r&&!t.has(f)&&!F(a,f,r,n))return!1}return 0===a.size}return!0}(t,e,n,l))return!1}else if(3===u){if(!function(t,e,n,a){for(var o=null,l=s(t),u=0;u<l.length;u++){var c=r(l[u],2),h=c[0],f=c[1];if("object"===i(h)&&null!==h)null===o&&(o=new Set),o.add(h);else{var p=e.get(h);if(void 0===p&&!e.has(h)||!O(f,p,n,a)){if(n||!j(t,e,h,f,a))return!1;null===o&&(o=new Set),o.add(h)}}}if(null!==o){for(var d=s(e),m=0;m<d.length;m++){var g=r(d[m],2),y=g[0],v=g[1];if("object"===i(y)&&null!==y){if(!U(o,t,y,v,n,a))return!1}else if(!(n||t.has(y)&&O(t.get(y),v,!1,a)||U(o,t,y,v,!1,a)))return!1}return 0===o.size}return!0}(t,e,n,l))return!1}else if(1===u)for(;c<t.length;c++){if(!f(t,c)){if(f(e,c))return!1;for(var h=Object.keys(t);c<h.length;c++){var p=h[c];if(!f(e,p)||!O(t[p],e[p],n,l))return!1}return h.length===Object.keys(e).length}if(!f(e,c)||!O(t[c],e[c],n,l))return!1}for(c=0;c<a.length;c++){var d=a[c];if(!O(t[d],e[d],n,l))return!1}return!0}(t,e,n,c,a,l);return a.val1.delete(t),a.val2.delete(e),w}function F(t,e,r,n){for(var i=o(t),a=0;a<i.length;a++){var s=i[a];if(O(e,s,r,n))return t.delete(s),!0}return!1}function B(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(c(t))return!1}return!0}function N(t,e,r){var n=B(r);return null!=n?n:e.has(n)&&!t.has(n)}function j(t,e,r,n,i){var a=B(r);if(null!=a)return a;var o=e.get(a);return!(void 0===o&&!e.has(a)||!O(n,o,!1,i))&&!t.has(a)&&O(n,o,!1,i)}function U(t,e,r,n,i,a){for(var s=o(t),l=0;l<s.length;l++){var u=s[l];if(O(r,u,i,a)&&O(n,e.get(u),i,a))return t.delete(u),!0}return!1}e.exports={isDeepEqual:function(t,e){return O(t,e,!1)},isDeepStrictEqual:function(t,e){return O(t,e,!0)}}}),xc=f((t,e)=>{function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n,i,a=rc().codes,o=a.ERR_AMBIGUOUS_ARGUMENT,s=a.ERR_INVALID_ARG_TYPE,l=a.ERR_INVALID_ARG_VALUE,u=a.ERR_INVALID_RETURN_VALUE,c=a.ERR_MISSING_ARGS,h=nc(),f=ec().inspect,p=ec().types,d=p.isPromise,m=p.isRegExp,g=lc()(),y=cc()(),v=Su()("RegExp.prototype.test");function x(){var t=vc();n=t.isDeepEqual,i=t.isDeepStrictEqual}var _=!1,b=e.exports=A,w={};function T(t){throw t.message instanceof Error?t.message:new h(t)}function k(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var a=new h({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw a.generatedMessage=i,a}}function A(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];k.apply(void 0,[A,e.length].concat(e))}b.fail=function t(e,r,n,i,a){var o,s=arguments.length;if(0===s?o="Failed":1===s?(n=e,e=void 0):(!1===_&&(_=!0,(process.emitWarning?process.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===s&&(i="!=")),n instanceof Error)throw n;var l={actual:e,expected:r,operator:void 0===i?"fail":i,stackStartFn:a||t};void 0!==n&&(l.message=n);var u=new h(l);throw o&&(u.message=o,u.generatedMessage=!0),u},b.AssertionError=h,b.ok=A,b.equal=function t(e,r,n){if(arguments.length<2)throw new c("actual","expected");e!=r&&T({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},b.notEqual=function t(e,r,n){if(arguments.length<2)throw new c("actual","expected");e==r&&T({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},b.deepEqual=function t(e,r,i){if(arguments.length<2)throw new c("actual","expected");void 0===n&&x(),n(e,r)||T({actual:e,expected:r,message:i,operator:"deepEqual",stackStartFn:t})},b.notDeepEqual=function t(e,r,i){if(arguments.length<2)throw new c("actual","expected");void 0===n&&x(),n(e,r)&&T({actual:e,expected:r,message:i,operator:"notDeepEqual",stackStartFn:t})},b.deepStrictEqual=function t(e,r,a){if(arguments.length<2)throw new c("actual","expected");void 0===n&&x(),i(e,r)||T({actual:e,expected:r,message:a,operator:"deepStrictEqual",stackStartFn:t})},b.notDeepStrictEqual=function t(e,r,a){if(arguments.length<2)throw new c("actual","expected");void 0===n&&x(),i(e,r)&&T({actual:e,expected:r,message:a,operator:"notDeepStrictEqual",stackStartFn:t})},b.strictEqual=function t(e,r,n){if(arguments.length<2)throw new c("actual","expected");y(e,r)||T({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},b.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new c("actual","expected");y(e,r)&&T({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var M,S=(M=function t(e,r,n){var i=this;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),r.forEach(function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&m(e[t])&&v(e[t],n[t])?i[t]=n[t]:i[t]=e[t])})},Object.defineProperty(M,"prototype",{writable:!1}),M);function E(t,e,a,o){if("function"!=typeof e){if(m(e))return v(e,t);if(2===arguments.length)throw new s("expected",["Function","RegExp"],e);if("object"!==r(t)||null===t){var u=new h({actual:t,expected:e,message:a,operator:"deepStrictEqual",stackStartFn:o});throw u.operator=o.name,u}var c=Object.keys(e);if(e instanceof Error)c.push("name","message");else if(0===c.length)throw new l("error",e,"may not be an empty object");return void 0===n&&x(),c.forEach(function(r){"string"==typeof t[r]&&m(e[r])&&v(e[r],t[r])||function(t,e,r,n,a,o){if(!(r in t)||!i(t[r],e[r])){if(!n){var s=new S(t,a),l=new S(e,a,t),u=new h({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw u.actual=t,u.expected=e,u.operator=o.name,u}T({actual:t,expected:e,message:n,operator:o.name,stackStartFn:o})}}(t,e,r,a,c,o)}),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function C(t){if("function"!=typeof t)throw new s("fn","Function",t);try{t()}catch(t){return t}return w}function I(t){return d(t)||null!==t&&"object"===r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function L(t){return Promise.resolve().then(function(){var e;if("function"==typeof t){if(!I(e=t()))throw new u("instance of Promise","promiseFn",e)}else{if(!I(t))throw new s("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then(function(){return e}).then(function(){return w}).catch(function(t){return t})})}function P(t,e,n,i){if("string"==typeof n){if(4===arguments.length)throw new s("error",["Object","Error","Function","RegExp"],n);if("object"===r(e)&&null!==e){if(e.message===n)throw new o("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===n)throw new o("error/message",'The error "'.concat(e,'" is identical to the message.'));i=n,n=void 0}else if(null!=n&&"object"!==r(n)&&"function"!=typeof n)throw new s("error",["Object","Error","Function","RegExp"],n);if(e===w){var a="";n&&n.name&&(a+=" (".concat(n.name,")")),a+=i?": ".concat(i):".";var l="rejects"===t.name?"rejection":"exception";T({actual:void 0,expected:n,operator:t.name,message:"Missing expected ".concat(l).concat(a),stackStartFn:t})}if(n&&!E(e,n,i,t))throw e}function z(t,e,r,n){if(e!==w){if("string"==typeof r&&(n=r,r=void 0),!r||E(e,r)){var i=n?": ".concat(n):".",a="doesNotReject"===t.name?"rejection":"exception";T({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(a).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function O(t,e,n,i,a){if(!m(e))throw new s("regexp","RegExp",e);var o="match"===a;if("string"!=typeof t||v(e,t)!==o){if(n instanceof Error)throw n;var l=!n;n=n||("string"!=typeof t?'The "string" argument must be of type string. Received type '+"".concat(r(t)," (").concat(f(t),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(f(e),". Input:\n\n").concat(f(t),"\n"));var u=new h({actual:t,expected:e,message:n,operator:a,stackStartFn:i});throw u.generatedMessage=l,u}}function D(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];k.apply(void 0,[D,e.length].concat(e))}b.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];P.apply(void 0,[t,C(e)].concat(n))},b.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return L(e).then(function(e){return P.apply(void 0,[t,e].concat(n))})},b.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];z.apply(void 0,[t,C(e)].concat(n))},b.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return L(e).then(function(e){return z.apply(void 0,[t,e].concat(n))})},b.ifError=function t(e){if(null!=e){var n="ifError got unwanted exception: ";"object"===r(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?n+=e.constructor.name:n+=e.message:n+=f(e);var i=new h({actual:e,expected:null,operator:"ifError",message:n,stackStartFn:t}),a=e.stack;if("string"==typeof a){var o=a.split("\n");o.shift();for(var s=i.stack.split("\n"),l=0;l<o.length;l++){var u=s.indexOf(o[l]);if(-1!==u){s=s.slice(0,u);break}}i.stack="".concat(s.join("\n"),"\n").concat(o.join("\n"))}throw i}},b.match=function t(e,r,n){O(e,r,n,t,"match")},b.doesNotMatch=function t(e,r,n){O(e,r,n,t,"doesNotMatch")},b.strict=g(D,b,{equal:b.strictEqual,deepEqual:b.deepStrictEqual,notEqual:b.notStrictEqual,notDeepEqual:b.notDeepStrictEqual}),b.strict.strict=b.strict}),_c=f((t,e)=>{var r=1e3,n=6e4,i=60*n,a=24*i,o=365.25*a;function s(t,e,r){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+r:Math.ceil(t/e)+" "+r+"s"}e.exports=function(t,e){e=e||{};var l=typeof t;if("string"===l&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===l&&!1===isNaN(t))return e.long?function(t){return s(t,a,"day")||s(t,i,"hour")||s(t,n,"minute")||s(t,r,"second")||t+" ms"}(t):function(t){return t>=a?Math.round(t/a)+"d":t>=i?Math.round(t/i)+"h":t>=n?Math.round(t/n)+"m":t>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}),bc=f((t,e)=>{var r;function n(e){function n(){if(n.enabled){var e=n,i=+new Date,a=i-(r||i);e.diff=a,e.prev=r,e.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var l=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;l++;var i=t.formatters[n];if("function"==typeof i){var a=o[l];r=i.call(e,a),o.splice(l,1),l--}return r}),t.formatArgs.call(e,o),(n.log||t.log||console.log.bind(console)).apply(e,o)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"==typeof t.init&&t.init(n),n}(t=e.exports=n.debug=n.default=n).coerce=function(t){return t instanceof Error?t.stack||t.message:t},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&("-"===(e=r[i].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=_c(),t.names=[],t.skips=[],t.formatters={}}),wc=f((t,e)=>{function r(){var e;try{e=t.storage.debug}catch(t){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=bc()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))}),e.splice(a,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(t){}},t.load=r,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(r())}),Tc=f((t,e)=>{var r=xc(),n=wc()("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),t._bytes=u,t._skipBytes=c,e&&(t._passthrough=h),e?t._transform=p:t._write=f};var i=-1,a=0,o=1,s=2;function l(t){n("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=i,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function u(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||l(this),n("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=a}function c(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||l(this),n("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=o}function h(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||l(this),n("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=s}function f(t,e,r){this._parserInit||l(this),n("write(%o bytes)",t.length),"function"==typeof e&&(r=e),m(this,t,null,r)}function p(t,e,r){this._parserInit||l(this),n("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),m(this,t,e,r)}function d(t,e,r,o){if(t._parserBytesLeft-=e.length,n("%o bytes left for stream piece",t._parserBytesLeft),t._parserState===a?(t._parserBuffers.push(e),t._parserBuffered+=e.length):t._parserState===s&&r(e),0!==t._parserBytesLeft)return o;var l=t._parserCallback;if(l&&t._parserState===a&&t._parserBuffers.length>1&&(e=Buffer.concat(t._parserBuffers,t._parserBuffered)),t._parserState!==a&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=i,t._parserBuffers.splice(0),l){var u=[];e&&u.push(e),r&&u.push(r);var c=l.length>u.length;c&&u.push(g(o));var h=l.apply(t,u);if(!c||o===h)return o}}var m=g(function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return d(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return d(e,a,n,function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0})}});function g(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}),kc=f(t=>{var e=tc().Transform,r=Tc();function n(){e.call(this,{readableObjectMode:!0})}function i(t,e,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=t,e&&(this.code=e),r&&(this.statusCode=r)}n.prototype=Object.create(e.prototype),n.prototype.constructor=n,r(n.prototype),t.ParserStream=n,t.sliceEq=function(t,e,r){for(var n=e,i=0;i<r.length;)if(t[n++]!==r[i++])return!1;return!0},t.str2arr=function(t,e){var r=[],n=0;if(e&&"hex"===e)for(;n<t.length;)r.push(parseInt(t.slice(n,n+2),16)),n+=2;else for(;n<t.length;n++)r.push(255&t.charCodeAt(n));return r},t.readUInt16LE=function(t,e){return t[e]|t[e+1]<<8},t.readUInt16BE=function(t,e){return t[e+1]|t[e]<<8},t.readUInt32LE=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|16777216*t[e+3]},t.readUInt32BE=function(t,e){return t[e+3]|t[e+2]<<8|t[e+1]<<16|16777216*t[e]},i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,t.ProbeError=i}),Ac=f((t,e)=>{var r=kc().readUInt16BE,n=kc().readUInt32BE;function i(t,e){if(t.length<4+e)return null;var r=n(t,e);return t.length<r+e||r<8?null:{boxtype:String.fromCharCode.apply(null,t.slice(e+4,e+8)),data:t.slice(e+8,e+r),end:e+r}}function a(t,e){for(var r=0;;){var a=i(t,r);if(!a)break;switch(a.boxtype){case"ispe":e.sizes.push({width:n(a.data,4),height:n(a.data,8)});break;case"irot":e.transforms.push({type:"irot",value:3&a.data[0]});break;case"imir":e.transforms.push({type:"imir",value:1&a.data[0]})}r=a.end}}function o(t,e,r){for(var n=0,i=0;i<r;i++)n=256*n+(t[e+i]||0);return n}function s(t,e){for(var n=t[4]>>4&15,i=15&t[4],a=t[5]>>4&15,s=r(t,6),l=8,u=0;u<s;u++){var c=r(t,l),h=r(t,l+=2),f=o(t,l+=2,a),p=r(t,l+=a);if(l+=2,0===h&&1===p){var d=o(t,l,n),m=o(t,l+n,i);e.item_loc[c]={length:m,offset:d+f}}l+=p*(n+i)}}function l(t,e){for(var n=r(t,4),a=6,o=0;o<n;o++){var s=i(t,a);if(!s)break;if("infe"===s.boxtype){for(var l=r(s.data,4),u="",c=8;c<s.data.length&&s.data[c];c++)u+=String.fromCharCode(s.data[c]);e.item_inf[u]=l}a=s.end}}function u(t,e){for(var r=0;;){var n=i(t,r);if(!n)break;"ipco"===n.boxtype&&a(n.data,e),r=n.end}}e.exports.unbox=i,e.exports.readSizeFromMeta=function(t){var e={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(function(t,e){for(var r=4;;){var n=i(t,r);if(!n)break;"iprp"===n.boxtype&&u(n.data,e),"iloc"===n.boxtype&&s(n.data,e),"iinf"===n.boxtype&&l(n.data,e),r=n.end}}(t,e),e.sizes.length){var r=function(t){var e=t.reduce(function(t,e){return t.width>e.width||t.width===e.width&&t.height>e.height?t:e}),r=t.reduce(function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e});return e.width>r.height||e.width===r.height&&e.height>r.width?e:r}(e.sizes),n=1;e.transforms.forEach(function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(n=0===t.value?r[n]:e[n=e[n=r[n]]]),"irot"===t.type)for(var i=0;i<t.value;i++)n=e[n]});var a=null;return e.item_inf.Exif&&(a=e.item_loc[e.item_inf.Exif]),{width:r.width,height:r.height,orientation:e.transforms.length?n:null,variants:e.sizes,exif_location:a}}},e.exports.getMimeType=function(t){var e=String.fromCharCode.apply(null,t.slice(0,4)),r={};r[e]=!0;for(var n=8;n<t.length;n+=4)r[String.fromCharCode.apply(null,t.slice(n,n+4))]=!0;if(r.mif1||r.msf1||r.miaf)return"avif"===e||"avis"===e||"avio"===e?{type:"avif",mime:"image/avif"}:"heic"===e||"heix"===e?{type:"heic",mime:"image/heic"}:"hevc"===e||"hevx"===e?{type:"heic",mime:"image/heic-sequence"}:r.avif||r.avis?{type:"avif",mime:"image/avif"}:r.heic||r.heix||r.hevc||r.hevx||r.heis?r.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}}),Mc=f((t,e)=>{function r(t,e){var r=new Error(t);return r.code=e,r}function n(t){try{return decodeURIComponent(escape(t))}catch(e){return t}}function i(t,e,n){this.input=t.subarray(e,n),this.start=e;var i=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==i&&"MM\0*"!==i)throw r("invalid TIFF signature","EBADDATA");this.big_endian="M"===i[0]}i.prototype.each=function(t){this.aborted=!1;var e=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:e}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},i.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},i.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},i.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},i.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));default:return null}},i.prototype.scan_ifd=function(t,e,i){var a=this.read_uint16(e);e+=2;for(var o=0;o<a;o++){var s=this.read_uint16(e),l=this.read_uint16(e+2),u=this.read_uint32(e+4),c=this.exif_format_length(l),h=u*c,f=h<=4?e+8:this.read_uint32(e+8),p=!1;if(f+h>this.input.length)throw r("unexpected EOF","EBADDATA");for(var d=[],m=f,g=0;g<u;g++,m+=c){var y=this.exif_format_read(l,m);if(null===y){d=null;break}d.push(y)}if(Array.isArray(d)&&2===l&&(d=n(String.fromCharCode.apply(null,d)))&&"\0"===d[d.length-1]&&(d=d.slice(0,-1)),this.is_subifd_link(t,s)&&Array.isArray(d)&&Number.isInteger(d[0])&&d[0]>0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:u,entry_offset:e+this.start,data_length:h,data_offset:f+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=i,e.exports.get_orientation=function(t){var e=0;try{return new i(t,0,t.length).each(function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch(t){return-1}}}),Sc=f((t,e)=>{var r=kc().str2arr,n=kc().sliceEq,i=kc().readUInt32BE,a=Ac(),o=Mc(),s=r("ftyp");e.exports=function(t){if(n(t,4,s)){var e=a.unbox(t,0);if(e){var r=a.getMimeType(e.data);if(r){for(var l,u=e.end;;){var c=a.unbox(t,u);if(!c)break;if(u=c.end,"mdat"===c.boxtype)return;if("meta"===c.boxtype){l=c.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var f={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(f.variants=h.variants),h.orientation&&(f.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=t.length){var p=i(t,h.exif_location.offset),d=t.slice(h.exif_location.offset+p+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(d);m>0&&(f.orientation=m)}return f}}}}}}}),Ec=f((t,e)=>{var r=kc().str2arr,n=kc().sliceEq,i=kc().readUInt16LE,a=r("BM");e.exports=function(t){if(!(t.length<26)&&n(t,0,a))return{width:i(t,18),height:i(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),Cc=f((t,e)=>{var r=kc().str2arr,n=kc().sliceEq,i=kc().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");e.exports=function(t){if(!(t.length<10)&&(n(t,0,a)||n(t,0,o)))return{width:i(t,6),height:i(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),Ic=f((t,e)=>{var r=kc().readUInt16LE;e.exports=function(t){var e=r(t,0),n=r(t,2),i=r(t,4);if(0===e&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;s<i;s++){var l=t[6+16*s]||256,u=t[6+16*s+1]||256,c={width:l,height:u};a.push(c),(l>o.width||u>o.height)&&(o=c)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),Lc=f((t,e)=>{var r=kc().readUInt16BE,n=kc().str2arr,i=kc().sliceEq,a=Mc(),o=n("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var n,s=t[e++];255===s;)s=t[e++];if(208<=s&&s<=217||1===s)n=0;else{if(!(192<=s&&s<=254))return;if(t.length-e<2)return;n=r(t,e)-2,e+=2}if(217===s||218===s)return;var l;if(225===s&&n>=10&&i(t,e,o)&&(l=a.get_orientation(t.slice(e+6,e+n))),n>=5&&192<=s&&s<=207&&196!==s&&200!==s&&204!==s){if(t.length-e<n)return;var u={width:r(t,e+3),height:r(t,e+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return l>0&&(u.orientation=l),u}e+=n}}}),Pc=f((t,e)=>{var r=kc().str2arr,n=kc().sliceEq,i=kc().readUInt32BE,a=r("‰PNG\r\n\n"),o=r("IHDR");e.exports=function(t){if(!(t.length<24)&&n(t,0,a)&&n(t,12,o))return{width:i(t,16),height:i(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}),zc=f((t,e)=>{var r=kc().str2arr,n=kc().sliceEq,i=kc().readUInt32BE,a=r("8BPS\0");e.exports=function(t){if(!(t.length<22)&&n(t,0,a))return{width:i(t,18),height:i(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),Oc=f((t,e)=>{function r(t){return 32===t||9===t||13===t||10===t}function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,u=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(t){return u.test(t)?t.match(u)[0]:"px"}e.exports=function(t){if(function(t){var e=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(e=3);e<n&&r(t[e]);)e++;return e!==n&&60===t[e]}(t)){for(var e="",u=0;u<t.length;u++)e+=String.fromCharCode(t[u]);var h=(e.match(i)||[""])[0];if(a.test(h)){var f=function(t){var e=t.match(o),r=t.match(s),n=t.match(l);return{width:e&&(e[1]||e[2]),height:r&&(r[1]||r[2]),viewbox:n&&(n[1]||n[2])}}(h),p=parseFloat(f.width),d=parseFloat(f.height);if(f.width&&f.height)return n(p)&&n(d)?{width:p,height:d,type:"svg",mime:"image/svg+xml",wUnits:c(f.width),hUnits:c(f.height)}:void 0;var m=(f.viewbox||"").split(" "),g={width:m[2],height:m[3]},y=parseFloat(g.width),v=parseFloat(g.height);if(n(y)&&n(v)&&c(g.width)===c(g.height)){var x=y/v;return f.width?n(p)?{width:p,height:p/x,type:"svg",mime:"image/svg+xml",wUnits:c(f.width),hUnits:c(f.width)}:void 0:f.height?n(d)?{width:d*x,height:d,type:"svg",mime:"image/svg+xml",wUnits:c(f.height),hUnits:c(f.height)}:void 0:{width:y,height:v,type:"svg",mime:"image/svg+xml",wUnits:c(g.width),hUnits:c(g.height)}}}}}}),Dc=f((t,e)=>{var r=kc().str2arr,n=kc().sliceEq,i=kc().readUInt16LE,a=kc().readUInt16BE,o=kc().readUInt32LE,s=kc().readUInt32BE,l=r("II*\0"),u=r("MM\0*");function c(t,e,r){return r?a(t,e):i(t,e)}function h(t,e,r){return r?s(t,e):o(t,e)}function f(t,e,r){var n=c(t,e+2,r);return 1!==h(t,e+4,r)||3!==n&&4!==n?null:3===n?c(t,e+8,r):h(t,e+8,r)}e.exports=function(t){if(!(t.length<8)&&(n(t,0,l)||n(t,0,u))){var e=77===t[0],r=h(t,4,e)-8;if(!(r<0)){var i=r+8;if(!(t.length-i<2)){var a=12*c(t,i+0,e);if(!(a<=0||(i+=2,t.length-i<a))){var o,s,p,d;for(o=0;o<a;o+=12)256===(d=c(t,i+o,e))?s=f(t,i+o,e):257===d&&(p=f(t,i+o,e));if(s&&p)return{width:s,height:p,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),Rc=f((t,e)=>{var r=kc().str2arr,n=kc().sliceEq,i=kc().readUInt16LE,a=kc().readUInt32LE,o=Mc(),s=r("RIFF"),l=r("WEBP");function u(t,e){if(157===t[e+3]&&1===t[e+4]&&42===t[e+5])return{width:16383&i(t,e+6),height:16383&i(t,e+8),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function c(t,e){if(47===t[e]){var r=a(t,e+1);return{width:1+(16383&r),height:1+(r>>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<<e|t[e+8]<<8|t[e+7]),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}e.exports=function(t){if(!(t.length<16)&&(n(t,0,s)||n(t,8,l))){var e=12,r=null,i=0,f=a(t,4)+8;if(!(f>t.length)){for(;e+8<f;)if(0!==t[e]){var p=String.fromCharCode.apply(null,t.slice(e,e+4)),d=a(t,e+4);"VP8 "===p&&d>=10?r=r||u(t,e+8):"VP8L"===p&&d>=9?r=r||c(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(i=o.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return i>0&&(r.orientation=i),r}}}}),Fc=f((t,e)=>{e.exports={avif:Sc(),bmp:Ec(),gif:Cc(),ico:Ic(),jpeg:Lc(),png:Pc(),psd:zc(),svg:Oc(),tiff:Dc(),webp:Rc()}}),Bc=f((t,e)=>{var r=Fc();e.exports=function(t){return function(t){for(var e=Object.keys(r),n=0;n<e.length;n++){var i=r[e[n]](t);if(i)return i}return null}(t)},e.exports.parsers=r}),Nc=f(t=>{var e=Bc(),r=zn().IMAGE_URL_PREFIX,n=Ul().Buffer;t.getImageSize=function(t){var i=t.replace(r,""),a=new n(i,"base64");return e(a)}}),jc=f((t,e)=>{var r=oe(),n=Ol(),i=T(),a=rr(),o=oe().maxRowLength,s=Nc().getImageSize;function l(t,e,n,i){return function(a){return r.constrain((a-t)*e,n,i)}}function u(t,e){return function(n){return r.constrain(n,t,e)}}e.exports=function(t,e){var r,c;if(e._hasZ)r=e.z.length,c=o(e.z);else if(e._hasSource){var h=s(e.source);r=h.height,c=h.width}var f,p=a.getFromId(t,e.xaxis||"x"),d=a.getFromId(t,e.yaxis||"y"),m=p.d2c(e.x0)-e.dx/2,g=d.d2c(e.y0)-e.dy/2,y=[m,m+c*e.dx],v=[g,g+r*e.dy];if(p&&"log"===p.type)for(f=0;f<c;f++)y.push(m+f*e.dx);if(d&&"log"===d.type)for(f=0;f<r;f++)v.push(g+f*e.dy);return e._extremes[p._id]=a.findExtremes(p,y),e._extremes[d._id]=a.findExtremes(d,v),e._scaler=function(t){var e=n.colormodel[t.colormodel],r=e.colormodel||t.colormodel,a=r.length;t._sArray=[];for(var o=0;o<a;o++)e.min[o]!==t.zmin[o]||e.max[o]!==t.zmax[o]?t._sArray.push(l(t.zmin[o],(e.max[o]-e.min[o])/(t.zmax[o]-t.zmin[o]),e.min[o],e.max[o])):t._sArray.push(u(e.min[o],e.max[o]));return function(e){for(var r=e.slice(0,a),n=0;n<a;n++){var o=r[n];if(!i(o))return!1;r[n]=t._sArray[n](o)}return r}}(e),[{x0:m,y0:g,z:e.z,w:c,h:r}]}}),Uc=f((t,e)=>{var r=v(),n=oe(),i=n.strTranslate,a=Te(),o=Ol(),s=Fo(),l=Ro().STYLE;e.exports=function(t,e,u,c){var h=e.xaxis,f=e.yaxis,p=!t._context._exportedPlot&&s();n.makeTraceGroups(c,u,"im").each(function(e){var s=r.select(this),u=e[0],c=u.trace,d=("fast"===c.zsmooth||!1===c.zsmooth&&p)&&!c._hasZ&&c._hasSource&&"linear"===h.type&&"linear"===f.type;c._realImage=d;var m,g,y,v,x,_,b=u.z,w=u.x0,T=u.y0,k=u.w,A=u.h,M=c.dx,S=c.dy;for(_=0;void 0===m&&_<k;)m=h.c2p(w+_*M),_++;for(_=k;void 0===g&&_>0;)g=h.c2p(w+_*M),_--;for(_=0;void 0===v&&_<A;)v=f.c2p(T+_*S),_++;for(_=A;void 0===x&&_>0;)x=f.c2p(T+_*S),_--;if(g<m&&(y=g,g=m,m=y),x<v&&(y=v,v=x,x=y),!d){var E=.5;m=Math.max(-E*h._length,m),g=Math.min(1.5*h._length,g),v=Math.max(-E*f._length,v),x=Math.min(1.5*f._length,x)}var C=Math.round(g-m),I=Math.round(x-v);if(C<=0||I<=0)s.selectAll("image").data([]).exit().remove();else{var L=s.selectAll("image").data([e]);L.enter().append("svg:image").attr({xmlns:a.svg,preserveAspectRatio:"none"}),L.exit().remove();var P=!1===c.zsmooth?l:"";if(d){var z=n.simpleMap(h.range,h.r2l),O=n.simpleMap(f.range,f.r2l),D=z[1]<z[0],R=O[1]>O[0];if(D||R){var F=m+C/2,B=v+I/2;P+="transform:"+i(F+"px",B+"px")+"scale("+(D?-1:1)+","+(R?-1:1)+")"+i(-F+"px",-B+"px")+";"}}L.attr("style",P);var N=new Promise(function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===k&&c._canvas.el.height===A&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=k,e.height=A;var r=e.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}}).then(function(){var t;if(c._hasZ)t=j(function(t,e){var r=b[e][t];return n.isTypedArray(r)&&(r=Array.from(r)),r}).toDataURL("image/png");else if(c._hasSource)if(d)t=c.source;else{var e=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,k,A).data;t=j(function(t,r){var n=4*(r*k+t);return[e[n],e[n+1],e[n+2],e[n+3]]}).toDataURL("image/png")}L.attr({"xlink:href":t,height:I,width:C,x:m,y:v})});t._promises.push(N)}function j(t){var e=document.createElement("canvas");e.width=C,e.height=I;var r,i=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return n.constrain(Math.round(h.c2p(w+t*M)-m),0,C)},s=function(t){return n.constrain(Math.round(f.c2p(T+t*S)-v),0,I)},l=o.colormodel[c.colormodel],p=l.colormodel||c.colormodel,d=l.fmt;for(_=0;_<u.w;_++){var g=a(_),y=a(_+1);if(y!==g&&!isNaN(y)&&!isNaN(g))for(var x=0;x<u.h;x++){var b=s(x),k=s(x+1);k===b||isNaN(k)||isNaN(b)||!t(_,x)||(r=c._scaler(t(_,x)),i.fillStyle=r?p+"("+d(r).join(",")+")":"rgba(0,0,0,0)",i.fillRect(g,b,y-g,k-b))}}return e}})}}),Vc=f((t,e)=>{var r=v();e.exports=function(t){r.select(t).selectAll(".im image").style("opacity",function(t){return t[0].trace.opacity})}}),qc=f((t,e)=>{var r=Pr(),n=oe(),i=n.isArrayOrTypedArray,a=Ol();e.exports=function(t,e,o){var s=t.cd[0],l=s.trace,u=t.xa,c=t.ya;if(!(r.inbox(e-s.x0,e-(s.x0+s.w*l.dx),0)>0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,f=Math.floor((e-s.x0)/l.dx),p=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[p][f]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,p,1,1).data),h){var d,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(d=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,_=x.length,b=l._scaler(h),w=v.suffix,T=[];(l.hovertemplate||d)&&(T.push("["+[b[0]+w[0],b[1]+w[1],b[2]+w[2]].join(", ")),4===_&&T.push(", "+b[3]+w[3]),T.push("]"),T=T.join(""),t.extraText=x.toUpperCase()+": "+T),i(l.hovertext)&&i(l.hovertext[p])?y=l.hovertext[p][f]:i(l.text)&&i(l.text[p])&&(y=l.text[p][f]);var k=c.c2p(s.y0+(p+.5)*l.dy),A=s.x0+(f+.5)*l.dx,M=s.y0+(p+.5)*l.dy,S="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(t,{index:[p,f],x0:u.c2p(s.x0+f*l.dx),x1:u.c2p(s.x0+(f+1)*l.dx),y0:k,y1:k,color:b,xVal:A,xLabelVal:A,yVal:M,yLabelVal:M,zLabelVal:S,text:y,hovertemplateLabels:{zLabel:S,colorLabel:T,"color[0]Label":b[0]+w[0],"color[1]Label":b[1]+w[1],"color[2]Label":b[2]+w[2],"color[3]Label":b[3]+w[3]}})]}}}}),Hc=f((t,e)=>{e.exports=function(t,e){return"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t.color=e.color,t.colormodel=e.trace.colormodel,t.z||(t.z=e.color),t}}),Gc=f((t,e)=>{e.exports={attributes:Dl(),supplyDefaults:Rl(),calc:jc(),plot:Uc(),style:Vc(),hoverPoints:qc(),eventData:Hc(),moduleType:"trace",name:"image",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),Zc=f((t,e)=>{e.exports=Gc()}),Wc=f((t,e)=>{var r=j(),n=wa().attributes,i=R(),a=V(),o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=D().extendFlat,u=Pt().pattern,c=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:u,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},c,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},c,{}),outsidetextfont:l({},c,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},c,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),Yc=f((t,e)=>{var r=T(),n=oe(),i=Wc(),a=wa().defaults,o=Za().handleText,s=oe().coercePattern;function l(t,e){var i=n.isArrayOrTypedArray(t),a=n.isArrayOrTypedArray(e),o=Math.min(i?t.length:1/0,a?e.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l<o;l++){var u=e[l];if(r(u)&&u>0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function u(t,e,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:l,handleMarkerDefaults:u,supplyDefaults:function(t,e,r,s){function c(r,a){return n.coerce(t,e,i,r,a)}var h=l(c("labels"),c("values")),f=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),f){e._length=f,u(t,e,s,c,!0),c("scalegroup");var p,d=c("text"),m=c("texttemplate");if(m||(p=c("textinfo",n.isArrayOrTypedArray(d)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),m||p&&"none"!==p){var g=c("textposition");o(t,e,s,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}else"none"===p&&c("textposition","none");a(e,s,c);var y=c("hole");if(c("title.text")){var v=c("title.position",y?"middle center":"top center");!y&&"middle center"===v&&(e.title.position="top center"),n.coerceFont(c,"title.font",s.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}}),Xc=f((t,e)=>{e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),$c=f((t,e)=>{var r=oe(),n=Xc();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("piecolorway",e.colorway),i("extendpiecolors")}}),Jc=f((t,e)=>{var r=T(),n=O(),i=q(),a={};function o(t){return function(e,r){return!(!e||(e=n(e),!e.isValid()))&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function s(t,e){var r,i=JSON.stringify(t),a=e[i];if(!a){for(a=t.slice(),r=0;r<t.length;r++)a.push(n(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)a.push(n(t[r]).darken(20).toHexString());e[i]=a}return a}e.exports={calc:function(t,e){var n,i,a=[],s=t._fullLayout,l=s.hiddenlabels||[],u=e.labels,c=e.marker.colors||[],h=e.values,f=e._length,p=e._hasValues&&f;if(e.dlabel)for(u=new Array(f),n=0;n<f;n++)u[n]=String(e.label0+n*e.dlabel);var d={},m=o(s["_"+e.type+"colormap"]),g=0,y=!1;for(n=0;n<f;n++){var v,x,_;if(p){if(v=h[n],!r(v))continue;v=+v}else v=1;(void 0===(x=u[n])||""===x)&&(x=n);var b=d[x=String(x)];void 0===b?(d[x]=a.length,(_=-1!==l.indexOf(x))||(g+=v),a.push({v:v,label:x,color:m(c[n],x),i:n,pts:[n],hidden:_})):(y=!0,(i=a[b]).v+=v,i.pts.push(n),i.hidden||(g+=v),!1===i.color&&c[n]&&(i.color=m(c[n],x)))}return a=a.filter(function(t){return t.v>=0}),("funnelarea"===e.type?y:e.sort)&&a.sort(function(t,e){return e.v-t.v}),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var u=0,c=0;c<i.length;c++){var h=i[c];if(h[0].trace.type===r)for(var f=0;f<h.length;f++){var p=h[f];!1===p.color&&(l[p.label]?p.color=l[p.label]:(l[p.label]=p.color=o[u%o.length],u++))}}},makePullColorFn:o,generateExtendedColors:s}}),Kc=f((t,e)=>{var r=Ye().appendArrayMultiPointValues;e.exports=function(t,e){var n={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,bbox:t.bbox,v:t.v};return 1===t.pts.length&&(n.pointNumber=n.i=t.pts[0]),r(n,e,t.pts),"funnelarea"===e.type&&(delete n.v,delete n.i),n}}),Qc=f((t,e)=>{var r=v(),n=we(),i=Pr(),a=q(),o=Je(),s=oe(),l=s.strScale,u=s.strTranslate,c=Ae(),h=$a(),f=h.recordMinTextSize,p=h.clearMinTextSize,d=Va().TEXTPAD,m=xr(),g=Kc(),y=oe().isValidTextValue;function x(t,e,n){var a=n[0],o=a.cx,l=a.cy,u=a.trace,c="funnelarea"===u.type;"_hasHoverLabel"in u||(u._hasHoverLabel=!1),"_hasHoverEvent"in u||(u._hasHoverEvent=!1),t.on("mouseover",function(t){var n=e._fullLayout,h=e._fullData[u.index];if(!e._dragging&&!1!==n.hovermode){var f=h.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[m.castOption(f,t.pts)],_module:u._module},n,0)),"all"===f&&(f="label+text+value+percent+name"),h.hovertemplate||"none"!==f&&"skip"!==f&&f){var p=t.rInscribed||0,d=o+t.pxmid[0]*(1-p),y=l+t.pxmid[1]*(1-p),v=n.separators,x=[];if(f&&-1!==f.indexOf("label")&&x.push(t.label),t.text=m.castOption(h.hovertext||h.text,t.pts),f&&-1!==f.indexOf("text")){var _=t.text;s.isValidTextValue(_)&&x.push(_)}t.value=t.v,t.valueLabel=m.formatPieValue(t.v,v),f&&-1!==f.indexOf("value")&&x.push(t.valueLabel),t.percent=t.v/a.vTotal,t.percentLabel=m.formatPiePercent(t.percent,v),f&&-1!==f.indexOf("percent")&&x.push(t.percentLabel);var b=h.hoverlabel,w=b.font,T=[];i.loneHover({trace:u,x0:d-p*a.r,x1:d+p*a.r,y:y,_x0:c?o+t.TL[0]:d-p*a.r,_x1:c?o+t.TR[0]:d+p*a.r,_y0:c?l+t.TL[1]:y-p*a.r,_y1:c?l+t.BL[1]:y+p*a.r,text:x.join("<br>"),name:h.hovertemplate||-1!==f.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:m.castOption(b.bgcolor,t.pts)||t.color,borderColor:m.castOption(b.bordercolor,t.pts),fontFamily:m.castOption(w.family,t.pts),fontSize:m.castOption(w.size,t.pts),fontColor:m.castOption(w.color,t.pts),nameLength:m.castOption(b.namelength,t.pts),textAlign:m.castOption(b.align,t.pts),hovertemplate:m.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],u._hasHoverLabel=!0}u._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,h)],event:r.event})}}),t.on("mouseout",function(t){var n=e._fullLayout,a=e._fullData[u.index],o=r.select(this).datum();u._hasHoverEvent&&(t.originalEvent=r.event,e.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),u._hasHoverEvent=!1),u._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),u._hasHoverLabel=!1)}),t.on("click",function(t){var n=e._fullLayout,a=e._fullData[u.index];e._dragging||!1===n.hovermode||(e._hoverdata=[g(t,a)],i.click(e,r.event))})}function _(t,e,r){var n=m.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=m.castOption(t._input.textfont.color,e.pts));var i=m.castOption(t.insidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,o=m.castOption(t.insidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,s=m.castOption(t.insidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,l=m.castOption(t.insidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,u=m.castOption(t.insidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,c=m.castOption(t.insidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,h=m.castOption(t.insidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,f=m.castOption(t.insidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n||a.contrast(e.color),family:i,size:o,weight:s,style:l,variant:u,textcase:c,lineposition:h,shadow:f}}function b(t,e){for(var r,n,i=0;i<t.length;i++)if((n=(r=t[i][0]).trace).title.text){var a=n.title.text;n._meta&&(a=s.templateString(a,n._meta));var l=o.tester.append("text").attr("data-notex",1).text(a).call(o.font,n.title.font).call(c.convertToTspans,e),u=o.bBox(l.node(),!0);r.titleBox={width:u.width,height:u.height},l.remove()}}function w(t,e,r){var n=r.r||e.rpx1,i=e.rInscribed;if(e.startangle===e.stopangle)return{rCenter:1-i,scale:0,rotate:0,textPosAngle:0};var a,o=e.ring,s=1===o&&Math.abs(e.startangle-e.stopangle)===2*Math.PI,l=e.halfangle,u=e.midangle,c=r.trace.insidetextorientation,h="horizontal"===c,f="tangential"===c,p="radial"===c,d="auto"===c,m=[];if(!d){var g,y=function(r,i){if(function(t,e){var r=t.startangle,n=t.stopangle;return r>e&&e>n||r<e&&e<n}(e,r)){var s=Math.abs(r-e.startangle),l=Math.abs(r-e.stopangle),u=s<l?s:l;(a="tan"===i?k(t,n,o,u,0):T(t,n,o,u,Math.PI/2)).textPosAngle=r,m.push(a)}};if(h||f){for(g=4;g>=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||p){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||h){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(t,n,o,l,u)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||f)&&((a=k(t,n,o,l,u)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,_=0,b=0;b<m.length;b++){var w=m[b].scale;if(_<w&&(_=w,x=b),!d&&_>=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:A(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:A(a,o/e),rotate:M(i+Math.PI/2)}}function A(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function C(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function I(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=P(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l=function(t,e){return t/(void 0===e?1:e)}(t.r,t.trace.aspectratio),u=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(u+=l,o.x-=(1+i)*l,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?u*=2:-1!==a.title.position.indexOf("right")&&(u+=l,o.x+=(1+i)*l,s.tx-=t.titleBox.width/2),r=u/t.titleBox.width,n=L(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function P(t){var e,r=t.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,e=0;e<t.pull.length;e++)t.pull[e]>r&&(r=t.pull[e]);return r}function z(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n][0],a=i.trace,o=a.domain,s=e.w*(o.x[1]-o.x[0]),l=e.h*(o.y[1]-o.y[0]);a.title.text&&"middle center"!==a.title.position&&(l-=L(i,e));var u=s/2,c=l/2;"funnelarea"===a.type&&!a.scalegroup&&(c/=a.aspectratio),i.r=Math.min(u,c)/(1+P(a)),i.cx=e.l+e.w*(a.domain.x[1]+a.domain.x[0])/2,i.cy=e.t+e.h*(1-a.domain.y[0])-l/2,a.title.text&&-1!==a.title.position.indexOf("bottom")&&(i.cy-=L(i,e)),a.scalegroup&&-1===r.indexOf(a.scalegroup)&&r.push(a.scalegroup)}!function(t,e){for(var r,n,i,a=0;a<e.length;a++){var o=1/0,s=e[a];for(n=0;n<t.length;n++)if((i=(r=t[n][0]).trace).scalegroup===s){var l;if("pie"===i.type)l=r.r*r.r;else if("funnelarea"===i.type){var u,c;i.aspectratio>1?c=(u=r.r)/i.aspectratio:u=(c=r.r)*i.aspectratio,l=(u*=(1+i.baseratio)/2)*c}o=Math.min(o,l/r.vTotal)}for(n=0;n<t.length;n++)if((i=(r=t[n][0]).trace).scalegroup===s){var h=o*r.vTotal;"funnelarea"===i.type&&(h/=(1+i.baseratio)/2,h/=i.aspectratio),r.r=Math.sqrt(h)}}}(t,r)}function O(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function D(t,e,r){var n,i=t._fullLayout,a=r.trace,o=a.texttemplate,l=a.textinfo;if(!o&&l&&"none"!==l){var u,c=l.split("+"),h=function(t){return-1!==c.indexOf(t)},f=h("label"),p=h("text"),d=h("value"),g=h("percent"),v=i.separators;if(u=f?[e.label]:[],p){var x=m.getFirstFilled(a.text,e.pts);y(x)&&u.push(x)}d&&u.push(m.formatPieValue(e.v,v)),g&&u.push(m.formatPiePercent(e.v/r.vTotal,v)),e.text=u.join("<br>")}if(o){var _=s.castOption(a,e.i,"texttemplate");if(_){var b={label:(n=e).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,e.pts);(y(w)||""===w)&&(b.text=w),e.text=s.texttemplateString(_,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var i=t._context.staticPlot,h=t._fullLayout,d=h._size;p("pie",h),b(e,t),z(e,d);var g=s.makeTraceGroups(h._pielayer,e,"trace").each(function(e){var p=r.select(this),g=e[0],y=g.trace;(function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,u="px0",c="px1";if("counterclockwise"===o.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;s+=l*t[e].v,l*=-1,u="px1",c="px0"}for(n=O(a,s),e=0;e<t.length;e++)!(r=t[e]).hidden&&(r[u]=n,r.startangle=s,s+=l*r.v/2,r.pxmid=O(a,s),r.midangle=s,s+=l*r.v/2,n=O(a,s),r.stopangle=s,r[c]=n,r.largeArc=r.v>i.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))})(e),p.attr("stroke-linejoin","round"),p.each(function(){var v=r.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var b=[[[],[]],[[],[]]],T=!1;v.each(function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,b[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,u=g.cy,p=r.select(this),d=p.selectAll("path.surface").data([n]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),p.call(x,t,e),y.pull){var v=+m.castOption(y.pull,n.pts)||0;v>0&&(l+=v*n.pxmid[0],u+=v*n.pxmid[1])}n.cxFinal=l,n.cyFinal=u;var k=y.hole;if(n.v===g.vTotal){var A="M"+(l+n.px0[0])+","+(u+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";k?d.attr("d","M"+(l+k*n.px0[0])+","+(u+k*n.px0[1])+L(n.px0,n.pxmid,!1,k)+L(n.pxmid,n.px0,!1,k)+"Z"+A):d.attr("d",A)}else{var M=L(n.px0,n.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(l+k*n.px1[0])+","+(u+k*n.px1[1])+L(n.px1,n.px0,!1,k)+"l"+S*n.px0[0]+","+S*n.px0[1]+M+"Z")}else d.attr("d","M"+l+","+u+"l"+n.px0[0]+","+n.px0[1]+M+"Z")}D(t,n,g);var E=m.castOption(y.textposition,n.pts),I=p.selectAll("g.slicetext").data(n.text&&"none"!==E?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each(function(){var i=s.ensureSingle(r.select(this),"text","",function(t){t.attr("data-notex",1)}),p=s.ensureUniformFontSize(t,"outside"===E?function(t,e,r){var n=m.castOption(t.outsidetextfont.color,e.pts)||m.castOption(t.textfont.color,e.pts)||r.color,i=m.castOption(t.outsidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,a=m.castOption(t.outsidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,o=m.castOption(t.outsidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,s=m.castOption(t.outsidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,l=m.castOption(t.outsidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,u=m.castOption(t.outsidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,c=m.castOption(t.outsidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,h=m.castOption(t.outsidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n,family:i,size:a,weight:o,style:s,variant:l,textcase:u,lineposition:c,shadow:h}}(y,n,h.font):_(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,p).call(c.convertToTspans,t);var d,v=o.bBox(i.node());if("outside"===E)d=C(v,n);else if(d=w(v,n,g),"auto"===E&&d.scale<1){var x=s.ensureUniformFontSize(t,y.outsidetextfont);i.call(o.font,x),d=C(v=o.bBox(i.node()),n)}var b=d.textPosAngle,k=void 0===b?n.pxmid:O(g.r,b);if(d.targetX=l+k[0]*d.rCenter+(d.x||0),d.targetY=u+k[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var A=d.targetY;n.yLabelMin=A-v.height/2,n.yLabelMid=A,n.yLabelMax=A+v.height/2,n.labelExtraX=0,n.labelExtraY=0,T=!0}d.fontSize=p.size,f(y.type,d,h),e[a].transform=d,s.setTransormAndDisplay(i,d)})}function L(t,e,r,i){var a=i*(e[0]-t[0]),o=i*(e[1]-t[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}});var k=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each(function(){var e,n=s.ensureSingle(r.select(this),"text","",function(t){t.attr("data-notex",1)}),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(c.convertToTspans,t),e="middle center"===y.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(g):I(g,d),n.attr("transform",u(e.x,e.y)+l(Math.min(1,e.scale))+u(e.tx,e.ty))}),T&&function(t,e){var r,n,i,a,o,l,u,c,h,f,p,d,g;function y(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function x(t,r){r||(r={});var i,c,h,p,d=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),x=d-g;if(x*u>0&&(t.labelExtraY=x),s.isArrayOrTypedArray(e.pull))for(c=0;c<f.length;c++)!((h=f[c])===t||(m.castOption(e.pull,t.pts)||0)>=(m.castOption(e.pull,h.pts)||0))&&((t.pxmid[1]-h.pxmid[1])*u>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-t.labelExtraY)*u>0&&(t.labelExtraY+=x):(y+t.labelExtraY-v)*u>0&&(i=3*l*Math.abs(c-f.indexOf(t)),(p=h.cxFinal+a(h.px0[0],h.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=p)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,u=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(c=t[n][r]).sort(i),h=t[1-n][r],f=h.concat(c),d=[],p=0;p<c.length;p++)void 0!==c[p].yLabelMid&&d.push(c[p]);for(g=!1,p=0;n&&p<h.length;p++)if(void 0!==h[p].yLabelMid){g=h[p];break}for(p=0;p<d.length;p++){var _=p&&d[p-1];g&&!p&&(_=g),x(d[p],_)}}}(b,y),function(t,e){t.each(function(t){var n=r.select(this);if(t.labelExtraX||t.labelExtraY){var i=n.select("g.slicetext text");t.transform.targetX+=t.labelExtraX,t.transform.targetY+=t.labelExtraY,s.setTransormAndDisplay(i,t.transform);var o=t.cxFinal+t.pxmid[0],l="M"+o+","+(t.cyFinal+t.pxmid[1]),u=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var c=t.labelExtraX*t.pxmid[1]/t.pxmid[0],h=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(c)>Math.abs(h)?l+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+u):l+="l"+t.labelExtraX+","+c+"v"+(h-c)+"h"+u}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+u;s.ensureSingle(n,"path","textline").call(a.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()})}(v,y),T&&y.automargin){var A=o.bBox(p.node()),M=y.domain,S=d.w*(M.x[1]-M.x[0]),E=d.h*(M.y[1]-M.y[0]),L=(.5*S-g.r)/d.w,P=(.5*E-g.r)/d.h;n.autoMargin(t,"pie."+y.uid+".automargin",{xl:M.x[0]-L,xr:M.x[1]+L,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(g.cx-g.r-A.left,0),r:Math.max(A.right-(g.cx+g.r),0),b:Math.max(A.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-A.top,0),pad:5})}})});setTimeout(function(){g.selectAll("tspan").each(function(){var t=r.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:_,positionTitleOutside:I,prerenderTitles:b,layoutAreas:z,attachFxHandlers:x,computeTransform:R}}),th=f((t,e)=>{var r=v(),n=br(),i=$a().resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each(function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each(function(e){r.select(this).call(n,e,i,t)})})}}),eh=f(t=>{var e=we();t.name="pie",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}),rh=f((t,e)=>{e.exports={attributes:Wc(),supplyDefaults:Yc().supplyDefaults,supplyLayoutDefaults:$c(),layoutAttributes:Xc(),calc:Jc().calc,crossTraceCalc:Jc().crossTraceCalc,plot:Qc().plot,style:th(),styleOne:br(),moduleType:"trace",name:"pie",basePlotModule:eh(),categories:["pie-like","pie","showLegend"],meta:{}}}),nh=f((t,e)=>{e.exports=rh()}),ih=f(t=>{var e=we();t.name="sunburst",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}),ah=f((t,e)=>{e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),oh=f((t,e)=>{var r=j(),n=Ot().hovertemplateAttrs,i=Ot().texttemplateAttrs,a=Ie(),o=wa().attributes,s=Wc(),l=ah(),u=D().extendFlat,c=Pt().pattern;e.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:u({colors:{valType:"data_array",editType:"calc"},line:{color:u({},s.marker.line.color,{dflt:null}),width:u({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:c,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:s.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:u({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:l.eventDataKeys}),textfont:s.textfont,insidetextorientation:s.insidetextorientation,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:s.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:o({name:"sunburst",trace:!0,editType:"calc"})}}),sh=f((t,e)=>{e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),lh=f((t,e)=>{var r=oe(),n=oh(),i=wa().defaults,a=Za().handleText,o=Yc().handleMarkerDefaults,s=Ge(),l=s.hasColorscale,u=s.handleDefaults;e.exports=function(t,e,s,c){function h(i,a){return r.coerce(t,e,n,i,a)}var f=h("labels"),p=h("parents");if(f&&f.length&&p&&p.length){var d=h("values");d&&d.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(t,e,c,h);var m=e._hasColorscale=l(t,"marker","colors")||(t.marker||{}).coloraxis;m&&u(t,e,c,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),a(t,e,c,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(e,c,h),e._length=null}else e.visible=!1}}),uh=f((t,e)=>{var r=oe(),n=sh();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("sunburstcolorway",e.colorway),i("extendsunburstcolors")}}),ch=f((t,e)=>{var r,n;r=t,n=function(t){function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,c=new u(t),h=+t.value&&(c.value=t.value),f=[c];for(null==e&&(e=o);r=f.pop();)if(h&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)f.push(n=r.children[a]=new u(i[a])),n.parent=r,n.depth=r.depth+1;return c.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function u(t){this.data=t,this.depth=this.height=0,this.parent=null}u.prototype=a.prototype={constructor:u,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n<i;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(t){for(var e,r,n,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),e=i.children)for(r=0,n=e.length;r<n;++r)a.push(e[r]);for(;i=o.pop();)t(i);return this},eachBefore:function(t){for(var e,r,n=this,i=[n];n=i.pop();)if(t(n),e=n.children)for(r=e.length-1;r>=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e},copy:function(){return a(this).eachBefore(s)}};var c=Array.prototype.slice;function h(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(c.call(t))).length,a=[];n<i;)e=t[n],r&&d(r,e)?++n:(r=g(a=f(a,e)),n=0);return r}function f(t,e){var r,n;if(m(e,t))return[e];for(r=0;r<t.length;++r)if(p(e,t[r])&&m(y(t[r],e),t))return[t[r],e];for(r=0;r<t.length-1;++r)for(n=r+1;n<t.length;++n)if(p(y(t[r],t[n]),e)&&p(y(t[r],e),t[n])&&p(y(t[n],e),t[r])&&m(v(t[r],t[n],e),t))return[t[r],t[n],e];throw new Error}function p(t,e){var r=t.r-e.r,n=e.x-t.x,i=e.y-t.y;return r<0||r*r<n*n+i*i}function d(t,e){var r=t.r-e.r+1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r<e.length;++r)if(!d(t,e[r]))return!1;return!0}function g(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return y(t[0],t[1]);case 3:return v(t[0],t[1],t[2])}}function y(t,e){var r=t.x,n=t.y,i=t.r,a=e.x,o=e.y,s=e.r,l=a-r,u=o-n,c=s-i,h=Math.sqrt(l*l+u*u);return{x:(r+a+l/h*c)/2,y:(n+o+u/h*c)/2,r:(h+i+s)/2}}function v(t,e,r){var n=t.x,i=t.y,a=t.r,o=e.x,s=e.y,l=e.r,u=r.x,c=r.y,h=r.r,f=n-o,p=n-u,d=i-s,m=i-c,g=l-a,y=h-a,v=n*n+i*i-a*a,x=v-o*o-s*s+l*l,_=v-u*u-c*c+h*h,b=p*d-f*m,w=(d*_-m*x)/(2*b)-n,T=(m*g-d*y)/b,k=(p*x-f*_)/(2*b)-i,A=(f*y-p*g)/b,M=T*T+A*A-1,S=2*(a+w*T+k*A),E=w*w+k*k-a*a,C=-(M?(S+Math.sqrt(S*S-4*M*E))/(2*M):E/S);return{x:n+w+T*C,y:i+k+A*C,r:C}}function x(t,e,r){var n,i,a,o,s=t.x-e.x,l=t.y-e.y,u=s*s+l*l;u?(i=e.r+r.r,i*=i,o=t.r+r.r,i>(o*=o)?(n=(u+o-i)/(2*u),a=Math.sqrt(Math.max(0,o/u-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(u+i-o)/(2*u),a=Math.sqrt(Math.max(0,i/u-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function _(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function b(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,u,c,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;s<i;++s){x(e._,r._,n=t[s]),n=new w(n),l=r.next,u=e.previous,c=r._.r,f=e._.r;do{if(c<=f){if(_(l._,n._)){r=l,e.next=r,r.previous=e,--s;continue t}c+=l._.r,l=l.next}else{if(_(u._,n._)){(e=u).next=r,r.previous=e,--s;continue t}f+=u._.r,u=u.previous}}while(l!==u.next);for(n.previous=e,n.next=r,e.next=r.previous=r=n,a=b(e);(n=n.next)!==r;)(o=b(n))<a&&(e=n,a=o);r=e.next}for(e=[r._],n=r;(n=n.next)!==r;)e.push(n._);for(n=h(e),s=0;s<i;++s)(e=t[s]).x-=n.x,e.y-=n.y;return n.r}function k(t){if("function"!=typeof t)throw new Error;return t}function A(){return 0}function M(t){return function(){return t}}function S(t){return Math.sqrt(t.value)}function E(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function C(t,e){return function(r){if(n=r.children){var n,i,a,o=n.length,s=t(r)*e||0;if(s)for(i=0;i<o;++i)n[i].r+=s;if(a=T(n),s)for(i=0;i<o;++i)n[i].r-=s;r.r=a+s}}}function I(t){return function(e){var r=e.parent;e.r*=t,r&&(e.x=r.x+t*e.x,e.y=r.y+t*e.y)}}function L(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function P(t,e,r,n,i){for(var a,o=t.children,s=-1,l=o.length,u=t.value&&(n-e)/t.value;++s<l;)(a=o[s]).y0=r,a.y1=i,a.x0=e,a.x1=e+=a.value*u}var z={depth:-1},O={};function D(t){return t.id}function R(t){return t.parentId}function F(t,e){return t.parent===e.parent?1:2}function B(t){var e=t.children;return e?e[0]:t.t}function N(t){var e=t.children;return e?e[e.length-1]:t.t}function j(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function U(t,e,r){return t.a.parent===e.parent?t.a:r}function V(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function q(t,e,r,n,i){for(var a,o=t.children,s=-1,l=o.length,u=t.value&&(i-r)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=n,a.y0=r,a.y1=r+=a.value*u}V.prototype=Object.create(u.prototype);var H=(1+Math.sqrt(5))/2;function G(t,e,r,n,i,a){for(var o,s,l,u,c,h,f,p,d,m,g,y=[],v=e.children,x=0,_=0,b=v.length,w=e.value;x<b;){l=i-r,u=a-n;do{c=v[_++].value}while(!c&&_<b);for(h=f=c,g=c*c*(m=Math.max(u/l,l/u)/(w*t)),d=Math.max(f/g,g/h);_<b;++_){if(c+=s=v[_].value,s<h&&(h=s),s>f&&(f=s),g=c*c*m,(p=Math.max(f/g,g/h))>d){c-=s;break}d=p}y.push(o={value:c,dice:l<u,children:v.slice(x,_)}),o.dice?P(o,r,n,i,w?n+=u*c/w:a):q(o,r,n,w?r+=l*c/w:i,a),w-=c,x=_}return y}var Z=function t(e){function r(t,r,n,i,a){G(e,t,r,n,i,a)}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(H),W=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,u,c,h=-1,f=o.length,p=t.value;++h<f;){for(l=(s=o[h]).children,u=s.value=0,c=l.length;u<c;++u)s.value+=l[u].value;s.dice?P(s,r,n,i,n+=(a-n)*s.value/p):q(s,r,n,r+=(i-r)*s.value/p,a),p-=s.value}else t._squarify=o=G(e,t,r,n,i,a),o.ratio=e}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(H);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter(function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)});var u=function(t){for(var e;e=t.children;)t=e[0];return t}(e),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=u.x-t(u,c)/2,f=c.x+t(c,u)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-h)/(f-h)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=A;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(E(t)).eachAfter(C(n,.5)).eachBefore(I(1)):i.eachBefore(E(S)).eachAfter(C(A,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(I(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=function(t){return null==t?null:k(t)}(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:M(+t),i):n},i},t.packEnclose=h,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&P(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),n.x0=i,n.y0=a,n.x1=o,n.y1=s}}(e,a)),n&&i.eachBefore(L),i}return i.round=function(t){return arguments.length?(n=!!t,i):n},i.size=function(r){return arguments.length?(t=+r[0],e=+r[1],i):[t,e]},i.padding=function(t){return arguments.length?(r=+t,i):r},i},t.stratify=function(){var t=D,e=R;function r(r){var n,i,a,o,s,c,h,f=r.length,p=new Array(f),d={};for(i=0;i<f;++i)n=r[i],s=p[i]=new u(n),null!=(c=t(n,i,r))&&(c+="")&&(d[h="$"+(s.id=c)]=h in d?O:s);for(i=0;i<f;++i)if(s=p[i],null!=(c=e(r[i],i,r))&&(c+="")){if(!(o=d["$"+c]))throw new Error("missing: "+c);if(o===O)throw new Error("ambiguous: "+c);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(a)throw new Error("multiple roots");a=s}if(!a)throw new Error("no root");if(a.parent=z,a.eachBefore(function(t){t.depth=t.parent.depth+1,--f}).eachBefore(l),a.parent=null,f>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=k(e),r):t},r.parentId=function(t){return arguments.length?(e=k(t),r):e},r},t.tree=function(){var t=F,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new V(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new V(n[i],i)),r.parent=e;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var u=i,c=i,h=i;i.eachBefore(function(t){t.x<u.x&&(u=t),t.x>c.x&&(c=t),t.depth>h.depth&&(h=t)});var f=u===c?1:t(u,c)/2,p=f-u.x,d=e/(c.x+f+p),m=r/(h.depth||1);i.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*m})}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],u=a.m,c=o.m,h=s.m,f=l.m;s=N(s),a=B(a),s&&a;)l=B(l),(o=N(o)).a=e,(i=s.z+h-a.z-u+t(s._,a._))>0&&(j(U(s,e,n),e,i),u+=i,c+=i),h+=s.m,u+=a.m,f+=l.m,c+=o.m;s&&!N(o)&&(o.t=s,o.m+=h-c),a&&!B(l)&&(l.t=a,l.m+=u-f,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=Z,e=!1,r=1,n=1,i=[0],a=A,o=A,s=A,l=A,u=A;function c(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),i=[0],e&&t.eachBefore(L),t}function h(e){var r=i[e.depth],n=e.x0+r,c=e.y0+r,h=e.x1-r,f=e.y1-r;h<n&&(n=h=(n+h)/2),f<c&&(c=f=(c+f)/2),e.x0=n,e.y0=c,e.x1=h,e.y1=f,e.children&&(r=i[e.depth+1]=a(e)/2,n+=u(e)-r,c+=o(e)-r,(h-=s(e)-r)<n&&(n=h=(n+h)/2),(f-=l(e)-r)<c&&(c=f=(c+f)/2),t(e,n,c,h,f))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(r=+t[0],n=+t[1],c):[r,n]},c.tile=function(e){return arguments.length?(t=k(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:M(+t),c):a},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:M(+t),c):o},c.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:M(+t),c):s},c.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:M(+t),c):l},c.paddingLeft=function(t){return arguments.length?(u="function"==typeof t?t:M(+t),c):u},c},t.treemapBinary=function(t,e,r,n,i){var a,o,s=t.children,l=s.length,u=new Array(l+1);for(u[0]=o=a=0;a<l;++a)u[a+1]=o+=s[a].value;!function t(e,r,n,i,a,o,l){if(e>=r-1){var c=s[e];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var h=u[e],f=n/2+h,p=e+1,d=r-1;p<d;){var m=p+d>>>1;u[m]<f?p=m+1:d=m}f-u[p-1]<u[p]-f&&e+1<p&&--p;var g=u[p]-h,y=n-g;if(o-i>l-a){var v=(i*y+o*g)/n;t(e,p,g,i,a,v,l),t(p,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,y,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=P,t.treemapResquarify=W,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:P)(t,e,r,n,i)},t.treemapSquarify=Z,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}),hh=f(t=>{var e=ch(),r=T(),n=oe(),i=Ge().makeColorScaleFuncFromTrace,a=Jc().makePullColorFn,o=Jc().generateExtendedColors,s=Ge().calc,l=k().ALMOST_EQUAL,u={},c={},h={};function f(t,e,r){var n=0,i=t.children;if(i){for(var a=i.length,o=0;o<a;o++)n+=f(i[o],e,r);r.branches&&n++}else r.leaves&&n++;return t.value=t.data.data.value=n,e._values||(e._values=[]),e._values[t.data.data.i]=n,n}t.calc=function(t,o){var u,c,h,p,d=t._fullLayout,m=o.ids,g=n.isArrayOrTypedArray(m),y=o.labels,v=o.parents,x=o.values,_=n.isArrayOrTypedArray(x),b=[],w={},T={},k=function(t,e){w[t]?w[t].push(e):w[t]=[e],T[e]=1},A=function(t){return t||"number"==typeof t},M=function(t){return!_||r(x[t])&&x[t]>=0};g?(u=Math.min(m.length,v.length),c=function(t){return A(m[t])&&M(t)},h=function(t){return String(m[t])}):(u=Math.min(y.length,v.length),c=function(t){return A(y[t])&&M(t)},h=function(t){return String(y[t])}),_&&(u=Math.min(u,x.length));for(var S=0;S<u;S++)if(c(S)){var E=h(S),C=A(v[S])?String(v[S]):"",I={i:S,id:E,pid:C,label:A(y[S])?String(y[S]):""};_&&(I.v=+x[S]),b.push(I),k(C,E)}if(w[""]){if(w[""].length>1){for(var L=n.randstr(),P=0;P<b.length;P++)""===b[P].pid&&(b[P].pid=L);b.unshift({hasMultipleRoots:!0,id:L,pid:"",label:""})}}else{var z,O=[];for(z in w)T[z]||O.push(z);if(1!==O.length)return n.warn(["Multiple implied roots, cannot build",o.type,"hierarchy of",o.name+".","These roots include:",O.join(", ")].join(" "));z=O[0],b.unshift({hasImpliedRoot:!0,id:z,pid:"",label:z})}try{p=e.stratify().id(function(t){return t.id}).parentId(function(t){return t.pid})(b)}catch(t){return n.warn(["Failed to build",o.type,"hierarchy of",o.name+".","Error:",t.message].join(" "))}var D=e.hierarchy(p),R=!1;if(_)switch(o.branchvalues){case"remainder":D.sum(function(t){return t.data.v});break;case"total":D.each(function(t){var e=t.data.data,r=e.v;if(t.children){var i=t.children.reduce(function(t,e){return t+e.data.data.v},0);if((e.hasImpliedRoot||e.hasMultipleRoots)&&(r=i),r<i*l)return R=!0,n.warn(["Total value for node",t.data.data.id,"of",o.name,"is smaller than the sum of its children.","\nparent value =",r,"\nchildren sum =",i].join(" "))}t.value=r})}else f(D,o,{branches:-1!==o.count.indexOf("branches"),leaves:-1!==o.count.indexOf("leaves")});if(!R){o.sort&&D.sort(function(t,e){return e.value-t.value});var F,B,N=o.marker.colors||[],j=!!N.length;return o._hasColorscale?(j||(N=_?o.values:o._values),s(t,o,{vals:N,containerStr:"marker",cLetter:"c"}),B=i(o.marker)):F=a(d["_"+o.type+"colormap"]),D.each(function(t){var e=t.data.data;e.color=o._hasColorscale?B(N[e.i]):F(N[e.i],e.id)}),b[0].hierarchy=D,b}},t._runCrossTraceCalc=function(t,e){var r=e._fullLayout,n=e.calcdata,i=r[t+"colorway"],a=r["_"+t+"colormap"];r["extend"+t+"colors"]&&(i=o(i,"icicle"===t?h:"treemap"===t?c:u));var s,l=0;function f(t){var e=t.data.data,r=e.id;!1===e.color&&(a[r]?e.color=a[r]:t.parent?t.parent.parent?e.color=t.parent.data.data.color:(a[r]=e.color=i[l%i.length],l++):e.color=s)}for(var p=0;p<n.length;p++){var d=n[p][0];d.trace.type===t&&d.hierarchy&&(s=d.trace.root.color,d.hierarchy.each(f))}},t.crossTraceCalc=function(e){return t._runCrossTraceCalc("sunburst",e)}});function fh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function ph(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}var dh=h(()=>{});function mh(){}function gh(){return this.rgb().formatHex()}function yh(){return this.rgb().formatHex8()}function vh(){return zh(this).formatHsl()}function xh(){return this.rgb().formatRgb()}function _h(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Hh.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?bh(e):3===r?new Ah(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?wh(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?wh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Gh.exec(t))?new Ah(e[1],e[2],e[3],1):(e=Zh.exec(t))?new Ah(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Wh.exec(t))?wh(e[1],e[2],e[3],e[4]):(e=Yh.exec(t))?wh(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Xh.exec(t))?Ph(e[1],e[2]/100,e[3]/100,1):(e=$h.exec(t))?Ph(e[1],e[2]/100,e[3]/100,e[4]):Jh.hasOwnProperty(t)?bh(Jh[t]):"transparent"===t?new Ah(NaN,NaN,NaN,0):null}function bh(t){return new Ah(t>>16&255,t>>8&255,255&t,1)}function wh(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ah(t,e,r,n)}function Th(t){return t instanceof mh||(t=_h(t)),t?new Ah((t=t.rgb()).r,t.g,t.b,t.opacity):new Ah}function kh(t,e,r,n){return 1===arguments.length?Th(t):new Ah(t,e,r,null==n?1:n)}function Ah(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Mh(){return`#${Lh(this.r)}${Lh(this.g)}${Lh(this.b)}`}function Sh(){return`#${Lh(this.r)}${Lh(this.g)}${Lh(this.b)}${Lh(255*(isNaN(this.opacity)?1:this.opacity))}`}function Eh(){let t=Ch(this.opacity);return`${1===t?"rgb(":"rgba("}${Ih(this.r)}, ${Ih(this.g)}, ${Ih(this.b)}${1===t?")":`, ${t})`}`}function Ch(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ih(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Lh(t){return((t=Ih(t))<16?"0":"")+t.toString(16)}function Ph(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Dh(t,e,r,n)}function zh(t){if(t instanceof Dh)return new Dh(t.h,t.s,t.l,t.opacity);if(t instanceof mh||(t=_h(t)),!t)return new Dh;if(t instanceof Dh)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(r-n)/s+6*(r<n):r===a?(n-e)/s+2:(e-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Dh(o,s,l,t.opacity)}function Oh(t,e,r,n){return 1===arguments.length?zh(t):new Dh(t,e,r,null==n?1:n)}function Dh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Rh(t){return(t=(t||0)%360)<0?t+360:t}function Fh(t){return Math.max(0,Math.min(1,t||0))}function Bh(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}var Nh,jh,Uh,Vh,qh,Hh,Gh,Zh,Wh,Yh,Xh,$h,Jh,Kh,Qh,tf=h(()=>{dh(),jh=1/(Nh=.7),Uh="\\s*([+-]?\\d+)\\s*",Vh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Hh=/^#([0-9a-f]{3,8})$/,Gh=new RegExp(`^rgb\\(${Uh},${Uh},${Uh}\\)$`),Zh=new RegExp(`^rgb\\(${qh},${qh},${qh}\\)$`),Wh=new RegExp(`^rgba\\(${Uh},${Uh},${Uh},${Vh}\\)$`),Yh=new RegExp(`^rgba\\(${qh},${qh},${qh},${Vh}\\)$`),Xh=new RegExp(`^hsl\\(${Vh},${qh},${qh}\\)$`),$h=new RegExp(`^hsla\\(${Vh},${qh},${qh},${Vh}\\)$`),Jh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},fh(mh,_h,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:gh,formatHex:gh,formatHex8:yh,formatHsl:vh,formatRgb:xh,toString:xh}),fh(Ah,kh,ph(mh,{brighter(t){return t=null==t?jh:Math.pow(jh,t),new Ah(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Nh:Math.pow(Nh,t),new Ah(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ah(Ih(this.r),Ih(this.g),Ih(this.b),Ch(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mh,formatHex:Mh,formatHex8:Sh,formatRgb:Eh,toString:Eh})),fh(Dh,Oh,ph(mh,{brighter(t){return t=null==t?jh:Math.pow(jh,t),new Dh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Nh:Math.pow(Nh,t),new Dh(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ah(Bh(t>=240?t-240:t+120,i,n),Bh(t,i,n),Bh(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Dh(Rh(this.h),Fh(this.s),Fh(this.l),Ch(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Ch(this.opacity);return`${1===t?"hsl(":"hsla("}${Rh(this.h)}, ${100*Fh(this.s)}%, ${100*Fh(this.l)}%${1===t?")":`, ${t})`}`}}))}),ef=h(()=>{Kh=Math.PI/180,Qh=180/Math.PI});function rf(t){if(t instanceof af)return new af(t.l,t.a,t.b,t.opacity);if(t instanceof hf)return ff(t);t instanceof Ah||(t=Th(t));var e,r,n=uf(t.r),i=uf(t.g),a=uf(t.b),o=of((.2225045*n+.7168786*i+.0606169*a)/df);return n===i&&i===a?e=r=o:(e=of((.4360747*n+.3850649*i+.1430804*a)/pf),r=of((.0139322*n+.0971045*i+.7141733*a)/mf)),new af(116*o-16,500*(e-o),200*(o-r),t.opacity)}function nf(t,e,r,n){return 1===arguments.length?rf(t):new af(t,e,r,null==n?1:n)}function af(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function of(t){return t>xf?Math.pow(t,1/3):t/vf+gf}function sf(t){return t>yf?t*t*t:vf*(t-gf)}function lf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function uf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cf(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof hf)return new hf(t.h,t.c,t.l,t.opacity);if(t instanceof af||(t=rf(t)),0===t.a&&0===t.b)return new hf(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Qh;return new hf(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new hf(t,e,r,null==n?1:n)}function hf(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function ff(t){if(isNaN(t.h))return new af(t.l,0,0,t.opacity);var e=t.h*Kh;return new af(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}var pf,df,mf,gf,yf,vf,xf,_f=h(()=>{dh(),tf(),ef(),pf=.96422,df=1,mf=.82521,gf=4/29,vf=3*(yf=6/29)*yf,xf=yf*yf*yf,fh(af,nf,ph(mh,{brighter(t){return new af(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new af(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new Ah(lf(3.1338561*(e=pf*sf(e))-1.6168667*(t=df*sf(t))-.4906146*(r=mf*sf(r))),lf(-.9787684*e+1.9161415*t+.033454*r),lf(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),fh(hf,cf,ph(mh,{brighter(t){return new hf(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new hf(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ff(this).rgb()}}))});function bf(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof wf)return new wf(t.h,t.s,t.l,t.opacity);t instanceof Ah||(t=Th(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(If*n+Ef*e-Cf*r)/(If+Ef-Cf),a=n-i,o=(Sf*(r-i)-Af*a)/Mf,s=Math.sqrt(o*o+a*a)/(Sf*i*(1-i)),l=s?Math.atan2(o,a)*Qh-120:NaN;return new wf(l<0?l+360:l,s,i,t.opacity)}(t):new wf(t,e,r,null==n?1:n)}function wf(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var Tf,kf,Af,Mf,Sf,Ef,Cf,If,Lf=h(()=>{dh(),tf(),ef(),Ef=(Sf=1.97294)*(Mf=-.90649),Cf=Sf*(kf=1.78277),If=kf*(Af=-.29227)-Mf*(Tf=-.14861),fh(wf,bf,ph(mh,{brighter(t){return t=null==t?jh:Math.pow(jh,t),new wf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Nh:Math.pow(Nh,t),new wf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Kh,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new Ah(255*(e+r*(Tf*n+kf*i)),255*(e+r*(Af*n+Mf*i)),255*(e+r*(Sf*n)),this.opacity)}}))}),Pf=h(()=>{tf(),_f(),Lf()});function zf(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function Of(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,s=n<e-1?t[n+2]:2*a-i;return zf((r-n/e)*e,o,i,a,s)}}var Df=h(()=>{});function Rf(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],o=t[(n+1)%e],s=t[(n+2)%e];return zf((r-n/e)*e,i,a,o,s)}}var Ff,Bf=h(()=>{Df()}),Nf=h(()=>{Ff=t=>()=>t});function jf(t,e){return function(r){return t+r*e}}function Uf(t,e){var r=e-t;return r?jf(t,r>180||r<-180?r-360*Math.round(r/360):r):Ff(isNaN(t)?e:t)}function Vf(t){return 1==(t=+t)?qf:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):Ff(isNaN(e)?r:e)}}function qf(t,e){var r=e-t;return r?jf(t,r):Ff(isNaN(t)?e:t)}var Hf=h(()=>{Nf()});function Gf(t){return function(e){var r,n,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r<i;++r)n=kh(e[r]),a[r]=n.r||0,o[r]=n.g||0,s[r]=n.b||0;return a=t(a),o=t(o),s=t(s),n.opacity=1,function(t){return n.r=a(t),n.g=o(t),n.b=s(t),n+""}}}var Zf,Wf,Yf,Xf=h(()=>{Pf(),Df(),Bf(),Hf(),Zf=function t(e){var r=Vf(e);function n(t,e){var n=r((t=kh(t)).r,(e=kh(e)).r),i=r(t.g,e.g),a=r(t.b,e.b),o=qf(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return n.gamma=t,n}(1),Wf=Gf(Of),Yf=Gf(Rf)});function $f(t,e){e||(e=[]);var r,n=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function Jf(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var Kf=h(()=>{});function Qf(t,e){return(Jf(e)?$f:tp)(t,e)}function tp(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=fp(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}}var ep=h(()=>{pp(),Kf()});function rp(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}var np=h(()=>{});function ip(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var ap=h(()=>{});function op(t,e){var r,n={},i={};for(r in(null===t||"object"!=typeof t)&&(t={}),(null===e||"object"!=typeof e)&&(e={}),e)r in t?n[r]=fp(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}var sp=h(()=>{pp()});function lp(t,e){var r,n,i,a=up.lastIndex=cp.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=up.exec(t))&&(n=cp.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:ip(r,n)})),a=cp.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}var up,cp,hp=h(()=>{ap(),up=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cp=new RegExp(up.source,"g")});function fp(t,e){var r,n=typeof e;return null==e||"boolean"===n?Ff(e):("number"===n?ip:"string"===n?(r=_h(e))?(e=r,Zf):lp:e instanceof _h?Zf:e instanceof Date?rp:Jf(e)?$f:Array.isArray(e)?tp:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?op:ip)(t,e)}var pp=h(()=>{Pf(),Xf(),ep(),np(),ap(),sp(),hp(),Nf(),Kf()});function dp(t){var e=t.length;return function(r){return t[Math.max(0,Math.min(e-1,Math.floor(r*e)))]}}var mp=h(()=>{});function gp(t,e){var r=Uf(+t,+e);return function(t){var e=r(t);return e-360*Math.floor(e/360)}}var yp=h(()=>{Hf()});function vp(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var xp=h(()=>{});function _p(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*bp,skewX:Math.atan(l)*bp,scaleX:o,scaleY:s}}var bp,wp,Tp=h(()=>{bp=180/Math.PI,wp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function kp(t){let e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?wp:_p(e.a,e.b,e.c,e.d,e.e,e.f)}function Ap(t){return null==t?wp:(Mp||(Mp=document.createElementNS("http://www.w3.org/2000/svg","g")),Mp.setAttribute("transform",t),(t=Mp.transform.baseVal.consolidate())?_p((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):wp)}var Mp,Sp=h(()=>{Tp()});function Ep(t,e,r,n){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push("translate(",null,e,null,r);s.push({i:l-4,x:ip(t,i)},{i:l-2,x:ip(n,a)})}else(i||a)&&o.push("translate("+i+e+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:ip(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:ip(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:ip(t,r)},{i:s-2,x:ip(e,n)})}else(1!==r||1!==n)&&a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join("")}}}var Cp,Ip,Lp=h(()=>{ap(),Sp(),Cp=Ep(kp,"px, ","px)","deg)"),Ip=Ep(Ap,", ",")",")")});function Pp(t){return((t=Math.exp(t))+1/t)/2}var zp,Op=h(()=>{zp=function t(e,r,n){function i(t,i){var a,o,s=t[0],l=t[1],u=t[2],c=i[0],h=i[1],f=i[2],p=c-s,d=h-l,m=p*p+d*d;if(m<1e-12)o=Math.log(f/u)/e,a=function(t){return[s+t*p,l+t*d,u*Math.exp(e*t*o)]};else{var g=Math.sqrt(m),y=(f*f-u*u+n*m)/(2*u*r*g),v=(f*f-u*u-n*m)/(2*f*r*g),x=Math.log(Math.sqrt(y*y+1)-y),_=Math.log(Math.sqrt(v*v+1)-v);o=(_-x)/e,a=function(t){var n=t*o,i=Pp(x),a=u/(r*g)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*n+x)-function(t){return((t=Math.exp(t))-1/t)/2}(x));return[s+a*p,l+a*d,u*i/Pp(e*n+x)]}}return a.duration=1e3*o*e/Math.SQRT2,a}return i.rho=function(e){var r=Math.max(.001,+e),n=r*r;return t(r,n,n*n)},i}(Math.SQRT2,2,4)});function Dp(t){return function(e,r){var n=t((e=Oh(e)).h,(r=Oh(r)).h),i=qf(e.s,r.s),a=qf(e.l,r.l),o=qf(e.opacity,r.opacity);return function(t){return e.h=n(t),e.s=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var Rp,Fp,Bp=h(()=>{Pf(),Hf(),Rp=Dp(Uf),Fp=Dp(qf)});function Np(t,e){var r=qf((t=nf(t)).l,(e=nf(e)).l),n=qf(t.a,e.a),i=qf(t.b,e.b),a=qf(t.opacity,e.opacity);return function(e){return t.l=r(e),t.a=n(e),t.b=i(e),t.opacity=a(e),t+""}}var jp=h(()=>{Pf(),Hf()});function Up(t){return function(e,r){var n=t((e=cf(e)).h,(r=cf(r)).h),i=qf(e.c,r.c),a=qf(e.l,r.l),o=qf(e.opacity,r.opacity);return function(t){return e.h=n(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var Vp,qp,Hp=h(()=>{Pf(),Hf(),Vp=Up(Uf),qp=Up(qf)});function Gp(t){return function e(r){function n(e,n){var i=t((e=bf(e)).h,(n=bf(n)).h),a=qf(e.s,n.s),o=qf(e.l,n.l),s=qf(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,r)),e.opacity=s(t),e+""}}return r=+r,n.gamma=e,n}(1)}var Zp,Wp,Yp=h(()=>{Pf(),Hf(),Zp=Gp(Uf),Wp=Gp(qf)});function Xp(t,e){void 0===e&&(e=t,t=fp);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return function(t){var e=Math.max(0,Math.min(n-1,Math.floor(t*=n)));return a[e](t-e)}}var $p=h(()=>{pp()});function Jp(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r}var Kp=h(()=>{}),Qp={};p(Qp,{interpolate:()=>fp,interpolateArray:()=>Qf,interpolateBasis:()=>Of,interpolateBasisClosed:()=>Rf,interpolateCubehelix:()=>Zp,interpolateCubehelixLong:()=>Wp,interpolateDate:()=>rp,interpolateDiscrete:()=>dp,interpolateHcl:()=>Vp,interpolateHclLong:()=>qp,interpolateHsl:()=>Rp,interpolateHslLong:()=>Fp,interpolateHue:()=>gp,interpolateLab:()=>Np,interpolateNumber:()=>ip,interpolateNumberArray:()=>$f,interpolateObject:()=>op,interpolateRgb:()=>Zf,interpolateRgbBasis:()=>Wf,interpolateRgbBasisClosed:()=>Yf,interpolateRound:()=>vp,interpolateString:()=>lp,interpolateTransformCss:()=>Cp,interpolateTransformSvg:()=>Ip,interpolateZoom:()=>zp,piecewise:()=>Xp,quantize:()=>Jp});var td=h(()=>{pp(),ep(),Df(),Bf(),np(),mp(),yp(),ap(),Kf(),sp(),xp(),hp(),Lp(),Op(),Xf(),Bp(),jp(),Hp(),Yp(),$p(),Kp()}),ed=f((t,e)=>{var r=Je(),n=q();e.exports=function(t,e,i,a,o){var s=e.data.data,l=s.i,u=o||s.color;if(l>=0){e.i=s.i;var c=i.marker;c.pattern?(!c.colors||!c.pattern.shape)&&(c.color=u,e.color=u):(c.color=u,e.color=u),r.pointStyle(t,i,a,e)}else n.fill(t,u)}}),rd=f((t,e)=>{var r=v(),n=q(),i=oe(),a=$a().resizeText,o=ed();function s(t,e,r,a){var s=e.data.data,l=!e.children,u=s.i,c=i.castOption(r,u,"marker.line.color")||n.defaultLine,h=i.castOption(r,u,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");a(t,e,"sunburst"),e.each(function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each(function(e){r.select(this).call(s,e,i,t)})})},styleOne:s}}),nd=f(t=>{var e=oe(),r=q(),n=hr(),i=xr();function a(t){return t.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter(function(e){if(t.getPtId(e)===r)return n=e.copy()}),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter(function(e){for(var i=e.children||[],a=0;a<i.length;a++){var o=i[a];if(t.getPtId(o)===r)return n=e.copy()}}),n||e},t.isEntry=function(t){return!t.parent},t.isLeaf=function(t){return!t.children},t.getPtId=function(t){return t.data.data.id},t.getPtLabel=function(t){return t.data.data.label},t.getValue=function(t){return t.value},t.isHierarchyRoot=function(t){return""===a(t)},t.setSliceCursor=function(e,r,i){var a=i.isTransitioning;if(!a){var o=e.datum();a=i.hideOnRoot&&t.isHierarchyRoot(o)||i.hideOnLeaves&&t.isLeaf(o)}n(e,a?null:"pointer")},t.getInsideTextFontKey=function(t,r,n,i,a){var o=(a||{}).onPathbar?"pathbar.textfont":"insidetextfont",s=n.data.data.i;return e.castOption(r,s,o+"."+t)||e.castOption(r,s,"textfont."+t)||i.size},t.getOutsideTextFontKey=function(t,r,n,i){var a=n.data.data.i;return e.castOption(r,a,"outsidetextfont."+t)||e.castOption(r,a,"textfont."+t)||i.size},t.isOutsideText=function(e,r){return!e._hasColorscale&&t.isHierarchyRoot(r)},t.determineTextFont=function(n,i,a,o){return t.isOutsideText(n,i)?function(e,r,n){return{color:t.getOutsideTextFontKey("color",e,r,n),family:t.getOutsideTextFontKey("family",e,r,n),size:t.getOutsideTextFontKey("size",e,r,n),weight:t.getOutsideTextFontKey("weight",e,r,n),style:t.getOutsideTextFontKey("style",e,r,n),variant:t.getOutsideTextFontKey("variant",e,r,n),textcase:t.getOutsideTextFontKey("textcase",e,r,n),lineposition:t.getOutsideTextFontKey("lineposition",e,r,n),shadow:t.getOutsideTextFontKey("shadow",e,r,n)}}(n,i,a):function(n,i,a,o){var s=(o||{}).onPathbar,l=i.data.data,u=l.i,c=e.castOption(n,u,(s?"pathbar.textfont":"insidetextfont")+".color");return!c&&n._input.textfont&&(c=e.castOption(n._input,u,"textfont.color")),{color:c||r.contrast(l.color),family:t.getInsideTextFontKey("family",n,i,a,o),size:t.getInsideTextFontKey("size",n,i,a,o),weight:t.getInsideTextFontKey("weight",n,i,a,o),style:t.getInsideTextFontKey("style",n,i,a,o),variant:t.getInsideTextFontKey("variant",n,i,a,o),textcase:t.getInsideTextFontKey("textcase",n,i,a,o),lineposition:t.getInsideTextFontKey("lineposition",n,i,a,o),shadow:t.getInsideTextFontKey("shadow",n,i,a,o)}}(n,i,a,o)},t.hasTransition=function(t){return!!(t&&t.duration>0)},t.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,a(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=i.formatPieValue,t.formatPercent=function(t,r){var n=e.formatPercent(t,0);return"0%"===n&&(n=i.formatPiePercent(t,r)),n}}),id=f((t,e)=>{var r=v(),n=Ut(),i=Ye().appendArrayPointValue,a=Pr(),o=oe(),s=he(),l=nd(),u=xr().formatPieValue;function c(t,e,r){for(var n=t.data.data,a={curveNumber:e.index,pointNumber:n.i,data:e._input,fullData:e},o=0;o<r.length;o++){var s=r[o];s in t&&(a[s]=t[s])}return"parentString"in t&&!l.isHierarchyRoot(t)&&(a.parent=t.parentString),i(a,e,n.i),a}e.exports=function(t,e,i,h,f){var p=h[0],d=p.trace,m=p.hierarchy,g="sunburst"===d.type,y="treemap"===d.type||"icicle"===d.type;"_hasHoverLabel"in d||(d._hasHoverLabel=!1),"_hasHoverEvent"in d||(d._hasHoverEvent=!1),t.on("mouseover",function(n){var s=i._fullLayout;if(!i._dragging&&!1!==s.hovermode){var h,v=i._fullData[d.index],x=n.data.data,_=x.i,b=l.isHierarchyRoot(n),w=l.getParent(m,n),T=l.getValue(n),k=function(t){return o.castOption(v,_,t)},A=k("hovertemplate"),M=a.castHoverinfo(v,s,_),S=s.separators;if(A||M&&"none"!==M&&"skip"!==M){var E,C;g&&(E=p.cx+n.pxmid[0]*(1-n.rInscribed),C=p.cy+n.pxmid[1]*(1-n.rInscribed)),y&&(E=n._hoverX,C=n._hoverY);var I={},L=[],P=[],z=function(t){return-1!==L.indexOf(t)};M&&(L="all"===M?v._module.attributes.hoverinfo.flags:M.split("+")),I.label=x.label,z("label")&&I.label&&P.push(I.label),x.hasOwnProperty("v")&&(I.value=x.v,I.valueLabel=u(I.value,S),z("value")&&P.push(I.valueLabel)),I.currentPath=n.currentPath=l.getPath(n.data),z("current path")&&!b&&P.push(I.currentPath);var O,D=[],R=function(){-1===D.indexOf(O)&&(P.push(O),D.push(O))};I.percentParent=n.percentParent=T/l.getValue(w),I.parent=n.parentString=l.getPtLabel(w),z("percent parent")&&(O=l.formatPercent(I.percentParent,S)+" of "+I.parent,R()),I.percentEntry=n.percentEntry=T/l.getValue(e),I.entry=n.entry=l.getPtLabel(e),z("percent entry")&&!b&&!n.onPathbar&&(O=l.formatPercent(I.percentEntry,S)+" of "+I.entry,R()),I.percentRoot=n.percentRoot=T/l.getValue(m),I.root=n.root=l.getPtLabel(m),z("percent root")&&!b&&(O=l.formatPercent(I.percentRoot,S)+" of "+I.root,R()),I.text=k("hovertext")||k("text"),z("text")&&(O=I.text,o.isValidTextValue(O)&&P.push(O)),h=[c(n,v,f.eventDataKeys)];var F={trace:v,y:C,_x0:n._x0,_x1:n._x1,_y0:n._y0,_y1:n._y1,text:P.join("<br>"),name:A||z("name")?v.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),fontWeight:k("hoverlabel.font.weight"),fontStyle:k("hoverlabel.font.style"),fontVariant:k("hoverlabel.font.variant"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:A,hovertemplateLabels:I,eventData:h};g&&(F.x0=E-n.rInscribed*n.rpx1,F.x1=E+n.rInscribed*n.rpx1,F.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];a.loneHover(F,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:B}),h[0].bbox=B[0],d._hasHoverLabel=!0}if(y){var N=t.select("path.surface");f.styleOne(N,n,v,i,{hovered:!0})}d._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[c(n,v,f.eventDataKeys)],event:r.event})}}),t.on("mouseout",function(e){var n=i._fullLayout,o=i._fullData[d.index],s=r.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=r.event,i.emit("plotly_unhover",{points:[c(s,o,f.eventDataKeys)],event:r.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=t.select("path.surface");f.styleOne(l,s,o,i,{hovered:!1})}}),t.on("click",function(t){var e=i._fullLayout,o=i._fullData[d.index],u=g&&(l.isHierarchyRoot(t)||l.isLeaf(t)),h=l.getPtId(t),p=l.isEntry(t)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(p),v={points:[c(t,o,f.eventDataKeys)],event:r.event};u||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+d.type+"click",v);if(!1!==x&&e.hovermode&&(i._hoverdata=[c(t,o,f.eventDataKeys)],a.click(i,r.event)),!u&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,e._tracePreGUI[o.uid],{level:o.level});var _={data:[{level:y}],traces:[d.index]},b={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(e._hoverlayer.node()),n.call("animate",i,_,b)}})}}),ad=f(t=>{var e=v(),r=ch(),n=(td(),m(Qp)).interpolate,i=Je(),a=oe(),o=Ae(),s=$a(),l=s.recordMinTextSize,u=s.clearMinTextSize,c=Qc(),h=xr().getRotationAngle,f=c.computeTransform,p=c.transformInsideText,d=rd().styleOne,g=Ka().resizeText,y=id(),x=ah(),_=nd();function b(s,u,c,m){var g=s._context.staticPlot,v=s._fullLayout,b=!v.uniformtext.mode&&_.hasTransition(m),T=e.select(c).selectAll("g.slice"),k=u[0],A=k.trace,M=k.hierarchy,S=_.findEntryWithLevel(M,A.level),E=_.getMaxDepth(A),C=v._size,I=A.domain,L=C.w*(I.x[1]-I.x[0]),P=C.h*(I.y[1]-I.y[0]),z=.5*Math.min(L,P),O=k.cx=C.l+C.w*(I.x[1]+I.x[0])/2,D=k.cy=C.t+C.h*(1-I.y[0])-P/2;if(!S)return T.remove();var R=null,F={};b&&T.each(function(t){F[_.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&_.isEntry(t)&&(R=t)});var B=function(t){return r.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),N=S.height+1,j=0,U=E;k.hasMultipleRoots&&_.isHierarchyRoot(S)&&(B=B.slice(1),N-=1,j=1,U+=1),B=B.filter(function(t){return t.y1<=U});var V=h(A.rotation);V&&B.forEach(function(t){t.x0+=V,t.x1+=V});var q=Math.min(N,E),H=function(t){return(t-j)/q*z},G=function(t){return a.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,O,D)},Z=function(t){return O+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},W=function(t){return D+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(T=T.data(B,_.getPtId)).enter().append("g").classed("slice",!0),b?T.exit().transition().each(function(){var t=e.select(this);t.select("path.surface").transition().attrTween("d",function(t){var e=function(t){var e,r=_.getPtId(t),i=F[r],a=F[_.getPtId(S)];if(a){var o=(t.x1>a.x1?2*Math.PI:0)+V;e=t.rpx1<a.rpx1?{x0:t.x0,x1:t.x1,rpx0:0,rpx1:0}:{x0:o,x1:o,rpx0:t.rpx0,rpx1:t.rpx1}}else{var s,l=_.getPtId(t.parent);T.each(function(t){if(_.getPtId(t)===l)return s=t});var u,c=s.children;c.forEach(function(t,e){if(_.getPtId(t)===r)return u=e});var h=c.length,f=n(s.x0,s.x1);e={rpx0:z,rpx1:z,x0:f(u/h),x1:f((u+1)/h)}}return n(i,e)}(t);return function(t){return G(e(t))}}),t.select("g.slicetext").attr("opacity",0)}).remove():T.exit().remove(),T.order();var Y=null;if(b&&R){var X=_.getPtId(R);T.each(function(t){null===Y&&_.getPtId(t)===X&&(Y=t.x1)})}var $=T;function J(t){var e=t.parent,r=F[_.getPtId(e)],i={};if(r){var a=e.children,o=a.indexOf(t),s=a.length,l=n(r.x0,r.x1);i.x0=l(o/s),i.x1=l(o/s)}else i.x0=i.x1=0;return i}b&&($=$.transition().each("end",function(){var t=e.select(this);_.setSliceCursor(t,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),$.each(function(r){var c=e.select(this),h=a.ensureSingle(c,"path","surface",function(t){t.style("pointer-events",g?"none":"all")});r.rpx0=H(r.y0),r.rpx1=H(r.y1),r.xmid=(r.x0+r.x1)/2,r.pxmid=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]}(r.rpx1,r.xmid),r.midangle=-(r.xmid-Math.PI/2),r.startangle=-(r.x0-Math.PI/2),r.stopangle=-(r.x1-Math.PI/2),r.halfangle=.5*Math.min(a.angleDelta(r.x0,r.x1)||Math.PI,Math.PI),r.ring=1-r.rpx0/r.rpx1,r.rInscribed=function(t){return 0===t.rpx0&&a.isFullCircle([t.x0,t.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2))}(r),b?h.transition().attrTween("d",function(t){var e=function(t){var e,r=F[_.getPtId(t)],i={x0:t.x0,x1:t.x1,rpx0:t.rpx0,rpx1:t.rpx1};if(r)e=r;else if(R)if(t.parent)if(Y){var o=(t.x1>Y?2*Math.PI:0)+V;e={x0:o,x1:o}}else e={rpx0:z,rpx1:z},a.extendFlat(e,J(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return n(e,i)}(t);return function(t){return G(e(t))}}):h.attr("d",G),c.call(y,S,s,u,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(_.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(d,r,A,s);var m=a.ensureSingle(c,"g","slicetext"),w=a.ensureSingle(m,"text","",function(t){t.attr("data-notex",1)}),T=a.ensureUniformFontSize(s,_.determineTextFont(A,r,v.font));w.text(t.formatSliceLabel(r,S,A,u,v)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,T).call(o.convertToTspans,s);var M=i.bBox(w.node());r.transform=p(M,r,k),r.transform.targetX=Z(r),r.transform.targetY=W(r);var E=function(t,e){var r=t.transform;return f(r,e),r.fontSize=T.size,l(A.type,r,v),a.getTextTransform(r)};b?w.transition().attrTween("transform",function(t){var e=function(t){var e,r=F[_.getPtId(t)],i=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},R)if(t.parent)if(Y){var o=t.x1>Y?2*Math.PI:0;e.x0=e.x1=o}else a.extendFlat(e,J(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var s=n(e.transform.textPosAngle,t.transform.textPosAngle),u=n(e.rpx1,t.rpx1),c=n(e.x0,t.x0),h=n(e.x1,t.x1),f=n(e.transform.scale,i.scale),p=n(e.transform.rotate,i.rotate),d=0===i.rCenter?3:0===e.transform.rCenter?1/3:1,m=n(e.transform.rCenter,i.rCenter),g=function(t){return m(Math.pow(t,d))};return function(t){var e=u(t);c(t),h(t);var r=g(t),n={rpx1:e,transform:{textPosAngle:s(t),rCenter:r,x:i.x,y:i.y}};return l(A.type,i,v),{transform:{targetX:Z(n),targetY:W(n),scale:f(t),rotate:p(t),rCenter:r}}}}(t);return function(t){return E(e(t),M)}}):w.attr("transform",E(r,M))})}function w(t){return function(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}(t.rpx1,t.transform.textPosAngle)}t.plot=function(t,r,n,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!n,h=!s.uniformtext.mode&&_.hasTransition(n);u("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,function(t){return t[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),e.transition().duration(n.duration).ease(n.easing).each("end",function(){o&&o()}).each("interrupt",function(){o&&o()}).each(function(){l.selectAll("g.trace").each(function(e){b(t,e,this,n)})})):(a.each(function(e){b(t,e,this,n)}),s.uniformtext.mode&&g(t,s._sunburstlayer.selectAll(".trace"),"sunburst")),c&&a.exit().remove()},t.formatSliceLabel=function(t,e,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!(o||s&&"none"!==s))return"";var l=i.separators,u=n[0],c=t.data.data,h=u.hierarchy,f=_.isHierarchyRoot(t),p=_.getParent(h,t),d=_.getValue(t);if(!o){var m,g=s.split("+"),y=function(t){return-1!==g.indexOf(t)},v=[];if(y("label")&&c.label&&v.push(c.label),c.hasOwnProperty("v")&&y("value")&&v.push(_.formatValue(c.v,l)),!f){y("current path")&&v.push(_.getPath(t.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var b=x>1;if(x){var w,T=function(t){m=_.formatPercent(w,l),b&&(m+=" of "+t),v.push(m)};y("percent parent")&&!f&&(w=d/_.getValue(p),T("parent")),y("percent entry")&&(w=d/_.getValue(e),T("entry")),y("percent root")&&(w=d/_.getValue(h),T("root"))}}return y("text")&&(m=a.castOption(r,c.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("<br>")}var k=a.castOption(r,c.i,"texttemplate");if(!k)return"";var A={};c.label&&(A.label=c.label),c.hasOwnProperty("v")&&(A.value=c.v,A.valueLabel=_.formatValue(c.v,l)),A.currentPath=_.getPath(t.data),f||(A.percentParent=d/_.getValue(p),A.percentParentLabel=_.formatPercent(A.percentParent,l),A.parent=_.getPtLabel(p)),A.percentEntry=d/_.getValue(e),A.percentEntryLabel=_.formatPercent(A.percentEntry,l),A.entry=_.getPtLabel(e),A.percentRoot=d/_.getValue(h),A.percentRootLabel=_.formatPercent(A.percentRoot,l),A.root=_.getPtLabel(h),c.hasOwnProperty("color")&&(A.color=c.color);var M=a.castOption(r,c.i,"text");return(a.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=a.castOption(r,c.i,"customdata"),a.texttemplateString(k,A,i._d3locale,A,r._meta||{})}}),od=f((t,e)=>{e.exports={moduleType:"trace",name:"sunburst",basePlotModule:ih(),categories:[],animatable:!0,attributes:oh(),layoutAttributes:sh(),supplyDefaults:lh(),supplyLayoutDefaults:uh(),calc:hh().calc,crossTraceCalc:hh().crossTraceCalc,plot:ad().plot,style:rd().style,colorbar:hi(),meta:{}}}),sd=f((t,e)=>{e.exports=od()}),ld=f(t=>{var e=we();t.name="treemap",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}),ud=f((t,e)=>{e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),cd=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Ie(),a=wa().attributes,o=Wc(),s=oh(),l=ud(),u=D().extendFlat,c=Pt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:u({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:s.marker.colors,pattern:c,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:s.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},o.textfont,{}),editType:"calc"},text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:u({},o.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:o.sort,root:s.root,domain:a({name:"treemap",trace:!0,editType:"calc"})}}),hd=f((t,e)=>{e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),fd=f((t,e)=>{var r=oe(),n=cd(),i=q(),a=wa().defaults,o=Za().handleText,s=Va().TEXTPAD,l=Yc().handleMarkerDefaults,u=Ge(),c=u.hasColorscale,h=u.handleDefaults;e.exports=function(t,e,u,f){function p(i,a){return r.coerce(t,e,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,f,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var x=-1!==e.textposition.indexOf("bottom");l(t,e,f,p),(e._hasColorscale=c(t,"marker","colors")||(t.marker||{}).coloraxis)?h(t,e,f,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(e.marker.colors||[]).length);var _=2*e.textfont.size;p("marker.pad.t",x?_/4:_),p("marker.pad.l",_/4),p("marker.pad.r",_/4),p("marker.pad.b",x?_:_/4),p("marker.cornerradius"),e._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,f,p),e._length=null}else e.visible=!1}}),pd=f((t,e)=>{var r=oe(),n=hd();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("treemapcolorway",e.colorway),i("extendtreemapcolors")}}),dd=f(t=>{var e=hh();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("treemap",t)}}),md=f((t,e)=>{e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o<a.length;o++)t(a[o],r,n)}}),gd=f((t,e)=>{var r=ch(),n=md();e.exports=function(t,e,i){var a,o=i.flipX,s=i.flipY,l="dice-slice"===i.packing,u=i.pad[s?"bottom":"top"],c=i.pad[o?"right":"left"],h=i.pad[o?"left":"right"],f=i.pad[s?"top":"bottom"];l&&(a=c,c=u,u=a,a=h,h=f,f=a);var p=r.treemap().tile(function(t,e){switch(t){case"squarify":return r.treemapSquarify.ratio(e);case"binary":return r.treemapBinary;case"dice":return r.treemapDice;case"slice":return r.treemapSlice;default:return r.treemapSliceDice}}(i.packing,i.squarifyratio)).paddingInner(i.pad.inner).paddingLeft(c).paddingRight(h).paddingTop(u).paddingBottom(f).size(l?[e[1],e[0]]:e)(t);return(l||o||s)&&n(p,e,{swapXY:l,flipX:o,flipY:s}),p}}),yd=f((t,e)=>{var r=v(),n=q(),i=oe(),a=nd(),o=$a().resizeText,s=ed();function l(t,e,r,o,l){var u,c,h=(l||{}).hovered,f=e.data.data,p=f.i,d=f.color,m=a.isHierarchyRoot(e),g=1;if(h)u=r._hovered.marker.line.color,c=r._hovered.marker.line.width;else if(m&&d===r.root.color)g=100,u="rgba(0,0,0,0)",c=0;else if(u=i.castOption(r,p,"marker.line.color")||n.defaultLine,c=i.castOption(r,p,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var y=r.marker.depthfade;if(y){var v,x=n.combine(n.addOpacity(r._backgroundColor,.75),d);if(!0===y){var _=a.getMaxDepth(r);v=isFinite(_)?a.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else v=e.data.depth-r._entryDepth,r._atRootLevel||v++;if(v>0)for(var b=0;b<v;b++){var w=.5*b/v;d=n.combine(n.addOpacity(x,w),d)}}}t.call(s,e,r,o,d).style("stroke-width",c).call(n.stroke,u).style("opacity",g)}e.exports={style:function(t){var e=t._fullLayout._treemaplayer.selectAll(".trace");o(t,e,"treemap"),e.each(function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each(function(e){r.select(this).call(l,e,i,t,{hovered:!1})})})},styleOne:l}}),vd=f((t,e)=>{var r=v(),n=oe(),i=Je(),a=Ae(),o=gd(),s=yd().styleOne,l=ud(),u=nd(),c=id(),h=!0;e.exports=function(t,e,f,p,d){var m=d.barDifY,g=d.width,y=d.height,v=d.viewX,x=d.viewY,_=d.pathSlice,b=d.toMoveInsideSlice,w=d.strTransform,T=d.hasTransition,k=d.handleSlicesExit,A=d.makeUpdateSliceInterpolator,M=d.makeUpdateTextInterpolator,S={},E=t._context.staticPlot,C=t._fullLayout,I=e[0],L=I.trace,P=I.hierarchy,z=g/L._entryDepth,O=u.listPath(f.data,"id"),D=o(P.copy(),[g,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(D=D.filter(function(t){var e=O.indexOf(t.data.id);return-1!==e&&(t.x0=z*e,t.x1=z*(e+1),t.y0=m,t.y1=m+y,t.onPathbar=!0,!0)})).reverse(),(p=p.data(D,u.getPtId)).enter().append("g").classed("pathbar",!0),k(p,h,S,[g,y],_),p.order();var R=p;T&&(R=R.transition().each("end",function(){var e=r.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),R.each(function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-Math.min(g,y)/2),o._hoverY=x(o.y1-y/2);var p=r.select(this),d=n.ensureSingle(p,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?d.transition().attrTween("d",function(t){var e=A(t,h,S,[g,y]);return function(t){return _(e(t))}}):d.attr("d",_),p.call(c,f,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),d.call(s,o,L,t,{hovered:!1}),o._text=(u.getPtLabel(o)||"").split("<br>").join(" ")||"";var m=n.ensureSingle(p,"g","slicetext"),k=n.ensureSingle(m,"text","",function(t){t.attr("data-notex",1)}),I=n.ensureUniformFontSize(t,u.determineTextFont(L,o,C.font,{onPathbar:!0}));k.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,I).call(a.convertToTspans,t),o.textBB=i.bBox(k.node()),o.transform=b(o,{fontSize:I.size,onPathbar:!0}),o.transform.fontSize=I.size,T?k.transition().attrTween("transform",function(t){var e=M(t,h,S,[g,y]);return function(t){return w(e(t))}}):k.attr("transform",w(o))})}}),xd=f((t,e)=>{var r=v(),n=(td(),m(Qp)).interpolate,i=nd(),a=oe(),o=Va().TEXTPAD,s=Qa().toMoveInsideBar,l=$a().recordMinTextSize,u=ud(),c=vd();function h(t){return i.isHierarchyRoot(t)?"":i.getPtId(t)}e.exports=function(t,e,f,p,d){var m=t._fullLayout,g=e[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,_=i.findEntryWithLevel(x,y.level),b=r.select(f),w=b.selectAll("g.pathbar"),T=b.selectAll("g.slice");if(!_)return w.remove(),void T.remove();var k=i.isHierarchyRoot(_),A=!m.uniformtext.mode&&i.hasTransition(p),M=i.getMaxDepth(y),S=m._size,E=y.domain,C=S.w*(E.x[1]-E.x[0]),I=S.h*(E.y[1]-E.y[0]),L=C,P=y.pathbar.thickness,z=y.marker.line.width+u.gapWithPathbar,O=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?I+z:-(P+z):0,D={x0:L,x1:L,y0:O,y1:O+P},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,U=function(t,e){return e?B[h(t)]:N[h(t)]},V=function(t,e,r,n){if(e)return B[h(x)]||D;var i=N[y.level]||r;return function(t){return t.data.depth-_.data.depth<M}(t)?R(t,i,n):{}};g.hasMultipleRoots&&k&&M++,y._maxDepth=M,y._backgroundColor=m.paper_bgcolor,y._entryDepth=_.data.depth,y._atRootLevel=k;var q=-C/2+S.l+S.w*(E.x[1]+E.x[0])/2,H=-I/2+S.t+S.h*(1-(E.y[1]+E.y[0])/2),G=function(t){return q+t},Z=function(t){return H+t},W=Z(0),Y=G(0),X=function(t){return Y+t},$=function(t){return W+t};function J(t,e){return t+","+e}var K=X(0),Q=function(t){t.x=Math.max(K,t.x)},tt=y.pathbar.edgeshape,et=y[v?"tiling":"marker"].pad,rt=function(t){return-1!==y.textposition.indexOf(t)},nt=rt("top"),it=rt("left"),at=rt("right"),ot=rt("bottom"),st=function(t,e){var r=t.x0,n=t.x1,i=t.y0,a=t.y1,u=t.textBB,c=nt||e.isHeader&&!ot?"start":ot?"end":"middle",h=rt("right"),f=rt("left")||e.onPathbar?-1:h?1:0;if(e.isHeader){if((r+=(v?et:et.l)-o)>=(n-=(v?et:et.r)-o)){var p=(r+n)/2;r=p,n=p}var d;ot?i<(d=a-(v?et:et.b))&&d<a&&(i=d):i<(d=i+(v?et:et.t))&&d<a&&(a=d)}var g=s(r,n,i,a,u,{isHorizontal:!1,constrained:!0,angle:0,anchor:c,leftToRight:f});return g.fontSize=e.fontSize,g.targetX=G(g.targetX),g.targetY=Z(g.targetY),isNaN(g.targetX)||isNaN(g.targetY)?{}:(r!==n&&i!==a&&l(y.type,g,m),{scale:g.scale,rotate:g.rotate,textX:g.textX,textY:g.textY,anchorX:g.anchorX,anchorY:g.anchorY,targetX:g.targetX,targetY:g.targetY})},lt=function(t,e){for(var r,n=0,i=t;!r&&n<M;)n++,(i=i.parent)?r=U(i,e):n=M;return r||{}},ut=function(t,e,r,i,o){var s,l=U(t,e);if(l)s=l;else if(e)s=D;else if(F)if(t.parent){var u=j||r;u&&!e?s=R(t,u,i):(s={},a.extendFlat(s,lt(t,e)))}else s=a.extendFlat({},t),v&&("h"===o.orientation?o.flipX?s.x0=t.x1:s.x1=0:o.flipY?s.y0=t.y1:s.y1=0);else s={};return n(s,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})},ct=function(t,e,r,o){var s=U(t,e),u={},c=V(t,e,r,o);a.extendFlat(u,{transform:st({x0:c.x0,x1:c.x1,y0:c.y0,y1:c.y1,textBB:t.textBB,_text:t._text},{isHeader:i.isHeader(t,y)})}),s?u=s:t.parent&&a.extendFlat(u,lt(t,e));var h=t.transform;return t.x0!==t.x1&&t.y0!==t.y1&&l(y.type,h,m),n(u,{transform:{scale:h.scale,rotate:h.rotate,textX:h.textX,textY:h.textY,anchorX:h.anchorX,anchorY:h.anchorY,targetX:h.targetX,targetY:h.targetY}})},ht=function(t,e,i,a,o){var s=a[0],l=a[1];A?t.exit().transition().each(function(){var t=r.select(this);t.select("path.surface").transition().attrTween("d",function(t){var r=function(t,e,r,i){var a,o=U(t,e);if(e)a=D;else{var s=U(_,e);a=s?R(t,s,i):{}}return n(o,a)}(t,e,0,[s,l]);return function(t){return o(r(t))}}),t.select("g.slicetext").attr("opacity",0)}).remove():t.exit().remove()},ft=function(t){var e=t.transform;return t.x0!==t.x1&&t.y0!==t.y1&&l(y.type,e,m),a.getTextTransform({textX:e.textX,textY:e.textY,anchorX:e.anchorX,anchorY:e.anchorY,targetX:e.targetX,targetY:e.targetY,scale:e.scale,rotate:e.rotate})};A&&(w.each(function(t){B[h(t)]={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1},t.transform&&(B[h(t)].transform={textX:t.transform.textX,textY:t.transform.textY,anchorX:t.transform.anchorX,anchorY:t.transform.anchorY,targetX:t.transform.targetX,targetY:t.transform.targetY,scale:t.transform.scale,rotate:t.transform.rotate})}),T.each(function(t){N[h(t)]={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1},t.transform&&(N[h(t)].transform={textX:t.transform.textX,textY:t.transform.textY,anchorX:t.transform.anchorX,anchorY:t.transform.anchorY,targetX:t.transform.targetX,targetY:t.transform.targetY,scale:t.transform.scale,rotate:t.transform.rotate}),!F&&i.isEntry(t)&&(F=t)})),j=d(t,e,_,T,{width:C,height:I,viewX:G,viewY:Z,pathSlice:function(t){var e=G(t.x0),r=G(t.x1),n=Z(t.y0),i=Z(t.y1),a=r-e,o=i-n;if(!a||!o)return"";var s=y.marker.cornerradius||0,l=Math.min(s,a/2,o/2);l&&t.data&&t.data.data&&t.data.data.label&&(nt&&(l=Math.min(l,et.t)),it&&(l=Math.min(l,et.l)),at&&(l=Math.min(l,et.r)),ot&&(l=Math.min(l,et.b)));var u=function(t,e){return l?"a"+J(l,l)+" 0 0 1 "+J(t,e):""};return"M"+J(e,n+l)+u(l,-l)+"L"+J(r-l,n)+u(l,l)+"L"+J(r,i-l)+u(-l,l)+"L"+J(e+l,i)+u(-l,-l)+"Z"},toMoveInsideSlice:st,prevEntry:F,makeUpdateSliceInterpolator:ut,makeUpdateTextInterpolator:ct,handleSlicesExit:ht,hasTransition:A,strTransform:ft}),y.pathbar.visible?c(t,e,_,w,{barDifY:O,width:L,height:P,viewX:X,viewY:$,pathSlice:function(t){var e=X(Math.max(Math.min(t.x0,t.x0),0)),r=X(Math.min(Math.max(t.x1,t.x1),L)),n=$(t.y0),i=$(t.y1),a=P/2,o={},s={};o.x=e,s.x=r,o.y=s.y=(n+i)/2;var l={x:e,y:n},u={x:r,y:n},c={x:r,y:i},h={x:e,y:i};return">"===tt?(l.x-=a,u.x-=a,c.x-=a,h.x-=a):"/"===tt?(c.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,u.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),Q(l),Q(h),Q(o),Q(u),Q(c),Q(s),"M"+J(l.x,l.y)+"L"+J(u.x,u.y)+"L"+J(s.x,s.y)+"L"+J(c.x,c.y)+"L"+J(h.x,h.y)+"L"+J(o.x,o.y)+"Z"},toMoveInsideSlice:st,makeUpdateSliceInterpolator:ut,makeUpdateTextInterpolator:ct,handleSlicesExit:ht,hasTransition:A,strTransform:ft}):w.remove()}}),_d=f((t,e)=>{var r=v(),n=nd(),i=$a().clearMinTextSize,a=Ka().resizeText,o=xd();e.exports=function(t,e,s,l,u){var c,h,f=u.type,p=u.drawDescendants,d=t._fullLayout,m=d["_"+f+"layer"],g=!s;i(f,d),(c=m.selectAll("g.trace."+f).data(e,function(t){return t[0].trace.uid})).enter().append("g").classed("trace",!0).classed(f,!0),c.order(),!d.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){m.selectAll("g.trace").each(function(e){o(t,e,this,s,p)})})):(c.each(function(e){o(t,e,this,s,p)}),d.uniformtext.mode&&a(t,m.selectAll(".trace"),f)),g&&c.exit().remove()}}),bd=f((t,e)=>{var r=v(),n=oe(),i=Je(),a=Ae(),o=gd(),s=yd().styleOne,l=ud(),u=nd(),c=id(),h=ad().formatSliceLabel,f=!1;e.exports=function(t,e,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),O=!z&&!I.marker.pad.t||z&&!I.marker.pad.b,D=o(p,[g,y],{packing:I.tiling.packing,squarifyratio:I.tiling.squarifyratio,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,pad:{inner:I.tiling.pad,top:I.marker.pad.t,left:I.marker.pad.l,right:I.marker.pad.r,bottom:I.marker.pad.b}}).descendants(),R=1/0,F=-1/0;D.forEach(function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(R=Math.min(R,e),F=Math.max(F,e))}),d=d.data(D,u.getPtId),I._maxVisibleLayers=isFinite(F)?F-R+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var B=null;if(T&&S){var N=u.getPtId(S);d.each(function(t){null===B&&u.getPtId(t)===N&&(B={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})})}var j=function(){return B||{x0:0,x1:g,y0:0,y1:y}},U=d;return T&&(U=U.transition().each("end",function(){var e=r.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),U.each(function(o){var d=u.isHeader(o,I);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.marker.pad.r),o._hoverY=x(z?o.y1-I.marker.pad.b/2:o.y0+I.marker.pad.t/2);var m=r.select(this),k=n.ensureSingle(m,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?k.transition().attrTween("d",function(t){var e=A(t,f,j(),[g,y]);return function(t){return _(e(t))}}):k.attr("d",_),m.call(c,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),k.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=d?O?"":u.getPtLabel(o)||"":h(o,p,I,e,C)||"";var S=n.ensureSingle(m,"g","slicetext"),D=n.ensureSingle(S,"text","",function(t){t.attr("data-notex",1)}),R=n.ensureUniformFontSize(t,u.determineTextFont(I,o,C.font)),F=o._text||" ",B=d&&-1===F.indexOf("<br>");D.text(F).classed("slicetext",!0).attr("text-anchor",P?"end":L||B?"start":"middle").call(i.font,R).call(a.convertToTspans,t),o.textBB=i.bBox(D.node()),o.transform=b(o,{fontSize:R.size,isHeader:d}),o.transform.fontSize=R.size,T?D.transition().attrTween("transform",function(t){var e=M(t,f,j(),[g,y]);return function(t){return w(e(t))}}):D.attr("transform",w(o))}),B}}),wd=f((t,e)=>{var r=_d(),n=bd();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"treemap",drawDescendants:n})}}),Td=f((t,e)=>{e.exports={moduleType:"trace",name:"treemap",basePlotModule:ld(),categories:[],animatable:!0,attributes:cd(),layoutAttributes:hd(),supplyDefaults:fd(),supplyLayoutDefaults:pd(),calc:dd().calc,crossTraceCalc:dd().crossTraceCalc,plot:wd(),style:yd().style,colorbar:hi(),meta:{}}}),kd=f((t,e)=>{e.exports=Td()}),Ad=f(t=>{var e=we();t.name="icicle",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}),Md=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Ie(),a=wa().attributes,o=Wc(),s=oh(),l=cd(),u=ud(),c=D().extendFlat,h=Pt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:c({colors:s.marker.colors,line:s.marker.line,pattern:h,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:s.leaf,pathbar:l.pathbar,text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:u.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:o.sort,root:s.root,domain:a({name:"icicle",trace:!0,editType:"calc"})}}),Sd=f((t,e)=>{e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),Ed=f((t,e)=>{var r=oe(),n=Md(),i=q(),a=wa().defaults,o=Za().handleText,s=Va().TEXTPAD,l=Yc().handleMarkerDefaults,u=Ge(),c=u.hasColorscale,h=u.handleDefaults;e.exports=function(t,e,u,f){function p(i,a){return r.coerce(t,e,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,f,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),l(t,e,f,p);var x=e._hasColorscale=c(t,"marker","colors")||(t.marker||{}).coloraxis;x&&h(t,e,f,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",x?1:.7),e._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,f,p),e._length=null}else e.visible=!1}}),Cd=f((t,e)=>{var r=oe(),n=Sd();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("iciclecolorway",e.colorway),i("extendiciclecolors")}}),Id=f(t=>{var e=hh();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("icicle",t)}}),Ld=f((t,e)=>{var r=ch(),n=md();e.exports=function(t,e,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,u=e[0],c=e[1];l&&(u=(t.height+1)*e[0]/Math.min(t.height+1,l),c=(t.height+1)*e[1]/Math.min(t.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[e[1],u]:[e[0],c])(t);return(s||a||o)&&n(h,e,{swapXY:s,flipX:a,flipY:o}),h}}),Pd=f((t,e)=>{var r=v(),n=q(),i=oe(),a=$a().resizeText,o=ed();function s(t,e,r,a){var s=e.data.data,l=!e.children,u=s.i,c=i.castOption(r,u,"marker.line.color")||n.defaultLine,h=i.castOption(r,u,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");a(t,e,"icicle"),e.each(function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each(function(e){r.select(this).call(s,e,i,t)})})},styleOne:s}}),zd=f((t,e)=>{var r=v(),n=oe(),i=Je(),a=Ae(),o=Ld(),s=Pd().styleOne,l=ud(),u=nd(),c=id(),h=ad().formatSliceLabel,f=!1;e.exports=function(t,e,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),O=o(p,[g,y],{flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,orientation:I.tiling.orientation,pad:{inner:I.tiling.pad},maxDepth:I._maxDepth}).descendants(),D=1/0,R=-1/0;O.forEach(function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),R=Math.max(R,e))}),d=d.data(O,u.getPtId),I._maxVisibleLayers=isFinite(R)?R-D+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var F=null;if(T&&S){var B=u.getPtId(S);d.each(function(t){null===F&&u.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})})}var N=function(){return F||{x0:0,x1:g,y0:0,y1:y}},j=d;return T&&(j=j.transition().each("end",function(){var e=r.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),j.each(function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.tiling.pad),o._hoverY=x(z?o.y1-I.tiling.pad/2:o.y0+I.tiling.pad/2);var d=r.select(this),m=n.ensureSingle(d,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?m.transition().attrTween("d",function(t){var e=A(t,f,N(),[g,y],{orientation:I.tiling.orientation,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1});return function(t){return _(e(t))}}):m.attr("d",_),d.call(c,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),m.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,p,I,e,C)||"";var k=n.ensureSingle(d,"g","slicetext"),S=n.ensureSingle(k,"text","",function(t){t.attr("data-notex",1)}),O=n.ensureUniformFontSize(t,u.determineTextFont(I,o,C.font));S.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":L?"start":"middle").call(i.font,O).call(a.convertToTspans,t),o.textBB=i.bBox(S.node()),o.transform=b(o,{fontSize:O.size}),o.transform.fontSize=O.size,T?S.transition().attrTween("transform",function(t){var e=M(t,f,N(),[g,y]);return function(t){return w(e(t))}}):S.attr("transform",w(o))}),F}}),Od=f((t,e)=>{var r=_d(),n=zd();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"icicle",drawDescendants:n})}}),Dd=f((t,e)=>{e.exports={moduleType:"trace",name:"icicle",basePlotModule:Ad(),categories:[],animatable:!0,attributes:Md(),layoutAttributes:Sd(),supplyDefaults:Ed(),supplyLayoutDefaults:Cd(),calc:Id().calc,crossTraceCalc:Id().crossTraceCalc,plot:Od(),style:Pd().style,colorbar:hi(),meta:{}}}),Rd=f((t,e)=>{e.exports=Dd()}),Fd=f(t=>{var e=we();t.name="funnelarea",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}),Bd=f((t,e)=>{var r=Wc(),n=j(),i=wa().attributes,a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=D().extendFlat;e.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}),Nd=f((t,e)=>{var r=Xc().hiddenlabels;e.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),jd=f((t,e)=>{var r=oe(),n=Bd(),i=wa().defaults,a=Za().handleText,o=Yc().handleLabelsAndValues,s=Yc().handleMarkerDefaults;e.exports=function(t,e,l,u){function c(i,a){return r.coerce(t,e,n,i,a)}var h=c("labels"),f=c("values"),p=o(h,f),d=p.len;if(e._hasLabels=p.hasLabels,e._hasValues=p.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),d){e._length=d,s(t,e,u,c),c("scalegroup");var m,g=c("text"),y=c("texttemplate");if(y||(m=c("textinfo",Array.isArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||m&&"none"!==m){var v=c("textposition");a(t,e,u,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&c("textposition","none");i(e,u,c),c("title.text")&&(c("title.position"),r.coerceFont(c,"title.font",u.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}}),Ud=f((t,e)=>{var r=oe(),n=Nd();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",e.colorway),i("extendfunnelareacolors")}}),Vd=f((t,e)=>{var r=Jc();e.exports={calc:function(t,e){return r.calc(t,e)},crossTraceCalc:function(t){r.crossTraceCalc(t,{type:"funnelarea"})}}}),qd=f((t,e)=>{var r=v(),n=Je(),i=oe(),a=i.strScale,o=i.strTranslate,s=Ae(),l=Qa().toMoveInsideBar,u=$a(),c=u.recordMinTextSize,h=u.clearMinTextSize,f=xr(),p=Qc(),d=p.attachFxHandlers,m=p.determineInsideTextFont,g=p.layoutAreas,y=p.prerenderTitles,x=p.positionTitleOutside,_=p.formatSliceLabel;function b(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}function w(t,e){return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}e.exports=function(t,e){var u=t._context.staticPlot,p=t._fullLayout;h("funnelarea",p),y(e,t),g(e,p._size),i.makeTraceGroups(p._funnelarealayer,e,"trace").each(function(e){var h=r.select(this),g=e[0],y=g.trace;(function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),u=e.vTotal,c=u*l/(1-l),h=u,f=c/u,p=[];for(p.push(C()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var d=s.v/h;f+=d,p.push(C())}var m=1/0,g=-1/0;for(o=0;o<p.length;o++)a=p[o],m=Math.min(m,a[1]),g=Math.max(g,a[1]);for(o=0;o<p.length;o++)p[o][1]-=(g+m)/2;var y=p[p.length-1][0],v=e.r,x=(g-m)/2,_=v/y,b=v/x*n;for(e.r=b*x,o=0;o<p.length;o++)p[o][0]*=_,p[o][1]*=b;var T=[-(a=p[0])[0],a[1]],k=[a[0],a[1]],A=0;for(o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var M=p[A+=1][0],S=p[A][1];s.TL=[-M,S],s.TR=[M,S],s.BL=T,s.BR=k,s.pxmid=w(s.TR,s.BR),T=s.TL,k=s.TR}}function E(){var t=Math.sqrt(f);return{x:t,y:-t}}function C(){var t=E();return[t.x,t.y]}})(e),h.each(function(){var h=r.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each(function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,x=r.select(this),w=x.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),x.call(d,t,e);var T="M"+(h+a.TR[0])+","+(v+a.TR[1])+b(a.TR,a.BR)+b(a.BR,a.BL)+b(a.BL,a.TL)+"Z";w.attr("d",T),_(t,a,g);var k=f.castOption(y.textposition,a.pts),A=x.selectAll("g.slicetext").data(a.text&&"none"!==k?[0]:[]);A.enter().append("g").classed("slicetext",!0),A.exit().remove(),A.each(function(){var u=i.ensureSingle(r.select(this),"text","",function(t){t.attr("data-notex",1)}),f=i.ensureUniformFontSize(t,m(y,a,p.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,f).call(s.convertToTspans,t);var d,g,x,_=n.bBox(u.node()),b=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(d=l(g,x,b,w,_,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,c(y.type,d,p),e[o].transform=d,i.setTransormAndDisplay(u,d)})}});var v=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each(function(){var e=i.ensureSingle(r.select(this),"text","",function(t){t.attr("data-notex",1)}),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),e.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,t);var u=x(g,p._size);e.attr("transform",o(u.x,u.y)+a(Math.min(1,u.scale))+o(u.tx,u.ty))})})})}}),Hd=f((t,e)=>{var r=v(),n=br(),i=$a().resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each(function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each(function(e){r.select(this).call(n,e,i,t)})})}}),Gd=f((t,e)=>{e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:Fd(),categories:["pie-like","funnelarea","showLegend"],attributes:Bd(),layoutAttributes:Nd(),supplyDefaults:jd(),supplyLayoutDefaults:Ud(),calc:Vd().calc,crossTraceCalc:Vd().crossTraceCalc,plot:qd(),style:Hd(),styleOne:br(),meta:{}}}),Zd=f((t,e)=>{e.exports=Gd()}),Wd=f((t,e)=>{!function(){var t={1964:function(t,e,r){t.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(t,e,r){function n(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==u(e)?e:e+""}function a(t,e,r){return e=s(e),function(t,e){if(e&&("object"==u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,[],s(t).constructor):e.apply(t,r))}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c=r(7507),h=r(3778),f="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=m,e.IS=50;var p=2147483647;function d(t){if(t>p)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,m.prototype),e}function m(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return v(t)}return g(t,e,r)}function g(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!m.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|w(t,e),n=d(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(rt(t,Uint8Array)){var e=new Uint8Array(t);return _(e.buffer,e.byteOffset,e.byteLength)}return x(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(t));if(rt(t,ArrayBuffer)||t&&rt(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(rt(t,SharedArrayBuffer)||t&&rt(t.buffer,SharedArrayBuffer)))return _(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return m.from(n,e,r);var i=function(t){if(m.isBuffer(t)){var e=0|b(t.length),r=d(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||nt(t.length)?d(0):x(t):"Buffer"===t.type&&Array.isArray(t.data)?x(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return m.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(t))}function y(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function v(t){return y(t),d(t<0?0:0|b(t))}function x(t){for(var e=t.length<0?0:0|b(t.length),r=d(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function _(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,m.prototype),n}function b(t){if(t>=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|t}function w(t,e){if(m.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||rt(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+u(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return tt(t).length;default:if(i)return n?-1:Q(t).length;e=(""+e).toLowerCase(),i=!0}}function T(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,e,r);case"utf8":case"utf-8":return z(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function k(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),nt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=m.from(e,n)),m.isBuffer(e))return 0===e.length?-1:M(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):M(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;a<s;a++)if(u(t,a)===u(e,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var h=!0,f=0;f<l;f++)if(u(t,a+f)!==u(e,f)){h=!1;break}if(h)return a}return-1}function S(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(nt(s))return a;t[r+a]=s}return a}function E(t,e,r,n){return et(Q(e,t.length-r),t,r,n)}function C(t,e,r,n){return et(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function I(t,e,r,n){return et(tt(e),t,r,n)}function L(t,e,r,n){return et(function(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function P(t,e,r){return 0===e&&r===t.length?c.fromByteArray(t):c.fromByteArray(t.slice(e,r))}function z(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,h=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=O));return r}(n)}m.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!m.TYPED_ARRAY_SUPPORT&&"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}}),m.poolSize=8192,m.from=function(t,e,r){return g(t,e,r)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array),m.alloc=function(t,e,r){return function(t,e,r){return y(t),t<=0?d(t):void 0!==e?"string"==typeof r?d(t).fill(e,r):d(t).fill(e):d(t)}(t,e,r)},m.allocUnsafe=function(t){return v(t)},m.allocUnsafeSlow=function(t){return v(t)},m.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==m.prototype},m.compare=function(t,e){if(rt(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),rt(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(t)||!m.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},m.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return m.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=m.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(rt(a,Uint8Array))i+a.length>n.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!m.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},m.byteLength=w,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)k(this,e,e+1);return this},m.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)k(this,e,e+3),k(this,e+1,e+2);return this},m.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)k(this,e,e+7),k(this,e+1,e+6),k(this,e+2,e+5),k(this,e+3,e+4);return this},m.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?z(this,0,t):T.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===m.compare(this,t)},m.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},f&&(m.prototype[f]=m.prototype.inspect),m.prototype.compare=function(t,e,r,n,i){if(rt(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+u(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(l[h]!==c[h]){a=l[h],o=c[h];break}return a<o?-1:o<a?1:0},m.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},m.prototype.indexOf=function(t,e,r){return A(this,t,e,r,!0)},m.prototype.lastIndexOf=function(t,e,r){return A(this,t,e,r,!1)},m.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return S(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return C(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function D(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function F(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;++a)i+=it[t[a]];return i}function B(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function N(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,a){if(!m.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function V(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function q(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,4),h.write(t,e,r,n,23,4),r+4}function G(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,8),h.write(t,e,r,n,52,8),r+8}m.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,m.prototype),n},m.prototype.readUintLE=m.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},m.prototype.readUintBE=m.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},m.prototype.readUint8=m.prototype.readUInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),this[t]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]|this[t+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]<<8|this[t+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},m.prototype.readBigUInt64LE=at(function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&J(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<<BigInt(32))}),m.prototype.readBigUInt64BE=at(function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&J(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),m.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},m.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},m.prototype.readInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},m.prototype.readInt16LE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt16BE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},m.prototype.readInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},m.prototype.readBigInt64LE=at(function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&J(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24))}),m.prototype.readBigInt64BE=at(function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&J(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r)}),m.prototype.readFloatLE=function(t,e){return t>>>=0,e||N(t,4,this.length),h.read(this,t,!0,23,4)},m.prototype.readFloatBE=function(t,e){return t>>>=0,e||N(t,4,this.length),h.read(this,t,!1,23,4)},m.prototype.readDoubleLE=function(t,e){return t>>>=0,e||N(t,8,this.length),h.read(this,t,!0,52,8)},m.prototype.readDoubleBE=function(t,e){return t>>>=0,e||N(t,8,this.length),h.read(this,t,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},m.prototype.writeUint8=m.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigUInt64LE=at(function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=at(function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},m.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},m.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},m.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},m.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigInt64LE=at(function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=at(function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeFloatLE=function(t,e,r){return H(this,t,e,!0,r)},m.prototype.writeFloatBE=function(t,e,r){return H(this,t,e,!1,r)},m.prototype.writeDoubleLE=function(t,e,r){return G(this,t,e,!0,r)},m.prototype.writeDoubleBE=function(t,e,r){return G(this,t,e,!1,r)},m.prototype.copy=function(t,e,r,n){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},m.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!m.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var o=m.isBuffer(t)?t:m.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<r-e;++a)this[a+e]=o[a%s]}return this};var Z={};function W(t,e,r){Z[t]=function(r){function i(){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),r=a(this,i),Object.defineProperty(r,"message",{value:e.apply(r,arguments),writable:!0,configurable:!0}),r.name="".concat(r.name," [").concat(t,"]"),r.stack,delete r.name,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(i,r),n(i,[{key:"code",get:function(){return t},set:function(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(t,"]: ").concat(this.message)}}])}(r)}function Y(t){for(var e="",r=t.length,n="-"===t[0]?1:0;r>=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function X(t,e,r,n,i,a){if(t>r||t<e){var o,s="bigint"==typeof e?"n":"";throw o=0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s),new Z.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){$(e,"offset"),(void 0===t[e]||void 0===t[e+r])&&J(e,t.length-(r+1))}(n,i,a)}function $(t,e){if("number"!=typeof t)throw new Z.ERR_INVALID_ARG_TYPE(e,"number",t)}function J(t,e,r){throw Math.floor(t)!==t?($(t,r),new Z.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(e),t)}W("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(u(e))},TypeError),W("ERR_OUT_OF_RANGE",function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+=" It must be ".concat(e,". Received ").concat(i)},RangeError);var K=/[^+/0-9A-Za-z-_]/g;function Q(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function tt(t){return c.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function et(t,e,r,n){var i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function rt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function nt(t){return t!=t}var it=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function at(t){return"undefined"==typeof BigInt?ot:t}function ot(){throw new Error("BigInt not supported")}},9216:function(t){t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(!i&&"undefined"!=typeof navigator&&(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(t,e,r){t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),h=i(),f=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new o({turntable:c,orbit:h,matrix:f},u)};var n=r(7261),i=r(9977),a=r(1811);function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r<e.length;++r)e[r].flush(t)},s.idle=function(t){for(var e=this._controllerList,r=0;r<e.length;++r)e[r].idle(t)},s.lookAt=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].lookAt(t,e,r,n)},s.rotate=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].rotate(t,e,r,n)},s.pan=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].pan(t,e,r,n)},s.translate=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].translate(t,e,r,n)},s.setMatrix=function(t,e){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setMatrix(t,e)},s.setDistanceLimits=function(t,e){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistanceLimits(t,e)},s.setDistance=function(t,e){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistance(t,e)},s.recalcMatrix=function(t){this._active.recalcMatrix(t)},s.getDistance=function(t){return this._active.getDistance(t)},s.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},s.lastT=function(){return this._active.lastT()},s.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},s.getMode=function(){return this._mode}},7169:function(t,e,r){var n="undefined"==typeof WeakMap?r(1538):WeakMap,i=r(2762),a=r(8116),o=new n;t.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},1085:function(t,e,r){var n=r(1371);t.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var i=t.split(/\r?\n/),a=String(i.length+e-1).length;return i.map(function(t,i){var o=i+e,s=String(o).length;return n(o,a-s)+r+t}).join("\n")}},3952:function(t,e,r){t.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],a=[0],o=1;o<e;++o)if(n.push(t[o]),i(n,r)){if(a.push(o),a.length===r+1)return a}else n.pop();return a};var n=r(3250);function i(t,e){for(var r=new Array(e+1),i=0;i<t.length;++i)r[i]=t[i];for(i=0;i<=t.length;++i){for(var a=t.length;a<=e;++a){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(a+1-i,s);r[a]=o}if(n.apply(void 0,r))return!0}return!1}},5995:function(t,e,r){t.exports=function(t,e){return n(e).filter(function(r){for(var n=new Array(r.length),a=0;a<r.length;++a)n[a]=e[r[a]];return i(n)*t<1})};var n=r(7642),i=r(6037)},3502:function(t,e,r){t.exports=function(t,e){return i(n(t,e))};var n=r(5995),i=r(9127)},6468:function(t){t.exports=function(t){return atob(t)}},2642:function(t,e,r){t.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];a[o]=s}for(a[r]=new Array(r+1),o=0;o<=r;++o)a[r][o]=1;var u=new Array(r+1);for(o=0;o<r;++o)u[o]=e[o];u[r]=1;var c=n(a,u),h=i(c[r+1]);0===h&&(h=1);var f=new Array(r+1);for(o=0;o<=r;++o)f[o]=i(c[o])/h;return f};var n=r(727);function i(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}},7507:function(t,e){e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,a=s(t),o=a[0],l=a[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),c=0,h=l>0?o-4:o;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,l=n-i;s<l;s+=o)a.push(u(t,s,s+o>l?l:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function u(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),i.push(l(n));return i.join("")}n[45]=62,n[95]=63},3865:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},1318:function(t){t.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},8697:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},7842:function(t,e,r){var n=r(6330),i=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);t.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,h=0;if(i(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;u=a(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(i(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;c=a(r)}else c=a(1);return h>0?u=u.ushln(h):h<0&&(c=c.ushln(-h)),s(u,c)}},6330:function(t,e,r){var n=r(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716:function(t,e,r){var n=r(6859);t.exports=function(t){return t.cmp(new n(0))}},1369:function(t,e,r){var n=r(5716);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a<e;a++)i+=r[a]*Math.pow(67108864,a);return n(t)*i}},4025:function(t,e,r){var n=r(2361),i=r(8828).countTrailingZeros;t.exports=function(t){var e=i(n.lo(t));if(e<32)return e;var r=i(n.hi(t));return r>20?52:r+32}},1533:function(t,e,r){r(6859),t.exports=function(t){return t&&"object"==typeof t&&!!t.words}},2651:function(t,e,r){var n=r(6859),i=r(2361);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},869:function(t,e,r){var n=r(2651),i=r(5716);t.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},6768:function(t,e,r){var n=r(6859);t.exports=function(t){return new n(t)}},6504:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},7721:function(t,e,r){var n=r(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},946:function(t,e,r){var n=r(1369),i=r(4025);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4;return u*(s+(f=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):u*(f*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(t){function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},8828:function(t,e){function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t<e)},e.max=function(t,e){return t^(t^e)&-(t<e)},e.isPow2=function(t){return!(t&t-1||!t)},e.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);(function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}})(n),e.reverse=function(t){return n[255&t]<<24|n[t>>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6859:function(t,e,r){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=l(t,e,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=l(t,e,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,c=r;c<s;c+=n)l=u(t,c,c+n,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var h=1;for(l=u(t,c,t.length,e),c=0;c<o;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var c=l>>>26,h=67108863&l,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;c+=(o=(i=0|t.words[d])*(a=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);r=0!=(a=s>>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],p=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?m+r:c[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s<a;s++)u[s]=0}else{for(s=0;s<a-i;s++)u[s]=0;for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[a-s-1]=o}return u},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return!(8191&e)&&(r+=13,e>>>=13),!(127&e)&&(r+=7,e>>>=7),!(15&e)&&(r+=4,e>>>=4),!(3&e)&&(r+=2,e>>>=2),!(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},a.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|r.words[a])+i,this.words[a]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o<n.length;o++)a=(e=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&e;for(;0!==a&&o<r.length;o++)a=(e=(0|r.words[o])+a)>>26,this.words[o]=67108863&e;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,u=0,c=0|o[0],h=8191&c,f=c>>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],_=8191&x,b=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],C=8191&E,I=E>>>13,L=0|o[7],P=8191&L,z=L>>>13,O=0|o[8],D=8191&O,R=O>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,q=0|s[1],H=8191&q,G=q>>>13,Z=0|s[2],W=8191&Z,Y=Z>>>13,X=0|s[3],$=8191&X,J=X>>>13,K=0|s[4],Q=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;u=((a=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var yt=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;u=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var vt=(u+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,W)|0))<<13)|0;u=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,V))+Math.imul(b,U)|0,a=Math.imul(b,V),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,Y)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,Y)|0;var xt=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,$)|0))<<13)|0;u=((a=a+Math.imul(f,J)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,G)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,J)|0;var _t=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,J)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,tt)|0;var bt=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;u=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,J)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(u+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;u=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(u+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(f,lt)|0))<<13)|0;u=((a=a+Math.imul(f,ut)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(b,rt)|0,a=a+Math.imul(b,nt)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ut)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ut)|0;var kt=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(z,W)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(b,at)|0,a=a+Math.imul(b,ot)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ut)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ut)|0,n=n+Math.imul(d,ht)|0,i=(i=i+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0;var At=(u+(n=n+Math.imul(h,dt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,G))+Math.imul(N,H)|0,a=Math.imul(N,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ut)|0)+Math.imul(b,lt)|0,a=a+Math.imul(b,ut)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,a=a+Math.imul(v,ft)|0;var Mt=(u+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,Y))+Math.imul(N,W)|0,a=Math.imul(N,Y),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ut)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(b,ht)|0,a=a+Math.imul(b,ft)|0;var St=(u+(n=n+Math.imul(y,dt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,dt)|0))<<13)|0;u=((a=a+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,J))+Math.imul(N,$)|0,a=Math.imul(N,J),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ut)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0;var Et=(u+(n=n+Math.imul(_,dt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(b,dt)|0))<<13)|0;u=((a=a+Math.imul(b,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,tt))+Math.imul(N,Q)|0,a=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ut)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Ct=(u+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(k,dt)|0))<<13)|0;u=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ut)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(I,ht)|0,a=a+Math.imul(I,ft)|0;var It=(u+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,dt)|0))<<13)|0;u=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ut)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(z,ht)|0,a=a+Math.imul(z,ft)|0;var Lt=(u+(n=n+Math.imul(C,dt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(I,dt)|0))<<13)|0;u=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ut))+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0;var Pt=(u+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(z,dt)|0))<<13)|0;u=((a=a+Math.imul(z,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,ht),i=(i=Math.imul(B,ft))+Math.imul(N,ht)|0,a=Math.imul(N,ft);var zt=(u+(n=n+Math.imul(D,dt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Ot=(u+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(N,dt)|0))<<13)|0;return u=((a=Math.imul(N,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,l[0]=gt,l[1]=yt,l[2]=vt,l[3]=xt,l[4]=_t,l[5]=bt,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=At,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=It,l[15]=Lt,l[16]=Pt,l[17]=zt,l[18]=Ot,0!==u&&(l[19]=u,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=p),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?p(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,e.length-1),u=Math.max(0,a-t.length+1);u<=l;u++){var c=a-u,h=(0|t.words[c])*(0|e.words[u]),f=67108863&h;s=67108863&(f=f+s|0),i+=(o=(o=o+(h/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},g.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var h=l,f=u,p=0;p<o;p++){var d=r[c+p],m=n[c+p],g=r[c+p+o],y=n[c+p+o],v=h*g-f*y;y=h*y+f*g,g=v,r[c+p]=d+g,n[c+p]=m+y,r[c+p+o]=d-g,n[c+p+o]=m-y,p!==s&&(v=l*h-u*f,f=l*f+u*h,h=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(!(-8192&a))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,a,s,l,n,i),this.transform(u,a,c,h,n,i);for(var p=0;p<n;p++){var d=s[p]*c[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*c[p],s[p]=d}return this.conjugate(s,l,n),this.transform(s,l,f,a,n,i),this.conjugate(f,a,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),m(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0!==o)if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a=t.length+r;this._expand(a);var o,s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;s=((o-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0===(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;0===(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var o=new a(1),s=new a(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,c=1;0===(r.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;0===(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);r.cmp(i)>=0?(r.isub(i),o.isub(s)):(i.isub(r),s.isub(o))}return(e=0===r.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new T(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(x,v),x.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=a&r,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(_,v),i(b,v),i(w,v),w.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new _;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},T.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<d);var y=this.pow(h,new a(1).iushln(d-g-1));f=f.redMul(y),h=y.redSqr(),p=p.redMul(h),d=g}return f},T.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},T.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new k(t)},i(k,T),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6204:function(t){t.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],u=l.length;for(r=0;r<u;++r){var c=o[s++]=new Array(u-1),h=0;for(n=0;n<u;++n)n!==r&&(c[h++]=l[n]);if(1&r){var f=c[1];c[1]=c[0],c[0]=f}}}return o}},6867:function(t,e,r){t.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return n=[],u(t,t,c,!0),n}(t);case 2:return"function"==typeof e?u(t,t,e,!0):function(t,e){return n=[],u(t,e,c,!1),n}(t,e);case 3:return u(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,i=r(1888),a=r(855),o=r(7150);function s(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var i=0,a=0,o=0,l=t.length;o<l;++o){var u=t[o];if(!s(e,u)){for(var c=0;c<2*e;++c)r[i++]=u[c];n[a++]=o}}return a}function u(t,e,r,n){var s=t.length,u=e.length;if(!(s<=0||u<=0)){var c=t[0].length>>>1;if(!(c<=0)){var h,f=i.mallocDouble(2*c*s),p=i.mallocInt32(s);if((s=l(t,c,f,p))>0){if(1===c&&n)a.init(s),h=a.sweepComplete(c,r,0,s,f,p,0,s,f,p);else{var d=i.mallocDouble(2*c*u),m=i.mallocInt32(u);(u=l(e,c,d,m))>0&&(a.init(s+u),h=1===c?a.sweepBipartite(c,r,0,s,f,p,0,u,d,m):o(c,r,n,s,f,p,u,d,m),i.free(d),i.free(m))}i.free(f),i.free(p)}return h}}}function c(t,e){n.push([t,e])}},2455:function(t,e){function r(t){return t?function(t,e,r,n,i,a,o,s,l,u,c){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,u,c){for(var h=2*t,f=n,p=h*n;f<i;++f,p+=h){var d=a[e+p],m=a[e+p+t],g=o[f];t:for(var y=s,v=h*s;y<l;++y,v+=h){var x=u[e+v],_=u[e+v+t],b=c[y];if(!(_<d||m<x)){for(var w=e+1;w<t;++w){var T=a[w+p],k=a[w+t+p],A=u[w+v],M=u[w+t+v];if(k<A||M<T)continue t}var S=r(g,b);if(void 0!==S)return S}}}}(t,e,r,n,i,a,o,s,l,u,c):function(t,e,r,n,i,a,o,s,l,u,c){for(var h=2*t,f=s,p=h*s;f<l;++f,p+=h){var d=u[e+p],m=u[e+p+t],g=c[f];t:for(var y=n,v=h*n;y<i;++y,v+=h){var x=a[e+v],_=a[e+v+t],b=o[y];if(!(m<x||_<d)){for(var w=e+1;w<t;++w){var T=a[w+v],k=a[w+t+v],A=u[w+p],M=u[w+t+p];if(k<A||M<T)continue t}var S=r(b,g);if(void 0!==S)return S}}}}(t,e,r,n,i,a,o,s,l,u,c)}:function(t,e,r,n,i,a,o,s,l,u,c,h){return a-i>u-l?n?function(t,e,r,n,i,a,o,s,l,u,c){for(var h=2*t,f=n,p=h*n;f<i;++f,p+=h){var d=a[e+p],m=a[e+p+t],g=o[f];t:for(var y=s,v=h*s;y<l;++y,v+=h){var x=u[e+v],_=c[y];if(!(x<=d||m<x)){for(var b=e+1;b<t;++b){var w=a[b+p],T=a[b+t+p],k=u[b+v],A=u[b+t+v];if(T<k||A<w)continue t}var M=r(_,g);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,u,c,h):function(t,e,r,n,i,a,o,s,l,u,c){for(var h=2*t,f=n,p=h*n;f<i;++f,p+=h){var d=a[e+p],m=a[e+p+t],g=o[f];t:for(var y=s,v=h*s;y<l;++y,v+=h){var x=u[e+v],_=c[y];if(!(x<d||m<x)){for(var b=e+1;b<t;++b){var w=a[b+p],T=a[b+t+p],k=u[b+v],A=u[b+t+v];if(T<k||A<w)continue t}var M=r(g,_);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,u,c,h):n?function(t,e,r,n,i,a,o,s,l,u,c){for(var h=2*t,f=s,p=h*s;f<l;++f,p+=h){var d=u[e+p],m=c[f];t:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[e+y],x=a[e+y+t],_=o[g];if(!(d<=v||x<d)){for(var b=e+1;b<t;++b){var w=a[b+y],T=a[b+t+y],k=u[b+p],A=u[b+t+p];if(T<k||A<w)continue t}var M=r(m,_);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,u,c,h):function(t,e,r,n,i,a,o,s,l,u,c){for(var h=2*t,f=s,p=h*s;f<l;++f,p+=h){var d=u[e+p],m=c[f];t:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[e+y],x=a[e+y+t],_=o[g];if(!(d<v||x<d)){for(var b=e+1;b<t;++b){var w=a[b+y],T=a[b+t+y],k=u[b+p],A=u[b+t+p];if(T<k||A<w)continue t}var M=r(_,m);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,u,c,h)}}e.partial=r(!1),e.full=r(!0)},7150:function(t,e,r){t.exports=function(t,e,r,a,c,S,E,C,I){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(_*r);w.length<a&&(n.free(w),w=n.mallocInt32(a));var o=i.nextPow2(b*r);T.length<o&&(n.free(T),T=n.mallocDouble(o))}(t,a+E);var L,P=0,z=2*t;for(k(P++,0,0,a,0,E,r?16:0,-1/0,1/0),r||k(P++,0,0,E,0,a,1,-1/0,1/0);P>0;){var O=(P-=1)*_,D=w[O],R=w[O+1],F=w[O+2],B=w[O+3],N=w[O+4],j=w[O+5],U=P*b,V=T[U],q=T[U+1],H=1&j,G=!!(16&j),Z=c,W=S,Y=C,X=I;if(H&&(Z=C,W=I,Y=c,X=S),!(2&j&&(F=g(t,D,R,F,Z,W,q),R>=F)||4&j&&(R=y(t,D,R,F,Z,W,V),R>=F))){var $=F-R,J=N-B;if(G){if(t*$*($+J)<p){if(void 0!==(L=l.scanComplete(t,D,e,R,F,Z,W,B,N,Y,X)))return L;continue}}else{if(t*Math.min($,J)<h){if(void 0!==(L=o(t,D,e,H,R,F,Z,W,B,N,Y,X)))return L;continue}if(t*$*J<f){if(void 0!==(L=l.scanBipartite(t,D,e,H,R,F,Z,W,B,N,Y,X)))return L;continue}}var K=d(t,D,R,F,Z,W,V,q);if(R<K)if(t*(K-R)<h){if(void 0!==(L=s(t,D+1,e,R,K,Z,W,B,N,Y,X)))return L}else if(D===t-2){if(void 0!==(L=H?l.sweepBipartite(t,e,B,N,Y,X,R,K,Z,W):l.sweepBipartite(t,e,R,K,Z,W,B,N,Y,X)))return L}else k(P++,D+1,R,K,B,N,H,-1/0,1/0),k(P++,D+1,B,N,R,K,1^H,-1/0,1/0);if(K<F){var Q=u(t,D,B,N,Y,X),tt=Y[z*Q+D],et=m(t,D,Q,N,Y,X,tt);if(et<N&&k(P++,D,K,F,et,N,(4|H)+(G?16:0),tt,q),B<Q&&k(P++,D,K,F,B,Q,(2|H)+(G?16:0),V,tt),Q+1===et){if(void 0!==(L=G?M(t,D,e,K,F,Z,W,Q,Y,X[Q]):A(t,D,e,H,K,F,Z,W,Q,Y,X[Q])))return L}else if(Q<et){var rt;if(G){if(K<(rt=v(t,D,K,F,Z,W,tt))){var nt=m(t,D,K,rt,Z,W,tt);if(D===t-2){if(K<nt&&void 0!==(L=l.sweepComplete(t,e,K,nt,Z,W,Q,et,Y,X))||nt<rt&&void 0!==(L=l.sweepBipartite(t,e,nt,rt,Z,W,Q,et,Y,X)))return L}else K<nt&&k(P++,D+1,K,nt,Q,et,16,-1/0,1/0),nt<rt&&(k(P++,D+1,nt,rt,Q,et,0,-1/0,1/0),k(P++,D+1,Q,et,nt,rt,1,-1/0,1/0))}}else K<(rt=H?x(t,D,K,F,Z,W,tt):v(t,D,K,F,Z,W,tt))&&(D===t-2?L=H?l.sweepBipartite(t,e,Q,et,Y,X,K,rt,Z,W):l.sweepBipartite(t,e,K,rt,Z,W,Q,et,Y,X):(k(P++,D+1,K,rt,Q,et,H,-1/0,1/0),k(P++,D+1,Q,et,K,rt,1^H,-1/0,1/0)))}}}}};var n=r(1888),i=r(8828),a=r(2455),o=a.partial,s=a.full,l=r(855),u=r(3545),c=r(8105),h=128,f=1<<22,p=1<<22,d=c("!(lo>=p0)&&!(p1>=hi)"),m=c("lo===p0"),g=c("lo<p0"),y=c("hi<=p0"),v=c("lo<=p0&&p0<=hi"),x=c("lo<p0&&p0<=hi"),_=6,b=2,w=n.mallocInt32(1024),T=n.mallocDouble(1024);function k(t,e,r,n,i,a,o,s,l){var u=_*t;w[u]=e,w[u+1]=r,w[u+2]=n,w[u+3]=i,w[u+4]=a,w[u+5]=o;var c=b*t;T[c]=s,T[c+1]=l}function A(t,e,r,n,i,a,o,s,l,u,c){var h=2*t,f=l*h,p=u[f+e];t:for(var d=i,m=i*h;d<a;++d,m+=h){var g=o[m+e],y=o[m+e+t];if(!(p<g||y<p||n&&p===g)){for(var v=s[d],x=e+1;x<t;++x){g=o[m+x],y=o[m+x+t];var _=u[f+x],b=u[f+x+t];if(y<_||b<g)continue t}var w;if(void 0!==(w=n?r(c,v):r(v,c)))return w}}}function M(t,e,r,n,i,a,o,s,l,u){var c=2*t,h=s*c,f=l[h+e];t:for(var p=n,d=n*c;p<i;++p,d+=c){var m=o[p];if(m!==u){var g=a[d+e],y=a[d+e+t];if(!(f<g||y<f)){for(var v=e+1;v<t;++v){g=a[d+v],y=a[d+v+t];var x=l[h+v],_=l[h+v+t];if(y<x||_<g)continue t}var b=r(m,u);if(void 0!==b)return b}}}}},3545:function(t,e,r){t.exports=function(t,e,r,o,s,l){if(o<=r+1)return r;for(var u=r,c=o,h=o+r>>>1,f=2*t,p=h,d=s[f*h+e];u<c;){if(c-u<i){a(t,e,u,c,s,l),d=s[f*h+e];break}var m=c-u,g=Math.random()*m+u|0,y=s[f*g+e],v=Math.random()*m+u|0,x=s[f*v+e],_=Math.random()*m+u|0,b=s[f*_+e];y<=x?b>=x?(p=v,d=x):y>=b?(p=g,d=y):(p=_,d=b):x>=b?(p=v,d=x):b>=y?(p=g,d=y):(p=_,d=b);for(var w=f*(c-1),T=f*p,k=0;k<f;++k,++w,++T){var A=s[w];s[w]=s[T],s[T]=A}var M=l[c-1];for(l[c-1]=l[p],l[p]=M,w=f*(c-1),T=f*(p=n(t,e,u,c-1,s,l,d)),k=0;k<f;++k,++w,++T)A=s[w],s[w]=s[T],s[T]=A;if(M=l[c-1],l[c-1]=l[p],l[p]=M,h<p){for(c=p-1;u<c&&s[f*(c-1)+e]===d;)c-=1;c+=1}else{if(!(p<h))break;for(u=p+1;u<c&&s[f*u+e]===d;)u+=1}}return n(t,e,r,h,s,l,s[f*h+e])};var n=r(8105)("lo<p0"),i=8;function a(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var u=i[s],c=l,h=o*(l-1);c>r&&i[h+e]>u;--c,h-=o){for(var f=h,p=h+o,d=0;d<o;++d,++f,++p){var m=i[f];i[f]=i[p],i[p]=m}var g=a[c];a[c]=a[c-1],a[c-1]=g}}},8105:function(t){t.exports=function(t){return e[t]};var e={"lo===p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,h=e,f=r;n>f;++f,l+=s)if(i[l+h]===o)if(c===f)c+=1,u+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var m=a[f];a[f]=a[c],a[c++]=m}return c},"lo<p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,h=e,f=r;n>f;++f,l+=s)if(i[l+h]<o)if(c===f)c+=1,u+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var m=a[f];a[f]=a[c],a[c++]=m}return c},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(c===f)c+=1,u+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var m=a[f];a[f]=a[c],a[c++]=m}return c},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(c===f)c+=1,u+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var m=a[f];a[f]=a[c],a[c++]=m}return c},"lo<p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,h=e,f=t+e,p=r;n>p;++p,l+=s){var d=i[l+h],m=i[l+f];if(d<o&&o<=m)if(c===p)c+=1,u+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[u],i[u++]=y}var v=a[p];a[p]=a[c],a[c++]=v}}return c},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,h=e,f=t+e,p=r;n>p;++p,l+=s){var d=i[l+h],m=i[l+f];if(d<=o&&o<=m)if(c===p)c+=1,u+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[u],i[u++]=y}var v=a[p];a[p]=a[c],a[c++]=v}}return c},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,u=l*r,c=u,h=r,f=e,p=t+e,d=r;n>d;++d,u+=l){var m=i[u+f],g=i[u+p];if(!(m>=o||s>=g))if(h===d)h+=1,c+=l;else{for(var y=0;l>y;++y){var v=i[u+y];i[u+y]=i[c],i[c++]=v}var x=a[d];a[d]=a[h],a[h++]=x}}return h}}},4192:function(t){t.exports=function(t,n){n<=4*e?r(0,n-1,t):u(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(u<a)break;if(u===a&&c<o)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function n(t,e,r){e*=2;var n=r[t*=2],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function i(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function a(t,e,r,n){e*=2,r*=2;var i=n[t*=2],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function o(t,e,r,n,i){e*=2,i[t*=2]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function s(t,e,r){e*=2;var n=r[t*=2],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function l(t,e,r,n){var i=n[t*=2];return i<e||i===e&&n[t+1]<r}function u(t,c,h){var f=(c-t+1)/6|0,p=t+f,d=c-f,m=t+c>>1,g=m-f,y=m+f,v=p,x=g,_=m,b=y,w=d,T=t+1,k=c-1,A=0;s(v,x,h)&&(A=v,v=x,x=A),s(b,w,h)&&(A=b,b=w,w=A),s(v,_,h)&&(A=v,v=_,_=A),s(x,_,h)&&(A=x,x=_,_=A),s(v,b,h)&&(A=v,v=b,b=A),s(_,b,h)&&(A=_,_=b,b=A),s(x,w,h)&&(A=x,x=w,w=A),s(x,_,h)&&(A=x,x=_,_=A),s(b,w,h)&&(A=b,b=w,w=A);for(var M=h[2*x],S=h[2*x+1],E=h[2*b],C=h[2*b+1],I=2*v,L=2*_,P=2*w,z=2*p,O=2*m,D=2*d,R=0;R<2;++R){var F=h[I+R],B=h[L+R],N=h[P+R];h[z+R]=F,h[O+R]=B,h[D+R]=N}i(g,t,h),i(y,c,h);for(var j=T;j<=k;++j)if(l(j,M,S,h))j!==T&&n(j,T,h),++T;else if(!l(j,E,C,h))for(;;){if(l(k,E,C,h)){l(k,M,S,h)?(a(j,T,k,h),++T,--k):(n(j,k,h),--k);break}if(--k<j)break}o(t,T-1,M,S,h),o(c,k+1,E,C,h),T-2-t<=e?r(t,T-2,h):u(t,T-2,h),c-(k+2)<=e?r(k+2,c,h):u(k+2,c,h),k-T<=e?r(T,k,h):u(T,k,h)}},855:function(t,e,r){t.exports={init:function(t){var e=i.nextPow2(t);l.length<e&&(n.free(l),l=n.mallocInt32(e)),u.length<e&&(n.free(u),u=n.mallocInt32(e)),c.length<e&&(n.free(c),c=n.mallocInt32(e)),h.length<e&&(n.free(h),h=n.mallocInt32(e)),f.length<e&&(n.free(f),f=n.mallocInt32(e)),p.length<e&&(n.free(p),p=n.mallocInt32(e));var r=8*e;d.length<r&&(n.free(d),d=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,i,s,f,p,y,v){for(var x=0,_=2*t,b=t-1,w=_-1,T=r;T<n;++T){var k=s[T],A=_*T;d[x++]=i[A+b],d[x++]=-(k+1),d[x++]=i[A+w],d[x++]=k}for(T=f;T<p;++T){k=v[T]+o;var M=_*T;d[x++]=y[M+b],d[x++]=-k,d[x++]=y[M+w],d[x++]=k}var S=x>>>1;a(d,S);var E=0,C=0;for(T=0;T<S;++T){var I=0|d[2*T+1];if(I>=o)m(c,h,C--,I=I-o|0);else if(I>=0)m(l,u,E--,I);else if(I<=-o){I=-I-o|0;for(var L=0;L<E;++L)if(void 0!==(P=e(l[L],I)))return P;g(c,h,C++,I)}else{for(I=-I-1|0,L=0;L<C;++L){var P;if(void 0!==(P=e(I,c[L])))return P}g(l,u,E++,I)}}},sweepComplete:function(t,e,r,n,i,o,s,y,v,x){for(var _=0,b=2*t,w=t-1,T=b-1,k=r;k<n;++k){var A=o[k]+1<<1,M=b*k;d[_++]=i[M+w],d[_++]=-A,d[_++]=i[M+T],d[_++]=A}for(k=s;k<y;++k){A=x[k]+1<<1;var S=b*k;d[_++]=v[S+w],d[_++]=1|-A,d[_++]=v[S+T],d[_++]=1|A}var E=_>>>1;a(d,E);var C=0,I=0,L=0;for(k=0;k<E;++k){var P=0|d[2*k+1],z=1&P;if(k<E-1&&P>>1==d[2*k+3]>>1&&(z=2,k+=1),P<0){for(var O=-(P>>1)-1,D=0;D<L;++D)if(void 0!==(R=e(f[D],O)))return R;if(0!==z)for(D=0;D<C;++D)if(void 0!==(R=e(l[D],O)))return R;if(1!==z)for(D=0;D<I;++D){var R;if(void 0!==(R=e(c[D],O)))return R}0===z?g(l,u,C++,O):1===z?g(c,h,I++,O):2===z&&g(f,p,L++,O)}else O=(P>>1)-1,0===z?m(l,u,C--,O):1===z?m(c,h,I--,O):2===z&&m(f,p,L--,O)}},scanBipartite:function(t,e,r,n,i,s,c,h,f,p,y,v){var x=0,_=2*t,b=e,w=e+t,T=1,k=1;n?k=o:T=o;for(var A=i;A<s;++A){var M=A+T,S=_*A;d[x++]=c[S+b],d[x++]=-M,d[x++]=c[S+w],d[x++]=M}for(A=f;A<p;++A){M=A+k;var E=_*A;d[x++]=y[E+b],d[x++]=-M}var C=x>>>1;a(d,C);var I=0;for(A=0;A<C;++A){var L=0|d[2*A+1];if(L<0){var P=!1;if((M=-L)>=o?(P=!n,M-=o):(P=!!n,M-=1),P)g(l,u,I++,M);else{var z=v[M],O=_*M,D=y[O+e+1],R=y[O+e+1+t];t:for(var F=0;F<I;++F){var B=l[F],N=_*B;if(!(R<c[N+e+1]||c[N+e+1+t]<D)){for(var j=e+2;j<t;++j)if(y[O+j+t]<c[N+j]||c[N+j+t]<y[O+j])continue t;var U,V=h[B];if(void 0!==(U=n?r(z,V):r(V,z)))return U}}}}else m(l,u,I--,L-T)}},scanComplete:function(t,e,r,n,i,s,u,c,h,f,p){for(var m=0,g=2*t,y=e,v=e+t,x=n;x<i;++x){var _=x+o,b=g*x;d[m++]=s[b+y],d[m++]=-_,d[m++]=s[b+v],d[m++]=_}for(x=c;x<h;++x){_=x+1;var w=g*x;d[m++]=f[w+y],d[m++]=-_}var T=m>>>1;a(d,T);var k=0;for(x=0;x<T;++x){var A=0|d[2*x+1];if(A<0)if((_=-A)>=o)l[k++]=_-o;else{var M=p[_-=1],S=g*_,E=f[S+e+1],C=f[S+e+1+t];t:for(var I=0;I<k;++I){var L=l[I],P=u[L];if(P===M)break;var z=g*L;if(!(C<s[z+e+1]||s[z+e+1+t]<E)){for(var O=e+2;O<t;++O)if(f[S+O+t]<s[z+O]||s[z+O+t]<f[S+O])continue t;var D=r(P,M);if(void 0!==D)return D}}}else{for(_=A-o,I=k-1;I>=0;--I)if(l[I]===_){for(O=I+1;O<k;++O)l[O-1]=l[O];break}--k}}}};var n=r(1888),i=r(8828),a=r(4192),o=1<<28,s=1024,l=n.mallocInt32(s),u=n.mallocInt32(s),c=n.mallocInt32(s),h=n.mallocInt32(s),f=n.mallocInt32(s),p=n.mallocInt32(s),d=n.mallocDouble(8*s);function m(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function g(t,e,r,n){t[r]=n,e[n]=r}},2538:function(t,e,r){var n=r(8902),i=r(5542),a=r(2272),o=r(5023);function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}t.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),h=!!u(r,"interior",!0),f=!!u(r,"exterior",!0),p=!!u(r,"infinity",!1);if(!h&&!f||0===t.length)return[];var d=n(t,e);if(c||h!==f||p){for(var m=i(t.length,function(t){return t.map(s).sort(l)}(e)),g=0;g<d.length;++g){var y=d[g];m.addTriangle(y[0],y[1],y[2])}return c&&a(t,m),f?h?p?o(m,0,p):m.cells():o(m,1,p):o(m,-1)}return d}},2272:function(t,e,r){var n=r(2646)[4];function i(t,e,r,i,a,o){var s=e.opposite(i,a);if(!(s<0)){if(a<i){var l=i;i=a,a=l,l=o,o=s,s=l}e.isConstraint(i,a)||n(t[i],t[a],t[o],t[s])<0&&r.push(i,a)}}r(2478),t.exports=function(t,e){for(var r=[],a=t.length,o=e.stars,s=0;s<a;++s)for(var l=o[s],u=1;u<l.length;u+=2)if(!((p=l[u])<s||e.isConstraint(s,p))){for(var c=l[u-1],h=-1,f=1;f<l.length;f+=2)if(l[f-1]===p){h=l[f];break}h<0||n(t[s],t[p],t[c],t[h])<0&&r.push(s,p)}for(;r.length>0;){for(var p=r.pop(),d=(c=-1,h=-1,l=o[s=r.pop()],1);d<l.length;d+=2){var m=l[d-1],g=l[d];m===p?h=g:g===p&&(c=m)}c<0||h<0||n(t[s],t[p],t[c],t[h])>=0||(e.flip(s,p),i(t,e,r,c,s,h),i(t,e,r,s,h,c),i(t,e,r,h,p,c),i(t,e,r,p,c,h))}}},5023:function(t,e,r){var n,i=r(2478);function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i<n;++i){var s=(y=r[i])[0],l=y[1],u=y[2];l<u?l<s&&(y[0]=l,y[1]=u,y[2]=s):u<s&&(y[0]=u,y[1]=s,y[2]=l)}r.sort(o);var c=new Array(n);for(i=0;i<c.length;++i)c[i]=0;var h=[],f=[],p=new Array(3*n),d=new Array(3*n),m=null;e&&(m=[]);var g=new a(r,p,d,c,h,f,m);for(i=0;i<n;++i)for(var y=r[i],v=0;v<3;++v){s=y[v],l=y[(v+1)%3];var x=p[3*i+v]=g.locate(l,s,t.opposite(l,s)),_=d[3*i+v]=t.isConstraint(s,l);x<0&&(_?f.push(i):(h.push(i),c[i]=1),e&&m.push([l,s,-1]))}return g}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,u=n.flags,c=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var p=s.pop();if(u[p]!==-i){u[p]=i,c[p];for(var d=0;d<3;++d){var m=f[3*p+d];m>=0&&0===u[m]&&(h[3*p+d]?l.push(m):(s.push(m),u[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var y=function(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}(c,u,e);return r?y.concat(n.boundary):y},a.prototype.locate=(n=[0,0,0],function(t,e,r){var a=t,s=e,l=r;return e<r?e<t&&(a=e,s=r,l=t):r<t&&(a=r,s=t,l=e),a<0?-1:(n[0]=a,n[1]=s,n[2]=l,i.eq(this.cells,n,o))})},8902:function(t,e,r){var n=r(2478),i=r(3250)[3];function a(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function o(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function s(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||0!==t.type&&(r=i(t.a,t.b,e.b))?r:t.idx-e.idx}function l(t,e){return i(t.a,t.b,e)}function u(t,e,r,a,o){for(var s=n.lt(e,a,l),u=n.gt(e,a,l),c=s;c<u;++c){for(var h=e[c],f=h.lowerIds,p=f.length;p>1&&i(r[f[p-2]],r[f[p-1]],a)>0;)t.push([f[p-1],f[p-2],o]),p-=1;f.length=p,f.push(o);var d=h.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function c(t,e){return(t.a[0]<e.a[0]?i(t.a,t.b,e.a):i(e.b,e.a,t.a))||(e.b[0]<t.b[0]?i(t.a,t.b,e.b):i(e.b,e.a,t.b))||t.idx-e.idx}function h(t,e,r){var i=n.le(t,r,c),o=t[i],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],t.splice(i+1,0,new a(r.a,r.b,r.idx,[l],s))}function f(t,e,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(t,r,c),o=t[a];t[a-1].upperIds=o.upperIds,t.splice(a,1)}t.exports=function(t,e){for(var r=t.length,n=e.length,i=[],l=0;l<r;++l)i.push(new o(t[l],null,0,l));for(l=0;l<n;++l){var c=e[l],p=t[c[0]],d=t[c[1]];p[0]<d[0]?i.push(new o(p,d,2,l),new o(d,p,1,l)):p[0]>d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[])],y=[],v=(l=0,i.length);l<v;++l){var x=i[l],_=x.type;0===_?u(y,g,t,x.a,x.idx):2===_?h(g,0,x):f(g,0,x)}return y}},5542:function(t,e,r){var n=r(2478);function i(t,e){this.stars=t,this.edges=e}t.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new i(r,e)};var a=i.prototype;function o(t,e,r){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}a.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,i){return t[0]=Math.min(r,i),t[1]=Math.max(r,i),n.eq(this.edges,t,e)>=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},a.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},a.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},a.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},2419:function(t){t.exports=function(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}},3628:function(t,e,r){var n=r(1338),i=r(727);function a(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function o(t){var e=t.length;if(0===e)return[];t[0].length;var r=n([t.length+1,t.length+1],1),o=n([t.length+1],1);r[e][e]=0;for(var s=0;s<e;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*a(t[s],t[l]);o[s]=a(t[s],t[s])}var u=i(r,o),c=0,h=u[e+1];for(s=0;s<h.length;++s)c+=h[s];var f=new Array(e);for(s=0;s<e;++s){h=u[s];var p=0;for(l=0;l<h.length;++l)p+=h[l];f[s]=p/c}return f}function s(t){if(0===t.length)return[];for(var e=t[0].length,r=n([e]),i=o(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*i[a];return r}s.barycenetric=o,t.exports=s},6037:function(t,e,r){t.exports=function(t){for(var e=n(t),r=0,i=0;i<t.length;++i)for(var a=t[i],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)};var n=r(3628)},332:function(t,e,r){t.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}for(var s=function(t,e,r){var n=d(t,[],p(t));return y(e,n,r),!!n}(t,e,!!r);v(t,e,!!r);)s=!0;if(r&&s)for(n.length=0,r.length=0,a=0;a<e.length;++a)o=e[a],n.push([o[0],o[1]]),r.push(o[2]);return s};var n=r(1755),i=r(6867),a=r(1125),o=r(7842),s=r(1318),l=r(946),u=r(5838),c=r(1278),h=r(3637);function f(t){var e=l(t);return[c(e,-1/0),c(e,1/0)]}function p(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[c(n[0],-1/0),c(n[1],-1/0),c(n[0],1/0),c(n[1],1/0)]}return e}function d(t,e,r){for(var a=e.length,o=new n(a),s=[],l=0;l<e.length;++l){var u=e[l],h=f(u[0]),p=f(u[1]);s.push([c(h[0],-1/0),c(p[0],-1/0),c(h[1],1/0),c(p[1],1/0)])}i(s,function(t,e){o.link(t,e)});var d=!0,m=new Array(a);for(l=0;l<a;++l)(y=o.find(l))!==l&&(d=!1,t[y]=[Math.min(t[l][0],t[y][0]),Math.min(t[l][1],t[y][1])]);if(d)return null;var g=0;for(l=0;l<a;++l){var y;(y=o.find(l))===l?(m[l]=g,t[g++]=t[l]):m[l]=-1}for(t.length=g,l=0;l<a;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(t,e){return t[0]-e[0]||t[1]-e[1]}function g(t,e){return t[0]-e[0]||t[1]-e[1]||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function y(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=e[(o=t[n])[0]],a=e[o[1]];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}else for(n=0;n<t.length;++n){var o;i=(o=t[n])[0],a=o[1],o[0]=Math.min(i,a),o[1]=Math.max(i,a)}r?t.sort(g):t.sort(m);var s=1;for(n=1;n<t.length;++n){var l=t[n-1],u=t[n];u[0]===l[0]&&u[1]===l[1]&&(!r||u[2]===l[2])||(t[s++]=u)}t.length=s}}function v(t,e,r){var n=function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[c(Math.min(a[0],o[0]),-1/0),c(Math.min(a[1],o[1]),-1/0),c(Math.max(a[0],o[0]),1/0),c(Math.max(a[1],o[1]),1/0)]}return r}(t,e),f=function(t,e,r){var n=[];return i(r,function(r,i){var o=e[r],s=e[i];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],u=t[o[1]],c=t[s[0]],h=t[s[1]];a(l,u,c,h)&&n.push([r,i])}}),n}(t,e,n),m=function(t,e,r,n){var o=[];return i(r,n,function(r,n){var i=e[r];if(i[0]!==n&&i[1]!==n){var s=t[n],l=t[i[0]],u=t[i[1]];a(l,u,s,s)&&o.push([r,n])}}),o}(t,e,n,p(t)),g=function(t,e,r,n,i){var a,c,f=t.map(function(t){return[o(t[0]),o(t[1])]});for(a=0;a<r.length;++a){var p=r[a];c=p[0];var d=p[1],m=e[c],g=e[d],y=h(u(t[m[0]]),u(t[m[1]]),u(t[g[0]]),u(t[g[1]]));if(y){var v=t.length;t.push([l(y[0]),l(y[1])]),f.push(y),n.push([c,v],[d,v])}}for(n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=f[t[1]],n=f[e[1]];return s(r[0],n[0])||s(r[1],n[1])}),a=n.length-1;a>=0;--a){var x=e[c=(S=n[a])[0]],_=x[0],b=x[1],w=t[_],T=t[b];if((w[0]-T[0]||w[1]-T[1])<0){var k=_;_=b,b=k}x[0]=_;var A,M=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===c;){var S,E=(S=n[--a])[1];i?e.push([M,E,A]):e.push([M,E]),M=E}i?e.push([M,b,A]):e.push([M,b])}return f}(t,e,f,m,r),v=d(t,g);return y(e,v,r),!!v||f.length>0||m.length>0}},3637:function(t,e,r){t.exports=function(t,e,r,n){var a=s(e,t),h=s(n,r),f=c(a,h);if(0===o(f))return null;var p=s(t,r),d=c(h,p),m=i(d,f),g=u(a,m);return l(t,g)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),u=r(8987);function c(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){var n=r(3642),i=r(395);function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,u,c,h,f,p,d,m;if(t||(t={}),p=(t.nshades||72)-1,f=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");c=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);c=h.slice()}if(c.length>p+1)throw new Error(h+" map requires nshades to be at least size "+c.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=c.map(function(t){return Math.round(t.index*p)}),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=c.map(function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n}),y=[];for(m=0;m<e.length-1;++m){u=e[m+1]-e[m],r=g[m],l=g[m+1];for(var v=0;v<u;v++){var x=v/u;y.push([Math.round(i(r[0],l[0],x)),Math.round(i(r[1],l[1],x)),Math.round(i(r[2],l[2],x)),i(r[3],l[3],x)])}}return y.push(c[c.length-1].rgb.concat(d[1])),"hex"===f?y=y.map(o):"rgbaString"===f?y=y.map(s):"float"===f&&(y=y.map(a)),y}},3140:function(t,e,r){t.exports=function(t,e,r,a){var o=n(e,r,a);if(0===o){var s=i(n(t,e,r)),u=i(n(t,e,a));if(s===u){if(0===s){var c=l(t,e,r);return c===l(t,e,a)?0:c?1:-1}return 0}return 0===u?s>0||l(t,e,a)?-1:1:0===s?u>0||l(t,e,r)?1:-1:i(u-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),u=a(r[1],-e[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},8572:function(t){t.exports=function(t){return t<0?-1:t>0?1:0}},8507:function(t){t.exports=function(t,n){var i=t.length,a=t.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var o=t[0]+t[1],s=n[0]+n[1];if(a=o+t[2]-(s+n[2]))return a;var l=e(t[0],t[1]),u=e(n[0],n[1]);return e(l,t[2])-e(u,n[2])||e(l+t[2],o)-e(u+n[2],s);case 4:var c=t[0],h=t[1],f=t[2],p=t[3],d=n[0],m=n[1],g=n[2],y=n[3];return c+h+f+p-(d+m+g+y)||e(c,h,f,p)-e(d,m,g,y,d)||e(c+h,c+f,c+p,h+f,h+p,f+p)-e(d+m,d+g,d+y,m+g,m+y,g+y)||e(c+h+f,c+h+p,c+f+p,h+f+p)-e(d+m+g,d+m+y,d+g+y,m+g+y);default:for(var v=t.slice().sort(r),x=n.slice().sort(r),_=0;_<i;++_)if(a=v[_]-x[_])return a;return 0}};var e=Math.min;function r(t,e){return t-e}},3788:function(t,e,r){var n=r(8507),i=r(2419);t.exports=function(t,e){return n(t,e)||i(t)-i(e)}},7352:function(t,e,r){var n=r(5721),i=r(4750),a=r(2690);t.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?n(t):2===r?i(t):a(t,r)}},5721:function(t){t.exports=function(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}},4750:function(t,e,r){t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];i[o]=[a,s],a=s}return i};var n=r(3090)},2690:function(t,e,r){t.exports=function(t,e){try{return n(t,!0)}catch(o){var r=i(t);if(r.length<=e)return[];var a=function(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];var a=e.length;for(i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}(t,r);return function(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(t){t.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=u*t[p]+c*e[p]+h*r[p]+f*n[p];return a}return u*t+c*e+h*r+f*n},t.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}},7642:function(t,e,r){var n=r(8954),i=r(1682);function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}t.exports=function(t,e){var r=t.length;if(0===r)return[];var s=t[0].length;if(s<1)return[];if(1===s)return function(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}(r,t,e);for(var l=new Array(r),u=1,c=0;c<r;++c){for(var h=t[c],f=new Array(s+1),p=0,d=0;d<s;++d){var m=h[d];f[d]=m,p+=m*m}f[s]=p,l[c]=new a(f,c),u=Math.max(p,u)}i(l,o),r=l.length;var g=new Array(r+s+1),y=new Array(r+s+1),v=(s+1)*(s+1)*u,x=new Array(s+1);for(c=0;c<=s;++c)x[c]=0;for(x[s]=v,g[0]=x.slice(),y[0]=-1,c=0;c<=s;++c)(f=x.slice())[c]=1,g[c+1]=f,y[c+1]=-1;for(c=0;c<r;++c){var _=l[c];g[c+s+1]=_.point,y[c+s+1]=_.index}var b=n(g,!1);if(b=e?b.filter(function(t){for(var e=0,r=0;r<=s;++r){var n=y[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0}):b.filter(function(t){for(var e=0;e<=s;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(c=0;c<b.length;++c)f=(_=b[c])[0],_[0]=_[1],_[1]=f;return b}},2361:function(t){var e=!1;if("undefined"!=typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);if(r[0]=1,e=!0,1072693248===n[1]){let e=function(t,e){return n[0]=t,n[1]=e,r[0]},i=function(t){return r[0]=t,n[0]},a=function(t){return r[0]=t,n[1]};t.exports=function(t){return r[0]=t,[n[0],n[1]]},t.exports.pack=e,t.exports.lo=i,t.exports.hi=a}else if(1072693248===n[0]){let e=function(t,e){return n[1]=t,n[0]=e,r[0]},i=function(t){return r[0]=t,n[1]},a=function(t){return r[0]=t,n[0]};t.exports=function(t){return r[0]=t,[n[1],n[0]]},t.exports.pack=e,t.exports.lo=i,t.exports.hi=a}else e=!1}if(!e){let e=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},r=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},n=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)};var i=new Buffer(8);t.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},t.exports.pack=e,t.exports.lo=r,t.exports.hi=n}t.exports.sign=function(e){return t.exports.hi(e)>>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1048576),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},1338:function(t){function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a<i;++a)o[a]=r;else for(a=0;a<i;++a)o[a]=e(t,r,n+1);return o}t.exports=function(t,r){switch(void 0===r&&(r=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,r);break;case"object":if("number"==typeof t.length)return e(t,r,0)}return[]}},3134:function(t,e,r){t.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i<r;++i){var a=t[i];e=Math.max(e,a[0],a[1])}e=1+(0|e)}e|=0;var o=new Array(e);for(i=0;i<e;++i)o[i]=[];for(i=0;i<r;++i)o[(a=t[i])[0]].push(a[1]),o[a[1]].push(a[0]);for(var s=0;s<e;++s)n(o[s],function(t,e){return t-e});return o};var n=r(1682)},5033:function(t){t.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},9215:function(t,e,r){t.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"==typeof t?new o(n=l(t),n,0):new o(t,l(t.length),0);case 2:var n;if("number"==typeof e)return new o(t,n=l(t.length),+e);r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=r(4769),i=r(2478);function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}var s=o.prototype;function l(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}s.flush=function(t){var e=i.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},s.curve=function(t){var e=this._time,r=e.length,o=i.le(e,t),s=this._scratch[0],l=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(o<0)for(var f=c-1,p=0;p<c;++p,--f)s[p]=l[f];else if(o>=r-1){f=l.length-1;var d=t-e[r-1];for(p=0;p<c;++p,--f)s[p]=l[f]+d*u[f]}else{f=c*(o+1)-1;var m=e[o],g=e[o+1]-m||1,y=this._scratch[1],v=this._scratch[2],x=this._scratch[3],_=this._scratch[4],b=!0;for(p=0;p<c;++p,--f)y[p]=l[f],x[p]=u[f]*g,v[p]=l[f+c],_[p]=u[f+c]*g,b=b&&y[p]===v[p]&&x[p]===_[p]&&0===x[p];if(b)for(p=0;p<c;++p)s[p]=y[p];else n(y,x,v,_,(t-m)/g,s)}var w=h[0],T=h[1];for(p=0;p<c;++p)s[p]=a(w[p],T[p],s[p]);return s},s.dcurve=function(t){var e=this._time,r=e.length,a=i.le(e,t),o=this._scratch[0],s=this._state,l=this._velocity,u=this.dimension;if(a>=r-1)for(var c=s.length-1,h=(e[r-1],0);h<u;++h,--c)o[h]=l[c];else{c=u*(a+1)-1;var f=e[a],p=e[a+1]-f||1,d=this._scratch[1],m=this._scratch[2],g=this._scratch[3],y=this._scratch[4],v=!0;for(h=0;h<u;++h,--c)d[h]=s[c],g[h]=l[c]*p,m[h]=s[c+u],y[h]=l[c+u]*p,v=v&&d[h]===m[h]&&g[h]===y[h]&&0===g[h];if(v)for(h=0;h<u;++h)o[h]=0;else for(n.derivative(d,g,m,y,(t-f)/p,o),h=0;h<u;++h)o[h]/=p}return o},s.lastT=function(){var t=this._time;return t[t.length-1]},s.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;c<2;++c)for(var h=0;h<r;++h)n.push(n[o++]),i.push(0);for(this._time.push(t),h=r;h>0;--h)n.push(a(l[h-1],u[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var p=a(u[f-1],c[f-1],arguments[f]);n.push(p),i.push((p-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,n=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(t);for(var l=e;l>0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var p=arguments[f];n.push(a(l[f-1],u[f-1],n[o++]+p)),i.push(p*h)}}},s.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,n=this._state,i=this._velocity,o=n.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)n.push(a(l[h],u[h],n[o]+c*i[o])),i.push(0),o+=1}}},3840:function(t){function e(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function a(t,e){this._compare=t,this.root=e}t.exports=function(t){return new a(t||p,null)};var o=a.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function u(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);return o<=0&&(i.left&&(a=u(t,e,r,n,i.left))||s>0&&(a=n(i.key,i.value)))?a:s>0&&i.right?u(t,e,r,n,i.right):void 0}function c(t,e){this.tree=t,this._stack=e}Object.defineProperty(o,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(o,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(t,r){for(var o=this._compare,s=this.root,l=[],u=[];s;){var c=o(t,s.key);l.push(s),u.push(c),s=c<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],u[h]<=0?l[h]=new e(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new e(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var f=l[h-1];if(s=l[h],1===f._color||1===s._color)break;var p=l[h-2];if(p.left===f)if(f.left===s){if(!(d=p.right)||0!==d._color){p._color=0,p.left=f.right,f._color=1,f.right=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).left===p?m.left=f:m.right=f);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else{if(!(d=p.right)||0!==d._color){f.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=f,s.right=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).left===p?m.left=s:m.right=s);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else if(f.right===s){if(!(d=p.left)||0!==d._color){p._color=0,p.right=f.left,f._color=1,f.left=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).right===p?m.right=f:m.left=f);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;f.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=f,s.left=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).right===p?m.right=s:m.left=s);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:return this._compare(e,r)>=0?void 0:u(e,r,this._compare,t,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new c(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new c(this,t)}}),o.at=function(t){if(t<0)return new c(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new c(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new c(this,[])},o.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new c(this,n);r=i<=0?r.left:r.right}return new c(this,[])},o.remove=function(t){var e=this.find(t);return e?e.remove():this},o.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=c.prototype;function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return t<e?-1:t>e?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new c(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var o=new Array(t.length),s=t[t.length-1];o[o.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?o[l]=new e(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var u=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var c=o[u-1];for(o.push(new e(s._color,c.key,c.value,s.left,s.right,s._count)),o[u-1].key=s.key,o[u-1].value=s.value,l=o.length-2;l>=u;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[u-1].left=o[u]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l<o.length;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(s.left||s.right){for(s.left?f(s,s.left):s.right&&f(s,s.right),s._color=1,l=0;l<o.length-1;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(1===o.length)return new a(this.tree._compare,null);for(l=0;l<o.length;++l)o[l]._count--;var p=o[o.length-2];return function(t){for(var e,a,o,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=1);if((a=t[l-1]).left===e){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((u=t[l-2]).left===a?u.left=o:u.right=o),void(t[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((u=t[l-2]).left===a?u.left=s:u.right=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=t[l-2]).left===a?u.left=o:u.right=o),t[l-1]=o,t[l]=a,l+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if((o=a.left).left&&0===o.left._color)return s=(o=a.left=r(o)).left=r(o.left),a.left=o.right,o.right=a,o.left=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((u=t[l-2]).right===a?u.right=o:u.left=o),void(t[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((u=t[l-2]).right===a?u.right=s:u.left=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var u;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=t[l-2]).right===a?u.right=o:u.left=o),t[l-1]=o,t[l]=a,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}(o),p.left===s?p.left=null:p.right=null,new a(this.tree._compare,o[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new e(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new e(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},3837:function(t,e,r){t.exports=function(t,e){var r=new p(t);return r.update(e),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=ArrayBuffer,c=DataView;function h(t){return Array.isArray(t)||function(t){return u.isView(t)&&!(t instanceof c)}(t)}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var d=p.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),u=e.bind(this,!0,function(t){if(h(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),c=!1,f=!1;if("bounds"in t)for(var p=t.bounds,d=0;d<2;++d)for(var m=0;m<3;++m)p[d][m]!==this.bounds[d][m]&&(f=!0),this.bounds[d][m]=p[d][m];if("ticks"in t)for(r=t.ticks,c=!0,this.autoTicks=!1,d=0;d<3;++d)this.tickSpacing[d]=0;else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,c=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),l("tickFontStyle")&&(c=!0),l("tickFontWeight")&&(c=!0),l("tickFontVariant")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),u("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),u("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),u("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),u("lineTickColor"),o("gridEnable"),a("gridWidth"),u("gridColor"),o("zeroEnable"),u("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),u("backgroundColor");var y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],v=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||c)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var h=a,f=s,p=o,d=l;u&1<<c&&(h=s,f=a,p=l,d=o),h[c]=r[0][c],f[c]=r[1][c],i[c]>0?(p[c]=-1,d[c]=0):(p[c]=0,d[c]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var _=[0,0,0],b=[0,0,0],w=[0,0,0];d.draw=function(t){t=t||x;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),c=u.cubeEdges,h=u.axis,p=n[12],d=n[13],m=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*p+i[7]*d+i[11]*m+i[15]*T)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=c[A],this.lastCubeProps.axis[A]=h[A];var M=g;for(A=0;A<3;++A)y(g[A],A,this.bounds,c,h);e=this.gl;var S,E,C,I=v;for(A=0;A<3;++A)this.backgroundEnable[A]?I[A]=h[A]:I[A]=0;for(this._background.draw(r,n,i,a,I,this.backgroundColor),this._lines.bind(r,n,i,this),A=0;A<3;++A){var L=[0,0,0];h[A]>0?L[A]=a[1][A]:L[A]=a[0][A];for(var P=0;P<2;++P){var z=(A+1+P)%3,O=(A+1+(1^P))%3;this.gridEnable[z]&&this._lines.drawGrid(z,O,this.bounds,L,this.gridColor[z],this.gridWidth[z]*this.pixelRatio)}for(P=0;P<2;++P)z=(A+1+P)%3,O=(A+1+(1^P))%3,this.zeroEnable[O]&&Math.min(a[0][O],a[1][O])<=0&&Math.max(a[0][O],a[1][O])>=0&&this._lines.drawZero(z,O,this.bounds,L,this.zeroLineColor[O],this.zeroLineWidth[O]*this.pixelRatio)}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var D=f(_,M[A].primalMinor),R=f(b,M[A].mirrorMinor),F=this.lineTickLength;for(P=0;P<3;++P){var B=k/r[5*P];D[P]*=F[P]*B,R[P]*=F[P]*B}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,D,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,R,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}function N(t){(C=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),A=0;A<3;++A){var U=M[A].primalMinor,V=M[A].mirrorMinor,q=f(w,M[A].primalOffset);for(P=0;P<3;++P)this.lineTickEnable[A]&&(q[P]+=k*U[P]*Math.max(this.lineTickLength[P],0)/r[5*P]);var H=[0,0,0];if(H[A]=1,this.tickEnable[A]){for(-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,E=1,"auto"===(S=[this.tickAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),C=[0,0,0],j(A,U,V),P=0;P<3;++P)q[P]+=k*U[P]*this.tickPad[P]/r[5*P];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],q,this.tickColor[A],H,C,S)}if(this.labelEnable[A]){for(E=0,C=[0,0,0],this.labels[A].length>4&&(N(A),E=1),"auto"===(S=[this.labelAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),P=0;P<3;++P)q[P]+=k*U[P]*this.labelPad[P]/r[5*P];q[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],q,this.labelColor[A],[0,0,0],C,S)}}this._text.unbind()},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(t,e,r){t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,f[l]=p;for(var d=-1;d<=1;d+=2){h[u]=d;for(var m=-1;m<=1;m+=2)h[c]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=u;u=c,c=g}var y=n(t,new Float32Array(e)),v=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:y,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:t.FLOAT,size:3,offset:12,stride:24}],v),_=a(t);return _.attributes.position.location=0,_.attributes.normal.location=1,new o(t,y,x,_)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(t,e,r){t.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var v=0,x=0;x<2;++x){c[2]=a[x][2];for(var _=0;_<2;++_){c[1]=a[_][1];for(var b=0;b<2;++b)c[0]=a[b][0],f(l[v],c,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)u[x][k]=l[x][k]/T;p&&(u[x][2]*=-1),T<0&&(w<0||u[x][2]<u[w][2])&&(w=x)}if(w<0){w=0;for(var A=0;A<3;++A){for(var M=(A+2)%3,S=(A+1)%3,E=-1,C=-1,I=0;I<2;++I){var L=(z=I<<A)+(I<<M)+(1-I<<S),P=z+(1-I<<M)+(I<<S);o(u[z],u[L],u[P],h)<0||(I?E=1:C=1)}if(E<0||C<0)C>E&&(w|=1<<A);else{for(I=0;I<2;++I){L=(z=I<<A)+(I<<M)+(1-I<<S),P=z+(1-I<<M)+(I<<S);var z,O=d([l[z],l[L],l[P],l[z+(1<<M)+(1<<S)]]);I?E=O:C=O}C>E&&(w|=1<<A)}}}var D=7^w,R=-1;for(x=0;x<8;++x)x===w||x===D||(R<0||u[R][1]>u[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(N=R^1<<x)!==w&&N!==D&&(F<0&&(F=N),(S=u[N])[0]<u[F][0]&&(F=N));var B=-1;for(x=0;x<3;++x){var N;(N=R^1<<x)!==w&&N!==D&&N!==F&&(B<0&&(B=N),(S=u[N])[0]>u[B][0]&&(B=N))}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var U=7^B;U===w||U===D?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var V=g,q=w;for(A=0;A<3;++A)V[A]=q&1<<A?-1:1;return y};var n=r(8828),i=r(6760),a=r(5202),o=r(3250),s=new Array(16),l=new Array(8),u=new Array(8),c=new Array(3),h=[0,0,0];function f(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}!function(){for(var t=0;t<8;++t)l[t]=[1,1,1,1],u[t]=[1,1,1]}();var p=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function d(t){for(var e=0;e<p.length;++e)if((t=a.positive(t,p[e])).length<3)return 0;var r=t[0],n=r[0]/r[3],i=r[1]/r[3],o=0;for(e=1;e+1<t.length;++e){var s=t[e],l=t[e+1],u=s[0]/s[3]-n,c=s[1]/s[3]-i,h=l[0]/l[3]-n,f=l[1]/l[3]-i;o+=Math.abs(u*f-c*h)}return o}var m=[1,1,1],g=[0,0,0],y={cubeEdges:m,axis:g}},501:function(t,e,r){t.exports=function(t,e,r){var o=[],s=[0,0,0],l=[0,0,0],u=[0,0,0],c=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;h<3;++h){for(var f=o.length/3|0,d=0;d<r[h].length;++d){var m=+r[h][d].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=o.length/3|0;s[h]=f,l[h]=g-f,f=o.length/3|0;for(var y=0;y<r[h].length;++y)m=+r[h][y].x,o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1);g=o.length/3|0,u[h]=f,c[h]=g-f}var v=n(t,new Float32Array(o)),x=i(t,[{buffer:v,type:t.FLOAT,size:3,stride:0,offset:0}]),_=a(t);return _.attributes.position.location=0,new p(t,v,x,_,l,s,c,u)};var n=r(2762),i=r(8116),a=r(1879).n,o=[0,0,0],s=[0,0,0],l=[0,0,0],u=[0,0,0],c=[1,1];function h(t){return t[0]=t[1]=t[2]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}var d=p.prototype;d.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,c[0]=this.gl.drawingBufferWidth,c[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=c,this.vao.bind()},d.unbind=function(){this.vao.unbind()},d.drawAxisLine=function(t,e,r,n,i){var a=h(s);this.shader.uniforms.majorAxis=s,a[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=a;var o,c=f(u,r);c[t]+=e[0][t],this.shader.uniforms.offset=c,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=n,(o=h(l))[(t+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=h(l))[(t+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},d.drawAxisTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=h(o);a[t]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=i;var s=h(l);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},d.drawGrid=function(t,e,r,n,i,a){if(this.gridCount[t]){var c=h(s);c[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=c;var p=f(u,n);p[e]+=r[0][e],this.shader.uniforms.offset=p;var d=h(o);d[t]=1,this.shader.uniforms.majorAxis=d;var m=h(l);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},d.drawZero=function(t,e,r,n,i,a){var o=h(s);this.shader.uniforms.majorAxis=o,o[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=o;var c=f(u,n);c[t]+=r[0][t],this.shader.uniforms.offset=c;var p=h(l);p[e]=1,this.shader.uniforms.screenAxis=p,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,6)},d.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},1879:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.n=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"}])};var s=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis, alignDir, alignOpt;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nfloat computeViewAngle(vec3 a, vec3 b) {\n vec3 A = project(a);\n vec3 B = project(b);\n\n return atan(\n (B.y - A.y) * resolution.y,\n (B.x - A.x) * resolution.x\n );\n}\n\nconst float PI = 3.141592;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst float ONE_AND_HALF_PI = 1.5 * PI;\n\nint option = int(floor(alignOpt.x + 0.001));\nfloat hv_ratio = alignOpt.y;\nbool enableAlign = (alignOpt.z != 0.0);\n\nfloat mod_angle(float a) {\n return mod(a, PI);\n}\n\nfloat positive_angle(float a) {\n return mod_angle((a < 0.0) ?\n a + TWO_PI :\n a\n );\n}\n\nfloat look_upwards(float a) {\n float b = positive_angle(a);\n return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.Q=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){t.exports=function(t,e,r,a,s,l){var c=n(t),h=i(t,[{buffer:c,size:3}]),f=o(t);f.attributes.position.location=0;var p=new u(t,f,c,h);return p.update(e,r,a,s,l),p};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||process.global||{},l=s.__TEXT_CACHE||{};function u(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var c=u.prototype,h=[0,0];c.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var u=[r.style,r.weight,r.variant,r.family].join("_"),c=l[u];c||(c=l[u]={});var h=c[e];h||(h=c[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,p=h.positions,d=h.cells,m=0,g=d.length;m<g;++m)for(var y=d[m],v=2;v>=0;--v){var x=p[y[v]];o.push(f*x[0],-f*x[1],t)}}for(var u=[0,0,0],c=[0,0,0],h=[0,0,0],f=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){h[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),f[d]=(o.length/3|0)-h[d],u[d]=o.length/3|0;for(var m=0;m<n[d].length;++m)if(n[d][m].text){var g={family:n[d][m].font||i[d].family,style:i[d].fontStyle||i[d].style,weight:i[d].fontWeight||i[d].weight,variant:i[d].fontVariant||i[d].variant};s(n[d][m].x,n[d][m].text,g,n[d][m].fontSize||12,1.25,p)}c[d]=(o.length/3|0)-u[d]}this.buffer.update(o),this.tickOffset=u,this.tickCount=c,this.labelOffset=h,this.labelCount=f},c.drawTicks=function(t,e,r,n,i,a,o,s){this.tickCount[t]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t]))},c.drawLabel=function(t,e,r,n,i,a,o,s){this.labelCount[t]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},c.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}},6444:function(t,e){function r(t,e){var r=t+"",n=r.indexOf("."),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var h=""+u;h.length<i;)h="0"+h;return c+"."+h}return c}e.create=function(t,e){for(var n=[],i=0;i<3;++i){for(var a=[],o=(t[0][i],t[1][i],0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:r(e[i],o)});for(o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:r(e[i],o)});n.push(a)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}},5445:function(t,e,r){t.exports=function(t,e,r,l,h){var f=e.model||u,p=e.view||u,y=e.projection||u,v=e._ortho||!1,x=t.bounds,_=(h=h||a(f,p,y,x,v)).axis;o(c,p,f),o(c,y,c);for(var b=m,w=0;w<3;++w)b[w].lo=1/0,b[w].hi=-1/0,b[w].pixelsPerDataUnit=1/0;var T=n(s(c,c));s(c,c);for(var k=0;k<3;++k){var A=(k+1)%3,M=(k+2)%3,S=g;t:for(w=0;w<2;++w){var E=[];if(_[k]<0!=!!w){S[k]=x[w][k];for(var C=0;C<2;++C){S[A]=x[C^w][A];for(var I=0;I<2;++I)S[M]=x[I^C^w][M],E.push(S.slice())}var L=v?5:4;for(C=L;C===L;++C){if(0===E.length)continue t;E=i.positive(E,T[C])}for(C=0;C<E.length;++C){M=E[C];var P=d(g,c,M,r,l);for(I=0;I<3;++I)b[I].lo=Math.min(b[I].lo,M[I]),b[I].hi=Math.max(b[I].hi,M[I]),I!==k&&(b[I].pixelsPerDataUnit=Math.min(b[I].pixelsPerDataUnit,Math.abs(P[I])))}}}}return b};var n=r(5033),i=r(5202),a=r(6429),o=r(6760),s=r(5665),l=r(5352),u=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=new Float32Array(16);function h(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}var f=[0,0,0,1],p=[0,0,0,1];function d(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=f,s=p,u=0;u<3;++u)s[u]=o[u]=r[u];s[3]=o[3]=1,s[a]+=1,l(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,l(o,o,e),o[3]<0&&(t[a]=1/0);var c=(o[0]/o[3]-s[0]/s[3])*n,h=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(c*c+h*h)}return t}var m=[new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0)],g=[0,0,0]},2762:function(t,e,r){var n=r(1888),i=r(5298),a=r(9618),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}var l=s.prototype;function u(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function c(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a<i;++a)r[a]=t[a];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"),r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},6405:function(t,e,r){var n=r(2931);t.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,h=1/0,f=-1/0,p=null,d=null,m=[],g=1/0,y=!1,v="raw"===t.coneSizemode,x=0;x<r.length;x++){var _=r[x];s=Math.min(_[0],s),l=Math.max(_[0],l),u=Math.min(_[1],u),c=Math.max(_[1],c),h=Math.min(_[2],h),f=Math.max(_[2],f);var b=i[x];if(n.length(b)>o&&(o=n.length(b)),x&&!v){var w=2*n.distance(p,_)/(n.length(d)+n.length(b));w?(g=Math.min(g,w),y=!1):y=!0}y||(p=_,d=b),m.push(b)}var T=[s,u,h],k=[l,c,f];e&&(e[0]=T,e[1]=k),0===o&&(o=1);var A=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=t.coneSize||(v?1:.5);t.absoluteConeSize&&(M=t.absoluteConeSize*A),a.coneScale=M,x=0;for(var S=0;x<r.length;x++)for(var E=(_=r[x])[0],C=_[1],I=_[2],L=m[x],P=n.length(L)*A,z=0;z<8;z++){a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vertexIntensity.push(P,P,P),a.vertexIntensity.push(P,P,P);var O=a.positions.length;a.cells.push([O-6,O-5,O-4],[O-3,O-2,O-1])}return a};var i=r(614);t.exports.createMesh=r(9060),t.exports.createConeMesh=function(e,r){return t.exports.createMesh(e,r,{shaders:i,traceType:"cone"})}},9060:function(t,e,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(6760),l=r(7608),u=r(9618),c=r(6729),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(t,e,r,n,i,a,o,s,l,u,c){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=u,this.triangleCount=0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.traceType=c,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=h,this._view=h,this._projection=h,this._resolution=[1,1]}var p=f.prototype;p.isOpaque=function(){return this.opacity>=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=c({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return u(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var f=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g<p.length;++g){var y=p[g];d=Math.min(d,y),m=Math.max(m,y)}else for(g=0;g<n.length;++g)y=n[g][2],d=Math.min(d,y),m=Math.max(m,y);for(this.intensity=p||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=0;g<n.length;++g)for(var v=n[g],x=0;x<3;++x)isNaN(v[x])||!isFinite(v[x])||(this.bounds[0][x]=Math.min(this.bounds[0][x],v[x]),this.bounds[1][x]=Math.max(this.bounds[1][x],v[x]));var _=0;t:for(g=0;g<r.length;++g){var b=r[g];if(3===b.length){for(x=0;x<3;++x){v=n[T=b[x]];for(var w=0;w<3;++w)if(isNaN(v[w])||!isFinite(v[w]))continue t}for(x=0;x<3;++x){var T;v=n[T=b[2-x]],a.push(v[0],v[1],v[2],v[3]);var k=i[T];o.push(k[0],k[1],k[2],k[3]||0);var A,M=f;3===M.length?s.push(M[0],M[1],M[2],1):s.push(M[0],M[1],M[2],M[3]),A=p?[(p[T]-d)/(m-d),0]:[(v[2]-d)/(m-d),0],l.push(A[0],A[1]),h.push(g)}_+=1}}this.triangleCount=_,this.trianglePositions.update(a),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(l),this.triangleIds.update(new Uint32Array(h))}},p.drawTransparent=p.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var u={model:r,view:n,projection:i,inverseModel:h.slice(),clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};u.inverseModel=l(u.inverseModel,u.model),e.disable(e.CULL_FACE),this.texture.bind(0);var c=new Array(16);for(s(c,u.view,u.model),s(c,u.projection,c),l(c,c),o=0;o<3;++o)u.eyePosition[o]=c[12+o]/c[15];var f=c[15];for(o=0;o<3;++o)f+=this.lightPosition[o]*c[4*o+3];for(o=0;o<3;++o){for(var p=c[12+o],d=0;d<3;++d)p+=c[4*d+o]*this.lightPosition[d];u.lightPosition[o]=p/f}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=u,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t||t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),c=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),h=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=t.LINEAR_MIPMAP_LINEAR,h.magFilter=t.LINEAR;var p=i(t),d=i(t),m=i(t),g=i(t),y=i(t),v=new f(t,h,l,c,p,d,y,m,g,a(t,[{buffer:p,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),r.traceType||"cone");return v.update(e),v}},614:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var n=r(737);t.exports=function(t){return n[t]}},9165:function(t,e,r){t.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*c,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function h(t,e,r,n){for(var i=c[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}l.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var i=[],a=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;t:for(var l=0;l<a;++l){for(var c=r[l],f=0;f<3;++f)if(isNaN(c[f])||!isFinite(c[f]))continue t;var p,d=n[l],m=e[s];Array.isArray(m[0])&&(m=e[l]),3===m.length?m=[m[0],m[1],m[2],1]:4===m.length&&(m=[m[0],m[1],m[2],m[3]],!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0)),isNaN(d[0][s])||isNaN(d[1][s])||(d[0][s]<0&&((p=c.slice())[s]+=d[0][s],i.push(c[0],c[1],c[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),u(this.bounds,p),o+=2+h(i,p,m,s)),d[1][s]>0&&((p=c.slice())[s]+=d[1][s],i.push(c[0],c[1],c[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),u(this.bounds,p),o+=2+h(i,p,m,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){var n=r(7766);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(a=n;a<r;++a)i[a]=t.NONE;l[n]=i}}(t,u),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),"number"!=typeof e)throw new Error("gl-fbo: Missing shape parameter");var c=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>c||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var f=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");f=t.FLOAT}else n.preferFloat&&h>0&&p&&(f=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(t,e,r,f,h,m,g,u)};var i,a,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d<i;++d)this.color[d]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var m=this,g=[0|e,0|r];Object.defineProperties(g,{0:{get:function(){return m._shape[0]},set:function(t){return m.width=t}},1:{get:function(){return m._shape[1]},set:function(t){return m.height=t}}}),this._shapeVector=g,function(t){var e=u(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),i=t._shape[0],a=t._shape[1],o=t.color.length,s=t._ext,d=t._useStencil,m=t._useDepth,g=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var y=0;y<o;++y)t.color[y]=f(r,i,a,g,r.RGBA,r.COLOR_ATTACHMENT0+y);0===o?(t._color_rb=p(r,i,a,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?d?t.depth=f(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=f(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),y=0;y<t.color.length;++y)t.color[y].dispose(),t.color[y]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),c(r,e),h(x)}c(r,e)}(this)}var m=d.prototype;function g(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var n=t.gl,i=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=u(n),o=0;o<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),c(n,a),h(s)),c(n,a)}}Object.defineProperties(m,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return g(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return g(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,g(this,this._shape[0],t),t},enumerable:!1}}),m.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},m.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},2992:function(t,e,r){var n=r(3387).sprintf,i=r(5171),a=r(1848),o=r(1085);t.exports=function(t,e,r){var s=a(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===i.FRAGMENT_SHADER?"fragment":"vertex");for(var u=n("Error compiling %s shader %s:\n",l,s),c=n("%s%s",u,t),h=t.split("\n"),f={},p=0;p<h.length;p++){var d=h[p];if(""!==d&&"\0"!==d){var m=parseInt(d.split(":")[2]);if(isNaN(m))throw new Error(n("Could not parse error: %s",d));f[m]=d}}var g=o(e).split("\n");for(p=0;p<g.length;p++)if((f[p+3]||f[p+2]||f[p+1])&&(u+=g[p]+"\n",f[p+1])){var y=f[p+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),u+=n("^^^ %s\n\n",y)}return{long:u.trim(),short:c.trim()}}},7319:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,a,o,null,l)},e.createPickShader=function(t){return i(t,a,s,null,l)}},5714:function(t,e,r){t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(new Array(1024),[256,1,4]),p=0;p<1024;++p)c.data[p]=255;var d=a(e,c);d.wrap=e.REPEAT;var m=new y(e,r,o,s,l,d);return m.update(t),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),u=r(9618),c=r(7319),h=c.createShader,f=c.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function y(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],f=t.position||t.positions;if(f){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e<f.length;++e){var y,v,x,_=f[e-1],b=f[e];for(a.push(s),o.push(_.slice()),r=0;r<3;++r){if(isNaN(_[r])||isNaN(b[r])||!isFinite(_[r])||!isFinite(b[r])){if(!n&&i.length>0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],_[r],b[r]),h[1][r]=Math.max(h[1][r],_[r],b[r])}Array.isArray(p[0])?(y=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],v=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):y=v=p,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(_,b),g){for(r=0;r<2;++r)i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3]);c+=2,g=!1}i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],T,-x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],s,-x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],s,x,v[0],v[1],v[2],v[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(f[f.length-1].slice()),this.bounds=h,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var A=u(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)A.set(e,0,r,0);1&l.le(k,k[k.length-1]*e/255)?A.set(e,0,0,0):A.set(e,0,0,255)}this.texture.setPixels(A)}},v.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},v.pick=function(t){if(!t||t.id!==this.pickId)return null;var e=function(t,e,r,n){return o[0]=n,o[1]=r,o[2]=e,o[3]=t,s[0]}(t.value[0],t.value[1],t.value[2],0),r=l.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new g(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],a=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),u=1-a,c=[0,0,0],h=0;h<3;++h)c[h]=u*n[h]+a*i[h];var f=Math.min(a<.5?r:r+1,this.points.length-1);return new g(e,c,f,this.points[f])}},1903:function(t){t.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},6864:function(t){t.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},9921:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],p=t[12],d=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-f*m)-(e*s-n*a)*(c*g-f*d)+(e*l-i*a)*(c*m-h*d)+(r*s-n*o)*(u*g-f*p)-(r*l-i*o)*(u*m-h*p)+(n*l-i*s)*(u*d-c*p)}},7399:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,p=i*s,d=i*l,m=a*o,g=a*s,y=a*l;return t[0]=1-h-d,t[1]=c+y,t[2]=f-g,t[3]=0,t[4]=c-y,t[5]=1-u-d,t[6]=p+m,t[7]=0,t[8]=f+g,t[9]=p-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},6743:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,p=i*l,d=i*u,m=a*u,g=o*s,y=o*l,v=o*u;return t[0]=1-(p+m),t[1]=h+v,t[2]=f-y,t[3]=0,t[4]=h-v,t[5]=1-(c+m),t[6]=d+g,t[7]=0,t[8]=f+y,t[9]=d-g,t[10]=1-(c+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},7894:function(t){t.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},7608:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,_=r*u-a*o,b=n*l-i*s,w=n*u-a*s,T=i*u-a*l,k=c*m-h*d,A=c*g-f*d,M=c*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(I=1/I,t[0]=(s*C-l*E+u*S)*I,t[1]=(i*E-n*C-a*S)*I,t[2]=(m*T-g*w+y*b)*I,t[3]=(f*w-h*T-p*b)*I,t[4]=(l*M-o*C-u*A)*I,t[5]=(r*C-i*M+a*A)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(c*T-f*_+p*x)*I,t[8]=(o*E-s*M+u*k)*I,t[9]=(n*M-r*E-a*k)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-c*w-p*v)*I,t[12]=(s*A-o*S-l*k)*I,t[13]=(r*S-n*A+i*k)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(c*b-h*x+f*v)*I,t):null}},6582:function(t,e,r){var n=r(7894);t.exports=function(t,e,r,i){var a,o,s,l,u,c,h,f,p,d,m=e[0],g=e[1],y=e[2],v=i[0],x=i[1],_=i[2],b=r[0],w=r[1],T=r[2];return Math.abs(m-b)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-T)<1e-6?n(t):(h=m-b,f=g-w,p=y-T,d=1/Math.sqrt(h*h+f*f+p*p),a=x*(p*=d)-_*(f*=d),o=_*(h*=d)-v*p,s=v*f-x*h,(d=Math.sqrt(a*a+o*o+s*s))?(a*=d=1/d,o*=d,s*=d):(a=0,o=0,s=0),l=f*s-p*o,u=p*a-h*s,c=h*o-f*a,(d=Math.sqrt(l*l+u*u+c*c))?(l*=d=1/d,u*=d,c*=d):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=p,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(l*m+u*g+c*y),t[14]=-(h*m+f*g+p*y),t[15]=1,t)}},6760:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*h+w*m,t[1]=x*i+_*l+b*f+w*g,t[2]=x*a+_*u+b*p+w*y,t[3]=x*o+_*c+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],t[4]=x*n+_*s+b*h+w*m,t[5]=x*i+_*l+b*f+w*g,t[6]=x*a+_*u+b*p+w*y,t[7]=x*o+_*c+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],t[8]=x*n+_*s+b*h+w*m,t[9]=x*i+_*l+b*f+w*g,t[10]=x*a+_*u+b*p+w*y,t[11]=x*o+_*c+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],t[12]=x*n+_*s+b*h+w*m,t[13]=x*i+_*l+b*f+w*g,t[14]=x*a+_*u+b*p+w*y,t[15]=x*o+_*c+b*d+w*v,t}},4040:function(t){t.exports=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t}},4772:function(t){t.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}},6079:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E=n[0],C=n[1],I=n[2],L=Math.sqrt(E*E+C*C+I*I);return Math.abs(L)<1e-6?null:(E*=L=1/L,C*=L,I*=L,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],f=e[5],p=e[6],d=e[7],m=e[8],g=e[9],y=e[10],v=e[11],x=E*E*o+a,_=C*E*o+I*i,b=I*E*o-C*i,w=E*C*o-I*i,T=C*C*o+a,k=I*C*o+E*i,A=E*I*o+C*i,M=C*I*o-E*i,S=I*I*o+a,t[0]=s*x+h*_+m*b,t[1]=l*x+f*_+g*b,t[2]=u*x+p*_+y*b,t[3]=c*x+d*_+v*b,t[4]=s*w+h*T+m*k,t[5]=l*w+f*T+g*k,t[6]=u*w+p*T+y*k,t[7]=c*w+d*T+v*k,t[8]=s*A+h*M+m*S,t[9]=l*A+f*M+g*S,t[10]=u*A+p*M+y*S,t[11]=c*A+d*M+v*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}},5567:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}},2408:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}},7089:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}},2504:function(t){t.exports=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},7656:function(t){t.exports=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,p,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+f*y+e[13],t[14]=a*m+u*g+p*y+e[14],t[15]=o*m+c*g+d*y+e[15]),t}},5665:function(t){t.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},7626:function(t,e,r){var n=r(2642),i=r(9346);function a(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function o(t,e,r,n,i){for(var o=a(n,a(r,a(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*i[0]*(1+o[0]),.5*i[1]*(1-o[1])]}function s(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}t.exports=function(t,e,r,a,l,u){if(1===t.length)return[0,t[0].slice()];for(var c=new Array(t.length),h=0;h<t.length;++h)c[h]=o(t[h],r,a,l,u);var f=0,p=1/0;for(h=0;h<c.length;++h){for(var d=0,m=0;m<2;++m)d+=Math.pow(c[h][m]-e[m],2);d<p&&(p=d,f=h)}var g=function(t,e){if(2===t.length){for(var r=0,a=0,o=0;o<2;++o)r+=Math.pow(e[o]-t[0][o],2),a+=Math.pow(e[o]-t[1][o],2);return(r=Math.sqrt(r))+(a=Math.sqrt(a))<1e-6?[1,0]:[a/(r+a),r/(a+r)]}if(3===t.length){var s=[0,0];return i(t[0],t[1],t[2],e,s),n(t,s)}return[]}(c,e),y=0;for(h=0;h<3;++h){if(g[h]<-.001||g[h]>1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[f,s(t,g),g]}},840:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:c,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),u=r(7608),c=r(9618),h=r(6729),f=r(7765),p=r(1888),d=r(840),m=r(7626),g=d.meshShader,y=d.wireShader,v=d.pointShader,x=d.pickShader,_=d.pointPickShader,b=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,T,k,A,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=b,this.pointUVs=T,this.pointSizes=k,this.pointIds=_,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function A(t,e){if(!e||!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var d=n[h][0],m=n[h][1],g=i[h],y=1-g,v=this.positions[d],x=this.positions[m],_=0;_<3;++_)o[s++]=g*v[_]+y*x[_]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),p.free(o)}else this.contourCount=0},k.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"contourEnable"in t&&(this.contourEnable=t.contourEnable),"contourColor"in t&&(this.contourColor=t.contourColor),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"lightPosition"in t&&(this.lightPosition=t.lightPosition),this.hasAlpha=!1,"opacity"in t&&(this.opacity=t.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in t&&(this.opacityscale=t.opacityscale,this.hasAlpha=!0),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=o(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t,e){for(var r=h({colormap:t,nshades:256,format:"rgba"}),n=new Uint8Array(1024),i=0;i<256;++i){for(var a=r[i],o=0;o<3;++o)n[4*i+o]=a[o];n[4*i+3]=e?255*A(i/255,e):255*a[3]}return c(n,[256,256,4],[4,0,1])}(t.colormap,this.opacityscale)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var i=[],a=[],l=[],u=[],f=[],p=[],d=[],m=[],g=[],y=[],v=[],x=[],_=[],b=[];this.cells=r,this.positions=n;var w=t.vertexNormals,T=t.cellNormals,k=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,M=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=s.faceNormals(r,n,M)),!T&&!w&&(w=s.vertexNormals(r,n,k));var S=t.vertexColors,E=t.cellColors,C=t.meshColor||[1,1,1,1],I=t.vertexUVs,L=t.vertexIntensity,P=t.cellUVs,z=t.cellIntensity,O=1/0,D=-1/0;if(!I&&!P)if(L)if(t.vertexIntensityBounds)O=+t.vertexIntensityBounds[0],D=+t.vertexIntensityBounds[1];else for(var R=0;R<L.length;++R){var F=L[R];O=Math.min(O,F),D=Math.max(D,F)}else if(z)if(t.cellIntensityBounds)O=+t.cellIntensityBounds[0],D=+t.cellIntensityBounds[1];else for(R=0;R<z.length;++R)F=z[R],O=Math.min(O,F),D=Math.max(D,F);else for(R=0;R<n.length;++R)F=n[R][2],O=Math.min(O,F),D=Math.max(D,F);this.intensity=L||z||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n),this.pickVertex=!(z||E);var B=t.pointSizes,N=t.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],R=0;R<n.length;++R)for(var j=n[R],U=0;U<3;++U)isNaN(j[U])||!isFinite(j[U])||(this.bounds[0][U]=Math.min(this.bounds[0][U],j[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],j[U]));var V=0,q=0,H=0;t:for(R=0;R<r.length;++R){var G=r[R];switch(G.length){case 1:for(j=n[W=G[0]],U=0;U<3;++U)if(isNaN(j[U])||!isFinite(j[U]))continue t;y.push(j[0],j[1],j[2]),Y=S?S[W]:E?E[R]:C,this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*A((L[W]-O)/(D-O),this.opacityscale)):3===Y.length?v.push(Y[0],Y[1],Y[2],this.opacity):(v.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)),X=I?I[W]:L?[(L[W]-O)/(D-O),0]:P?P[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],x.push(X[0],X[1]),B?_.push(B[W]):_.push(N),b.push(R),H+=1;break;case 2:for(U=0;U<2;++U){j=n[W=G[U]];for(var Z=0;Z<3;++Z)if(isNaN(j[Z])||!isFinite(j[Z]))continue t}for(U=0;U<2;++U)j=n[W=G[U]],p.push(j[0],j[1],j[2]),Y=S?S[W]:E?E[R]:C,this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*A((L[W]-O)/(D-O),this.opacityscale)):3===Y.length?d.push(Y[0],Y[1],Y[2],this.opacity):(d.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)),X=I?I[W]:L?[(L[W]-O)/(D-O),0]:P?P[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],m.push(X[0],X[1]),g.push(R);q+=1;break;case 3:for(U=0;U<3;++U)for(j=n[W=G[U]],Z=0;Z<3;++Z)if(isNaN(j[Z])||!isFinite(j[Z]))continue t;for(U=0;U<3;++U){var W,Y,X,$;j=n[W=G[2-U]],i.push(j[0],j[1],j[2]),(Y=S?S[W]:E?E[R]:C)?this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*A((L[W]-O)/(D-O),this.opacityscale)):3===Y.length?a.push(Y[0],Y[1],Y[2],this.opacity):(a.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)):a.push(.5,.5,.5,1),X=I?I[W]:L?[(L[W]-O)/(D-O),0]:P?P[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],u.push(X[0],X[1]),$=w?w[W]:T[R],l.push($[0],$[1],$[2]),f.push(R)}V+=1}}this.pointCount=H,this.edgeCount=q,this.triangleCount=V,this.pointPositions.update(y),this.pointColors.update(v),this.pointUVs.update(x),this.pointSizes.update(_),this.pointIds.update(new Uint32Array(b)),this.edgePositions.update(p),this.edgeColors.update(d),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(i),this.triangleColors.update(a),this.triangleUVs.update(u),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(f))}},k.drawTransparent=k.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,inverseModel:w.slice(),clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};s.inverseModel=u(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var c,h=new Array(16);for(l(h,s.view,s.model),l(h,s.projection,h),u(h,h),o=0;o<3;++o)s.eyePosition[o]=h[12+o]/h[15];var f=h[15];for(o=0;o<3;++o)f+=this.lightPosition[o]*h[4*o+3];for(o=0;o<3;++o){for(var p=h[12+o],d=0;d<3;++d)p+=h[4*d+o]*this.lightPosition[d];s.lightPosition[o]=p/f}this.triangleCount>0&&((c=this.triShader).bind(),c.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((c=this.lineShader).bind(),c.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((c=this.pointShader).bind(),c.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((c=this.contourShader).bind(),c.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.pick=function(t){if(!t||t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=t.coord[0],s=t.coord[1];if(!this.pickVertex){var l=this.positions[r[0]],u=this.positions[r[1]],c=this.positions[r[2]],h=[(l[0]+u[0]+c[0])/3,(l[1]+u[1]+c[1])/3,(l[2]+u[2]+c[2])/3];return{_cellCenter:!0,position:[o,s],index:e,cell:r,cellId:e,intensity:this.intensity[e],dataCoordinate:h}}var f=m(i,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!f)return null;var p=f[2],d=0;for(a=0;a<r.length;++a)d+=p[a]*this.intensity[r[a]];return{position:f[1],index:r[f[0]],cell:r,cellId:e,intensity:d,dataCoordinate:this.positions[r[f[0]]]}},k.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},t.exports=function(t,e){if(1===arguments.length&&(t=(e=t).gl),!(t.getExtension("OES_standard_derivatives")||t.getExtension("MOZ_OES_standard_derivatives")||t.getExtension("WEBKIT_OES_standard_derivatives")))throw new Error("derivatives not supported");var r=function(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}(t),s=function(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}(t),l=function(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}(t),u=function(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}(t),h=function(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}(t),f=function(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e}(t),p=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));p.generateMipmap(),p.minFilter=t.LINEAR_MIPMAP_LINEAR,p.magFilter=t.LINEAR;var d=i(t),m=i(t),w=i(t),k=i(t),A=i(t),M=a(t,[{buffer:d,type:t.FLOAT,size:3},{buffer:A,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2},{buffer:k,type:t.FLOAT,size:3}]),S=i(t),E=i(t),C=i(t),I=i(t),L=a(t,[{buffer:S,type:t.FLOAT,size:3},{buffer:I,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:E,type:t.FLOAT,size:4},{buffer:C,type:t.FLOAT,size:2}]),P=i(t),z=i(t),O=i(t),D=i(t),R=i(t),F=a(t,[{buffer:P,type:t.FLOAT,size:3},{buffer:R,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:t.FLOAT,size:4},{buffer:O,type:t.FLOAT,size:2},{buffer:D,type:t.FLOAT,size:1}]),B=i(t),N=new T(t,p,r,s,l,u,h,f,d,A,m,w,k,M,S,I,E,C,L,P,R,z,O,D,F,B,a(t,[{buffer:B,type:t.FLOAT,size:3}]));return N.update(e),N}},4437:function(t,e,r){t.exports=function(t,e){t=t||document.body;var r=[.01,1/0];"distanceLimits"in(e=e||{})&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var u=i({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,f=t.clientWidth,p=t.clientHeight,d={keyBindingMode:"rotate",enableWheel:!0,view:u,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:u.modes,_ortho:e._ortho||e.projection&&"orthographic"===e.projection.type||!1,tick:function(){var e=n(),r=this.delay,i=e-2*r;u.idle(e-r),u.recalcMatrix(i),u.flush(e-(100+2*r));for(var a=!0,o=u.computedMatrix,s=0;s<16;++s)a=a&&c[s]===o[s],c[s]=o[s];var l=t.clientWidth===f&&t.clientHeight===p;return f=t.clientWidth,p=t.clientHeight,a?!l:(h=Math.exp(u.computedRadius[0]),!0)},lookAt:function(t,e,r){u.lookAt(u.lastT(),t,e,r)},rotate:function(t,e,r){u.rotate(u.lastT(),t,e,r)},pan:function(t,e,r){u.pan(u.lastT(),t,e,r)},translate:function(t,e,r){u.translate(u.lastT(),t,e,r)}};return Object.defineProperties(d,{matrix:{get:function(){return u.computedMatrix},set:function(t){return u.setMatrix(u.lastT(),t),u.computedMatrix},enumerable:!0},mode:{get:function(){return u.getMode()},set:function(t){var e=u.computedUp.slice(),r=u.computedEye.slice(),i=u.computedCenter.slice();if(u.setMode(t),"turntable"===t){var a=n();u._active.lookAt(a,r,i,e),u._active.lookAt(a+500,r,i,[0,0,1]),u._active.flush(a)}return u.getMode()},enumerable:!0},center:{get:function(){return u.computedCenter},set:function(t){return u.lookAt(u.lastT(),null,t),u.computedCenter},enumerable:!0},eye:{get:function(){return u.computedEye},set:function(t){return u.lookAt(u.lastT(),t),u.computedEye},enumerable:!0},up:{get:function(){return u.computedUp},set:function(t){return u.lookAt(u.lastT(),null,null,t),u.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(t){return u.setDistance(u.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return u.getDistanceLimits(r)},set:function(t){return u.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),d._lastX=-1,d._lastY=-1,d._lastMods={shift:!1,control:!1,alt:!1,meta:!1},d.enableMouseListeners=function(){function e(e,r,i,a){var o=d.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,c="zoom"===o,f=!!a.control,p=!!a.alt,m=!!a.shift,g=!!(1&e),y=!!(2&e),v=!!(4&e),x=1/t.clientHeight,_=x*(r-d._lastX),b=x*(i-d._lastY),w=d.flipX?1:-1,T=d.flipY?1:-1,k=Math.PI*d.rotateSpeed,A=n();if(-1!==d._lastX&&-1!==d._lastY&&((s&&g&&!f&&!p&&!m||g&&!f&&!p&&m)&&u.rotate(A,w*k*_,-T*k*b,0),(l&&g&&!f&&!p&&!m||y||g&&f&&!p&&!m)&&u.pan(A,-d.translateSpeed*_*h,d.translateSpeed*b*h,0),c&&g&&!f&&!p&&!m||v||g&&!f&&p&&!m)){var M=-d.zoomSpeed*b/window.innerHeight*(A-u.lastT())*100;u.pan(A,0,0,h*(Math.exp(M)-1))}return d._lastX=r,d._lastY=i,d._lastMods=a,!0}}d.mouseListener=a(t,e),t.addEventListener("touchstart",function(r){var n=s(r.changedTouches[0],t);e(0,n[0],n[1],d._lastMods),e(1,n[0],n[1],d._lastMods)},!!l&&{passive:!0}),t.addEventListener("touchmove",function(r){var n=s(r.changedTouches[0],t);e(1,n[0],n[1],d._lastMods),r.preventDefault()},!!l&&{passive:!1}),t.addEventListener("touchend",function(t){e(0,d._lastX,d._lastY,d._lastMods)},!!l&&{passive:!0}),d.wheelListener=o(t,function(t,e){if(!1!==d.keyBindingMode&&d.enableWheel){var r=d.flipX?1:-1,i=d.flipY?1:-1,a=n();if(Math.abs(t)>Math.abs(e))u.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,h*(Math.exp(o)-1))}}},!0)},d.enableMouseListeners(),d};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),u=r(7169),c=r(351),h=r(4772),f=r(4040),p=r(799),d=r(9216)({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function y(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d})),!r)throw new Error("webgl not supported");var v=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,_=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),b=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},A=i(r,k);A.enable=!k.disable;var M=t.spikes||{},S=o(r,M),E=[],C=[],I=[],L=[],P=!0,z=!0,O=new Array(16),D=new Array(16),R={view:null,projection:O,model:D,_ortho:!1},F=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,T),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:A,axesPixels:null,spikes:S,bounds:v,objects:E,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function U(){if(!N._stopped&&N.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",P=!0}}}function V(){for(var t=E.length,e=L.length,n=0;n<e;++n)I[n]=0;t:for(n=0;n<t;++n){var i=E[n],a=i.pickSlots;if(a){for(var o=0;o<e;++o)if(I[o]+a<255){C[n]=o,i.setPickBase(I[o]+1),I[o]+=a;continue t}var l=s(r,F);C[n]=e,L.push(l),I.push(a),i.setPickBase(1),e+=1}else C[n]=-1}for(;e>0&&0===I[e-1];)I.pop(),L.pop().dispose()}function q(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}N.autoResize&&U(),window.addEventListener("resize",U),N.update=function(t){N._stopped||(P=!0,z=!0)},N.add=function(t){N._stopped||(t.axes=A,E.push(t),C.push(-1),P=!0,z=!0,V())},N.remove=function(t){if(!N._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),P=!0,z=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",q),N.mouseListener.enabled=!1,!N.contextLost)){A.dispose(),S.dispose();for(var t=0;t<E.length;++t)E[t].dispose();for(_.dispose(),t=0;t<L.length;++t)L[t].dispose();b.dispose(),r=null,A=null,S=null,E=[]}},N._mouseRotating=!1,N._prevButtons=0,N.enableMouseListeners=function(){N.mouseListener=c(e,function(t,e,r){if(!N._stopped){var n=L.length,i=E.length,a=x.object;x.distance=1/0,x.mouse[0]=e,x.mouse[1]=r,x.object=null,x.screen=null,x.dataCoordinate=x.dataPosition=null;var o=!1;if(t&&N._prevButtons)N._mouseRotating=!0;else{N._mouseRotating&&(z=!0),N._mouseRotating=!1;for(var s=0;s<n;++s){var l=L[s].query(e,j[1]-r-1,N.pickRadius);if(l){if(l.distance>x.distance)continue;for(var u=0;u<i;++u){var c=E[u];if(C[u]===s){var h=c.pick(l);h&&(x.buttons=t,x.screen=l.coord,x.distance=l.distance,x.object=c,x.index=h.distance,x.dataPosition=h.position,x.dataCoordinate=h.dataCoordinate,x.data=h,o=!0)}}}}}a&&a!==x.object&&(a.highlight&&a.highlight(null),P=!0),x.object&&(x.object.highlight&&x.object.highlight(x.data),P=!0),(o=o||x.object!==a)&&N.onselect&&N.onselect(x),1&t&&!(1&N._prevButtons)&&N.onclick&&N.onclick(x),N._prevButtons=t}})},e.addEventListener("webglcontextlost",q);var H=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],G=[H[0].slice(),H[1].slice()];function Z(){if(!q()){U();var t=N.camera.tick();R.view=N.camera.matrix,P=P||t,z=z||t,A.pixelRatio=N.pixelRatio,S.pixelRatio=N.pixelRatio;var e=E.length,n=H[0],i=H[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<e;++o){(I=E[o]).pixelRatio=N.pixelRatio,I.axes=N.axes,P=P||!!I.dirty,z=z||!!I.dirty;var s=I.bounds;if(s)for(var l=s[0],c=s[1],p=0;p<3;++p)n[p]=Math.min(n[p],l[p]),i[p]=Math.max(i[p],c[p])}var d=N.bounds;if(N.autoBounds)for(p=0;p<3;++p){if(i[p]<n[p])n[p]=-1,i[p]=1;else{n[p]===i[p]&&(n[p]-=1,i[p]+=1);var m=.05*(i[p]-n[p]);n[p]=n[p]-m,i[p]=i[p]+m}d[0][p]=n[p],d[1][p]=i[p]}var y=!1;for(p=0;p<3;++p)y=y||G[0][p]!==d[0][p]||G[1][p]!==d[1][p],G[0][p]=d[0][p],G[1][p]=d[1][p];if(z=z||y,P=P||y){if(y){var v=[0,0,0];for(o=0;o<3;++o)v[o]=g((d[1][o]-d[0][o])/10);A.autoTicks?A.update({bounds:d,tickSpacing:v}):A.update({bounds:d})}var T=r.drawingBufferWidth,k=r.drawingBufferHeight;for(F[0]=T,F[1]=k,j[0]=0|Math.max(T/N.pixelRatio,1),j[1]=0|Math.max(k/N.pixelRatio,1),function(t,e){var r=t.bounds,n=t.cameraParams,i=n.projection,a=n.model,o=t.gl.drawingBufferWidth,s=t.gl.drawingBufferHeight,l=t.zNear,u=t.zFar,c=t.fovy,p=o/s;e?(f(i,-p,p,-1,1,l,u),n._ortho=!0):(h(i,c,p,l,u),n._ortho=!1);for(var d=0;d<16;++d)a[d]=0;a[15]=1;var m=0;for(d=0;d<3;++d)m=Math.max(m,r[1][d]-r[0][d]);for(d=0;d<3;++d)t.autoScale?a[5*d]=t.aspect[d]/(r[1][d]-r[0][d]):a[5*d]=1/m,t.autoCenter&&(a[12+d]=.5*-a[5*d]*(r[0][d]+r[1][d]))}(N,w),o=0;o<e;++o)(I=E[o]).axesBounds=d,N.clipToBounds&&(I.clipBounds=d);x.object&&(N.snapToData?S.position=x.dataCoordinate:S.position=x.dataPosition,S.bounds=d),z&&(z=!1,function(){if(!q()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL);for(var t=E.length,e=L.length,n=0;n<e;++n){var i=L[n];i.shape=j,i.begin();for(var a=0;a<t;++a)if(C[a]===n){var o=E[a];o.drawPick&&(o.pixelRatio=1,o.drawPick(R))}i.end()}}}()),N.axesPixels=a(N.axes,R,T,k),N.onrender&&N.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,T,k),N.clearRGBA(),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var M=!1;for(A.enable&&(M=M||A.isTransparent(),A.draw(R)),S.axes=A,x.object&&S.draw(R),r.disable(r.CULL_FACE),o=0;o<e;++o)(I=E[o]).axes=A,I.pixelRatio=N.pixelRatio,I.isOpaque&&I.isOpaque()&&I.draw(R),I.isTransparent&&I.isTransparent()&&(M=!0);if(M){for(_.shape=F,_.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),A.enable&&A.isTransparent()&&A.drawTransparent(R),o=0;o<e;++o)(I=E[o]).isOpaque&&I.isOpaque()&&I.draw(R);for(r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),A.isTransparent()&&A.drawTransparent(R),o=0;o<e;++o){var I;(I=E[o]).isTransparent&&I.isTransparent()&&I.drawTransparent(R)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),b.bind(),_.color[0].bind(0),b.uniforms.accumBuffer=0,u(r),r.disable(r.BLEND)}for(P=!1,o=0;o<e;++o)E[o].dirty=!1}}}return N.enableMouseListeners(),function t(){N._stopped||N.contextLost||(Z(),requestAnimationFrame(t))}(),N.redraw=function(){N._stopped||(P=!0,Z())},N},createCamera:n}},783:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],p=r[0],d=r[1],m=r[2],g=r[3];return(a=u*p+c*d+h*m+f*g)<0&&(a=-a,p=-p,d=-d,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*p,t[1]=s*c+l*d,t[2]=s*h+l*m,t[3]=s*f+l*g,t}},5964:function(t){t.exports=function(t){return t||0===t?t.toString():""}},9366:function(t,e,r){var n=r(4359);t.exports=function(t,e,r){var a=[e.style,e.weight,e.variant,e.family].join("_"),o=i[a];if(o||(o=i[a]={}),t in o)return o[t];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e.family,fontStyle:e.style,fontWeight:e.weight,fontVariant:e.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(t,s);s.triangles=!1;var u,c,h=n(t,s);if(r&&1!==r){for(u=0;u<l.positions.length;++u)for(c=0;c<l.positions[u].length;++c)l.positions[u][c]/=r;for(u=0;u<h.positions.length;++u)for(c=0;c<h.positions[u].length;++c)h.positions[u][c]/=r}var f=[[1/0,1/0],[-1/0,-1/0]],p=h.positions.length;for(u=0;u<p;++u){var d=h.positions[u];for(c=0;c<2;++c)f[0][c]=Math.min(f[0][c],d[c]),f[1][c]=Math.max(f[1][c],d[c])}return o[t]=[l,h,f]};var i={}},1283:function(t,e,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:c},f={vertex:o,fragment:l,attributes:c},p={vertex:s,fragment:l,attributes:c},d={vertex:a,fragment:u,attributes:c},m={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};function y(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return y(t,h)},e.createOrtho=function(t){return y(t,f)},e.createProject=function(t){return y(t,p)},e.createPickPerspective=function(t){return y(t,d)},e.createPickOrtho=function(t){return y(t,m)},e.createPickProject=function(t){return y(t,g)}},8418:function(t,e,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),u=r(9366),c=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f=ArrayBuffer,p=DataView;function d(t){return Array.isArray(t)||function(t){return f.isView(t)&&!(t instanceof p)}(t)}function m(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function g(t,e,r,n){return m(n,n),m(n,n),m(n,n)}function y(t,e){this.index=t,this.dataCoordinate=this.position=e}function v(t){return!0===t||t>1?1:t}function x(t,e,r,n,i,a,o,s,l,u,c,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=h,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),h=i(e),f=i(e),p=i(e),d=i(e),m=a(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:f,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new x(e,r,n,o,h,f,p,d,m,s,u,c);return g.update(t),g};var _=x.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},_.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var b=[0,0],w=[0,0,0],T=[0,0,0],k=[0,0,0,1],A=[0,0,0,1],M=h.slice(),S=[0,0,0],E=[[0,0,0],[0,0,0]];function C(t){return t[0]=t[1]=t[2]=0,t}function I(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function L(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function P(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||h,c=r.view||h,f=r.projection||h,p=e.axesBounds,d=function(t){for(var e=E,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],b[0]=2/o.drawingBufferWidth,b[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=f,l.screenSize=b,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=d,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var y=M,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=p[0][m]:y[12+m]=p[1][m],s(y,u,y),l.model=y;var x=(m+1)%3,_=(m+2)%3,P=C(w),z=C(T);P[x]=1,z[_]=1;var O=g(0,0,0,I(k,P)),D=g(0,0,0,I(A,z));if(Math.abs(O[1])>Math.abs(D[1])){var R=O;O=D,D=R,R=P,P=z,z=R;var F=x;x=_,_=F}O[0]<0&&(P[x]=-1),D[1]>0&&(z[_]=-1);var B=0,N=0;for(v=0;v<4;++v)B+=Math.pow(u[4*x+v],2),N+=Math.pow(u[4*_+v],2);P[x]/=Math.sqrt(B),z[_]/=Math.sqrt(N),l.axes[0]=P,l.axes[1]=z,l.fragClipBounds[0]=L(S,d[0],m,-1e8),l.fragClipBounds[1]=L(S,d[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var z=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&P(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,b[0]=2/s.drawingBufferWidth,b[1]=2/s.drawingBufferHeight,l.screenSize=b,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=z,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function D(t,e,r,i){var a;a=d(t)?e<t.length?t[e]:void 0:t,a=c(a);var o=!0;n(a)&&(a="▼",o=!1),r||(r={});var s=r.family;d(s)&&(s=s[e]),s||(s="normal");var l=r.weight;d(l)&&(l=l[e]),l||(l="normal");var h=r.style;d(h)&&(h=h[e]),h||(h="normal");var f=r.variant;d(f)&&(f=f[e]),f||(f="normal");var p=u(a,{family:s,weight:l,style:h,variant:f},i);return{mesh:(p=u(a,r,i))[0],lines:p[1],bounds:p[2],visible:o}}_.draw=function(t){O(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!1,!1)},_.drawTransparent=function(t){O(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!0,!1)},_.drawPick=function(t){O(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,1,!0,!0)},_.pick=function(t){if(!t||t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(d(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(d(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){d(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},u=t.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else for(i=[],a=[],n=0;n<u.length;++n)i[n]=u[n][0],a[n]=u[n][1];var c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],f=t.glyph,p=t.color,m=t.size,g=t.angle,y=t.lineColor,x=-1,_=0,b=0,w=0;if(s.length){w=s.length;t:for(n=0;n<w;++n){for(var T=s[n],k=0;k<3;++k)if(isNaN(T[k])||!isFinite(T[k]))continue t;var A=(j=D(f,n,l,this.pixelRatio)).mesh,M=j.lines,S=j.bounds;_+=3*A.cells.length,b+=2*M.edges.length}}var E=_+b,C=o.mallocFloat(3*E),I=o.mallocFloat(4*E),L=o.mallocFloat(2*E),P=o.mallocUint32(E);if(E>0){var z=0,O=_,R=[0,0,0,1],F=[0,0,0,1],B=d(p)&&d(p[0]),N=d(y)&&d(y[0]);t:for(n=0;n<w;++n){for(x+=1,T=s[n],k=0;k<3;++k){if(isNaN(T[k])||!isFinite(T[k]))continue t;h[k]=Math.max(h[k],T[k]),c[k]=Math.min(c[k],T[k])}A=(j=D(f,n,l,this.pixelRatio)).mesh,M=j.lines,S=j.bounds;var j,U=j.visible;if(U)if(d(p)){if(3===(V=B?n<p.length?p[n]:[0,0,0,0]:p).length){for(k=0;k<3;++k)R[k]=V[k];R[3]=1}else if(4===V.length){for(k=0;k<4;++k)R[k]=V[k];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;else R=[1,1,1,0];if(U)if(d(y)){var V;if(3===(V=N?n<y.length?y[n]:[0,0,0,0]:y).length){for(k=0;k<3;++k)F[k]=V[k];F[k]=1}else if(4===V.length){for(k=0;k<4;++k)F[k]=V[k];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else F[0]=F[1]=F[2]=0,F[3]=1;else F=[1,1,1,0];var q=.5;U?d(m)?q=n<m.length?+m[n]:12:m?q=+m:this.useOrtho&&(q=12):q=0;var H=0;d(g)?H=n<g.length?+g[n]:0:g&&(H=+g);var G=Math.cos(H),Z=Math.sin(H);for(T=s[n],k=0;k<3;++k)h[k]=Math.max(h[k],T[k]),c[k]=Math.min(c[k],T[k]);var W=i,Y=a;W=0,d(i)?W=n<i.length?i[n]:0:i&&(W=i),Y=0,d(a)?Y=n<a.length?a[n]:0:a&&(Y=a);var X=[W*=W>0?1-S[0][0]:W<0?1+S[1][0]:1,Y*=Y>0?1-S[0][1]:Y<0?1+S[1][1]:1],$=A.cells||[],J=A.positions||[];for(k=0;k<$.length;++k)for(var K=$[k],Q=0;Q<3;++Q){for(var tt=0;tt<3;++tt)C[3*z+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*z+tt]=R[tt];P[z]=x;var et=J[K[Q]];L[2*z]=q*(G*et[0]-Z*et[1]+X[0]),L[2*z+1]=q*(Z*et[0]+G*et[1]+X[1]),z+=1}for($=M.edges,J=M.positions,k=0;k<$.length;++k)for(K=$[k],Q=0;Q<2;++Q){for(tt=0;tt<3;++tt)C[3*O+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*O+tt]=F[tt];P[O]=x,et=J[K[Q]],L[2*O]=q*(G*et[0]-Z*et[1]+X[0]),L[2*O+1]=q*(Z*et[0]+G*et[1]+X[1]),O+=1}}}this.bounds=[c,h],this.points=s,this.pointCount=s.length,this.vertexCount=_,this.lineVertexCount=b,this.pointBuffer.update(C),this.colorBuffer.update(I),this.glyphBuffer.update(L),this.idBuffer.update(P),o.free(C),o.free(I),o.free(L),o.free(P)},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},3589:function(t,e,r){t.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var u=l.prototype;Object.defineProperty(u,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;a<r*e*4;++a)n[a]=255}return t}}}),u.begin=function(){var t=this.gl;this.shape,t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},u.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},u.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,"number"!=typeof r&&(r=1);var i=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),l=0|Math.min(Math.max(e-r,0),n[1]),u=0|Math.min(Math.max(e+r,0),n[1]);if(o<=i||u<=l)return null;var c=[o-i,u-l],h=a(this.buffer,[c[0],c[1],4],[4,4*n[0],1],4*(i+n[0]*l)),f=function(t,e,r){for(var n=1e8,i=-1,a=-1,o=t.shape[0],s=t.shape[1],l=0;l<o;l++)for(var u=0;u<s;u++){var c=t.get(l,u,0),h=t.get(l,u,1),f=t.get(l,u,2),p=t.get(l,u,3);if(c<255||h<255||f<255||p<255){var d=e-l,m=r-u,g=d*d+m*m;g<n&&(n=g,i=l,a=u)}}return[i,a,n]}(h.hi(c[0],c[1],1),r,r),p=f[0],d=f[1];return p<0||Math.pow(this.radius,2)<f[2]?null:new s(p+i|0,d+l|0,h.get(p,d,0),[h.get(p,d,1),h.get(p,d,2),h.get(p,d,3)],Math.sqrt(f[2]))},u.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},9405:function(t,e,r){var n=r(3327),i=r(8731),a=r(216),o=r(5091),s=r(2145),l=r(8866);function u(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var c=u.prototype;function h(t,e){return t.name<e.name?-1:1}c.bind=function(){this.program||this._relink();var t,e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},c.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},c.update=function(t,e,r,u){if(!e||1===arguments.length){var c=t;t=c.vertex,e=c.fragment,r=c.uniforms,u=c.attributes}var f=this,p=f.gl,d=f._vref;f._vref=o.shader(p,p.VERTEX_SHADER,t),d&&d.dispose(),f.vertShader=f._vref.shader;var m=this._fref;if(f._fref=o.shader(p,p.FRAGMENT_SHADER,e),m&&m.dispose(),f.fragShader=f._fref.shader,!r||!u){var g=p.createProgram();if(p.attachShader(g,f.fragShader),p.attachShader(g,f.vertShader),p.linkProgram(g),!p.getProgramParameter(g,p.LINK_STATUS)){var y=p.getProgramInfoLog(g);throw new l(y,"Error linking program:"+y)}r=r||s.uniforms(p,g),u=u||s.attributes(p,g),p.deleteProgram(g)}(u=u.slice()).sort(h);var v,x=[],_=[],b=[];for(v=0;v<u.length;++v){var w=u[v];if(w.type.indexOf("mat")>=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A<T;++A)k[A]=b.length,_.push(w.name+"["+A+"]"),"number"==typeof w.location?b.push(w.location+A):Array.isArray(w.location)&&w.location.length===T&&"number"==typeof w.location[A]?b.push(0|w.location[A]):b.push(-1);x.push({name:w.name,type:w.type,locations:k})}else x.push({name:w.name,type:w.type,locations:[b.length]}),_.push(w.name),"number"==typeof w.location?b.push(0|w.location):b.push(-1)}var M=0;for(v=0;v<b.length;++v)if(b[v]<0){for(;b.indexOf(M)>=0;)M+=1;b[v]=M}var S=new Array(r.length);function E(){f.program=o.program(p,f._vref,f._fref,_,b);for(var t=0;t<r.length;++t)S[t]=p.getUniformLocation(f.program,r[t].name)}E(),f._relink=E,f.types={uniforms:a(r),attributes:a(u)},f.attributes=i(p,f,x,b),Object.defineProperty(f,"uniforms",n(p,f,r,S))},t.exports=function(t,e,r,n,i){var a=new u(t);return a.update(e,r,n,i),a}},8866:function(t){function e(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}e.prototype=new Error,e.prototype.name="GLError",e.prototype.constructor=e,t.exports=e},8731:function(t,e,r){t.exports=function(t,e,r,i){for(var a={},o=0,u=r.length;o<u;++o){var c=r[o],h=c.name,f=c.type,p=c.locations;switch(f){case"bool":case"int":case"float":s(t,e,p[0],i,1,a,h);break;default:if(f.indexOf("vec")>=0){if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);s(t,e,p[0],i,d,a,h)}else{if(!(f.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+f);var d;if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);l(t,e,p,i,d,a,h)}}}return a};var n=r(8866);function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var u=o[a],c=new i(t,e,r,n,a,u);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),u(t,n[r],e),e},get:function(){return c},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),u=new Array(i),c=0;c<i;++c)s(t,e,r[c],n,i,l,c),u[c]=l[c];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<i;++e)u[e].location=t[e];else for(e=0;e<i;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(i),e=0;e<i;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,a,o,s){e=e||t.FLOAT,a=!!a,o=o||i*i,s=s||0;for(var l=0;l<i;++l){var u=n[r[l]];t.vertexAttribPointer(u,i,e,a,o,s+l*i),t.enableVertexAttribArray(u)}};var h=new Array(i),f=t["vertexAttrib"+i+"fv"];Object.defineProperty(a,o,{set:function(e){for(var a=0;a<i;++a){var o=n[r[a]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))f.call(t,o,e[a]);else{for(var s=0;s<i;++s)h[s]=e[i*a+s];f.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}},3327:function(t,e,r){var n=r(216),i=r(8866);function a(t){return function(){return t}}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}t.exports=function(t,e,r,s){function l(t){return function(e,r,n){return e.getUniform(r.program,n[t])}}function u(e){return function(n){for(var a=c("",e),o=0;o<a.length;++o){var l=a[o],u=l[0],h=l[1];if(s[h]){var f=n;if("string"==typeof u&&(0===u.indexOf(".")||0===u.indexOf("["))){var p=u;if(0===u.indexOf(".")&&(p=u.slice(1)),p.indexOf("]")===p.length-1){var d=p.indexOf("["),m=p.slice(0,d),g=p.slice(d+1,p.length-1);f=m?n[m][g]:n[g]}else f=n[p]}var y,v=r[h].type;switch(v){case"bool":case"int":case"sampler2D":case"samplerCube":t.uniform1i(s[h],f);break;case"float":t.uniform1f(s[h],f);break;default:var x=v.indexOf("vec");if(!(0<=x&&x<=1&&v.length===4+x)){if(0===v.indexOf("mat")&&4===v.length){if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+y+"fv"](s[h],!1,f);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+y+"iv"](s[h],f);break;case"v":t["uniform"+y+"fv"](s[h],f);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function h(t,e,n){if("object"==typeof n){var c=f(n);Object.defineProperty(t,e,{get:a(c),set:u(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:l(n),set:u(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type)}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)h(e,r,t[r])}else for(var n in e={},t)h(e,n,t[n]);return e}var p=n(r,!0);return{get:a(f(p)),set:u(p),enumerable:!0,configurable:!0}}},216:function(t){t.exports=function(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name.split("."),a=r,o=0;o<i.length;++o){var s=i[o].split("[");if(s.length>1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l<s.length;++l){var u=parseInt(s[l]);l<s.length-1||o<i.length-1?(u in a||(l<s.length-1?a[u]=[]:a[u]={}),a=a[u]):a[u]=e?n:t[n].type}}else o<i.length-1?(s[0]in a||(a[s[0]]={}),a=a[s[0]]):a[s[0]]=e?n:t[n].type}return r}},2145:function(t,e){e.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=i(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},e.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&n.push({name:o.name,type:i(t,o.type)})}return n};var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},n=null;function i(t,e){if(!n){var i=Object.keys(r);n={};for(var a=0;a<i.length;++a){var o=i[a];n[t[o]]=r[o]}}return n[e]}},5091:function(t,e,r){e.shader=function(t,e,r){return c(t).getShaderReference(e,r)},e.program=function(t,e,r,n,i){return c(t).getProgram(e,r,n,i)};var n=r(8866),i=r(2992),a=new("undefined"==typeof WeakMap?r(606):WeakMap),o=0;function s(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0===--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var u=l.prototype;function c(t){var e=a.get(t);return e||(e=new l(t),a.set(t,e)),e}u.getShaderReference=function(t,e){var r=this.gl,a=this.shaders[t===r.FRAGMENT_SHADER|0],l=a[e];if(l&&r.isShader(l.shader))l.count+=1;else{var u=function(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(a);try{var s=i(o,r,e)}catch(t){throw console.warn("Failed to format compiler error: "+t),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return a}(r,t,e);l=a[e]=new s(o++,e,t,u,[],1,this)}return l},u.getProgram=function(t,e,r,i){var a=[t.id,e.id,r.join(":"),i.join(":")].join("@"),o=this.programs[a];return(!o||!this.gl.isProgram(o))&&(this.programs[a]=o=function(t,e,r,i,a){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<i.length;++s)t.bindAttribLocation(o,a[s],i[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,t.shader,e.shader,r,i),t.programs.push(a),e.programs.push(a)),o}},1493:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * (view * (model * vec4(vertexPosition, 1.0)));\n vec2 clipOffset = (projection * (view * (model * vec4(color, 0.0)))).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},4449:function(t,e,r){var n=r(2762),i=r(8116),a=r(1493);t.exports=function(t,e){var r=[];function o(t,e,n,i,a,o){var s=[t,e,n,0,0,0,1];s[i+3]=1,s[i]=a,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[i]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[i]=a,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(t,r),u=i(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=a(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new s(t,l,u,c);return h.update(e),h};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var l=s.prototype,u=[0,0,0],c=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||o,s=t.view||o,l=t.projection||o;this.axes&&(i=this.axes.lastCubeProps.axis);for(var f=u,p=c,d=0;d<3;++d)i&&i[d]<0?(f[d]=this.bounds[0][d],p[d]=this.bounds[1][d]):(f[d]=this.bounds[1][d],p[d]=this.bounds[0][d]);for(h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,f,p],n.uniforms.colors=this.colors,n.uniforms.screenShape=h,d=0;d<3;++d)n.uniforms.lineWidth=this.lineWidth[d]*this.pixelRatio,this.enabled[d]&&(r.draw(e.TRIANGLES,6,6*d),this.drawSides[d]&&r.draw(e.TRIANGLES,12,18+12*d));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6740:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s<t.length;s++)for(var l=t[s].velocities,u=0;u<l.length;u++)o=Math.max(o,n.length(l[u]));var c=t.map(function(t){return function(t,e,r,a){for(var o=t.points,s=t.velocities,l=t.divergences,u=[],c=[],h=[],f=[],p=[],d=[],m=0,g=0,y=i.create(),v=i.create(),x=0;x<o.length;x++){var _=o[x],b=s[x],w=l[x];0===e&&(w=.05*r),g=n.length(b)/a,y=i.create(),n.copy(y,b),y[3]=w;for(var T=0;T<8;T++)p[T]=[_[0],_[1],_[2],T];if(f.length>0)for(T=0;T<8;T++){var k=(T+1)%8;u.push(f[T],p[T],p[k],p[k],f[k],f[T]),h.push(v,y,y,y,v,v),d.push(m,g,g,g,m,m);var A=u.length;c.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=f;f=p,p=M;var S=v;v=y,y=S;var E=m;m=g,g=E}return{positions:u,cells:c,vectors:h,vertexIntensity:d}}(t,r,a,o)}),h=[],f=[],p=[],d=[];for(s=0;s<c.length;s++){var m=c[s],g=h.length;for(h=h.concat(m.positions),p=p.concat(m.vectors),d=d.concat(m.vertexIntensity),u=0;u<m.cells.length;u++){var y=m.cells[u],v=[];f.push(v);for(var x=0;x<y.length;x++)v.push(y[x]+g)}}return{positions:h,cells:f,vectors:p,vertexIntensity:d,colormap:e}},s=function(t,e){var r,n=t.length;for(r=0;r<n;r++){var i=t[r];if(i===e)return r;if(i>e)return r-1}return r},l=function(t,e,r){return t<e?e:t>r?r:t},u=function(t){var e=1/0;t.sort(function(t,e){return t-e});for(var r=t.length,n=1;n<r;n++){var i=Math.abs(t[n]-t[n-1]);i<e&&(e=i)}return e};t.exports=function(t,e){var r=t.startingPositions,i=t.maxLength||1e3,c=t.tubeSize||1,h=t.absoluteTubeSize,f=t.gridFill||"+x+y+z",p={};-1!==f.indexOf("-x")&&(p.reversedX=!0),-1!==f.indexOf("-y")&&(p.reversedY=!0),-1!==f.indexOf("-z")&&(p.reversedZ=!0),p.filled=a.indexOf(f.replace(/-/g,"").replace(/\+/g,""));var d=t.getVelocity||function(e){return function(t,e,r){var i=e.vectors,a=e.meshgrid,o=t[0],u=t[1],c=t[2],h=a[0].length,f=a[1].length,p=a[2].length,d=s(a[0],o),m=s(a[1],u),g=s(a[2],c),y=d+1,v=m+1,x=g+1;if(d=l(d,0,h-1),y=l(y,0,h-1),m=l(m,0,f-1),v=l(v,0,f-1),g=l(g,0,p-1),x=l(x,0,p-1),d<0||m<0||g<0||y>h-1||v>f-1||x>p-1)return n.create();var _,b,w,T,k,A,M=a[0][d],S=a[0][y],E=a[1][m],C=a[1][v],I=a[2][g],L=(o-M)/(S-M),P=(u-E)/(C-E),z=(c-I)/(a[2][x]-I);switch(isFinite(L)||(L=.5),isFinite(P)||(P=.5),isFinite(z)||(z=.5),r.reversedX&&(d=h-1-d,y=h-1-y),r.reversedY&&(m=f-1-m,v=f-1-v),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,A=x,w=m*p,T=v*p,_=d*p*f,b=y*p*f;break;case 4:k=g,A=x,_=d*p,b=y*p,w=m*p*h,T=v*p*h;break;case 3:w=m,T=v,k=g*f,A=x*f,_=d*f*p,b=y*f*p;break;case 2:w=m,T=v,_=d*f,b=y*f,k=g*f*h,A=x*f*h;break;case 1:_=d,b=y,k=g*h,A=x*h,w=m*h*p,T=v*h*p;break;default:_=d,b=y,w=m*h,T=v*h,k=g*h*f,A=x*h*f}var O=i[_+w+k],D=i[_+w+A],R=i[_+T+k],F=i[_+T+A],B=i[b+w+k],N=i[b+w+A],j=i[b+T+k],U=i[b+T+A],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,O,B,L),n.lerp(q,D,N,L),n.lerp(H,R,j,L),n.lerp(G,F,U,L);var Z=n.create(),W=n.create();n.lerp(Z,V,H,P),n.lerp(W,q,G,P);var Y=n.create();return n.lerp(Y,Z,W,z),Y}(e,t,p)},m=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],y=e[0][0],v=e[0][1],x=e[0][2],_=e[1][0],b=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(e<y||e>_||r<v||r>b||n<x||n>w)},k=10*n.distance(e[0],e[1])/i,A=k*k,M=1,S=0,E=r.length;E>1&&(M=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;l<s;l++){var c=t[l],h=c[0],f=c[1],p=c[2];i[h]||(e.push(h),i[h]=!0),a[f]||(r.push(f),a[f]=!0),o[p]||(n.push(p),o[p]=!0)}var d=u(e),m=u(r),g=u(n),y=Math.min(d,m,g);return isFinite(y)?y:1}(r));for(var C=0;C<E;C++){var I=n.create();n.copy(I,r[C]);var L=[I],P=[],z=d(I),O=I;P.push(z);var D=[],R=m(I,z),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F),g.push({points:L,velocities:P,divergences:D});for(var B=0;B<100*i&&L.length<i&&T(I);){B++;var N=n.clone(z),j=n.squaredLength(N);if(0===j)break;j>A&&n.scale(N,N,k/Math.sqrt(j)),n.add(N,N,I),z=d(N),n.squaredDistance(O,N)-A>-1e-4*A&&(L.push(N),O=N,P.push(z),R=m(N,z),F=n.length(R),isFinite(F)&&F>S&&(S=F),D.push(F)),I=N}}var U=o(g,t.colormap,S,M);return h?U.tubeScale=h:(0===S&&(S=1),U.tubeScale=.5*c*M/S),U};var c=r(6740),h=r(6405).createMesh;t.exports.createTubeMesh=function(t,e){return h(t,e,{shaders:c,traceType:"streamtube"})}},990:function(t,e,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);\n vec4 clipPosition = projection * (view * worldPosition);\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},9499:function(t,e,r){t.exports=function(t){var e=t.gl,r=v(e),n=_(e),s=x(e),l=b(e),u=i(e),c=a(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),h=i(e),f=a(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,S,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,m,s,l,h,f,p,d,[0,0,0]),y={levels:[[],[],[]]};for(var T in t)y[T]=t[T];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),u=r(5298),c=r(9994),h=r(9618),f=r(3711),p=r(6760),d=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,_=y.createPickShader,b=y.createPickContourShader,w=40,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var S=256;function E(t,e,r,n,i,a,o,l,u,c,f,p,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=E.prototype;C.genColormap=function(t,e){var r=!1,n=c([l({colormap:t,nshades:S,format:"rgba"}).map(function(t,n){var i=e?function(t,e){if(!e||!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]})]);return u.divseq(n,255),this.hasAlphaScale=r,n},C.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},C.isOpaque=function(){return!this.isTransparent()},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var I=[0,0,0],L={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||I,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var u=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var z={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=T.slice(),D=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=t.model||T,n.view=t.view||T,n.projection=t.projection||T,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=D,n.vertexColor=this.vertexColor;var s=O;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=P(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)!this.surfaceProject[i]||!this.vertexCount||(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var f=this._contourVAO;for(f.bind(),i=0;i<3;++i)for(h.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o<this.contourLevels[i].length;++o)o===this.highlightLevel[i]?(h.uniforms.contourColor=this.highlightColor[i],h.uniforms.contourTint=this.highlightTint[i]):(0===o||o-1===this.highlightLevel[i])&&(h.uniforms.contourColor=this.contourColor[i],h.uniforms.contourTint=this.contourTint[i]),this._contourCounts[i][o]&&(h.uniforms.height=this.contourLevels[i][o],f.draw(r.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(h.uniforms.model=c.projections[i],h.uniforms.clipBounds=c.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){h.uniforms.permutation=A[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(h.uniforms.contourColor=this.highlightColor[o],h.uniforms.contourTint=this.highlightTint[o]):(0===m||m-1===this.highlightLevel[o])&&(h.uniforms.contourColor=this.contourColor[o],h.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][m]&&(h.uniforms.height=this.contourLevels[o][m],f.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m]))}for(f.unbind(),(f=this._dynamicVAO).bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=A[i],r.lineWidth(this.dynamicWidth[i]*this.pixelRatio),h.uniforms.contourColor=this.dynamicColor[i],h.uniforms.contourTint=this.dynamicTint[i],h.uniforms.height=this.dynamicLevel[i],f.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(h.uniforms.model=c.projections[o],h.uniforms.clipBounds=c.clipBounds[o],f.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));f.unbind()}}C.draw=function(t){return R.call(this,t,!1)},C.drawTransparent=function(t){return R.call(this,t,!0)};var F={model:T,view:T,projection:T,inverseModel:T,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function B(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function N(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function j(t){if(Array.isArray(t)){if(Array.isArray(t))return[N(t[0]),N(t[1]),N(t[2])];var e=N(t);return[e.slice(),e.slice(),e.slice()]}}C.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=F;r.model=t.model||T,r.view=t.view||T,r.projection=t.projection||T,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=D;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var o=P(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]*this.pixelRatio),s.uniforms.permutation=A[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(s.uniforms.height=this.contourLevels[a][n],l.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){s.uniforms.permutation=A[a],e.lineWidth(this.contourWidth[a]*this.pixelRatio);for(var u=0;u<this.contourLevels[a].length;++u)this._contourCounts[a][u]&&(s.uniforms.height=this.contourLevels[a][u],l.draw(e.LINES,this._contourCounts[a][u],this._contourOffsets[a][u]))}l.unbind()}},C.pick=function(t){if(!t||t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var p=i+c,d=s+f,g=h*(f?l:1-l),y=0;y<3;++y)u[y]+=this._field[y].get(p,d)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],u[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]<this.contourLevels[x].length-1){var _=this.contourLevels[x][v[x]],b=this.contourLevels[x][v[x]+1];Math.abs(_-u[x])>Math.abs(b-u[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},C.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=B(t.contourWidth,Number)),"showContour"in t&&(this.showContour=B(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=B(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=j(t.contourColor)),"contourProject"in t&&(this.contourProject=B(t.contourProject,function(t){return B(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=j(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=B(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=B(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(y=0;y<2;++y)if(u.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(t.ticks){var c=t.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=c[o];if((Array.isArray(p)||p.length)&&(p=h(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=h(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var v=this._field,x=h(s.mallocFloat(3*v[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)g(x.pick(o),v[o],"mirror");var _=h(s.mallocFloat(3*v[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var b=x.get(0,o,y,0),w=x.get(0,o,y,1),T=x.get(1,o,y,0),A=x.get(1,o,y,1),M=x.get(2,o,y,0),S=x.get(2,o,y,1),E=T*S-A*M,C=M*w-S*b,I=b*A-w*T,L=Math.sqrt(E*E+C*C+I*I);L<1e-8?(L=Math.max(Math.abs(E),Math.abs(C),Math.abs(I)))<1e-8?(I=1,C=E=0,L=1):L=1/L:L=1/Math.sqrt(L),_.set(o,y,0,E*L),_.set(o,y,1,C*L),_.set(o,y,2,I*L)}s.free(x.data);var P=[1/0,1/0,1/0],z=[-1/0,-1/0,-1/0],O=1/0,D=-1/0,R=(a[0]-1)*(a[1]-1)*6,F=s.mallocFloat(n.nextPow2(10*R)),N=0,U=0;for(o=0;o<a[0]-1;++o)t:for(y=0;y<a[1]-1;++y){for(var V=0;V<2;++V)for(var q=0;q<2;++q)for(var H=0;H<3;++H){var G=this._field[H].get(1+o+V,1+y+q);if(isNaN(G)||!isFinite(G))continue t}for(H=0;H<6;++H){var Z=o+k[H][0],W=y+k[H][1],Y=this._field[0].get(Z+1,W+1),X=this._field[1].get(Z+1,W+1);G=this._field[2].get(Z+1,W+1),E=_.get(Z+1,W+1,0),C=_.get(Z+1,W+1,1),I=_.get(Z+1,W+1,2),t.intensity&&($=t.intensity.get(Z,W));var $=t.intensity?t.intensity.get(Z,W):G+this.objectOffset[2];F[N++]=Z,F[N++]=W,F[N++]=Y,F[N++]=X,F[N++]=G,F[N++]=0,F[N++]=$,F[N++]=E,F[N++]=C,F[N++]=I,P[0]=Math.min(P[0],Y+this.objectOffset[0]),P[1]=Math.min(P[1],X+this.objectOffset[1]),P[2]=Math.min(P[2],G+this.objectOffset[2]),O=Math.min(O,$),z[0]=Math.max(z[0],Y+this.objectOffset[0]),z[1]=Math.max(z[1],X+this.objectOffset[1]),z[2]=Math.max(z[2],G+this.objectOffset[2]),D=Math.max(D,$),U+=1}}for(t.intensityBounds&&(O=+t.intensityBounds[0],D=+t.intensityBounds[1]),o=6;o<N;o+=10)F[o]=(F[o]-O)/(D-O);this._vertexCount=U,this._coordinateBuffer.update(F.subarray(0,N)),s.freeFloat(F),s.free(_.data),this.bounds=[P,z],this.intensity=t.intensity||this._field[2],(this.intensityBounds[0]!==O||this.intensityBounds[1]!==D)&&(r=!0),this.intensityBounds=[O,D]}if("levels"in t){var J=t.levels;for(J=Array.isArray(J[0])?J.slice():[[],[],J],o=0;o<3;++o)J[o]=J[o].slice(),J[o].sort(function(t,e){return t-e});for(o=0;o<3;++o)for(y=0;y<J[o].length;++y)J[o][y]-=this.objectOffset[o];t:for(o=0;o<3;++o){if(J[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<J[o].length;++y)if(J[o][y]!==this.contourLevels[o][y]){r=!0;break t}}this.contourLevels=J}if(r){v=this._field,a=this.shape;for(var K=[],Q=0;Q<3;++Q){var tt=this.contourLevels[Q],et=[],rt=[],nt=[0,0,0];for(o=0;o<tt.length;++o){var it=f(this._field[Q],tt[o]);et.push(K.length/5|0),U=0;t:for(y=0;y<it.cells.length;++y){var at=it.cells[y];for(H=0;H<2;++H){var ot=it.positions[at[H]],st=ot[0],lt=0|Math.floor(st),ut=st-lt,ct=ot[1],ht=0|Math.floor(ct),ft=ct-ht,pt=!1;e:for(var dt=0;dt<3;++dt){nt[dt]=0;var mt=(Q+dt+1)%3;for(V=0;V<2;++V){var gt=V?ut:1-ut;for(Z=0|Math.min(Math.max(lt+V,0),a[0]),q=0;q<2;++q){var yt=q?ft:1-ft;if(W=0|Math.min(Math.max(ht+q,0),a[1]),G=dt<2?this._field[mt].get(Z,W):(this.intensity.get(Z,W)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(G)||isNaN(G)){pt=!0;break e}var vt=gt*yt;nt[dt]+=vt*G}}}if(pt){if(H>0){for(var xt=0;xt<5;++xt)K.pop();U-=1}continue t}K.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[Q]=et,this._contourCounts[Q]=rt}var _t=s.mallocFloat(K.length);for(o=0;o<K.length;++o)_t[o]=K[o];this._contourBuffer.update(_t),s.freeFloat(_t)}},C.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)s.freeFloat(this._field[t].data)},C.highlight=function(t){var e,r;if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;for(r=this.snapToData?t.dataCoordinate:t.position,e=0;e<3;++e)r[e]-=this.objectOffset[e];if(this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,u=(o+2)%3,c=this._field[o],h=this._field[l],p=this._field[u],d=f(c,r[o]),m=d.cells,g=d.positions;for(this._dynamicOffsets[o]=n,e=0;e<m.length;++e)for(var y=m[e],v=0;v<2;++v){var x=g[y[v]],_=+x[0],b=0|_,w=0|Math.min(b+1,i[0]),T=_-b,k=1-T,A=+x[1],M=0|A,S=0|Math.min(M+1,i[1]),E=A-M,C=1-E,I=k*C,L=k*E,P=T*C,z=T*E,O=I*h.get(b,M)+L*h.get(b,S)+P*h.get(w,M)+z*h.get(w,S),D=I*p.get(b,M)+L*p.get(b,S)+P*p.get(w,M)+z*p.get(w,S);if(isNaN(O)||isNaN(D)){v&&(n-=1);break}a[2*n+0]=O,a[2*n+1]=D,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),s.freeFloat(a)}}},7766:function(t,e,r){var n=r(9618),i=r(5298),a=r(1888);t.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||function(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return g(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=u(e)?e:e.raw;if(r)return function(t,e,r,n,i,a){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new f(t,o,r,n,i,a)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=d(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var h=0;if(2===o.length)h=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])h=t.ALPHA;else if(2===o[2])h=t.LUMINANCE_ALPHA;else if(3===o[2])h=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}}u===t.FLOAT&&!t.getExtension("OES_texture_float")&&(u=t.UNSIGNED_BYTE,l=!1);var p,g,y=e.size;if(l)p=0===e.offset&&e.data.length===y?e.data:e.data.subarray(e.offset,e.offset+y);else{var v=[o[2],o[2]*o[0],1];g=a.malloc(y,r);var x=n(g,o,v,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?i.assign(x,e):c(x,e),p=g.subarray(0,y)}var _=m(t);return t.texImage2D(t.TEXTURE_2D,0,h,o[0],o[1],0,h,u,p),l||a.free(g),new f(t,_,o[0],o[1],h,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var c=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function f(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=f.prototype;function d(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),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),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new f(t,o,e,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,h){var f=h.dtype,p=h.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=d(p,h.stride.slice());if("float32"===f?m=t.FLOAT:"float64"===f?(m=t.FLOAT,y=!1,f="float32"):"uint8"===f?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,y=!1,f="uint8"),2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],h=n(h.data,p,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}if((g===t.LUMINANCE||g===t.ALPHA)&&(s===t.LUMINANCE||s===t.ALPHA)&&(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=u.indexOf(o)<0;if(x&&u.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var _;_=l===t.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var b=n(_,p,[p[2],p[2]*p[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?c(b,h):i.assign(b,h),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,_.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,_.subarray(0,v)),l===t.FLOAT?a.freeFloat32(_):a.freeUint8(_)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},1433:function(t){t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,u=!!a.normalized,c=a.stride||0,h=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,u,c,h)}else{if("number"==typeof a)t.vertexAttrib1f(i,a);else if(1===a.length)t.vertexAttrib1f(i,a[0]);else if(2===a.length)t.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)t.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error("gl-vao: Invalid vertex attribute");t.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}t.disableVertexAttribArray(i)}}for(;i<n;++i)t.disableVertexAttribArray(i)}else for(t.bindBuffer(t.ARRAY_BUFFER,null),i=0;i<n;++i)t.disableVertexAttribArray(i)}},870:function(t,e,r){var n=r(1433);function i(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},i.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},t.exports=function(t){return new i(t)}},7518:function(t,e,r){var n=r(1433);function i(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function a(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},a.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},a.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},a.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},a.prototype.update=function(t,e,r){if(this.bind(),n(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var a=0;a<t.length;++a){var o=t[a];"number"==typeof o?this._attribs.push(new i(a,1,o)):Array.isArray(o)&&this._attribs.push(new i(a,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},t.exports=function(t,e){return new a(t,e,e.createVertexArrayOES())}},8116:function(t,e,r){var n=r(7518),i=r(870);function a(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}t.exports=function(t,e,r,o){var s,l=t.createVertexArray?new a(t):t.getExtension("OES_vertex_array_object");return(s=l?n(t,l):i(t)).update(e,r,o),s}},5632:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}},8192:function(t,e,r){t.exports=function(t,e){var r=n(t[0],t[1],t[2]),o=n(e[0],e[1],e[2]);i(r,r),i(o,o);var s=a(r,o);return s>1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},3126:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},3990:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},1091:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},244:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},2681:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},5137:function(t,e,r){t.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s<l;s+=e)n[0]=t[s],n[1]=t[s+1],n[2]=t[s+2],a(n,n,o),t[s]=n[0],t[s+1]=n[1],t[s+2]=n[2];return t};var n=r(1091)()},2825:function(t){t.exports=function(t,e,r){var n=new Float32Array(3);return n[0]=t,n[1]=e,n[2]=r,n}},2931:function(t,e,r){t.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}},811:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}},868:function(t,e,r){t.exports=r(1387)},1387:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}},6658:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}},7417:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}},8107:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}},4505:function(t,e,r){t.exports=r(5847)},5847:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}},5093:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}},3536:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},7636:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},6894:function(t){t.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=i+o*u-s*l,t[2]=a+o*l+s*u,t}},109:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+s*l+o*u,t[1]=e[1],t[2]=a+s*u-o*l,t}},8692:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+o*u-s*l,t[1]=a+o*l+s*u,t[2]=e[2],t}},2447:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},6621:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},8489:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},1463:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},3066:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},492:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},5673:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},264:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+h*-l-f*-s,t[1]=h*u+p*-s+f*-o-c*-l,t[2]=f*u+p*-l+c*-s-h*-o,t}},4361:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},2335:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},2933:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},7536:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},3750:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},3390:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},6808:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},2573:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},160:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2334:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},3576:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},1498:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},5177:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},9131:function(t,e,r){var n=r(5177),i=r(9288);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},9288:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4844:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},4578:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},7960:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},483:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},6860:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},5352:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},4041:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+h*-l-f*-s,t[1]=h*u+p*-s+f*-o-c*-l,t[2]=f*u+p*-l+c*-s-h*-o,t[3]=e[3],t}},1848:function(t,e,r){var n=r(4905),i=r(6468);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r<e.length;r++){var a=e[r];if("preprocessor"===a.type){var o=a.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?i(l):l).trim()}}}}},5874:function(t,e,r){t.exports=function(t){var e,r,T,k=0,A=0,M=l,S=[],E=[],C=1,I=0,L=0,P=!1,z=!1,O="",D=a,R=n;"300 es"===(t=t||{}).version&&(D=s,R=o);var F={},B={};for(k=0;k<D.length;k++)F[D[k]]=!0;for(k=0;k<R.length;k++)B[R[k]]=!0;return function(t){return E=[],null!==t?function(t){k=0,t.toString&&(t=t.toString()),O+=t.replace(/\r\n/g,"\n"),T=O.length;for(var r;e=O[k],k<T;){switch(r=k,M){case c:k=H();break;case h:k=q();break;case f:k=V();break;case p:k=G();break;case d:k=Y();break;case b:k=W();break;case m:k=X();break;case u:k=$();break;case x:k=U();break;case l:k=j()}r!==k&&("\n"===O[r]?(I=0,++C):++I)}return A+=k,O=O.slice(k),E}(t):(S.length&&N(S.join("")),M=_,N("(eof)"),E)};function N(t){t.length&&E.push({type:w[M],data:t,position:L,line:C,column:I})}function j(){return S=S.length?[]:S,"/"===r&&"*"===e?(L=A+k-1,M=c,r=e,k+1):"/"===r&&"/"===e?(L=A+k-1,M=h,r=e,k+1):"#"===e?(M=f,L=A+k,k):/\s/.test(e)?(M=x,L=A+k,k):(P=/\d/.test(e),z=/[^\w_]/.test(e),L=A+k,M=P?d:z?p:u,k)}function U(){return/[^\s]/g.test(e)?(N(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function V(){return"\r"!==e&&"\n"!==e||"\\"===r?(S.push(e),r=e,k+1):(N(S.join("")),M=l,k)}function q(){return V()}function H(){return"/"===e&&"*"===r?(S.push(e),N(S.join("")),M=l,k+1):(S.push(e),r=e,k+1)}function G(){if("."===r&&/\d/.test(e))return M=m,k;if("/"===r&&"*"===e)return M=c,k;if("/"===r&&"/"===e)return M=h,k;if("."===e&&S.length){for(;Z(S););return M=m,k}if(";"===e||")"===e||"("===e){if(S.length)for(;Z(S););return N(e),M=l,k+1}var t=2===S.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;Z(S););return M=l,k}return S.push(e),r=e,k+1}function Z(t){for(var e,r,n=0;;){if(e=i.indexOf(t.slice(0,t.length+n).join("")),r=i[e],-1===e){if(n--+t.length>0)continue;r=t.slice(0,1).join("")}return N(r),L+=r.length,(S=S.slice(r.length)).length}}function W(){return/[^a-fA-F0-9]/.test(e)?(N(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function Y(){return"."===e||/[eE]/.test(e)?(S.push(e),M=m,r=e,k+1):"x"===e&&1===S.length&&"0"===S[0]?(M=b,S.push(e),r=e,k+1):/[^\d]/.test(e)?(N(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function X(){return"f"===e&&(S.push(e),r=e,k+=1),/[eE]/.test(e)||("-"===e||"+"===e)&&/[eE]/.test(r)?(S.push(e),r=e,k+1):/[^\d]/.test(e)?(N(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function $(){if(/[^\d\w_]/.test(e)){var t=S.join("");return M=B[t]?v:F[t]?y:g,N(S.join("")),M=l,k}return S.push(e),r=e,k+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,u=9999,c=0,h=1,f=2,p=3,d=4,m=5,g=6,y=7,v=8,x=9,_=10,b=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(t,e,r){var n=r(6852);n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var n=r(620);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var n=r(5874);t.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},3236:function(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}},7520:function(t,e,r){var n=r(9507);t.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},3778:function(t,e){e.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*m}},8954:function(t,e,r){t.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),f=h.adjacent,p=new Array(i+2);for(c=0;c<=i;++c){for(var d=l.slice(),m=0;m<=i;++m)m===c&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var y=new a(d,new Array(i+1),!0);f[c]=y,p[c]=y}for(p[i+1]=h,c=0;c<=i;++c){d=f[c].vertices;var v=f[c].adjacent;for(m=0;m<=i;++m){var x=d[m];if(x<0)v[m]=h;else for(var _=0;_<=i;++_)f[_].vertices.indexOf(x)<0&&(v[m]=f[_])}}var b=new u(i,o,p),w=!!e;for(c=i+1;c<r;++c)b.insert(t[c],w);return b.boundary()};var n=r(3250),i=r(6803).Fw;function a(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function o(t,e,r){this.vertices=t,this.cell=e,this.index=r}function s(t,e){return i(t.vertices,e.vertices)}a.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var l=[];function u(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var i=0;i<=t;++i)this.tuple[i]=this.vertices[i];var a=l[t];a||(a=l[t]=function(t){var e=n[t+1];return e||(e=n),function(t){return function(){var e=this.tuple;return t.apply(this,e)}}(e)}(t)),this.orient=a}var c=u.prototype;c.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;h<=r;++h){var f=c[h];i[h]=f<0?e:a[f]}var p=this.orient();if(p>0)return u;u.lastVisited=-n,0===p&&o.push(u)}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var p=this.orient();if(a[c]=f,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var p=(e=h.pop()).vertices,d=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=d[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,_=0;_<=n;++_)v[_]<0?(x=_,l[_]=t):l[_]=i[v[_]];if(this.orient()>0){v[x]=r,y.boundary=!1,u.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var b=y.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);c.push(k);var A=b.indexOf(e);if(!(A<0))for(b[A]=k,T[m]=y,w[g]=-1,T[g]=e,d[g]=k,k.flip(),_=0;_<=n;++_){var M=w[_];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,C=0;C<=n;++C){var I=w[C];I<0||C===_||(S[E++]=I)}f.push(new o(S,k,_))}}}}}for(f.sort(s),g=0;g+1<f.length;g+=2){var L=f[g],P=f[g+1],z=L.index,O=P.index;z<0||O<0||(L.cell.adjacent[L.index]=P.cell,P.cell.adjacent[P.index]=L.cell)}},c.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];a[o]=s<0?t:r[s]}var l=this.orient(a);l<0||0===l&&!(n=this.handleBoundaryDegeneracy(n,t))||this.addPeaks(t,n)}},c.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,u=0,c=0;c<=t;++c)s[c]>=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},3352:function(t,e,r){var n=r(2478);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new y(g(t)):new y(null)};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function h(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function f(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function p(t,e){return t-e}function d(t,e){return t[0]-e[0]||t[1]-e[1]}function m(t,e){return t[1]-e[1]||t[0]-e[0]}function g(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(p);var n=e[e.length>>1],a=[],o=[],s=[];for(r=0;r<t.length;++r){var l=t[r];l[1]<n?a.push(l):n<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(d),c.sort(m),new i(n,g(a),g(o),u,c)}function y(t){this.root=t}a.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},a.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t)for(this.count-=1,this.leftPoints.splice(a,1),s=n.ge(this.rightPoints,t,m);s<this.rightPoints.length&&this.rightPoints[s][1]===t[1];++s)if(this.rightPoints[s]===t)return this.rightPoints.splice(s,1),1;return 0},a.queryPoint=function(t,e){return t<this.mid?this.left&&(r=this.left.queryPoint(t,e))?r:c(this.leftPoints,t,e):t>this.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):f(this.leftPoints,e);var r},a.queryInterval=function(t,e,r){var n;return t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r))||e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:e<this.mid?c(this.leftPoints,e,r):t>this.mid?h(this.rightPoints,t,r):f(this.leftPoints,r)};var v=y.prototype;v.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},v.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},v.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},v.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(t){t.exports=!0},7163:function(t){function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},5219:function(t){t.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},395:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},2652:function(t,e,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),u={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},c=i(),h=i(),f=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,y){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(c,t)||(a(h,c),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8)))return!1;var v=c[3],x=c[7],_=c[11],b=c[12],w=c[13],T=c[14],k=c[15];if(0!==v||0!==x||0!==_){if(f[0]=v,f[1]=x,f[2]=_,f[3]=k,!s(h,h))return!1;l(h,h),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(g,f,h)}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=b,e[1]=w,e[2]=T,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(p,c),r[0]=u.length(p[0]),u.normalize(p[0],p[0]),i[0]=u.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=u.length(p[1]),u.normalize(p[1],p[1]),i[0]/=r[1],i[1]=u.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=u.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=u.length(p[2]),u.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],u.cross(d,p[1],p[2]),u.dot(p[0],d)<0)for(var A=0;A<3;A++)r[A]*=-1,p[A][0]*=-1,p[A][1]*=-1,p[A][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(y[0]=-y[0]),p[0][2]>p[2][0]&&(y[1]=-y[1]),p[1][0]>p[0][1]&&(y[2]=-y[2]),!0}},4335:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7442:function(t,e,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),u=h(),c=h();function h(){return{translate:f(),scale:f(1),skew:f(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function f(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var f=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!f||!p||(n(c.translate,l.translate,u.translate,h),n(c.skew,l.skew,u.skew,h),n(c.scale,l.scale,u.scale,h),n(c.perspective,l.perspective,u.perspective,h),s(c.quaternion,l.quaternion,u.quaternion,h),i(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},7182:function(t,e,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};n.create();var i=n.create();t.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},1811:function(t,e,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),u=r(6582),c=r(7656);r(2504);var h=r(3536),f=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),p=!0;for(u=0;u<16;++u)f[u]=s[l++];var d=this.nextMatrix;for(u=0;u<16;++u)d[u]=s[l++],p=p&&f[u]===d[u];if(c<1e-6||p)for(u=0;u<16;++u)o[u]=f[u];else i(o,f,d,(t-e[r])/c)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,_=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)x[u]=y[u]-o[2+4*u]*_}},d.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;n<16;++n)e.push(e[r++]);this._time.push(t)}},d.flush=function(t){var e=n.gt(this._time,t)-2;e<0||(this._time.splice(0,e),this._components.splice(0,16*e))},d.lastT=function(){return this._time[this._time.length-1]},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||f,n=n||this.computedUp,this.setMatrix(t,u(this.computedMatrix,e,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},d.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&s(i,i,e),r&&o(i,i,r),n&&l(i,i,n),this.setMatrix(t,a(this.computedMatrix,i))};var m=[0,0,0];d.pan=function(t,e,r,n){m[0]=-(e||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;c(i,i,m),this.setMatrix(t,a(i,i))},d.translate=function(t,e,r,n){m[0]=e||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;c(i,i,m),this.setMatrix(t,i)},d.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},d.setDistance=function(t,e){this.computedRadius[0]=e},d.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},d.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},3090:function(t,e,r){t.exports=function(t){var e=t.length;if(e<3){for(var r=new Array(e),i=0;i<e;++i)r[i]=i;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}var a=new Array(e);for(i=0;i<e;++i)a[i]=i;a.sort(function(e,r){return t[e][0]-t[r][0]||t[e][1]-t[r][1]});var o=[a[0],a[1]],s=[a[0],a[1]];for(i=2;i<e;++i){for(var l=a[i],u=t[l],c=o.length;c>1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,f=(i=0,o.length);i<f;++i)r[h++]=o[i];for(var p=s.length-2;p>0;--p)r[h++]=s[p];return r};var n=r(3250)[3]},351:function(t,e,r){t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(0,t)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function f(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?u(0,t):u(r,t)}function d(t){u(r|n.buttons(t),t)}function m(t){u(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",h),t.addEventListener("keyup",f),t.addEventListener("keydown",f),t.addEventListener("keypress",f),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",f),window.addEventListener("keydown",f),window.addEventListener("keypress",f)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",h),t.removeEventListener("keyup",f),t.removeEventListener("keydown",f),t.removeEventListener("keypress",f),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",f),window.removeEventListener("keydown",f),window.removeEventListener("keypress",f)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?e:t.getBoundingClientRect()}(r);return n[0]=i-o.left,n[1]=a-o.top,n}},4687:function(t,e){function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e;if(1===(e=t.button))return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0},e.element=r,e.x=function(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=r(t).getBoundingClientRect();return t.clientX-e.left}return 0},e.y=function(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=r(t).getBoundingClientRect();return t.clientY-e.top}return 0}},8512:function(t,e,r){var n=r(665);t.exports=function(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var i=n("ex",t),a=function(t){r&&t.preventDefault();var n=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=1;switch(t.deltaMode){case 1:s=i;break;case 2:s=window.innerHeight}if(a*=s,o*=s,(n*=s)||a||o)return e(n,a,o,t)};return t.addEventListener("wheel",a),a}},2640:function(t,e,r){var n=r(1888);t.exports=function(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!=typeof t&&e("Must specify arguments");var r=t.order;Array.isArray(r)||e("Must specify order");var a=t.arrayArguments||1;a<1&&e("Must have at least one array argument");var o=t.scalarArguments||0;o<0&&e("Scalar arg count must be > 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var s=t.getters||[],l=new Array(a),u=0;u<a;++u)s.indexOf(u)>=0?l[u]=!0:l[u]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(","),u=i[l];return u(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var u,c=0|a.shape[0],h=0|a.shape[1],f=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-d,v=0,x=0|-m,_=0,b=-d-m|0,w=0,T=0|d,k=m-d*c|0,A=0,M=0,S=0,E=2*c|0,C=n(E),I=n(E),L=0,P=0,z=-1,O=-1,D=0,R=0|-c,F=0|c,B=0,N=-c-1|0,j=c-1|0,U=0,V=0,q=0;for(A=0;A<c;++A)C[L++]=r(f[g],o,s,l),g+=T;if(g+=k,h>0){if(M=1,C[L++]=r(f[g],o,s,l),g+=T,c>0)for(A=1,u=f[g],P=C[L]=r(u,o,s,l),D=C[L+z],B=C[L+R],U=C[L+N],(P!==D||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,D,B,U,o,s,l),V=I[L]=S++),L+=1,g+=T,A=2;A<c;++A)u=f[g],P=C[L]=r(u,o,s,l),D=C[L+z],B=C[L+R],U=C[L+N],(P!==D||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,D,B,U,o,s,l),V=I[L]=S++,U!==D&&e(I[L+z],V,w,v,U,D,o,s,l)),L+=1,g+=T;for(g+=k,L=0,q=z,z=O,O=q,q=R,R=F,F=q,q=N,N=j,j=q,M=2;M<h;++M){if(C[L++]=r(f[g],o,s,l),g+=T,c>0)for(A=1,u=f[g],P=C[L]=r(u,o,s,l),D=C[L+z],B=C[L+R],U=C[L+N],(P!==D||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,D,B,U,o,s,l),V=I[L]=S++,U!==B&&e(I[L+R],V,_,w,B,U,o,s,l)),L+=1,g+=T,A=2;A<c;++A)u=f[g],P=C[L]=r(u,o,s,l),D=C[L+z],B=C[L+R],U=C[L+N],(P!==D||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,D,B,U,o,s,l),V=I[L]=S++,U!==B&&e(I[L+R],V,_,w,B,U,o,s,l),U!==D&&e(I[L+z],V,w,v,U,D,o,s,l)),L+=1,g+=T;1&M&&(L=0),q=z,z=O,O=q,q=R,R=F,F=q,q=N,N=j,j=q,g+=k}}i(I),i(C)}},"false,1,0":function(t,e,r,n,i){return function(a,o,s,l){var u,c=0|a.shape[0],h=0|a.shape[1],f=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-d,v=0,x=0|-m,_=0,b=-d-m|0,w=0,T=0|m,k=d-m*h|0,A=0,M=0,S=0,E=2*h|0,C=n(E),I=n(E),L=0,P=0,z=-1,O=-1,D=0,R=0|-h,F=0|h,B=0,N=-h-1|0,j=h-1|0,U=0,V=0,q=0;for(M=0;M<h;++M)C[L++]=r(f[g],o,s,l),g+=T;if(g+=k,c>0){if(A=1,C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,u=f[g],P=C[L]=r(u,o,s,l),B=C[L+R],D=C[L+z],U=C[L+N],(P!==B||P!==D||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,B,D,U,o,s,l),V=I[L]=S++),L+=1,g+=T,M=2;M<h;++M)u=f[g],P=C[L]=r(u,o,s,l),B=C[L+R],D=C[L+z],U=C[L+N],(P!==B||P!==D||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,B,D,U,o,s,l),V=I[L]=S++,U!==D&&e(I[L+z],V,_,w,D,U,o,s,l)),L+=1,g+=T;for(g+=k,L=0,q=R,R=F,F=q,q=z,z=O,O=q,q=N,N=j,j=q,A=2;A<c;++A){if(C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,u=f[g],P=C[L]=r(u,o,s,l),B=C[L+R],D=C[L+z],U=C[L+N],(P!==B||P!==D||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,B,D,U,o,s,l),V=I[L]=S++,U!==B&&e(I[L+R],V,w,v,U,B,o,s,l)),L+=1,g+=T,M=2;M<h;++M)u=f[g],P=C[L]=r(u,o,s,l),B=C[L+R],D=C[L+z],U=C[L+N],(P!==B||P!==D||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,u,v,_,w,P,B,D,U,o,s,l),V=I[L]=S++,U!==D&&e(I[L+z],V,_,w,D,U,o,s,l),U!==B&&e(I[L+R],V,w,v,U,B,o,s,l)),L+=1,g+=T;1&A&&(L=0),q=R,R=F,F=q,q=z,z=O,O=q,q=N,N=j,j=q,g+=k}}i(I),i(C)}}}},6199:function(t,e,r){var n=r(1338),i={zero:function(t,e,r,n){var i=t[0];n|=0;var a=0,o=r[0];for(a=0;a<i;++a)e[n]=0,n+=o},fdTemplate1:function(t,e,r,n,i,a,o){var s=t[0],l=r[0],u=-1*l,c=l;n|=0,o|=0;var h=0,f=l,p=a[0];for(h=0;h<s;++h)i[o]=.5*(e[n+u]-e[n+c]),n+=f,o+=p},fdTemplate2:function(t,e,r,n,i,a,o,s,l,u){var c=t[0],h=t[1],f=r[0],p=r[1],d=a[0],m=a[1],g=l[0],y=l[1],v=-1*f,x=f,_=-1*p,b=p;n|=0,o|=0,u|=0;var w=0,T=0,k=p,A=f-h*p,M=m,S=d-h*m,E=y,C=g-h*y;for(T=0;T<c;++T){for(w=0;w<h;++w)i[o]=.5*(e[n+v]-e[n+x]),s[u]=.5*(e[n+_]-e[n+b]),n+=k,o+=M,u+=E;n+=A,o+=S,u+=C}}},a={cdiff:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,u=i.dtype,c=i.order,h=[a,o.join(),s,l.join(),u,c.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,u,c])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},zero:function(t){var e={};return function(r){var n=r.dtype,i=r.order,a=[n,i.join()].join(),o=e[a];return o||(e[a]=o=t([n,i])),o(r.shape.slice(0),r.data,r.stride,0|r.offset)}},fdTemplate1:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),u=e[l];return u||(e[l]=u=t([i,a,o,s])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}},fdTemplate2:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,u=i.dtype,c=i.order,h=[a,o.join(),s,l.join(),u,c.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,u,c])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}}};function o(t){return(0,a[t.funcName])(s.bind(void 0,t))}function s(t){return i[t.funcName]}function l(t){return o({funcName:t.funcName})}var u={},c={},h=l({funcName:"cdiff"}),f=l({funcName:"zero"});function p(t){return t in u?u[t]:u[t]=l({funcName:"fdTemplate"+t})}function d(t,e,r,n){return function(t,i){var a=i.shape.slice();return a[0]>2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}t.exports=function(t,e,r){if(Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size)return t;if(0===e.dimension)return t.set(0),t;var i=function(t){var e=t.join();if(a=c[e])return a;for(var r=t.length,n=[h,f],i=1;i<=r;++i)n.push(p(i));var a=d.apply(void 0,n);return c[e]=a,a}(r);return i(t,e)}},4317:function(t){function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r<t.shape[0],a=0<=r+1&&r+1<t.shape[0];return(1-n)*(i?+t.get(r):0)+n*(a?+t.get(r+1):0)}function r(t,e,r){var n=Math.floor(e),i=e-n,a=0<=n&&n<t.shape[0],o=0<=n+1&&n+1<t.shape[0],s=Math.floor(r),l=r-s,u=0<=s&&s<t.shape[1],c=0<=s+1&&s+1<t.shape[1],h=a&&u?t.get(n,s):0,f=a&&c?t.get(n,s+1):0;return(1-l)*((1-i)*h+i*(o&&u?t.get(n+1,s):0))+l*((1-i)*f+i*(o&&c?t.get(n+1,s+1):0))}function n(t,e,r,n){var i=Math.floor(e),a=e-i,o=0<=i&&i<t.shape[0],s=0<=i+1&&i+1<t.shape[0],l=Math.floor(r),u=r-l,c=0<=l&&l<t.shape[1],h=0<=l+1&&l+1<t.shape[1],f=Math.floor(n),p=n-f,d=0<=f&&f<t.shape[2],m=0<=f+1&&f+1<t.shape[2],g=o&&c&&d?t.get(i,l,f):0,y=o&&h&&d?t.get(i,l+1,f):0,v=s&&c&&d?t.get(i+1,l,f):0,x=s&&h&&d?t.get(i+1,l+1,f):0,_=o&&c&&m?t.get(i,l,f+1):0,b=o&&h&&m?t.get(i,l+1,f+1):0;return(1-p)*((1-u)*((1-a)*g+a*v)+u*((1-a)*y+a*x))+p*((1-u)*((1-a)*_+a*(s&&c&&m?t.get(i+1,l,f+1):0))+u*((1-a)*b+a*(s&&h&&m?t.get(i+1,l+1,f+1):0)))}function i(t){var e,r,n=0|t.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(e=0;e<n;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,u,c,h=0;t:for(e=0;e<1<<n;++e){for(u=1,c=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;u*=a[l],c+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;u*=1-a[l],c+=t.stride[l]*i[l]}h+=u*t.data[c]}return h}t.exports=function(t,a,o,s){switch(t.shape.length){case 0:return 0;case 1:return e(t,a);case 2:return r(t,a,o);case 3:return n(t,a,o,s);default:return i.apply(void 0,arguments)}},t.exports.d1=e,t.exports.d2=r,t.exports.d3=n},5298:function(t,e){var r={"float64,2,1,0":function(){return function(t,e,r,n,i){var a=t[0],o=t[1],s=t[2],l=r[0],u=r[1],c=r[2];n|=0;var h=0,f=0,p=0,d=c,m=u-s*c,g=l-o*u;for(p=0;p<a;++p){for(f=0;f<o;++f){for(h=0;h<s;++h)e[n]/=i,n+=d;n+=m}n+=g}}},"uint8,2,0,1,float64,2,1,0":function(){return function(t,e,r,n,i,a,o,s){for(var l=t[0],u=t[1],c=t[2],h=r[0],f=r[1],p=r[2],d=a[0],m=a[1],g=a[2],y=n|=0,v=o|=0,x=0|t[0];x>0;){x<64?(l=x,x=0):(l=64,x-=64);for(var _=0|t[1];_>0;){_<64?(u=_,_=0):(u=64,_-=64),n=y+x*h+_*f,o=v+x*d+_*m;var b=0,w=0,T=0,k=p,A=h-c*p,M=f-l*h,S=g,E=d-c*g,C=m-l*d;for(T=0;T<u;++T){for(w=0;w<l;++w){for(b=0;b<c;++b)e[n]=i[o]*s,n+=k,o+=S;n+=A,o+=E}n+=M,o+=C}}}}},"float32,1,0,float32,1,0":function(){return function(t,e,r,n,i,a,o){var s=t[0],l=t[1],u=r[0],c=r[1],h=a[0],f=a[1];n|=0,o|=0;var p=0,d=0,m=c,g=u-l*c,y=f,v=h-l*f;for(d=0;d<s;++d){for(p=0;p<l;++p)e[n]=i[o],n+=m,o+=y;n+=g,o+=v}}},"float32,1,0,float32,0,1":function(){return function(t,e,r,n,i,a,o){for(var s=t[0],l=t[1],u=r[0],c=r[1],h=a[0],f=a[1],p=n|=0,d=o|=0,m=0|t[1];m>0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+m*c+g*u,o=d+m*f+g*h;var y=0,v=0,x=c,_=u-l*c,b=f,w=h-l*f;for(v=0;v<s;++v){for(y=0;y<l;++y)e[n]=i[o],n+=x,o+=b;n+=_,o+=w}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(t,e,r,n,i,a,o){for(var s=t[0],l=t[1],u=t[2],c=r[0],h=r[1],f=r[2],p=a[0],d=a[1],m=a[2],g=n|=0,y=o|=0,v=0|t[2];v>0;){v<64?(u=v,v=0):(u=64,v-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var _=0|t[1];_>0;){_<64?(l=_,_=0):(l=64,_-=64),n=g+v*f+x*c+_*h,o=y+v*m+x*p+_*d;var b=0,w=0,T=0,k=f,A=c-u*f,M=h-s*c,S=m,E=p-u*m,C=d-s*p;for(T=0;T<l;++T){for(w=0;w<s;++w){for(b=0;b<u;++b)e[n]=i[o],n+=k,o+=S;n+=A,o+=E}n+=M,o+=C}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(t,e,r,n,i,a,o){var s=t[0],l=t[1],u=t[2],c=r[0],h=r[1],f=r[2],p=a[0],d=a[1],m=a[2];n|=0,o|=0;var g=0,y=0,v=0,x=f,_=c-u*f,b=h-s*c,w=m,T=p-u*m,k=d-s*p;for(v=0;v<l;++v){for(y=0;y<s;++y){for(g=0;g<u;++g)e[n]=i[o],n+=x,o+=w;n+=_,o+=T}n+=b,o+=k}}}},n=function(t,e){var n=e.join(",");return(0,r[n])()},i={mul:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,u=i.dtype,c=i.order,h=[a,o.join(),s,l.join(),u,c.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,u,c])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},muls:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,u=[a,o.join(),s,l.join()].join(),c=e[u];return c||(e[u]=c=t([a,o,s,l])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},mulseq:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=e[o];return s||(e[o]=s=t([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},div:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,u=i.dtype,c=i.order,h=[a,o.join(),s,l.join(),u,c.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,u,c])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},divs:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,u=[a,o.join(),s,l.join()].join(),c=e[u];return c||(e[u]=c=t([a,o,s,l])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},divseq:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=e[o];return s||(e[o]=s=t([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},assign:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),u=e[l];return u||(e[l]=u=t([i,a,o,s])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}}};function a(t){return function(t){return(0,i[t.funcName])(n.bind(void 0,t))}({funcName:t.funcName})}var o={mul:"*",div:"/"};(function(){for(var t in o)e[t]=a({funcName:t}),e[t+"s"]=a({funcName:t+"s"}),e[t+"seq"]=a({funcName:t+"seq"})})(),e.assign=a({funcName:"assign"})},9994:function(t,e,r){var n=r(9618),i=r(8277);t.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},8277:function(t){var e=function(){return function(t,e,r,n,i){var a=t[0],o=t[1],s=t[2],l=r[0],u=r[1],c=r[2],h=[0,0,0];n|=0;var f=0,p=0,d=0,m=c,g=u-s*c,y=l-o*u;for(d=0;d<a;++d){for(p=0;p<o;++p){for(f=0;f<s;++f){var v,x=i;for(v=0;v<h.length-1;++v)x=x[h[v]];e[n]=x[h[h.length-1]],n+=m,++h[2]}n+=g,h[2]-=s,++h[1]}n+=y,h[1]-=o,++h[0]}}};t.exports=function(t){return function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=e[o];return s||(e[o]=s=t([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}}(e.bind(void 0,t))}({funcName:"convert"})},7640:function(t,e,r){var n=r(1888);function i(t){return"uint32"===t?[n.mallocUint32,n.freeUint32]:null}var a={"uint32,1,0":function(t,e){return function(r,n,i,a,o,s,l,u,c,h,f){var p,d,m,g,y,v,x,_,b=r*o+a,w=t(u);for(p=r+1;p<=n;++p){for(d=p,m=b+=o,y=0,v=b,g=0;g<u;++g)w[y++]=i[v],v+=c;t:for(;d-- >r;){y=0,v=m-o;e:for(g=0;g<u;++g){if((x=i[v])<(_=w[y]))break t;if(x>_)break e;v+=h,y+=f}for(y=m,v=m-o,g=0;g<u;++g)i[y]=i[v],y+=c,v+=c;m-=o}for(y=m,v=0,g=0;g<u;++g)i[y]=w[v++],y+=c}e(w)}}},o={"uint32,1,0":function(t,e,r){return function n(i,a,o,s,l,u,c,h,f,p,d){var m,g,y,v,x,_,b,w,T,k,A,M,S,E,C,I,L,P,z,O,D,R,F,B,N,j=(a-i+1)/6|0,U=i+j,V=a-j,q=i+a>>1,H=q-j,G=q+j,Z=U,W=H,Y=q,X=G,$=V,J=i+1,K=a-1,Q=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),at=e(nt);A=l*Z,M=l*W,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=Z,Z=W,W=g;break t}if(rt<0)break t;N+=p}A=l*X,M=l*$,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=X,X=$,$=g;break t}if(rt<0)break t;N+=p}A=l*Z,M=l*Y,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=Z,Z=Y,Y=g;break t}if(rt<0)break t;N+=p}A=l*W,M=l*Y,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=W,W=Y,Y=g;break t}if(rt<0)break t;N+=p}A=l*Z,M=l*X,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=Z,Z=X,X=g;break t}if(rt<0)break t;N+=p}A=l*Y,M=l*X,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=Y,Y=X,X=g;break t}if(rt<0)break t;N+=p}A=l*W,M=l*$,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=W,W=$,$=g;break t}if(rt<0)break t;N+=p}A=l*W,M=l*Y,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=W,W=Y,Y=g;break t}if(rt<0)break t;N+=p}A=l*X,M=l*$,N=s;t:for(k=0;k<h;++k){if(w=M+N,(rt=o[b=A+N]-o[w])>0){g=X,X=$,$=g;break t}if(rt<0)break t;N+=p}for(A=l*Z,M=l*W,S=l*Y,E=l*X,C=l*$,I=l*U,L=l*q,P=l*V,B=0,N=s,k=0;k<h;++k)b=A+N,w=M+N,T=S+N,z=E+N,O=C+N,D=I+N,R=L+N,F=P+N,it[B]=o[w],at[B]=o[z],Q=Q&&it[B]===at[B],y=o[b],v=o[T],x=o[O],o[D]=y,o[R]=v,o[F]=x,++B,N+=f;for(A=l*H,M=l*i,N=s,k=0;k<h;++k)w=M+N,o[b=A+N]=o[w],N+=f;for(A=l*G,M=l*a,N=s,k=0;k<h;++k)w=M+N,o[b=A+N]=o[w],N+=f;if(Q)for(_=J;_<=K;++_){for(b=s+_*l,B=0,k=0;k<h&&0===(rt=o[b]-it[B]);++k)B+=d,b+=p;if(0!==rt)if(rt<0){if(_!==J)for(A=l*_,M=l*J,N=s,k=0;k<h;++k)w=M+N,m=o[b=A+N],o[b]=o[w],o[w]=m,N+=f;++J}else for(;;){for(b=s+K*l,B=0,k=0;k<h&&0===(rt=o[b]-it[B]);++k)B+=d,b+=p;if(!(rt>0)){if(rt<0){for(A=l*_,M=l*J,S=l*K,N=s,k=0;k<h;++k)w=M+N,T=S+N,m=o[b=A+N],o[b]=o[w],o[w]=o[T],o[T]=m,N+=f;++J,--K;break}for(A=l*_,M=l*K,N=s,k=0;k<h;++k)w=M+N,m=o[b=A+N],o[b]=o[w],o[w]=m,N+=f;--K;break}K--}}else for(_=J;_<=K;++_){for(b=s+_*l,B=0,k=0;k<h&&0===(tt=o[b]-it[B]);++k)B+=d,b+=p;if(tt<0){if(_!==J)for(A=l*_,M=l*J,N=s,k=0;k<h;++k)w=M+N,m=o[b=A+N],o[b]=o[w],o[w]=m,N+=f;++J}else{for(b=s+_*l,B=0,k=0;k<h&&0===(et=o[b]-at[B]);++k)B+=d,b+=p;if(et>0)for(;;){for(b=s+K*l,B=0,k=0;k<h&&0===(rt=o[b]-at[B]);++k)B+=d,b+=p;if(!(rt>0)){for(b=s+K*l,B=0,k=0;k<h&&0===(rt=o[b]-it[B]);++k)B+=d,b+=p;if(rt<0){for(A=l*_,M=l*J,S=l*K,N=s,k=0;k<h;++k)w=M+N,T=S+N,m=o[b=A+N],o[b]=o[w],o[w]=o[T],o[T]=m,N+=f;++J,--K}else{for(A=l*_,M=l*K,N=s,k=0;k<h;++k)w=M+N,m=o[b=A+N],o[b]=o[w],o[w]=m,N+=f;--K}break}if(--K<_)break}}}for(A=l*i,M=l*(J-1),B=0,N=s,k=0;k<h;++k)w=M+N,o[b=A+N]=o[w],o[w]=it[B],++B,N+=f;for(A=l*a,M=l*(K+1),B=0,N=s,k=0;k<h;++k)w=M+N,o[b=A+N]=o[w],o[w]=at[B],++B,N+=f;if(J-2-i<=32?t(i,J-2,o,s,l,u,c,h,f,p,d):n(i,J-2,o,s,l,u,c,h,f,p,d),a-(K+2)<=32?t(K+2,a,o,s,l,u,c,h,f,p,d):n(K+2,a,o,s,l,u,c,h,f,p,d),Q)return r(it),void r(at);if(J<U&&K>V){t:for(;;){for(b=s+J*l,B=0,N=s,k=0;k<h;++k){if(o[b]!==it[B])break t;++B,b+=f}++J}t:for(;;){for(b=s+K*l,B=0,N=s,k=0;k<h;++k){if(o[b]!==at[B])break t;++B,b+=f}--K}for(_=J;_<=K;++_){for(b=s+_*l,B=0,k=0;k<h&&0===(tt=o[b]-it[B]);++k)B+=d,b+=p;if(0===tt){if(_!==J)for(A=l*_,M=l*J,N=s,k=0;k<h;++k)w=M+N,m=o[b=A+N],o[b]=o[w],o[w]=m,N+=f;++J}else{for(b=s+_*l,B=0,k=0;k<h&&0===(et=o[b]-at[B]);++k)B+=d,b+=p;if(0===et)for(;;){for(b=s+K*l,B=0,k=0;k<h&&0===(rt=o[b]-at[B]);++k)B+=d,b+=p;if(0!==rt){for(b=s+K*l,B=0,k=0;k<h&&0===(rt=o[b]-it[B]);++k)B+=d,b+=p;if(rt<0){for(A=l*_,M=l*J,S=l*K,N=s,k=0;k<h;++k)w=M+N,T=S+N,m=o[b=A+N],o[b]=o[w],o[w]=o[T],o[T]=m,N+=f;++J,--K}else{for(A=l*_,M=l*K,N=s,k=0;k<h;++k)w=M+N,m=o[b=A+N],o[b]=o[w],o[w]=m,N+=f;--K}break}if(--K<_)break}}}}r(it),r(at),K-J<=32?t(J,K,o,s,l,u,c,h,f,p,d):n(J,K,o,s,l,u,c,h,f,p,d)}}},s={"uint32,1,0":function(t,e){return function(r){var n=r.data,i=0|r.offset,a=r.shape,o=r.stride,s=0|o[0],l=0|a[0],u=0|o[1],c=0|a[1],h=u,f=u;l<=32?t(0,l-1,n,i,s,u,l,c,h,f,1):e(0,l-1,n,i,s,u,l,c,h,f,1)}}};t.exports=function(t,e){var r=[e,t].join(","),n=s[r],l=function(t,e){var r=i(e),n=[e,t].join(","),o=a[n];return r?o(r[0],r[1]):o()}(t,e),u=function(t,e,r){var n=i(e),a=[e,t].join(","),s=o[a];return t.length>1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,u)}},446:function(t,e,r){var n=r(7640),i={};t.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},9618:function(t,e,r){var n=r(7163),i="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(a);var n=new Array(r.length);for(t=0;t<n.length;++t)n[t]=r[t][1];return n}var s={T:function(t){function e(t){this.data=t}var r=e.prototype;return r.dtype=t,r.index=function(){return-1},r.size=0,r.dimension=-1,r.shape=r.stride=r.order=[],r.lo=r.hi=r.transpose=r.step=function(){return new e(this.data)},r.get=r.set=function(){},r.pick=function(){return null},function(t){return new e(t)}},0:function(t,e){function r(t,e){this.data=t,this.offset=e}var n=r.prototype;return n.dtype=t,n.index=function(){return this.offset},n.dimension=0,n.size=1,n.shape=n.stride=n.order=[],n.lo=n.hi=n.transpose=n.step=function(){return new r(this.data,this.offset)},n.pick=function(){return e(this.data)},n.valueOf=n.get=function(){return"generic"===t?this.data.get(this.offset):this.data[this.offset]},n.set=function(e){return"generic"===t?this.data.set(this.offset,e):this.data[this.offset]=e},function(t,e,n,i){return new r(t,i)}},1:function(t,e,r){function n(t,e,r,n){this.data=t,this.shape=[e],this.stride=[r],this.offset=0|n}var i=n.prototype;return i.dtype=t,i.dimension=1,Object.defineProperty(i,"size",{get:function(){return this.shape[0]}}),i.order=[0],i.set=function(e,r){return"generic"===t?this.data.set(this.offset+this.stride[0]*e,r):this.data[this.offset+this.stride[0]*e]=r},i.get=function(e){return"generic"===t?this.data.get(this.offset+this.stride[0]*e):this.data[this.offset+this.stride[0]*e]},i.index=function(t){return this.offset+this.stride[0]*t},i.hi=function(t){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,this.stride[0],this.offset)},i.lo=function(t){var e=this.offset,r=0,i=this.shape[0],a=this.stride[0];return"number"==typeof t&&t>=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=u(-r/l)):r=u(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=u(-i/l)):i=u(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],h=this.stride[2];return"number"==typeof t&&t>=0&&(i+=u*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=c*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,u,c,h,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,h=0,f=Math.ceil;return"number"==typeof t&&((h=0|t)<0?(c+=s*(i-1),i=f(-i/h)):i=f(i/h),s*=h),"number"==typeof e&&((h=0|e)<0?(c+=l*(a-1),a=f(-a/h)):a=f(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(c+=u*(o-1),o=f(-o/h)):o=f(o/h),u*=h),new n(this.data,i,a,o,s,l,u,c)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,u){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|u}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3];return"number"==typeof t&&t>=0&&(a+=h*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=f*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=p*(o=0|r),u-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),c-=o),new n(this.data,s,l,u,c,h,f,p,d,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],h=this.stride[2],f=this.stride[3],p=this.offset,d=0,m=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(p+=u*(a-1),a=m(-a/d)):a=m(a/d),u*=d),"number"==typeof e&&((d=0|e)<0?(p+=c*(o-1),o=m(-o/d)):o=m(o/d),c*=d),"number"==typeof r&&((d=0|r)<0?(p+=h*(s-1),s=m(-s/d)):s=m(s/d),h*=d),"number"==typeof i&&((d=0|i)<0?(p+=f*(l-1),l=m(-l/d)):l=m(l/d),f*=d),new n(this.data,a,o,s,l,u,c,h,f,p)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,u,c,h){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,u,c],this.offset=0|h}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],h=this.shape[3],f=this.shape[4],p=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof t&&t>=0&&(o+=p*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=d*(s=0|e),u-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),c-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"==typeof a&&a>=0&&(o+=y*(s=0|a),f-=s),new n(this.data,l,u,c,h,f,p,d,m,g,y,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"==typeof t&&((y=0|t)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"==typeof e&&((y=0|e)<0?(g+=f*(s-1),s=v(-s/y)):s=v(s/y),f*=y),"number"==typeof r&&((y=0|r)<0?(g+=p*(l-1),l=v(-l/y)):l=v(l/y),p*=y),"number"==typeof i&&((y=0|i)<0?(g+=d*(u-1),u=v(-u/y)):u=v(u/y),d*=y),"number"==typeof a&&((y=0|a)<0?(g+=m*(c-1),c=v(-c/y)):c=v(c/y),m*=y),new n(this.data,o,s,l,u,c,h,f,p,d,m,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,u[t][0]):n(t,u[t],o)}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===a)for(a=0,s=0;s<o;++s)r[s]<0&&(a-=(e[s]-1)*r[s]);for(var h=function(t){if(n(t))return"buffer";if(i)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(t)?"array":"generic"}(t),f=u[h];f.length<=o+1;)f.push(l(h,f.length-1));return(0,f[o+1])(t,e,r,a)}},1278:function(t,e,r){var n=r(2361),i=Math.pow(2,-1074),a=-1>>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o)i[o]=[0,0,0];for(o=0;o<t.length;++o)for(var s=t[o],l=0,u=s[s.length-1],c=s[0],h=0;h<s.length;++h){l=u,u=c,c=s[(h+1)%s.length];for(var f=e[l],p=e[u],d=e[c],m=new Array(3),g=0,y=new Array(3),v=0,x=0;x<3;++x)m[x]=f[x]-p[x],g+=m[x]*m[x],y[x]=d[x]-p[x],v+=y[x]*y[x];if(g*v>a){var _=i[u],b=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;_[x]+=b*(y[w]*m[T]-y[T]*m[w])}}}for(o=0;o<n;++o){_=i[o];var k=0;for(x=0;x<3;++x)k+=_[x]*_[x];if(k>a)for(b=1/Math.sqrt(k),x=0;x<3;++x)_[x]*=b;else for(x=0;x<3;++x)_[x]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o){for(var s=t[o],l=new Array(3),u=0;u<3;++u)l[u]=e[s[u]];var c=new Array(3),h=new Array(3);for(u=0;u<3;++u)c[u]=l[1][u]-l[0][u],h[u]=l[2][u]-l[0][u];var f=new Array(3),p=0;for(u=0;u<3;++u){var d=(u+1)%3,m=(u+2)%3;f[u]=c[d]*h[m]-c[m]*h[d],p+=f[u]*f[u]}for(p=p>a?1/Math.sqrt(p):0,u=0;u<3;++u)f[u]*=p;i[o]=f}return i}},4081:function(t){t.exports=function(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u);h=Math.sqrt(2*f-c+1),e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},9977:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=u(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var f=h.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},f.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],h=i[4],f=i[8],p=c*a+h*o+f*s,d=l(c-=a*p,h-=o*p,f-=s*p);c/=d,h/=d,f/=d,i[2],i[6],i[10];var m=c*e+a*r,g=h*e+o*r,y=f*e+s*r;this.center.move(t,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(t,Math.log(v))},f.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],h=i[5],f=i[9],p=i[2],d=i[6],m=i[10],g=e*a+r*c,y=e*o+r*h,v=e*s+r*f,x=-(d*v-m*y),_=-(m*g-p*v),b=-(p*y-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(_,2)-Math.pow(b,2))),T=u(x,_,b,w);T>1e-6?(x/=T,_/=T,b/=T,w/=T):(x=_=b=0,w=1);var k=this.computedRotation,A=k[0],M=k[1],S=k[2],E=k[3],C=A*w+E*x+M*b-S*_,I=M*w+E*_+S*x-A*b,L=S*w+E*b+A*_-M*x,P=E*w-A*x-M*_-S*b;if(n){x=p,_=d,b=m;var z=Math.sin(n)/l(x,_,b);x*=z,_*=z,b*=z,P=P*(w=Math.cos(e))-(C=C*w+P*x+I*b-L*_)*x-(I=I*w+P*_+L*x-C*b)*_-(L=L*w+P*b+C*_-I*x)*b}var O=u(C,I,L,P);O>1e-6?(C/=O,I/=O,L/=O,P/=O):(C=I=L=0,P=1),this.rotation.set(t,C,I,L,P)},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*h,l-n[6]*h,u-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},f.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},f.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},f.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371:function(t,e,r){var n=r(3233);t.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},3202:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},3088:function(t,e,r){t.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o<r;++o)a[0][o]=[],a[1][o]=[];for(o=0;o<i;++o){var s=t[o];a[0][s[0]].push(s),a[1][s[1]].push(s)}var l=[];for(o=0;o<r;++o)a[0][o].length+a[1][o].length===0&&l.push([o]);function u(t,e){var r=a[e][t[e]];r.splice(r.indexOf(t),1)}function c(t,r,i){for(var o,s,l,c=0;c<2;++c)if(a[c][r].length>0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=a[h][r],p=0;p<f.length;++p){var d=f[p],m=d[1^h];n(e[t],e[r],e[s],e[m])>0&&(o=d,s=m,l=h)}return i||o&&u(o,l),s}function h(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],h=t,f=o[1],p=c(l,h,!0);if(n(e[l],e[h],e[f],e[p])<0)break;o.push(t),s=c(l,h)}return o}function f(t,e){return e[1]===e[e.length-1]}for(o=0;o<r;++o)for(var p=0;p<2;++p){for(var d=[];a[p][o].length>0;){a[0][o].length;var m=h(o,p);f(0,m)?d.push.apply(d,m):(d.length>0&&l.push(d),d=m)}d.length>0&&l.push(d)}return l};var n=r(3140)},5609:function(t,e,r){t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;a[s]=l,i[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){i[p=o.pop()]=!1;var u=r[p];for(s=0;s<u.length;++s){var c=u[s];0===--a[c]&&o.push(c)}}var h=new Array(e.length),f=[];for(s=0;s<e.length;++s)if(i[s]){var p=f.length;h[s]=p,f.push(e[s])}else h[s]=-1;var d=[];for(s=0;s<t.length;++s){var m=t[s];i[m[0]]&&i[m[1]]&&d.push([h[m[0]],h[m[1]]])}return[d,f]};var n=r(3134)},2095:function(t,e,r){t.exports=function(t,e){var r=u(t,e);t=r[0];for(var h=(e=r[1]).length,f=(t.length,n(t,e.length)),p=0;p<h;++p)if(f[p].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var d=i(t,e),m=(d=d.filter(function(t){for(var r=t.length,n=[0],i=0;i<r;++i){var a=e[t[i]],l=e[t[(i+1)%r]],u=o(-a[0],a[1]),c=o(-a[0],l[1]),h=o(l[0],a[1]),f=o(l[0],l[1]);n=s(n,s(s(u,c),s(h,f)))}return n[n.length-1]>0})).length,g=new Array(m),y=new Array(m);for(p=0;p<m;++p){g[p]=p;var v=new Array(m),x=d[p].map(function(t){return e[t]}),_=a([x]),b=0;t:for(var w=0;w<m;++w)if(v[w]=0,p!==w){for(var T=(q=d[w]).length,k=0;k<T;++k){var A=_(e[q[k]]);if(0!==A){A<0&&(v[w]=1,b+=1);continue t}}v[w]=1,b+=1}y[p]=[b,p,v]}for(y.sort(function(t,e){return e[0]-t[0]}),p=0;p<m;++p){var M=(v=y[p])[1],S=v[2];for(w=0;w<m;++w)S[w]&&(g[w]=M)}var E=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}(m);for(p=0;p<m;++p)E[p].push(g[p]),E[g[p]].push(p);var C={},I=c(h,!1);for(p=0;p<m;++p)for(T=(q=d[p]).length,w=0;w<T;++w){var L=q[w],P=q[(w+1)%T],z=Math.min(L,P)+":"+Math.max(L,P);if(z in C){var O=C[z];E[O].push(p),E[p].push(O),I[L]=I[P]=!0}else C[z]=p}function D(t){for(var e=t.length,r=0;r<e;++r)if(!I[t[r]])return!1;return!0}var R=[],F=c(m,-1);for(p=0;p<m;++p)g[p]!==p||D(d[p])?F[p]=-1:(R.push(p),F[p]=0);for(r=[];R.length>0;){var B=R.pop(),N=E[B];l(N,function(t,e){return t-e});var j,U=N.length,V=F[B];for(0===V&&(j=[q=d[B]]),p=0;p<U;++p){var q,H=N[p];F[H]>=0||(F[H]=1^V,R.push(H),0!==V)||D(q=d[H])||(q.reverse(),j.push(q))}0===V&&r.push(j)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),u=r(5609);function c(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}},5085:function(t,e,r){t.exports=function(t){for(var e=t.length,r=[],a=[],s=0;s<e;++s)for(var c=t[s],h=c.length,f=h-1,p=0;p<h;f=p++){var d=c[f],m=c[p];d[0]===m[0]?a.push([d,m]):r.push([d,m])}if(0===r.length)return 0===a.length?u:function(t){return function(e){return t(e[0],e[1])?0:1}}(l(a));var g=i(r),y=function(t,e){return function(r){var i=o.le(e,r[0]);if(i<0)return 1;var a=t[i];if(!a){if(!(i>0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(u<0)a=a.left;else{if(!(u>0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(g.slabs,g.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(t){for(var e={},r=0;r<t.length;++r){var n=t[r],i=n[0][0],o=n[0][1],l=n[1][1],u=[Math.min(o,l),Math.max(o,l)];i in e?e[i].push(u):e[i]=[u]}var c={},h=Object.keys(e);for(r=0;r<h.length;++r){var f=e[h[r]];c[h[r]]=a(f)}return function(t){return function(e,r){var n=t[e];return!!n&&!!n.queryPoint(r,s)}}(c)}function u(t){return 1}},9346:function(t){var e=new Float64Array(4),r=new Float64Array(4),n=new Float64Array(4);t.exports=function(t,i,a,o,s){e.length<o.length&&(e=new Float64Array(o.length),r=new Float64Array(o.length),n=new Float64Array(o.length));for(var l=0;l<o.length;++l)e[l]=t[l]-o[l],r[l]=i[l]-t[l],n[l]=a[l]-t[l];var u=0,c=0,h=0,f=0,p=0,d=0;for(l=0;l<o.length;++l){var m=r[l],g=n[l],y=e[l];u+=m*m,c+=m*g,h+=g*g,f+=y*m,p+=y*g,d+=y*y}var v,x,_,b,w,T=Math.abs(u*h-c*c),k=c*p-h*f,A=c*f-u*p;if(k+A<=T)if(k<0)A<0&&f<0?(A=0,-f>=u?(k=1,v=u+2*f+d):v=f*(k=-f/u)+d):(k=0,p>=0?(A=0,v=d):-p>=h?(A=1,v=h+2*p+d):v=p*(A=-p/h)+d);else if(A<0)A=0,f>=0?(k=0,v=d):-f>=u?(k=1,v=u+2*f+d):v=f*(k=-f/u)+d;else{var M=1/T;v=(k*=M)*(u*k+c*(A*=M)+2*f)+A*(c*k+h*A+2*p)+d}else k<0?(_=h+p)>(x=c+f)?(b=_-x)>=(w=u-2*c+h)?(k=1,A=0,v=u+2*f+d):v=(k=b/w)*(u*k+c*(A=1-k)+2*f)+A*(c*k+h*A+2*p)+d:(k=0,_<=0?(A=1,v=h+2*p+d):p>=0?(A=0,v=d):v=p*(A=-p/h)+d):A<0?(_=u+f)>(x=c+p)?(b=_-x)>=(w=u-2*c+h)?(A=1,k=0,v=h+2*p+d):v=(k=1-(A=b/w))*(u*k+c*A+2*f)+A*(c*k+h*A+2*p)+d:(A=0,_<=0?(k=1,v=u+2*f+d):f>=0?(k=0,v=d):v=f*(k=-f/u)+d):(b=h+p-c-f)<=0?(k=0,A=1,v=h+2*p+d):b>=(w=u-2*c+h)?(k=1,A=0,v=u+2*f+d):v=(k=b/w)*(u*k+c*(A=1-k)+2*f)+A*(c*k+h*A+2*p)+d;var S=1-k-A;for(l=0;l<o.length;++l)s[l]=S*t[l]+k*i[l]+A*a[l];return v<0?0:v}},8648:function(t,e,r){t.exports=r(783)},2653:function(t,e,r){var n=r(3865);t.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a<r;++a)i[a]=n(t[a],e[a]);return i}},5838:function(t,e,r){t.exports=function(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=n(t[r]);return e};var n=r(7842)},8987:function(t,e,r){var n=r(7842),i=r(6504);t.exports=function(t,e){for(var r=n(e),a=t.length,o=new Array(a),s=0;s<a;++s)o[s]=i(t[s],r);return o}},544:function(t,e,r){var n=r(5572);t.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a<r;++a)i[a]=n(t[a],e[a]);return i}},5771:function(t,e,r){var n=r(8507),i=r(3788),a=r(2419);t.exports=function(t){t.sort(i);for(var e=t.length,r=0,o=0;o<e;++o){var s=t[o],l=a(s);if(0!==l){if(r>0){var u=t[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},3233:function(t){var e,r="";t.exports=function(t,n){if("string"!=typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||void 0===e)e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i<e;++i){var s,l;(l=(s=r)-((r=(a=t[i])+s)-a))&&(t[o++]=l)}return t[o++]=r,t.length=o,t}},2962:function(t,e,r){var n=r(5250),i=r(8210),a=r(3012),o=r(7004);function s(t,e,r,n){return function(e){return n(t(r(e[0][0],e[1][1]),r(-e[0][1],e[1][0])))}}function l(t,e,r,n){return function(i){return n(t(e(t(r(i[1][1],i[2][2]),r(-i[1][2],i[2][1])),i[0][0]),t(e(t(r(i[1][0],i[2][2]),r(-i[1][2],i[2][0])),-i[0][1]),e(t(r(i[1][0],i[2][1]),r(-i[1][1],i[2][0])),i[0][2]))))}}function u(t,e,r,n){return function(i){return n(t(t(e(t(e(t(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][1]),t(e(t(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),-i[1][2]),e(t(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][3]))),i[0][0]),e(t(e(t(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][0]),t(e(t(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][2]),e(t(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),i[1][3]))),-i[0][1])),t(e(t(e(t(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),i[1][0]),t(e(t(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][1]),e(t(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][3]))),i[0][2]),e(t(e(t(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][0]),t(e(t(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),-i[1][1]),e(t(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][2]))),-i[0][3]))))}}function c(t,e,r,n){return function(i){return n(t(t(e(t(t(e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][1]),e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),-i[1][2])),t(e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][3]),e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),-i[1][4]))),i[0][0]),e(t(t(e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][0]),e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][2])),t(e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),i[1][3]),e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][4]))),-i[0][1])),t(e(t(t(e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),i[1][0]),e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][1])),t(e(t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][3]),e(t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),-i[1][4]))),i[0][2]),t(e(t(t(e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][0]),e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),-i[1][1])),t(e(t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][2]),e(t(e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][4]))),-i[0][3]),e(t(t(e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),i[1][0]),e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][1])),t(e(t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),i[1][2]),e(t(e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][3]))),i[0][4])))))}}function h(t){return(2===t?s:3===t?l:4===t?u:5===t?c:void 0)(i,a,n,o)}var f=[function(){return[0]},function(t){return[t[0][0]]}];function p(t,e,r,n,i,a,o,s){return function(l){switch(l.length){case 0:return t(l);case 1:return e(l);case 2:return r(l);case 3:return n(l);case 4:return i(l);case 5:return a(l)}var u=o[l.length];return u||(u=o[l.length]=s(l.length)),u(l)}}!function(){for(;f.length<6;)f.push(h(f.length));t.exports=p.apply(void 0,f.concat([f,h]));for(var e=0;e<f.length;++e)t.exports[e]=f[e]}()},1944:function(t,e,r){var n=r(5250),i=r(8210);t.exports=function(t,e){for(var r=n(t[0],e[0]),a=1;a<t.length;++a)r=i(r,n(t[a],e[a]));return r}},2646:function(t,e,r){var n=r(5250),i=r(8210),a=r(8545),o=r(3012);function s(t){return(3===t?l:4===t?u:5===t?c:h)(i,a,n,o)}function l(t,e,r,n){return function(i,a,o){var s=r(i[0],i[0]),l=n(s,a[0]),u=n(s,o[0]),c=r(a[0],a[0]),h=n(c,i[0]),f=n(c,o[0]),p=r(o[0],o[0]),d=n(p,i[0]),m=n(p,a[0]),g=t(e(m,f),e(h,l)),y=e(d,u),v=e(g,y);return v[v.length-1]}}function u(t,e,r,n){return function(i,a,o,s){var l=t(r(i[0],i[0]),r(i[1],i[1])),u=n(l,a[0]),c=n(l,o[0]),h=n(l,s[0]),f=t(r(a[0],a[0]),r(a[1],a[1])),p=n(f,i[0]),d=n(f,o[0]),m=n(f,s[0]),g=t(r(o[0],o[0]),r(o[1],o[1])),y=n(g,i[0]),v=n(g,a[0]),x=n(g,s[0]),_=t(r(s[0],s[0]),r(s[1],s[1])),b=n(_,i[0]),w=n(_,a[0]),T=n(_,o[0]),k=t(t(n(e(T,x),a[1]),t(n(e(w,m),-o[1]),n(e(v,d),s[1]))),t(n(e(w,m),i[1]),t(n(e(b,h),-a[1]),n(e(p,u),s[1])))),A=t(t(n(e(T,x),i[1]),t(n(e(b,h),-o[1]),n(e(y,c),s[1]))),t(n(e(v,d),i[1]),t(n(e(y,c),-a[1]),n(e(p,u),o[1])))),M=e(k,A);return M[M.length-1]}}function c(t,e,r,n){return function(i,a,o,s,l){var u=t(r(i[0],i[0]),t(r(i[1],i[1]),r(i[2],i[2]))),c=n(u,a[0]),h=n(u,o[0]),f=n(u,s[0]),p=n(u,l[0]),d=t(r(a[0],a[0]),t(r(a[1],a[1]),r(a[2],a[2]))),m=n(d,i[0]),g=n(d,o[0]),y=n(d,s[0]),v=n(d,l[0]),x=t(r(o[0],o[0]),t(r(o[1],o[1]),r(o[2],o[2]))),_=n(x,i[0]),b=n(x,a[0]),w=n(x,s[0]),T=n(x,l[0]),k=t(r(s[0],s[0]),t(r(s[1],s[1]),r(s[2],s[2]))),A=n(k,i[0]),M=n(k,a[0]),S=n(k,o[0]),E=n(k,l[0]),C=t(r(l[0],l[0]),t(r(l[1],l[1]),r(l[2],l[2]))),I=n(C,i[0]),L=n(C,a[0]),P=n(C,o[0]),z=n(C,s[0]),O=t(t(t(n(t(n(e(z,E),o[1]),t(n(e(P,T),-s[1]),n(e(S,w),l[1]))),a[2]),t(n(t(n(e(z,E),a[1]),t(n(e(L,v),-s[1]),n(e(M,y),l[1]))),-o[2]),n(t(n(e(P,T),a[1]),t(n(e(L,v),-o[1]),n(e(b,g),l[1]))),s[2]))),t(n(t(n(e(S,w),a[1]),t(n(e(M,y),-o[1]),n(e(b,g),s[1]))),-l[2]),t(n(t(n(e(z,E),a[1]),t(n(e(L,v),-s[1]),n(e(M,y),l[1]))),i[2]),n(t(n(e(z,E),i[1]),t(n(e(I,p),-s[1]),n(e(A,f),l[1]))),-a[2])))),t(t(n(t(n(e(L,v),i[1]),t(n(e(I,p),-a[1]),n(e(m,c),l[1]))),s[2]),t(n(t(n(e(M,y),i[1]),t(n(e(A,f),-a[1]),n(e(m,c),s[1]))),-l[2]),n(t(n(e(S,w),a[1]),t(n(e(M,y),-o[1]),n(e(b,g),s[1]))),i[2]))),t(n(t(n(e(S,w),i[1]),t(n(e(A,f),-o[1]),n(e(_,h),s[1]))),-a[2]),t(n(t(n(e(M,y),i[1]),t(n(e(A,f),-a[1]),n(e(m,c),s[1]))),o[2]),n(t(n(e(b,g),i[1]),t(n(e(_,h),-a[1]),n(e(m,c),o[1]))),-s[2]))))),D=t(t(t(n(t(n(e(z,E),o[1]),t(n(e(P,T),-s[1]),n(e(S,w),l[1]))),i[2]),n(t(n(e(z,E),i[1]),t(n(e(I,p),-s[1]),n(e(A,f),l[1]))),-o[2])),t(n(t(n(e(P,T),i[1]),t(n(e(I,p),-o[1]),n(e(_,h),l[1]))),s[2]),n(t(n(e(S,w),i[1]),t(n(e(A,f),-o[1]),n(e(_,h),s[1]))),-l[2]))),t(t(n(t(n(e(P,T),a[1]),t(n(e(L,v),-o[1]),n(e(b,g),l[1]))),i[2]),n(t(n(e(P,T),i[1]),t(n(e(I,p),-o[1]),n(e(_,h),l[1]))),-a[2])),t(n(t(n(e(L,v),i[1]),t(n(e(I,p),-a[1]),n(e(m,c),l[1]))),o[2]),n(t(n(e(b,g),i[1]),t(n(e(_,h),-a[1]),n(e(m,c),o[1]))),-l[2])))),R=e(O,D);return R[R.length-1]}}function h(t,e,r,n){return function(i,a,o,s,l,u){var c=t(t(r(i[0],i[0]),r(i[1],i[1])),t(r(i[2],i[2]),r(i[3],i[3]))),h=n(c,a[0]),f=n(c,o[0]),p=n(c,s[0]),d=n(c,l[0]),m=n(c,u[0]),g=t(t(r(a[0],a[0]),r(a[1],a[1])),t(r(a[2],a[2]),r(a[3],a[3]))),y=n(g,i[0]),v=n(g,o[0]),x=n(g,s[0]),_=n(g,l[0]),b=n(g,u[0]),w=t(t(r(o[0],o[0]),r(o[1],o[1])),t(r(o[2],o[2]),r(o[3],o[3]))),T=n(w,i[0]),k=n(w,a[0]),A=n(w,s[0]),M=n(w,l[0]),S=n(w,u[0]),E=t(t(r(s[0],s[0]),r(s[1],s[1])),t(r(s[2],s[2]),r(s[3],s[3]))),C=n(E,i[0]),I=n(E,a[0]),L=n(E,o[0]),P=n(E,l[0]),z=n(E,u[0]),O=t(t(r(l[0],l[0]),r(l[1],l[1])),t(r(l[2],l[2]),r(l[3],l[3]))),D=n(O,i[0]),R=n(O,a[0]),F=n(O,o[0]),B=n(O,s[0]),N=n(O,u[0]),j=t(t(r(u[0],u[0]),r(u[1],u[1])),t(r(u[2],u[2]),r(u[3],u[3]))),U=n(j,i[0]),V=n(j,a[0]),q=n(j,o[0]),H=n(j,s[0]),G=n(j,l[0]),Z=t(t(t(n(t(t(n(t(n(e(G,N),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),u[1]))),o[2]),n(t(n(e(G,N),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),u[1]))),-s[2])),t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,A),u[1]))),l[2]),n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,A),l[1]))),-u[2]))),a[3]),t(n(t(t(n(t(n(e(G,N),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),u[1]))),a[2]),n(t(n(e(G,N),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),u[1]))),-s[2])),t(n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),u[1]))),l[2]),n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),-u[2]))),-o[3]),n(t(t(n(t(n(e(G,N),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),u[1]))),a[2]),n(t(n(e(G,N),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),u[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(k,v),u[1]))),l[2]),n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(k,v),l[1]))),-u[2]))),s[3]))),t(t(n(t(t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,A),u[1]))),a[2]),n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),u[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(k,v),u[1]))),s[2]),n(t(n(e(L,A),a[1]),t(n(e(I,x),-o[1]),n(e(k,v),s[1]))),-u[2]))),-l[3]),n(t(t(n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,A),l[1]))),a[2]),n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),-o[2])),t(n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(k,v),l[1]))),s[2]),n(t(n(e(L,A),a[1]),t(n(e(I,x),-o[1]),n(e(k,v),s[1]))),-l[2]))),u[3])),t(n(t(t(n(t(n(e(G,N),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),u[1]))),a[2]),n(t(n(e(G,N),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),u[1]))),-s[2])),t(n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),u[1]))),l[2]),n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),-u[2]))),i[3]),n(t(t(n(t(n(e(G,N),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),u[1]))),i[2]),n(t(n(e(G,N),i[1]),t(n(e(U,m),-l[1]),n(e(D,d),u[1]))),-s[2])),t(n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),u[1]))),l[2]),n(t(n(e(B,P),i[1]),t(n(e(D,d),-s[1]),n(e(C,p),l[1]))),-u[2]))),-a[3])))),t(t(t(n(t(t(n(t(n(e(G,N),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),u[1]))),i[2]),n(t(n(e(G,N),i[1]),t(n(e(U,m),-l[1]),n(e(D,d),u[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),u[1]))),l[2]),n(t(n(e(R,_),i[1]),t(n(e(D,d),-a[1]),n(e(y,h),l[1]))),-u[2]))),s[3]),n(t(t(n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),u[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),u[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),u[1]))),s[2]),n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),-u[2]))),-l[3])),t(n(t(t(n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),i[2]),n(t(n(e(B,P),i[1]),t(n(e(D,d),-s[1]),n(e(C,p),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(D,d),-a[1]),n(e(y,h),l[1]))),s[2]),n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),-l[2]))),u[3]),n(t(t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,A),u[1]))),a[2]),n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),u[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(k,v),u[1]))),s[2]),n(t(n(e(L,A),a[1]),t(n(e(I,x),-o[1]),n(e(k,v),s[1]))),-u[2]))),i[3]))),t(t(n(t(t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,A),u[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),u[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),u[1]))),s[2]),n(t(n(e(L,A),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-u[2]))),-a[3]),n(t(t(n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),u[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),u[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),u[1]))),s[2]),n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),-u[2]))),o[3])),t(n(t(t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(k,v),u[1]))),i[2]),n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),u[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),u[1]))),o[2]),n(t(n(e(k,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-u[2]))),-s[3]),n(t(t(n(t(n(e(L,A),a[1]),t(n(e(I,x),-o[1]),n(e(k,v),s[1]))),i[2]),n(t(n(e(L,A),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-a[2])),t(n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),o[2]),n(t(n(e(k,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-s[2]))),u[3]))))),W=t(t(t(n(t(t(n(t(n(e(G,N),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),u[1]))),o[2]),n(t(n(e(G,N),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),u[1]))),-s[2])),t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,A),u[1]))),l[2]),n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,A),l[1]))),-u[2]))),i[3]),t(n(t(t(n(t(n(e(G,N),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),u[1]))),i[2]),n(t(n(e(G,N),i[1]),t(n(e(U,m),-l[1]),n(e(D,d),u[1]))),-s[2])),t(n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),u[1]))),l[2]),n(t(n(e(B,P),i[1]),t(n(e(D,d),-s[1]),n(e(C,p),l[1]))),-u[2]))),-o[3]),n(t(t(n(t(n(e(G,N),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),u[1]))),i[2]),n(t(n(e(G,N),i[1]),t(n(e(U,m),-l[1]),n(e(D,d),u[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),u[1]))),l[2]),n(t(n(e(F,M),i[1]),t(n(e(D,d),-o[1]),n(e(T,f),l[1]))),-u[2]))),s[3]))),t(t(n(t(t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,A),u[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),u[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),u[1]))),s[2]),n(t(n(e(L,A),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-u[2]))),-l[3]),n(t(t(n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,A),l[1]))),i[2]),n(t(n(e(B,P),i[1]),t(n(e(D,d),-s[1]),n(e(C,p),l[1]))),-o[2])),t(n(t(n(e(F,M),i[1]),t(n(e(D,d),-o[1]),n(e(T,f),l[1]))),s[2]),n(t(n(e(L,A),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-l[2]))),u[3])),t(n(t(t(n(t(n(e(G,N),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),u[1]))),a[2]),n(t(n(e(G,N),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),u[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(k,v),u[1]))),l[2]),n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(k,v),l[1]))),-u[2]))),i[3]),n(t(t(n(t(n(e(G,N),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),u[1]))),i[2]),n(t(n(e(G,N),i[1]),t(n(e(U,m),-l[1]),n(e(D,d),u[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),u[1]))),l[2]),n(t(n(e(F,M),i[1]),t(n(e(D,d),-o[1]),n(e(T,f),l[1]))),-u[2]))),-a[3])))),t(t(t(n(t(t(n(t(n(e(G,N),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),u[1]))),i[2]),n(t(n(e(G,N),i[1]),t(n(e(U,m),-l[1]),n(e(D,d),u[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),u[1]))),l[2]),n(t(n(e(R,_),i[1]),t(n(e(D,d),-a[1]),n(e(y,h),l[1]))),-u[2]))),o[3]),n(t(t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(k,v),u[1]))),i[2]),n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),u[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),u[1]))),o[2]),n(t(n(e(k,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-u[2]))),-l[3])),t(n(t(t(n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(k,v),l[1]))),i[2]),n(t(n(e(F,M),i[1]),t(n(e(D,d),-o[1]),n(e(T,f),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(D,d),-a[1]),n(e(y,h),l[1]))),o[2]),n(t(n(e(k,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-l[2]))),u[3]),n(t(t(n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,A),l[1]))),a[2]),n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),-o[2])),t(n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(k,v),l[1]))),s[2]),n(t(n(e(L,A),a[1]),t(n(e(I,x),-o[1]),n(e(k,v),s[1]))),-l[2]))),i[3]))),t(t(n(t(t(n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,A),l[1]))),i[2]),n(t(n(e(B,P),i[1]),t(n(e(D,d),-s[1]),n(e(C,p),l[1]))),-o[2])),t(n(t(n(e(F,M),i[1]),t(n(e(D,d),-o[1]),n(e(T,f),l[1]))),s[2]),n(t(n(e(L,A),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-l[2]))),-a[3]),n(t(t(n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),i[2]),n(t(n(e(B,P),i[1]),t(n(e(D,d),-s[1]),n(e(C,p),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(D,d),-a[1]),n(e(y,h),l[1]))),s[2]),n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),-l[2]))),o[3])),t(n(t(t(n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(k,v),l[1]))),i[2]),n(t(n(e(F,M),i[1]),t(n(e(D,d),-o[1]),n(e(T,f),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(D,d),-a[1]),n(e(y,h),l[1]))),o[2]),n(t(n(e(k,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-l[2]))),-s[3]),n(t(t(n(t(n(e(L,A),a[1]),t(n(e(I,x),-o[1]),n(e(k,v),s[1]))),i[2]),n(t(n(e(L,A),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-a[2])),t(n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),o[2]),n(t(n(e(k,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-s[2]))),l[3]))))),Y=e(Z,W);return Y[Y.length-1]}}var f=[function(){return 0},function(){return 0},function(){return 0}];function p(t){var e=f[t.length];return e||(e=f[t.length]=s(t.length)),e.apply(void 0,t)}function d(t,e,r,n,i,a,o,s){return function(e,r,l,u,c,h){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,l);case 4:return a(e,r,l,u);case 5:return o(e,r,l,u,c);case 6:return s(e,r,l,u,c,h)}for(var f=new Array(arguments.length),p=0;p<arguments.length;++p)f[p]=arguments[p];return t(f)}}!function(){for(;f.length<=6;)f.push(s(f.length));t.exports=d.apply(void 0,[p].concat(f));for(var e=0;e<=6;++e)t.exports[e]=f[e]}()},727:function(t,e,r){var n=r(2962);function i(t){var e=2===t?a:3===t?o:4===t?s:5===t?l:u;return e(t<6?n[t]:n)}function a(t){return function(e,r){return[t([[+r[0],+e[0][1]],[+r[1],+e[1][1]]]),t([[+e[0][0],+r[0]],[+e[1][0],+r[1]]]),t(e)]}}function o(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2]],[+r[1],+e[1][1],+e[1][2]],[+r[2],+e[2][1],+e[2][2]]]),t([[+e[0][0],+r[0],+e[0][2]],[+e[1][0],+r[1],+e[1][2]],[+e[2][0],+r[2],+e[2][2]]]),t([[+e[0][0],+e[0][1],+r[0]],[+e[1][0],+e[1][1],+r[1]],[+e[2][0],+e[2][1],+r[2]]]),t(e)]}}function s(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2],+e[0][3]],[+r[1],+e[1][1],+e[1][2],+e[1][3]],[+r[2],+e[2][1],+e[2][2],+e[2][3]],[+r[3],+e[3][1],+e[3][2],+e[3][3]]]),t([[+e[0][0],+r[0],+e[0][2],+e[0][3]],[+e[1][0],+r[1],+e[1][2],+e[1][3]],[+e[2][0],+r[2],+e[2][2],+e[2][3]],[+e[3][0],+r[3],+e[3][2],+e[3][3]]]),t([[+e[0][0],+e[0][1],+r[0],+e[0][3]],[+e[1][0],+e[1][1],+r[1],+e[1][3]],[+e[2][0],+e[2][1],+r[2],+e[2][3]],[+e[3][0],+e[3][1],+r[3],+e[3][3]]]),t([[+e[0][0],+e[0][1],+e[0][2],+r[0]],[+e[1][0],+e[1][1],+e[1][2],+r[1]],[+e[2][0],+e[2][1],+e[2][2],+r[2]],[+e[3][0],+e[3][1],+e[3][2],+r[3]]]),t(e)]}}function l(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2],+e[0][3],+e[0][4]],[+r[1],+e[1][1],+e[1][2],+e[1][3],+e[1][4]],[+r[2],+e[2][1],+e[2][2],+e[2][3],+e[2][4]],[+r[3],+e[3][1],+e[3][2],+e[3][3],+e[3][4]],[+r[4],+e[4][1],+e[4][2],+e[4][3],+e[4][4]]]),t([[+e[0][0],+r[0],+e[0][2],+e[0][3],+e[0][4]],[+e[1][0],+r[1],+e[1][2],+e[1][3],+e[1][4]],[+e[2][0],+r[2],+e[2][2],+e[2][3],+e[2][4]],[+e[3][0],+r[3],+e[3][2],+e[3][3],+e[3][4]],[+e[4][0],+r[4],+e[4][2],+e[4][3],+e[4][4]]]),t([[+e[0][0],+e[0][1],+r[0],+e[0][3],+e[0][4]],[+e[1][0],+e[1][1],+r[1],+e[1][3],+e[1][4]],[+e[2][0],+e[2][1],+r[2],+e[2][3],+e[2][4]],[+e[3][0],+e[3][1],+r[3],+e[3][3],+e[3][4]],[+e[4][0],+e[4][1],+r[4],+e[4][3],+e[4][4]]]),t([[+e[0][0],+e[0][1],+e[0][2],+r[0],+e[0][4]],[+e[1][0],+e[1][1],+e[1][2],+r[1],+e[1][4]],[+e[2][0],+e[2][1],+e[2][2],+r[2],+e[2][4]],[+e[3][0],+e[3][1],+e[3][2],+r[3],+e[3][4]],[+e[4][0],+e[4][1],+e[4][2],+r[4],+e[4][4]]]),t([[+e[0][0],+e[0][1],+e[0][2],+e[0][3],+r[0]],[+e[1][0],+e[1][1],+e[1][2],+e[1][3],+r[1]],[+e[2][0],+e[2][1],+e[2][2],+e[2][3],+r[2]],[+e[3][0],+e[3][1],+e[3][2],+e[3][3],+r[3]],[+e[4][0],+e[4][1],+e[4][2],+e[4][3],+r[4]]]),t(e)]}}function u(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2],+e[0][3],+e[0][4],+e[0][5]],[+r[1],+e[1][1],+e[1][2],+e[1][3],+e[1][4],+e[1][5]],[+r[2],+e[2][1],+e[2][2],+e[2][3],+e[2][4],+e[2][5]],[+r[3],+e[3][1],+e[3][2],+e[3][3],+e[3][4],+e[3][5]],[+r[4],+e[4][1],+e[4][2],+e[4][3],+e[4][4],+e[4][5]],[+r[5],+e[5][1],+e[5][2],+e[5][3],+e[5][4],+e[5][5]]]),t([[+e[0][0],+r[0],+e[0][2],+e[0][3],+e[0][4],+e[0][5]],[+e[1][0],+r[1],+e[1][2],+e[1][3],+e[1][4],+e[1][5]],[+e[2][0],+r[2],+e[2][2],+e[2][3],+e[2][4],+e[2][5]],[+e[3][0],+r[3],+e[3][2],+e[3][3],+e[3][4],+e[3][5]],[+e[4][0],+r[4],+e[4][2],+e[4][3],+e[4][4],+e[4][5]],[+e[5][0],+r[5],+e[5][2],+e[5][3],+e[5][4],+e[5][5]]]),t([[+e[0][0],+e[0][1],+r[0],+e[0][3],+e[0][4],+e[0][5]],[+e[1][0],+e[1][1],+r[1],+e[1][3],+e[1][4],+e[1][5]],[+e[2][0],+e[2][1],+r[2],+e[2][3],+e[2][4],+e[2][5]],[+e[3][0],+e[3][1],+r[3],+e[3][3],+e[3][4],+e[3][5]],[+e[4][0],+e[4][1],+r[4],+e[4][3],+e[4][4],+e[4][5]],[+e[5][0],+e[5][1],+r[5],+e[5][3],+e[5][4],+e[5][5]]]),t([[+e[0][0],+e[0][1],+e[0][2],+r[0],+e[0][4],+e[0][5]],[+e[1][0],+e[1][1],+e[1][2],+r[1],+e[1][4],+e[1][5]],[+e[2][0],+e[2][1],+e[2][2],+r[2],+e[2][4],+e[2][5]],[+e[3][0],+e[3][1],+e[3][2],+r[3],+e[3][4],+e[3][5]],[+e[4][0],+e[4][1],+e[4][2],+r[4],+e[4][4],+e[4][5]],[+e[5][0],+e[5][1],+e[5][2],+r[5],+e[5][4],+e[5][5]]]),t([[+e[0][0],+e[0][1],+e[0][2],+e[0][3],+r[0],+e[0][5]],[+e[1][0],+e[1][1],+e[1][2],+e[1][3],+r[1],+e[1][5]],[+e[2][0],+e[2][1],+e[2][2],+e[2][3],+r[2],+e[2][5]],[+e[3][0],+e[3][1],+e[3][2],+e[3][3],+r[3],+e[3][5]],[+e[4][0],+e[4][1],+e[4][2],+e[4][3],+r[4],+e[4][5]],[+e[5][0],+e[5][1],+e[5][2],+e[5][3],+r[5],+e[5][5]]]),t([[+e[0][0],+e[0][1],+e[0][2],+e[0][3],+e[0][4],+r[0]],[+e[1][0],+e[1][1],+e[1][2],+e[1][3],+e[1][4],+r[1]],[+e[2][0],+e[2][1],+e[2][2],+e[2][3],+e[2][4],+r[2]],[+e[3][0],+e[3][1],+e[3][2],+e[3][3],+e[3][4],+r[3]],[+e[4][0],+e[4][1],+e[4][2],+e[4][3],+e[4][4],+r[4]],[+e[5][0],+e[5][1],+e[5][2],+e[5][3],+e[5][4],+r[5]]]),t(e)]}}var c=[function(){return[[0]]},function(t,e){return[[e[0]],[t[0][0]]]}];function h(t,e,r,n,i,a,o,s){return function(l,u){switch(l.length){case 0:return t(l,u);case 1:return e(l,u);case 2:return r(l,u);case 3:return n(l,u);case 4:return i(l,u);case 5:return a(l,u)}var c=o[l.length];return c||(c=o[l.length]=s(l.length)),c(l,u)}}!function(){for(;c.length<6;)c.push(i(c.length));t.exports=h.apply(void 0,c.concat([c,i]));for(var e=0;e<6;++e)t.exports[e]=c[e]}()},3250:function(t,e,r){var n=r(5250),i=r(8210),a=r(3012),o=r(8545),s=11102230246251565e-32,l=(3+16*s)*s,u=(7+56*s)*s;function c(t,e,r,n){return function(r,i,a){var o=t(t(e(i[1],a[0]),e(-a[1],i[0])),t(e(r[1],i[0]),e(-i[1],r[0]))),s=t(e(r[1],a[0]),e(-a[1],r[0])),l=n(o,s);return l[l.length-1]}}function h(t,e,r,n){return function(i,a,o,s){var l=t(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),a[2]),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),s[2]))),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),s[2])))),u=t(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),t(r(t(e(a[1],o[0]),e(-o[1],a[0])),i[2]),t(r(t(e(i[1],o[0]),e(-o[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),o[2])))),c=n(l,u);return c[c.length-1]}}function f(t,e,r,n){return function(i,a,o,s,l){var u=t(t(t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),o[2]),t(r(t(e(o[1],l[0]),e(-l[1],o[0])),-s[2]),r(t(e(o[1],s[0]),e(-s[1],o[0])),l[2]))),a[3]),t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),r(t(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),-o[3]),r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),l[2]))),s[3]))),t(r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),a[2]),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),s[2]))),-l[3]),t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),r(t(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),i[3]),r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-s[2]),r(t(e(i[1],s[0]),e(-s[1],i[0])),l[2]))),-a[3])))),t(t(r(t(r(t(e(a[1],l[0]),e(-l[1],a[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),l[2]))),s[3]),t(r(t(r(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),s[2]))),-l[3]),r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),a[2]),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),s[2]))),i[3]))),t(r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),-a[3]),t(r(t(r(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),s[2]))),o[3]),r(t(r(t(e(a[1],o[0]),e(-o[1],a[0])),i[2]),t(r(t(e(i[1],o[0]),e(-o[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),o[2]))),-s[3]))))),c=t(t(t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),o[2]),t(r(t(e(o[1],l[0]),e(-l[1],o[0])),-s[2]),r(t(e(o[1],s[0]),e(-s[1],o[0])),l[2]))),i[3]),r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-s[2]),r(t(e(i[1],s[0]),e(-s[1],i[0])),l[2]))),-o[3])),t(r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),l[2]))),s[3]),r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),-l[3]))),t(t(r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),l[2]))),i[3]),r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),l[2]))),-a[3])),t(r(t(r(t(e(a[1],l[0]),e(-l[1],a[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),l[2]))),o[3]),r(t(r(t(e(a[1],o[0]),e(-o[1],a[0])),i[2]),t(r(t(e(i[1],o[0]),e(-o[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),o[2]))),-l[3])))),h=n(u,c);return h[h.length-1]}}function p(t){return(3===t?c:4===t?h:f)(i,n,a,o)}var d=p(3),m=p(4),g=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=l*n;return o>=s||o<=-s?o:d(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],h=t[2]-n[2],f=e[2]-n[2],p=r[2]-n[2],d=a*c,g=o*l,y=o*s,v=i*c,x=i*l,_=a*s,b=h*(d-g)+f*(y-v)+p*(x-_),w=(Math.abs(d)+Math.abs(g))*Math.abs(h)+(Math.abs(y)+Math.abs(v))*Math.abs(f)+(Math.abs(x)+Math.abs(_))*Math.abs(p),T=u*w;return b>T||-b>T?b:m(t,e,r,n)}];function y(t){var e=g[t.length];return e||(e=g[t.length]=p(t.length)),e.apply(void 0,t)}function v(t,e,r,n,i,a,o){return function(e,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,u)}for(var c=new Array(arguments.length),h=0;h<arguments.length;++h)c[h]=arguments[h];return t(c)}}!function(){for(;g.length<=5;)g.push(p(g.length));t.exports=v.apply(void 0,[y].concat(g));for(var e=0;e<=5;++e)t.exports[e]=g[e]}()},5382:function(t,e,r){var n=r(8210),i=r(3012);t.exports=function(t,e){if(1===t.length)return i(e,t[0]);if(1===e.length)return i(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var a=0;a<t.length;++a)r=n(r,i(e,t[a]));else for(a=0;a<e.length;++a)r=n(r,i(t,e[a]));return r}},3012:function(t,e,r){var n=r(5250),i=r(9362);t.exports=function(t,e){var r=t.length;if(1===r){var a=n(t[0],e);return a[0]?a:[a[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;n(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){n(t[c],e,l);var h=s[1];i(h,l[0],s),s[0]&&(o[u++]=s[0]);var f=l[1],p=s[1],d=f+p,m=p-(d-f);s[1]=d,m&&(o[u++]=m)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}},1125:function(t,e,r){t.exports=function(t,e,r,i){var a=n(t,r,i),o=n(e,r,i);if(a>0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c);if(Math.max(u,c)<s||l<h)return!1}return!0}(t,e,r,i))};var n=r(3250)[3]},8545:function(t){t.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}(t[0],-e[0]);var i,a,o=new Array(r+n),s=0,l=0,u=0,c=Math.abs,h=t[l],f=c(h),p=-e[u],d=c(p);f<d?(a=h,(l+=1)<r&&(h=t[l],f=c(h))):(a=p,(u+=1)<n&&(p=-e[u],d=c(p))),l<r&&f<d||u>=n?(i=h,(l+=1)<r&&(h=t[l],f=c(h))):(i=p,(u+=1)<n&&(p=-e[u],d=c(p)));for(var m,g,y=i+a,v=y-i,x=a-v,_=x,b=y;l<r&&u<n;)f<d?(i=h,(l+=1)<r&&(h=t[l],f=c(h))):(i=p,(u+=1)<n&&(p=-e[u],d=c(p))),(x=(a=_)-(v=(y=i+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<r;)(x=(a=_)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<r&&(h=t[l]);for(;u<n;)(x=(a=_)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(u+=1)<n&&(p=-e[u]);return _&&(o[s++]=_),b&&(o[s++]=b),s||(o[s++]=0),o.length=s,o}},8210:function(t){t.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}(t[0],e[0]);var i,a,o=new Array(r+n),s=0,l=0,u=0,c=Math.abs,h=t[l],f=c(h),p=e[u],d=c(p);f<d?(a=h,(l+=1)<r&&(h=t[l],f=c(h))):(a=p,(u+=1)<n&&(p=e[u],d=c(p))),l<r&&f<d||u>=n?(i=h,(l+=1)<r&&(h=t[l],f=c(h))):(i=p,(u+=1)<n&&(p=e[u],d=c(p)));for(var m,g,y=i+a,v=y-i,x=a-v,_=x,b=y;l<r&&u<n;)f<d?(i=h,(l+=1)<r&&(h=t[l],f=c(h))):(i=p,(u+=1)<n&&(p=e[u],d=c(p))),(x=(a=_)-(v=(y=i+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<r;)(x=(a=_)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<r&&(h=t[l]);for(;u<n;)(x=(a=_)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(u+=1)<n&&(p=e[u]);return _&&(o[s++]=_),b&&(o[s++]=b),s||(o[s++]=0),o.length=s,o}},9127:function(t,e,r){t.exports=function(t){return i(n(t))};var n=r(6204),i=r(5771)},7765:function(t,e,r){t.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}(t)),0===t.length||s<1)return{cells:[],vertexIds:[],vertexWeights:[]};var l=function(t,e){for(var r=t.length,n=i.mallocUint8(r),a=0;a<r;++a)n[a]=t[a]<e|0;return n}(e,+r),u=function(t,e){for(var r=t.length,o=e*(e+1)/2*r|0,s=i.mallocUint32(2*o),l=0,u=0;u<r;++u)for(var c=t[u],h=(e=c.length,0);h<e;++h)for(var f=0;f<h;++f){var p=c[f],d=c[h];s[l++]=0|Math.min(p,d),s[l++]=0|Math.max(p,d)}var m=l/2|0;a(n(s,[m,2]));var g=2;for(u=2;u<l;u+=2)s[u-2]===s[u]&&s[u-1]===s[u+1]||(s[g++]=s[u],s[g++]=s[u+1]);return n(s,[g/2|0,2])}(t,s),c=function(t,e,r,a){for(var o=t.data,s=t.shape[0],l=i.mallocDouble(s),u=0,c=0;c<s;++c){var h=o[2*c],f=o[2*c+1];if(r[h]!==r[f]){var p=e[h],d=e[f];o[2*u]=h,o[2*u+1]=f,l[u++]=(d-a)/(d-p)}}return t.shape[0]=u,n(l,[u])}(u,e,l,+r),h=function(t,e){var r=i.mallocInt32(2*e),n=t.shape[0],a=t.data;r[0]=0;for(var o=0,s=0;s<n;++s){var l=a[2*s];if(l!==o){for(r[2*o+1]=s;++o<l;)r[2*o]=s,r[2*o+1]=s;r[2*o]=s}}for(r[2*o+1]=n;++o<e;)r[2*o]=r[2*o+1]=n;return r}(u,0|e.length),f=o(s)(t,u.data,h,l),p=function(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;i<e;++i)n[i]=[r[2*i],r[2*i+1]];return n}(u),d=[].slice.call(c.data,0,c.shape[0]);return i.free(l),i.free(u.data),i.free(c.data),i.free(h),{cells:f,vertexIds:p,vertexWeights:d}};var n=r(9618),i=r(1888),a=r(446),o=r(1570)},1570:function(t){t.exports=function(t){return e[t]()};var e=[function(){return function(t,e,r,n){for(var i=t.length,a=0;a<i;++a)t[a].length;return[]}},function(){function t(t,e,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=t[2*i],s=t[2*i+1];o<s;){var l=o+s>>1,u=e[2*l+1];if(u===a)return l;a<u?s=l:o=l+1}return o}return function(e,r,n,i){for(var a=e.length,o=[],s=0;s<a;++s){var l=e[s];if(2===l.length){var u=(0|i[l[0]])+(i[l[1]]<<1);if(0===u||3===u)continue;switch(u){case 0:break;case 1:o.push([t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0])])}}}return o}},function(){function t(t,e,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=t[2*i],s=t[2*i+1];o<s;){var l=o+s>>1,u=e[2*l+1];if(u===a)return l;a<u?s=l:o=l+1}return o}return function(e,r,n,i){for(var a=e.length,o=[],s=0;s<a;++s){var l=e[s],u=l.length;if(3===u){if(0==(c=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===c)continue;switch(c){case 0:break;case 1:o.push([t(n,r,l[0],l[2]),t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0]),t(n,r,l[1],l[2])]);break;case 3:o.push([t(n,r,l[0],l[2]),t(n,r,l[1],l[2])]);break;case 4:o.push([t(n,r,l[2],l[1]),t(n,r,l[2],l[0])]);break;case 5:o.push([t(n,r,l[2],l[1]),t(n,r,l[0],l[1])]);break;case 6:o.push([t(n,r,l[1],l[0]),t(n,r,l[2],l[0])])}}else if(2===u){var c;if(0==(c=(0|i[l[0]])+(i[l[1]]<<1))||3===c)continue;switch(c){case 0:break;case 1:o.push([t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0])])}}}return o}},function(){function t(t,e,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=t[2*i],s=t[2*i+1];o<s;){var l=o+s>>1,u=e[2*l+1];if(u===a)return l;a<u?s=l:o=l+1}return o}return function(e,r,n,i){for(var a=e.length,o=[],s=0;s<a;++s){var l=e[s],u=l.length;if(4===u){if(0==(c=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2)+(i[l[3]]<<3))||15===c)continue;switch(c){case 0:break;case 1:o.push([t(n,r,l[0],l[1]),t(n,r,l[0],l[2]),t(n,r,l[0],l[3])]);break;case 2:o.push([t(n,r,l[1],l[2]),t(n,r,l[1],l[0]),t(n,r,l[1],l[3])]);break;case 3:o.push([t(n,r,l[1],l[2]),t(n,r,l[0],l[2]),t(n,r,l[0],l[3])],[t(n,r,l[1],l[3]),t(n,r,l[1],l[2]),t(n,r,l[0],l[3])]);break;case 4:o.push([t(n,r,l[2],l[0]),t(n,r,l[2],l[1]),t(n,r,l[2],l[3])]);break;case 5:o.push([t(n,r,l[0],l[1]),t(n,r,l[2],l[1]),t(n,r,l[0],l[3])],[t(n,r,l[2],l[1]),t(n,r,l[2],l[3]),t(n,r,l[0],l[3])]);break;case 6:o.push([t(n,r,l[2],l[0]),t(n,r,l[1],l[0]),t(n,r,l[1],l[3])],[t(n,r,l[2],l[3]),t(n,r,l[2],l[0]),t(n,r,l[1],l[3])]);break;case 7:o.push([t(n,r,l[0],l[3]),t(n,r,l[1],l[3]),t(n,r,l[2],l[3])]);break;case 8:o.push([t(n,r,l[3],l[1]),t(n,r,l[3],l[0]),t(n,r,l[3],l[2])]);break;case 9:o.push([t(n,r,l[3],l[1]),t(n,r,l[0],l[1]),t(n,r,l[0],l[2])],[t(n,r,l[3],l[2]),t(n,r,l[3],l[1]),t(n,r,l[0],l[2])]);break;case 10:o.push([t(n,r,l[1],l[0]),t(n,r,l[3],l[0]),t(n,r,l[1],l[2])],[t(n,r,l[3],l[0]),t(n,r,l[3],l[2]),t(n,r,l[1],l[2])]);break;case 11:o.push([t(n,r,l[1],l[2]),t(n,r,l[0],l[2]),t(n,r,l[3],l[2])]);break;case 12:o.push([t(n,r,l[3],l[0]),t(n,r,l[2],l[0]),t(n,r,l[2],l[1])],[t(n,r,l[3],l[1]),t(n,r,l[3],l[0]),t(n,r,l[2],l[1])]);break;case 13:o.push([t(n,r,l[0],l[1]),t(n,r,l[2],l[1]),t(n,r,l[3],l[1])]);break;case 14:o.push([t(n,r,l[2],l[0]),t(n,r,l[1],l[0]),t(n,r,l[3],l[0])])}}else if(3===u){if(0==(c=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===c)continue;switch(c){case 0:break;case 1:o.push([t(n,r,l[0],l[2]),t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0]),t(n,r,l[1],l[2])]);break;case 3:o.push([t(n,r,l[0],l[2]),t(n,r,l[1],l[2])]);break;case 4:o.push([t(n,r,l[2],l[1]),t(n,r,l[2],l[0])]);break;case 5:o.push([t(n,r,l[2],l[1]),t(n,r,l[0],l[1])]);break;case 6:o.push([t(n,r,l[1],l[0]),t(n,r,l[2],l[0])])}}else if(2===u){var c;if(0==(c=(0|i[l[0]])+(i[l[1]]<<1))||3===c)continue;switch(c){case 0:break;case 1:o.push([t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0])])}}}return o}}]},6803:function(t,e,r){r(8828),r(1755),e.Fw=function(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),u=i(e[0],e[1]);return(s=i(l,t[2])-i(u,e[2]))||i(l+t[2],a)-i(u+e[2],o);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=c[f]-h[f])return n;return 0}}},3105:function(t,e){function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t<e)},e.max=function(t,e){return t^(t^e)&-(t<e)},e.isPow2=function(t){return!(t&t-1||!t)},e.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);(function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}})(n),e.reverse=function(t){return n[255&t]<<24|n[t>>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},2014:function(t,e,r){var n=r(3105),i=r(4623);function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),u=i(e[0],e[1]);return(s=i(l,t[2])-i(u,e[2]))||i(l+t[2],a)-i(u+e[2],o);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=c[f]-h[f])return n;return 0}}function o(t,e){return a(t[0],e[0])}function s(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=[t[i],e[i]];for(n.sort(o),i=0;i<r;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(a),t}function l(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var i=t[n];if(a(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function u(t,e){for(var r=0,n=t.length-1,i=-1;r<=n;){var o=r+n>>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i<o;++i)r[i]=[];for(var s=[],l=(i=0,e.length);i<l;++i)for(var c=e[i],h=c.length,f=1,p=1<<h;f<p;++f){s.length=n.popCount(f);for(var d=0,m=0;m<h;++m)f&1<<m&&(s[d++]=c[m]);var g=u(t,s);if(!(g<0))for(;r[g++].push(i),!(g>=t.length||0!==a(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<<e+1)-1,a=0;a<t.length;++a)for(var o=t[a],l=i;l<1<<o.length;l=n.nextCombination(l)){for(var u=new Array(e+1),c=0,h=0;h<o.length;++h)l&1<<h&&(u[c++]=o[h]);r.push(u)}return s(r)}e.dimension=function(t){for(var e=0,r=Math.max,n=0,i=t.length;n<i;++n)e=r(e,t[n].length);return e-1},e.countVertices=function(t){for(var e=-1,r=Math.max,n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)e=r(e,a[o]);return e+1},e.cloneCells=function(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e},e.compareCells=a,e.normalize=s,e.unique=l,e.findCell=u,e.incidence=c,e.dual=function(t,e){if(!e)return c(l(h(t,0)),t);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];n=0;for(var i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r},e.explode=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0|i.length,o=1,l=1<<a;o<l;++o){for(var u=[],c=0;c<a;++c)o>>>c&1&&u.push(i[c]);e.push(u)}return s(e)},e.skeleton=h,e.boundary=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;++a){for(var l=new Array(i.length-1),u=0,c=0;u<o;++u)u!==a&&(l[c++]=i[u]);e.push(l)}return s(e)},e.connectedComponents=function(t,e){return e?function(t,e){for(var r=new i(e),n=0;n<t.length;++n)for(var a=t[n],o=0;o<a.length;++o)for(var s=o+1;s<a.length;++s)r.link(a[o],a[s]);var l=[],u=r.ranks;for(n=0;n<u.length;++n)u[n]=-1;for(n=0;n<t.length;++n){var c=r.find(t[n][0]);u[c]<0?(u[c]=l.length,l.push([t[n].slice(0)])):l[u[c]].push(t[n].slice(0))}return l}(t,e):function(t){for(var e=l(s(h(t,0))),r=new i(e.length),n=0;n<t.length;++n)for(var a=t[n],o=0;o<a.length;++o)for(var c=u(e,[a[o]]),f=o+1;f<a.length;++f)r.link(c,u(e,[a[f]]));var p=[],d=r.ranks;for(n=0;n<d.length;++n)d[n]=-1;for(n=0;n<t.length;++n){var m=r.find(u(e,[t[n][0]]));d[m]<0?(d[m]=p.length,p.push([t[n].slice(0)])):p[d[m]].push(t[n].slice(0))}return p}(t)}},4623:function(t){function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}t.exports=e,e.prototype.length=function(){return this.roots.length},e.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},e.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},e.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},5878:function(t,e,r){t.exports=function(t,e,r){for(var a=e.length,o=t.length,s=new Array(a),l=new Array(a),u=new Array(a),c=new Array(a),h=0;h<a;++h)s[h]=l[h]=-1,u[h]=1/0,c[h]=!1;for(h=0;h<o;++h){var f=t[h];if(2!==f.length)throw new Error("Input must be a graph");var p=f[1],d=f[0];-1!==l[d]?l[d]=-2:l[d]=p,-1!==s[p]?s[p]=-2:s[p]=d}function m(t){if(c[t])return 1/0;var r=s[t],i=l[t];return r<0||i<0?1/0:function(t,e,r){var i=Math.abs(n(t,e,r)),a=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return i/a}(e[t],e[r],e[i])}function g(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,A[r]=e,A[n]=t}function y(t){return u[k[t]]}function v(t){return 1&t?t-1>>1:(t>>1)-1}function x(t){for(var e=y(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n<M){var o=y(n);o<r&&(a=n,r=o)}if(i<M&&y(i)<r&&(a=i),a===t)return t;g(t,a),t=a}}function _(t){for(var e=y(t);t>0;){var r=v(t);if(!(r>=0&&e<y(r)))return t;g(t,r),t=r}}function b(){if(M>0){var t=k[0];return g(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=k[t];return u[r]===e?t:(u[r]=-1/0,_(t),b(),u[r]=e,_((M+=1)-1))}function T(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],m(e)),A[r]>=0&&w(A[r],m(r))}}var k=[],A=new Array(a);for(h=0;h<a;++h)(u[h]=m(h))<1/0?(A[h]=k.length,k.push(h)):A[h]=-1;var M=k.length;for(h=M>>1;h>=0;--h)x(h);for(;;){var S=b();if(S<0||u[S]>r)break;T(S)}var E=[];for(h=0;h<a;++h)c[h]||(A[h]=E.length,E.push(e[h].slice()));function C(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!c[n]||i<0||i===n||(i=t[n=i],!c[n]||i<0||i===n))break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}E.length;var I=[];return t.forEach(function(t){var e=C(s,t[0]),r=C(l,t[1]);if(e>=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&I.push([n,i])}}),i.unique(i.normalize(I)),{positions:E,edges:I}};var n=r(3250),i=r(2014)},1303:function(t,e,r){t.exports=function(t,e){var r,a,o,s;if(e[0][0]<e[1][0])r=e[0],a=e[1];else{if(!(e[0][0]>e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=r(3250);function i(t,e){var r,i,a,o;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return l<u?l-u:s>c?s-c:l-c}r=e[1],i=e[0]}t[0][1]<t[1][1]?(a=t[0],o=t[1]):(a=t[1],o=t[0]);var h=n(i,r,a);return h||(h=n(i,r,o))?h:o-i}},4209:function(t,e,r){t.exports=function(t){for(var e=t.length,r=2*e,n=new Array(r),a=0;a<e;++a){var l=t[a],u=l[0][0]<l[1][0];n[2*a]=new h(l[0][0],l,u,a),n[2*a+1]=new h(l[1][0],l,!u,a)}n.sort(function(t,e){var r=t.x-e.x;return r||(r=t.create-e.create)?r:Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1])});var f=i(o),p=[],d=[],m=[];for(a=0;a<r;){for(var g=n[a].x,y=[];a<r;){var v=n[a];if(v.x!==g)break;a+=1,v.segment[0][0]===v.x&&v.segment[1][0]===v.x?v.create&&(v.segment[0][1]<v.segment[1][1]?(y.push(new c(v.segment[0][1],v.index,!0,!0)),y.push(new c(v.segment[1][1],v.index,!1,!1))):(y.push(new c(v.segment[1][1],v.index,!0,!1)),y.push(new c(v.segment[0][1],v.index,!1,!0)))):f=v.create?f.insert(v.segment,v.index):f.remove(v.segment)}p.push(f.root),d.push(g),m.push(y)}return new s(p,d,m)};var n=r(2478),i=r(3840),a=r(3250),o=r(1303);function s(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function l(t,e){return t.y-e}function u(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=a(n,i,e);if(s<0)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var h=this.horizontal[e];if(h.length>0){var f=n.ge(h,t[1],l);if(f<h.length){var p=h[f];if(t[1]===p.y){if(p.closed)return p.index;for(;f<h.length-1&&h[f+1].y===t[1];)if((p=h[f+=1]).closed)return p.index;if(p.y===t[1]&&!p.start){if((f+=1)>=h.length)return i;p=h[f]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},5202:function(t,e,r){var n=r(1944),i=r(8210);function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l<o;++l)s[l]=i*t[l]+a*r[l];return s}t.exports=function(t,e){for(var r=[],n=[],i=a(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){var c=a(l=t[u],e);if(i<0&&c>0||i>0&&c<0){var h=o(s,c,l,i);r.push(h),n.push(h.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l<t.length;++l,i=s){var u=a(s=t[l],e);(n<0&&u>0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},t.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l<t.length;++l,i=s){var u=a(s=t[l],e);(n<0&&u>0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},3387:function(t,e,r){var n;!function(){var i={not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,u,c,h,f,p=1,d=t.length,m="";for(n=0;n<d;n++)if("string"==typeof t[n])m+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[p],o=0;o<s.keys.length;o++){if(null==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?e[s.param_no]:e[p++];if(i.not_type.test(s.type)&&i.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(i.number.test(s.type)&&(h=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?f="":(f=h?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(f+r).length,l=s.width&&c>0?u.repeat(c):"",m+=s.align?f+r+l:"0"===u?f+l+r:l+f+r)}return m}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0!==(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))&&(t.exports=n))}()},3711:function(t,e,r){t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;s<n;++s)a[s]=[r[s]],o[s]=[s];return{positions:a,cells:o}}(t,e);var r=t.order.join()+"-"+t.dtype,s=o[r];return e=+e||0,s||(s=o[r]=function(t,e){var r=t.length+"d",i=a[r];if(i)return i(n,t,e)}(t.order,t.dtype)),s(t,e)};var n=r(2640),i=r(781),a={"2d":function(t,e,r){var n=t({order:e,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(t,e,r,n){return t>n|0},vertex:function(t,e,r,n,i,a,o,s,l,u,c,h,f){var p=(0|o)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:c.push([t-.5,e-.5]);break;case 1:c.push([t-.25-.25*(n+r-2*f)/(r-n),e-.25-.25*(i+r-2*f)/(r-i)]);break;case 2:c.push([t-.75-.25*(-n-r+2*f)/(n-r),e-.25-.25*(a+n-2*f)/(n-a)]);break;case 3:c.push([t-.5,e-.5-.5*(i+r+a+n-4*f)/(r-i+n-a)]);break;case 4:c.push([t-.25-.25*(a+i-2*f)/(i-a),e-.75-.25*(-i-r+2*f)/(i-r)]);break;case 5:c.push([t-.5-.5*(n+r+a+i-4*f)/(r-n+i-a),e-.5]);break;case 6:c.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:c.push([t-.75-.25*(a+i-2*f)/(i-a),e-.75-.25*(a+n-2*f)/(n-a)]);break;case 8:c.push([t-.75-.25*(-a-i+2*f)/(a-i),e-.75-.25*(-a-n+2*f)/(a-n)]);break;case 9:c.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:c.push([t-.5-.5*(-n-r-a-i+4*f)/(n-r+a-i),e-.5]);break;case 11:c.push([t-.25-.25*(-a-i+2*f)/(a-i),e-.75-.25*(i+r-2*f)/(r-i)]);break;case 12:c.push([t-.5,e-.5-.5*(-i-r-a-n+4*f)/(i-r+a-n)]);break;case 13:c.push([t-.75-.25*(n+r-2*f)/(r-n),e-.25-.25*(-a-n+2*f)/(a-n)]);break;case 14:c.push([t-.25-.25*(-n-r+2*f)/(n-r),e-.25-.25*(-i-r+2*f)/(i-r)])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},o={}},665:function(t,e,r){var n=r(3202);t.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),(e===window||e===document)&&(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},7261:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||h(r),i=t.radius||1,a=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var p=t.eye,d=[p[0]-e[0],p[1]-e[1],p[2]-e[2]];o(n,d,r),u(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=u(d[0],d[1],d[2]);var m=l(r,d)/i,g=l(n,d)/i;c=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new f(t.zoomMin,t.zoomMax,e,r,n,i,a,c)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function u(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t){return Math.min(1,Math.max(-1,t))}function h(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function f(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var p=f.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=h;var f=this.computedToward;o(f,e,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),y=Math.sin(d),v=Math.cos(m),x=Math.sin(m),_=this.computedCenter,b=g*v,w=y*v,T=x,k=-g*x,A=-y*x,M=v,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=b*r[a]+w*f[a]+T*e[a];E[4*a+1]=k*r[a]+A*f[a]+M*e[a],E[4*a+2]=C,E[4*a+3]=0}var I=E[1],L=E[5],P=E[9],z=E[2],O=E[6],D=E[10],R=L*D-P*O,F=P*z-I*D,B=I*O-L*z,N=u(R,F,B);for(R/=N,F/=N,B/=N,E[0]=R,E[4]=F,E[8]=B,a=0;a<3;++a)S[a]=_[a]+E[2+4*a]*p;for(a=0;a<3;++a){c=0;for(var j=0;j<3;++j)c+=E[a+4*j]*S[j];E[12+a]=-c}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];for(a(i,i,n,d),u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix;Math.exp(this.computedRadius[0]);var a=i[1],o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],h=i[4],f=i[8],p=c*a+h*o+f*s,d=u(c-=a*p,h-=o*p,f-=s*p),m=(c/=d)*e+a*r,g=(h/=d)*e+o*r,y=(f/=d)*e+s*r;this.center.move(t,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(t,Math.log(v))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],h=e[a+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),m=Math.max(f,p,d);f===m?(s=s<0?-1:1,l=h=0):d===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=u(s,l,h);s/=g,l/=g,h/=g}var y,v,x=e[o],_=e[o+4],b=e[o+8],w=x*s+_*l+b*h,T=u(x-=s*w,_-=l*w,b-=h*w),k=l*(b/=T)-h*(_/=T),A=h*(x/=T)-s*b,M=s*_-l*x,S=u(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(t,H,G,Z),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,_,b),2===a){var E=e[1],C=e[5],I=e[9],L=E*x+C*_+I*b,P=E*k+C*A+I*M;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(P,L)}else{var z=e[2],O=e[6],D=e[10],R=z*s+O*l+D*h,F=z*x+O*_+D*b,B=z*k+O*A+D*M;y=Math.asin(c(R)),v=Math.atan2(B,F)}this.angle.jump(t,v,y),this.recalcMatrix(t);var N=e[2],j=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Z=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*W,G-j*W,Z-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],p=u(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,m=d[0],g=d[1],y=d[2],v=i*m+a*g+o*y,x=u(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(m=a*f-o*h,g=o*l-i*f,y=i*h-a*l,x=u(m,g,y),x<1e-6))){m/=x,g/=x,y/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,y),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var _=a*y-o*g,b=o*m-i*y,w=i*g-a*m,T=u(_,b,w),k=i*l+a*h+o*f,A=m*l+g*h+y*f,M=(_/=T)*l+(b/=T)*h+(w/=T)*f,S=Math.asin(c(k)),E=Math.atan2(M,A),C=this.angle._state,I=C[C.length-1],L=C[C.length-2];I%=2*Math.PI;var P=Math.abs(I+2*Math.PI-E),z=Math.abs(I-E),O=Math.abs(I-2*Math.PI-E);P<z&&(I+=2*Math.PI),O<z&&(I-=2*Math.PI),this.angle.jump(this.angle.lastT(),I,L),this.angle.set(t,E,S)}}}}},5250:function(t){t.exports=function(t,r,n){var i=t*r,a=e*t,o=a-(a-t),s=t-o,l=e*r,u=l-(l-r),c=r-u,h=s*c-(i-o*u-s*u-o*c);return n?(n[0]=h,n[1]=i,n):[h,i]};var e=+(Math.pow(2,27)+1)},9362:function(t){t.exports=function(t,e,r){var n=t+e,i=n-t,a=e-i,o=t-(n-i);return r?(r[0]=o+a,r[1]=n,r):[o+a,n]}},1888:function(t,e,r){var n=r(8828),i=r(1338),a=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,u=r.g.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=i([32,0])),u.BIGUINT64||(u.BIGUINT64=i([32,0])),u.BIGINT64||(u.BIGINT64=i([32,0])),u.BUFFER||(u.BUFFER=i([32,0]));var c=u.DATA,h=u.BUFFER;function f(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);c[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=c[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function y(t){return new Int8Array(p(t),0,t)}function v(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function _(t){return new Float32Array(p(4*t),0,t)}function b(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))h[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);c[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){f(t.buffer)},e.freeArrayBuffer=f,e.freeBuffer=function(t){h[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return v(t);case"int32":return x(t);case"float":case"float32":return _(t);case"double":case"float64":return b(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},e.mallocArrayBuffer=p,e.mallocUint8=d,e.mallocUint16=m,e.mallocUint32=g,e.mallocInt8=y,e.mallocInt16=v,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=_,e.mallocFloat64=e.mallocDouble=b,e.mallocUint8Clamped=w,e.mallocBigUint64=T,e.mallocBigInt64=k,e.mallocDataView=A,e.mallocBuffer=M,e.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,h[t].length=0}},1755:function(t){function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}t.exports=e;var r=e.prototype;Object.defineProperty(r,"length",{get:function(){return this.roots.length}}),r.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},r.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},r.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},1682:function(t){t.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,e(i=t[o],a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}(t,e)):(r||t.sort(),function(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;a<r;++a,i=n)if(i=n,(n=t[a])!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}(t))}},4359:function(t,e,r){t.exports=function(t,e){return("object"!=typeof e||null===e)&&(e={}),n(t,e.canvas||i,e.context||a,e)};var n=r(7718),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},7718:function(t,e,r){t.exports=function(t,e,r,n){var a=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return n&&(n.size&&n.size>0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter(function(t){return t}).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",b(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\<br\>/g,"\n"):r.replace(/\<br\>/g," ");var s="",l=[];for(I=0;I<r.length;++I)l[I]=s;!0===o.bolds&&(l=x(u,c,r,l)),!0===o.italics&&(l=x(h,f,r,l)),!0===o.superscripts&&(l=x(p,m,r,l)),!0===o.subscripts&&(l=x(g,v,r,l));var _=[],b="";for(I=0;I<r.length;++I)null!==l[I]&&(b+=r[I],_.push(l[I]));var w=b.split("\n"),T=w.length,k=Math.round(a*n),A=n,M=2*n,S=0,E=T*k+M;t.height<E&&(t.height=E),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff";var C,I,L,P,z,O=0,D="";function R(){if(""!==D){var t=e.measureText(D).width;e.fillText(D,A+L,M+P),L+=t}}function F(){return Math.round(z)+"px "}function B(t,r){var n=""+e.font;if(!0===o.subscripts){var i=t.indexOf(y),a=r.indexOf(y),s=i>-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),z*=Math.pow(.75,l-s),n=n.replace("?px ",F())),P+=.25*k*(l-s)}if(!0===o.superscripts){var u=t.indexOf(d),h=r.indexOf(d),p=u>-1?parseInt(t[1+u]):0,m=h>-1?parseInt(r[1+h]):0;p!==m&&(n=n.replace(F(),"?px "),z*=Math.pow(.75,m-p),n=n.replace("?px ",F())),P-=.25*k*(m-p)}if(!0===o.bolds){var g=t.indexOf(c)>-1,v=r.indexOf(c)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(f)>-1,_=r.indexOf(f)>-1;!x&&_&&(n="italic "+n),x&&!_&&(n=n.replace("italic ",""))}e.font=n}for(C=0;C<T;++C){var N=w[C]+"\n";for(L=0,P=C*k,z=n,D="",I=0;I<N.length;++I){var j=I+O<_.length?_[I+O]:_[_.length-1];s===j?D+=N[I]:(R(),D=N[I],void 0!==j&&(B(s,j),s=j))}R(),O+=N.length;var U=0|Math.round(L+2*A);S<U&&(S=U)}var V=S,q=M+k*T;return i(e.getImageData(0,0,V,q).data,[q,V,4]).pick(-1,-1,0).transpose(1,0)}(e,r,t,a,o,s),n,a)},t.exports.processPixels=b;var n=r(3711),i=r(9618),a=r(5878),o=r(332),s=r(2538),l=r(2095),u="b",c="b|",h="i",f="i|",p="sup",d="+",m="+1",g="sub",y="-",v="-1";function x(t,e,r,n){for(var i="<"+t+">",a="</"+t+">",o=i.length,s=a.length,l=e[0]===d||e[0]===y,u=0,c=-s;u>-1&&!(-1===(u=r.indexOf(i,u))||(c=r.indexOf(a,u+o),-1===c)||c<=u);){for(var h=u;h<c+s;++h)if(h<u+o||h>=c)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var f=n[h].indexOf(e[0]);-1===f?n[h]+=e:l&&(n[h]=n[h].substr(0,f+1)+(1+parseInt(n[h][f+1]))+n[h].substr(f+2))}var p=u+o,m=r.substr(p,c-p).indexOf(i);u=-1!==m?m:c+s}return n}function _(t,e,r,i){var u=function(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,i),c=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l<s;++l)for(var u=t[l],c=0;c<2;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var f=0;switch(i){case"hanging":case"top":f=-a[1];break;case"middle":f=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":f=-3*r;break;case"bottom":f=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var p=1/r;return"lineHeight"in e?p*=+e.lineHeight:"width"in e?p=e.width/(o[0]-a[0]):"height"in e&&(p=e.height/(o[1]-a[1])),t.map(function(t){return[p*(t[0]+h),p*(t[1]+f)]})}(u.positions,e,r),h=u.edges,f="ccw"===e.orientation;if(o(c,h),e.polygons||e.polygon||e.polyline){for(var p=l(h,c),d=new Array(p.length),m=0;m<p.length;++m){for(var g=p[m],y=new Array(g.length),v=0;v<g.length;++v){for(var x=g[v],_=new Array(x.length),b=0;b<x.length;++b)_[b]=c[x[b]].slice();f&&_.reverse(),y[v]=_}d[m]=y}return d}return e.triangles||e.triangulate||e.triangle?{cells:s(c,h,{delaunay:!1,exterior:!1,interior:!0}),positions:c}:{edges:h,positions:c}}function b(t,e,r){try{return _(t,e,r,!0)}catch(t){}try{return _(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},1538:function(t){!function(){if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=g);var e=!1;if("function"==typeof WeakMap){var r=WeakMap;if("undefined"==typeof navigator||!/Firefox/.test(navigator.userAgent)){var n=new r,i=Object.freeze({});if(n.set(i,1),1===n.get(i))return void(t.exports=WeakMap);e=!0}}var a=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:",u=l+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var c=new ArrayBuffer(25),h=new Uint8Array(c);crypto.getRandomValues(h),u=l+"rand:"+Array.prototype.map.call(h,function(t){return(t%36).toString(36)}).join("")+"___"}if(o(Object,"getOwnPropertyNames",{value:function(t){return a(t).filter(y)}}),"getPropertyNames"in Object){var f=Object.getPropertyNames;o(Object,"getPropertyNames",{value:function(t){return f(t).filter(y)}})}!function(){var t=Object.freeze;o(Object,"freeze",{value:function(e){return v(e),t(e)}});var e=Object.seal;o(Object,"seal",{value:function(t){return v(t),e(t)}});var r=Object.preventExtensions;o(Object,"preventExtensions",{value:function(t){return v(t),r(t)}})}();var p=!1,d=0,m=function(){this instanceof m||_();var t=[],e=[],r=d++;return Object.create(m.prototype,{get___:{value:x(function(n,i){var a,o=v(n);return o?r in o?o[r]:i:(a=t.indexOf(n))>=0?e[a]:i})},has___:{value:x(function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:x(function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this})},delete___:{value:x(function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))})}})};m.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof m||_();var t,n=new r,i=void 0,a=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new m),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new m),i.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:x(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:x(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:x(t)},delete___:{value:x(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:x(function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0})}})}e&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),t.exports=m)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function y(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function _(){!p&&"undefined"!=typeof console&&(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(t,e,r){var n=r(8284);t.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},8284:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},606:function(t,e,r){var n=r(236);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},3349:function(t){var e=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],u=s;n|=0;var c=0,h=s;for(c=0;c<o;++c){var f=e[n]-a,p=e[n+u]-a;f>=0!=p>=0&&i.push(l[0]+.5+.5*(f+p)/(f-p)),n+=h,++l[0]}}};t.exports=function(t){return function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=e[s];return l||(e[s]=l=t([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(e.bind(void 0,t))}({funcName:"zeroCrossings"})},781:function(t,e,r){t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(3349)},7790:function(){}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}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.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var i=n(1964);e.exports=i}()}),Yd=f((t,e)=>{e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),Xd=f((t,e)=>{var r=Yd();e.exports=function(t){var e,i,a=[],o=1;if("string"==typeof t)if(t=t.toLowerCase(),r[t])a=r[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1);o=1,(c=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===c&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===c&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],u="rgb"===l;i=s=l.replace(/a$/,"");var c="cmyk"===s?4:"gray"===s?1:3;a=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===s?255*parseFloat(t)/100:parseFloat(t);if("h"===s[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==n[t])return n[t]}return parseFloat(t)}),l===s&&a.push(1),o=u||void 0===a[c]?1:a[c],a=a.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(a=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),i=t.match(/([a-z])/gi).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(a=[t[0],t[1],t[2]],i="rgb",o=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(i="rgb",a=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",a=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),o=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(o/=100)):(i="rgb",a=[t>>>16,(65280&t)>>>8,255&t]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),$d=f((t,e)=>{var r=Xd();e.exports=function(t){Array.isArray(t)&&t.raw&&(t=String.raw.apply(null,arguments));var e,n=r(t);if(!n.space)return[];var i=[0,0,0],a="h"===n.space[0]?[360,100,100]:[255,255,255];return(e=Array(3))[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),e[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),e[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),"h"===n.space[0]&&(e=function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];u<3;)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u++]=255*a;return i}(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}}),Jd=f((t,e)=>{e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}}),Kd=f((t,e)=>{e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),Qd=f((t,e)=>{var r=$d(),n=Jd(),i=Kd();e.exports=function(t,e){("float"===e||!e)&&(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var a,o=new(i(e))(4),s="uint8"!==e&&"uint8_clamped"!==e;return(!t.length||"string"==typeof t)&&((t=r(t))[0]/=255,t[1]/=255,t[2]/=255),(a=t)instanceof Uint8Array||a instanceof Uint8ClampedArray||Array.isArray(a)&&(a[0]>1||0===a[0])&&(a[1]>1||0===a[1])&&(a[2]>1||0===a[2])&&(!a[3]||a[3]>1)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=n(Math.floor(255*t[0]),0,255),o[1]=n(Math.floor(255*t[1]),0,255),o[2]=n(Math.floor(255*t[2]),0,255),o[3]=null==t[3]?255:n(Math.floor(255*t[3]),0,255)),o)}}),tm=f((t,e)=>{var r=Qd();e.exports=function(t){return t?r(t):[0,0,0,1]}}),em=f((t,e)=>{var r=T(),n=O(),i=Qd(),a=Ge(),o=V().defaultLine,s=S().isArrayOrTypedArray,l=i(o);function u(t,e){var r=t;return r[3]*=e,r}function c(t){if(r(t))return l;var e=i(t);return e.length?e:l}function h(t){return r(t)?t:1}e.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var o,f,p,d,m,g=s(n),y=s(e),v=a.extractOpts(t),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(t):c,f=g?function(t,e){return void 0===t[e]?l:i(o(t[e]))}:c,p=y?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||y)for(var _=0;_<r;_++)d=f(n,_),m=p(e,_),x[_]=u(d,m);else x=u(i(n),e);return x},parseColorScale:function(t){var e=a.extractOpts(t),r=e.colorscale;return e.reversescale&&(r=a.flipScale(e.colorscale)),r.map(function(t){var e=t[0],r=n(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,r.a]}})}}}),rm=f((t,e)=>{e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}),nm=f((t,e)=>{e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),im=f((t,e)=>{var r=Ut();function n(t,e,n,i){if(!e||!e.visible)return null;for(var a=r.getComponentMethod("errorbars","makeComputeError")(e),o=new Array(t.length),s=0;s<t.length;s++){var l=a(+t[s],s);if("log"===i.type){var u=i.c2l(t[s]),c=t[s]-l[0],h=t[s]+l[1];if(o[s]=[(i.c2l(c,!0)-u)*n,(i.c2l(h,!0)-u)*n],c>0){var f=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=f),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,f)}}else o[s]=[-l[0]*n,l[1]*n]}return o}e.exports=function(t,e,r){var i=[n(t.x,t.error_x,e[0],r.xaxis),n(t.y,t.error_y,e[1],r.yaxis),n(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}(i);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],u=0;u<3;u++)if(i[u])for(var c=0;c<2;c++)l[c][u]=i[u][s][c];o[s]=l}return o}}),am=f((t,e)=>{var r=Wd().gl_line3d,n=Wd().gl_scatter3d,i=Wd().gl_error3d,a=Wd().gl_mesh3d,o=Wd().delaunay_triangulate,s=oe(),l=tm(),u=em().formatColor,c=We(),h=rm(),f=nm(),p=rr(),d=Ye().appendArrayPointValue,m=im();function g(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var y=g.prototype;function v(t){return null==t?0:t.indexOf("left")>-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function b(t){return f[t]}function w(t,e,r,n,i){var a=null;if(s.isArrayOrTypedArray(t)){a=[];for(var o=0;o<e;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,s.identity);return a}function T(t,e){var r,n,i,a,o,h,f=[],g=t.fullSceneLayout,y=t.dataScale,T=g.xaxis,k=g.yaxis,A=g.zaxis,M=e.marker,S=e.line,E=e.x||[],C=e.y||[],I=e.z||[],L=E.length,P=e.xcalendar,z=e.ycalendar,O=e.zcalendar;for(o=0;o<L;o++)r=T.d2l(E[o],0,P)*y[0],n=k.d2l(C[o],0,z)*y[1],i=A.d2l(I[o],0,O)*y[2],f[o]=[r,n,i];if(Array.isArray(e.text))h=e.text;else if(s.isTypedArray(e.text))h=Array.from(e.text);else if(void 0!==e.text)for(h=new Array(L),o=0;o<L;o++)h[o]=e.text;function D(t,e){var r=g[t];return p.tickText(r,r.d2l(e),!0).text}var R=e.texttemplate;if(R){var F=t.fullLayout._d3locale,B=Array.isArray(R),N=B?Math.min(R.length,L):L,j=B?function(t){return R[t]}:function(){return R};for(h=new Array(N),o=0;o<N;o++){var U={x:E[o],y:C[o],z:I[o]},V={xLabel:D("xaxis",E[o]),yLabel:D("yaxis",C[o]),zLabel:D("zaxis",I[o])},q={};d(q,e,o);var H=e._meta||{};h[o]=s.texttemplateString(j(o),V,F,q,U,H)}}if(a={position:f,mode:e.mode,text:h},"line"in e&&(a.lineColor=u(S,1,L),a.lineWidth=S.width,a.lineDashes=S.dash),"marker"in e){var G=c(e);a.scatterColor=u(M,1,L),a.scatterSize=w(M.size,L,_,20,G),a.scatterMarker=w(M.symbol,L,b,"●"),a.scatterLineWidth=M.line.width,a.scatterLineColor=u(M.line,1,L),a.scatterAngle=0}"textposition"in e&&(a.textOffset=function(t){var e=[0,0];if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=[0,0],t[r]&&(e[r][0]=v(t[r]),e[r][1]=x(t[r]));else e[0]=v(t),e[1]=x(t);return e}(e.textposition),a.textColor=u(e.textfont,1,L),a.textSize=w(e.textfont.size,L,s.identity,12),a.textFontFamily=e.textfont.family,a.textFontWeight=e.textfont.weight,a.textFontStyle=e.textfont.style,a.textFontVariant=e.textfont.variant,a.textAngle=0);var Z=["x","y","z"];for(a.project=[!1,!1,!1],a.projectScale=[1,1,1],a.projectOpacity=[1,1,1],o=0;o<3;++o){var W=e.projection[Z[o]];(a.project[o]=W.show)&&(a.projectOpacity[o]=W.opacity,a.projectScale[o]=W.scale)}a.errorBounds=m(e,y,g);var Y=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[1,1,1],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&!1!==t[2].visible&&(a=t[2]),a&&a.visible&&(e[i]=a.width/2,r[i]=l(a.color),n[i]=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return a.errorColor=Y.color,a.errorLineWidth=Y.lineWidth,a.errorCapSize=Y.capSize,a.delaunayAxis=e.surfaceaxis,a.delaunayColor=l(e.surfacecolor),a}function k(t){if(s.isArrayOrTypedArray(t)){var e=t[0];return s.isArrayOrTypedArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function A(t){return s.isArrayOrTypedArray(t)?4===t.length&&"number"==typeof t[0]?k(t):t.map(k):null}y.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){var e=t.index=t.data.index;return t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),t.textLabel="",this.textLabels&&(s.isArrayOrTypedArray(this.textLabels)?(this.textLabels[e]||0===this.textLabels[e])&&(t.textLabel=this.textLabels[e]):t.textLabel=this.textLabels),t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},y.update=function(t){var e,s,l,u,c=this.scene.glplot.gl,f=h.solid;this.data=t;var p=T(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in h&&(f=h[p.lineDashes]),this.color=A(p.scatterColor)||A(p.lineColor),this.dataPoints=p.position,e={gl:this.scene.glplot.gl,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:f[0],dashScale:f[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=r(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var d=t.opacity;if(t.marker&&void 0!==t.marker.opacity&&(d*=t.marker.opacity),s={gl:this.scene.glplot.gl,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:d,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(s):(this.scatterPlot=n(s),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),u={gl:this.scene.glplot.gl,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFontFamily,fontWeight:p.textFontWeight,fontStyle:p.textFontStyle,fontVariant:p.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(u):(this.textMarkers=n(u),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),l={gl:this.scene.glplot.gl,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=i(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n<t.length;++n){var u=t[n];isNaN(u[i])||!isFinite(u[i])||isNaN(u[a])||!isFinite(u[a])||(s.push([u[i],u[a]]),l.push(n))}var c=o(s);for(n=0;n<c.length;++n)for(var h=c[n],f=0;f<h.length;++f)h[f]=l[h[f]];return{positions:t,cells:c,meshColor:e}}(p.position,p.delaunayColor,p.delaunayAxis);m.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=c,this.delaunayMesh=a(m),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},y.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=function(t,e){var r=new g(t,e.uid);return r.update(e),r}}),om=f((t,e)=>{var r=bn(),n=R(),i=Ie(),a=Se().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=j(),u=rm(),c=nm(),h=D().extendFlat,f=Lt().overrideAll,p=Gt(),d=r.line,m=r.marker,g=m.line,y=h({width:d.width,dash:{valType:"enumerated",values:p(u),dflt:"solid"}},i("line")),v=e.exports=f({x:r.x,y:r.y,z:{valType:"data_array"},text:h({},r.text,{}),texttemplate:s({},{}),hovertext:h({},r.hovertext,{}),hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),mode:h({},r.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:r.connectgaps,line:y,marker:h({symbol:{valType:"enumerated",values:p(c),dflt:"circle",arrayOk:!0},size:h({},m.size,{dflt:8}),sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode,opacity:h({},m.opacity,{arrayOk:!1}),colorbar:m.colorbar,line:h({width:h({},g.width,{arrayOk:!1})},i("marker.line"))},i("marker")),textposition:h({},r.textposition,{dflt:"top center"}),textfont:n({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:h({},l.hoverinfo)},"calc","nested");v.x.editType=v.y.editType=v.z.editType="calc+clearAxisTypes"}),sm=f((t,e)=>{var r=Ut(),n=oe(),i=Ze(),a=Gn(),o=Zn(),s=Yn(),l=om();e.exports=function(t,e,u,c){function h(r,i){return n.coerce(t,e,l,r,i)}var f=function(t,e,n,i){var a=0,o=n("x"),s=n("y"),l=n("z"),u=r.getComponentMethod("calendars","handleTraceDefaults");return u(t,e,["x","y","z"],i),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),e._length=e._xlength=e._ylength=e._zlength=a),a}(t,e,h,c);if(f){h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),i.hasMarkers(e)&&a(t,e,u,c,h,{noSelect:!0,noAngle:!0}),i.hasLines(e)&&(h("connectgaps"),o(t,e,u,c,h)),i.hasText(e)&&(h("texttemplate"),s(t,e,c,h,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var p=(e.line||{}).color,d=(e.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",p||d);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(t,e,p||d||u,{axis:"z"}),v(t,e,p||d||u,{axis:"y",inherit:"z"}),v(t,e,p||d||u,{axis:"x",inherit:"z"})}else e.visible=!1}}),lm=f((t,e)=>{var r=ri(),n=ei();e.exports=function(t,e){var i=[{x:!1,y:!1,trace:e,t:{}}];return r(i,e),n(t,e),i}}),um=f((t,e)=>{e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}}),cm=f((t,e)=>{var r=um();e.exports=function(t){return r("webgl",t)}}),hm=f((t,e)=>{var r=q(),n=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=n);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var i=document.createElement("div");i.className="no-webgl",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=r.defaults[0],i.style.position="absolute",i.style.left=i.style.top="0px",i.style.width=i.style.height="100%",i.style["background-color"]=r.lightLine,i.style["z-index"]=30;var a=document.createElement("p");return a.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",a.style.position="relative",a.style.top="50%",a.style.left="50%",a.style.height="30%",a.style.width="50%",a.style.margin="-15% 0 0 -25%",i.appendChild(a),t.container.appendChild(i),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),fm=f((t,e)=>{var r=tm(),n=oe(),i=["xaxis","yaxis","zaxis"];function a(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}a.prototype.merge=function(t,e){for(var a=this,o=0;o<3;++o){var s=e[i[o]];s.visible?(a.labels[o]=t._meta?n.templateString(s.title.text,t._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(a.labelColor[o]=r(s.title.font.color)),s.title.font.family&&(a.labelFont[o]=s.title.font.family),s.title.font.size&&(a.labelSize[o]=s.title.font.size),s.title.font.weight&&(a.labelFontWeight[o]=s.title.font.weight),s.title.font.style&&(a.labelFontStyle[o]=s.title.font.style),s.title.font.variant&&(a.labelFontVariant[o]=s.title.font.variant)),"showline"in s&&(a.lineEnable[o]=s.showline),"linecolor"in s&&(a.lineColor[o]=r(s.linecolor)),"linewidth"in s&&(a.lineWidth[o]=s.linewidth),"showgrid"in s&&(a.gridEnable[o]=s.showgrid),"gridcolor"in s&&(a.gridColor[o]=r(s.gridcolor)),"gridwidth"in s&&(a.gridWidth[o]=s.gridwidth),"log"===s.type?a.zeroEnable[o]=!1:"zeroline"in s&&(a.zeroEnable[o]=s.zeroline),"zerolinecolor"in s&&(a.zeroLineColor[o]=r(s.zerolinecolor)),"zerolinewidth"in s&&(a.zeroLineWidth[o]=s.zerolinewidth),"ticks"in s&&s.ticks?a.lineTickEnable[o]=!0:a.lineTickEnable[o]=!1,"ticklen"in s&&(a.lineTickLength[o]=a._defaultLineTickLength[o]=s.ticklen),"tickcolor"in s&&(a.lineTickColor[o]=r(s.tickcolor)),"tickwidth"in s&&(a.lineTickWidth[o]=s.tickwidth),"tickangle"in s&&(a.tickAngle[o]="auto"===s.tickangle?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(a.tickEnable[o]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(a.tickColor[o]=r(s.tickfont.color)),s.tickfont.family&&(a.tickFont[o]=s.tickfont.family),s.tickfont.size&&(a.tickSize[o]=s.tickfont.size),s.tickfont.weight&&(a.tickFontWeight[o]=s.tickfont.weight),s.tickfont.style&&(a.tickFontStyle[o]=s.tickfont.style),s.tickfont.variant&&(a.tickFontVariant[o]=s.tickfont.variant)),"mirror"in s?-1!==["ticks","all","allticks"].indexOf(s.mirror)?(a.lineTickMirror[o]=!0,a.lineMirror[o]=!0):!0===s.mirror?(a.lineTickMirror[o]=!1,a.lineMirror[o]=!0):(a.lineTickMirror[o]=!1,a.lineMirror[o]=!1):a.lineMirror[o]=!1,"showbackground"in s&&!1!==s.showbackground?(a.backgroundEnable[o]=!0,a.backgroundColor[o]=r(s.backgroundcolor)):a.backgroundEnable[o]=!1):(a.tickEnable[o]=!1,a.labelEnable[o]=!1,a.lineEnable[o]=!1,a.lineTickEnable[o]=!1,a.gridEnable[o]=!1,a.zeroEnable[o]=!1,a.backgroundEnable[o]=!1)}},e.exports=function(t,e){var r=new a;return r.merge(t,e),r}}),pm=f((t,e)=>{var r=tm(),n=["xaxis","yaxis","zaxis"];function i(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}i.prototype.merge=function(t){for(var e=0;e<3;++e){var i=t[n[e]];i.visible?(this.enabled[e]=i.showspikes,this.colors[e]=r(i.spikecolor),this.drawSides[e]=i.spikesides,this.lineWidth[e]=i.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new i;return e.merge(t),e}}),dm=f((t,e)=>{e.exports=function(t){for(var e=t.axesOptions,a=t.glplot.axesPixels,o=t.fullSceneLayout,s=[[],[],[]],l=0;l<3;++l){var u=o[i[l]];if(u._length=(a[l].hi-a[l].lo)*a[l].pixelsPerDataUnit/t.dataScale[l],Math.abs(u._length)===1/0||isNaN(u._length))s[l]=[];else{u._input_range=u.range.slice(),u.range[0]=a[l].lo/t.dataScale[l],u.range[1]=a[l].hi/t.dataScale[l],u._m=1/(t.dataScale[l]*a[l].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var c=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var h=u.nticks||n.constrain(u._length/40,4,9);r.autoTicks(u,Math.abs(u.range[1]-u.range[0])/h)}for(var f=r.calcTicks(u,{msUTC:!0}),p=0;p<f.length;++p)f[p].x=f[p].x*t.dataScale[l],"date"===u.type&&(f[p].text=f[p].text.replace(/\<br\>/g," "));s[l]=f,u.tickmode=c}}for(e.ticks=s,l=0;l<3;++l)for(t.glplot.bounds[0][l],t.glplot.bounds[1][l],p=0;p<2;++p)e.bounds[p][l]=t.glplot.bounds[p][l];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;e[r]=i}return e}(s)};var r=rr(),n=oe(),i=["xaxis","yaxis","zaxis"]}),mm=f((t,e)=>{var r,n,i=Wd().gl_plot3d,a=i.createCamera,o=i.createScene,s=cm(),l=or(),u=Ut(),c=oe(),h=c.preserveDrawingBuffer(),f=rr(),p=Pr(),d=tm(),m=hm(),g=Bi(),y=fm(),v=pm(),x=dm(),_=er().applyAutorangeOptions,b=!1;function w(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=y(e,e[this.id]),this.spikeOptions=v(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var T=w.prototype;T.prepareOptions=function(){var t=this,e={canvas:t.canvas,gl:t.gl,glOptions:{preserveDrawingBuffer:h,premultipliedAlpha:!0,antialias:!0},container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:t.camera,pixelRatio:t.pixelRatio};if(t.staticMode){if(!(n||(r=document.createElement("canvas"),n=s({canvas:r,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");e.gl=n,e.canvas=r}return e};var k=!0;T.tryCreatePlot=function(){var t=this,e=t.prepareOptions(),r=!0;try{t.glplot=o(e)}catch(n){if(t.staticMode||!k||h)r=!1;else{c.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{h=e.glOptions.preserveDrawingBuffer=!0,t.glplot=o(e)}catch(t){h=e.glOptions.preserveDrawingBuffer=!1,r=!1}}}return k=!1,r},T.initializeGLCamera=function(){var t=this,e=t.fullSceneLayout.camera,r="orthographic"===e.projection.type;t.camera=a(t.container,{center:[e.center.x,e.center.y,e.center.z],eye:[e.eye.x,e.eye.y,e.eye.z],up:[e.up.x,e.up.y,e.up.z],_ortho:r,zoomMin:.01,zoomMax:100,mode:"orbit"})},T.initializeGLPlot=function(){var t=this;if(t.initializeGLCamera(),!t.tryCreatePlot())return m(t);t.traces={},t.make4thDimension();var e=t.graphDiv,r=e.layout,n=function(){var e={};return t.isCameraChanged(r)&&(e[t.id+".camera"]=t.getCamera()),t.isAspectChanged(r)&&(e[t.id+".aspectratio"]=t.glplot.getAspectratio(),"manual"!==r[t.id].aspectmode&&(t.fullSceneLayout.aspectmode=r[t.id].aspectmode=e[t.id+".aspectmode"]="manual")),e},i=function(t){if(!1!==t.fullSceneLayout.dragmode){var e=n();t.saveLayout(r),t.graphDiv.emit("plotly_relayout",e)}};return t.glplot.canvas&&(t.glplot.canvas.addEventListener("mouseup",function(){i(t)}),t.glplot.canvas.addEventListener("touchstart",function(){b=!0}),t.glplot.canvas.addEventListener("wheel",function(r){if(e._context._scrollZoom.gl3d){if(t.camera._ortho){var n=r.deltaX>r.deltaY?1.1:.9090909090909091,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}},!!l&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}}),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})},!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},T.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var u=Object.keys(e.traces),h=null,d=e.glplot.selection,m=0;m<u.length;++m)"skip"!==(t=e.traces[u[m]]).data.hoverinfo&&t.handlePick(d)&&(h=t),t.setContourLevels&&t.setContourLevels();function y(t,r,n){var i=e.fullSceneLayout[t+"axis"];return"log"!==i.type&&(r=i.d2l(r)),f.hoverLabelText(i,r,n)}if(null!==h){var v=g(e.glplot.cameraParams,d.dataCoordinate);t=h.data;var _=r._fullData[t.index],w=d.index,T={xLabel:y("x",d.traceCoordinate[0],t.xhoverformat),yLabel:y("y",d.traceCoordinate[1],t.yhoverformat),zLabel:y("z",d.traceCoordinate[2],t.zhoverformat)},k=p.castHoverinfo(_,e.fullLayout,w),A=(k||"").split("+"),M=k&&"all"===k;!_.hovertemplate&&!M&&(-1===A.indexOf("x")&&(T.xLabel=void 0),-1===A.indexOf("y")&&(T.yLabel=void 0),-1===A.indexOf("z")&&(T.zLabel=void 0),-1===A.indexOf("text")&&(d.textLabel=void 0),-1===A.indexOf("name")&&(h.name=void 0));var S,E=[];"cone"===t.type||"streamtube"===t.type?(T.uLabel=y("x",d.traceCoordinate[3],t.uhoverformat),(M||-1!==A.indexOf("u"))&&E.push("u: "+T.uLabel),T.vLabel=y("y",d.traceCoordinate[4],t.vhoverformat),(M||-1!==A.indexOf("v"))&&E.push("v: "+T.vLabel),T.wLabel=y("z",d.traceCoordinate[5],t.whoverformat),(M||-1!==A.indexOf("w"))&&E.push("w: "+T.wLabel),T.normLabel=d.traceCoordinate[6].toPrecision(3),(M||-1!==A.indexOf("norm"))&&E.push("norm: "+T.normLabel),"streamtube"===t.type&&(T.divergenceLabel=d.traceCoordinate[7].toPrecision(3),(M||-1!==A.indexOf("divergence"))&&E.push("divergence: "+T.divergenceLabel)),d.textLabel&&E.push(d.textLabel),S=E.join("<br>")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=f.hoverLabelText(e._mockAxis,e._mockAxis.d2l(d.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+T.valueLabel),d.textLabel&&E.push(d.textLabel),S=E.join("<br>")):S=d.textLabel;var C={x:d.traceCoordinate[0],y:d.traceCoordinate[1],z:d.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};p.appendArrayPointValue(C,_,w),t._module.eventData&&(C=_._module.eventData(C,d,_,{},w));var I={points:[C]};if(e.fullSceneLayout.hovermode){var L=[];p.loneHover({trace:_,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:S,name:h.name,color:p.castHoverOption(_,w,"bgcolor")||h.color,borderColor:p.castHoverOption(_,w,"bordercolor"),fontFamily:p.castHoverOption(_,w,"font.family"),fontSize:p.castHoverOption(_,w,"font.size"),fontColor:p.castHoverOption(_,w,"font.color"),nameLength:p.castHoverOption(_,w,"namelength"),textAlign:p.castHoverOption(_,w,"align"),hovertemplate:c.castOption(_,w,"hovertemplate"),hovertemplateLabels:c.extendFlat({},C,T),eventData:[C]},{container:n,gd:r,inOut_bbox:L}),C.bbox=L[0]}d.distance<5&&(d.buttons||b)?r.emit("plotly_click",I):r.emit("plotly_hover",I),this.oldEventData=I}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},T.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var A=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=A[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],h=e["_"+o+"length"];if(c.isArrayOrTypedArray(l))for(var f,p=0;p<(h||l.length);p++)if(c.isArrayOrTypedArray(l[p]))for(var d=0;d<l[p].length;++d)f=s.d2l(l[p][d],0,u),!isNaN(f)&&isFinite(f)&&(r[0][i]=Math.min(r[0][i],f),r[1][i]=Math.max(r[1][i],f));else f=s.d2l(l[p],0,u),!isNaN(f)&&isFinite(f)&&(r[0][i]=Math.min(r[0][i],f),r[1][i]=Math.max(r[1][i],f));else r[0][i]=Math.min(r[0][i],0),r[1][i]=Math.max(r[1][i],h-1)}}T.plot=function(t,e,r){var n=this;if(n.plotArgs=[t,e,r],!n.glplot.contextLost){var i,a,o,s,l,u,c=e[n.id],h=r[n.id];n.fullLayout=e,n.fullSceneLayout=c,n.axesOptions.merge(e,c),n.spikeOptions.merge(c),n.setViewport(c),n.updateFx(c.dragmode,c.hovermode),n.camera.enableWheel=n.graphDiv._context._scrollZoom.gl3d,n.glplot.setClearColor(d(c.bgcolor)),n.setConvert(l),t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(o=0;o<t.length;++o)!0===(i=t[o]).visible&&0!==i._length&&M(this,i,f);!function(t,e){for(var r=t.fullSceneLayout,n=r.annotations||[],i=0;i<3;i++)for(var a=A[i],o=a.charAt(0),s=r[a],l=0;l<n.length;l++){var u=n[l];if(u.visible){var c=s.r2l(u[o]);!isNaN(c)&&isFinite(c)&&(e[0][i]=Math.min(e[0][i],c),e[1][i]=Math.max(e[1][i],c))}}}(this,f);var p=[1,1,1];for(s=0;s<3;++s)f[1][s]===f[0][s]?p[s]=1:p[s]=1/(f[1][s]-f[0][s]);for(n.dataScale=p,n.convertAnnotations(this),o=0;o<t.length;++o)!0===(i=t[o]).visible&&0!==i._length&&((a=n.traces[i.uid])?a.data.type===i.type?a.update(i):(a.dispose(),a=i._module.plot(this,i),n.traces[i.uid]=a):(a=i._module.plot(this,i),n.traces[i.uid]=a),a.name=i.name);var m=Object.keys(n.traces);t:for(o=0;o<m.length;++o){for(s=0;s<t.length;++s)if(t[s].uid===m[o]&&!0===t[s].visible&&0!==t[s]._length)continue t;(a=n.traces[m[o]]).dispose(),delete n.traces[m[o]]}n.glplot.objects.sort(function(t,e){return t._trace.data.index-e._trace.data.index});var g=[[0,0,0],[0,0,0]],y=[],v={};for(o=0;o<3;++o){var x;if((u=(l=c[A[o]]).type)in v?(v[u].acc*=p[o],v[u].count+=1):v[u]={acc:p[o],count:1},l.autorange){g[0][o]=1/0,g[1][o]=-1/0;var b=n.glplot.objects,w=n.fullSceneLayout.annotations||[],T=l._name.charAt(0);for(s=0;s<b.length;s++){var k=b[s],S=k.bounds,E=k._trace.data._pad||0;"ErrorBars"===k.constructor.name&&l._lowerLogErrorBound?g[0][o]=Math.min(g[0][o],l._lowerLogErrorBound):g[0][o]=Math.min(g[0][o],S[0][o]/p[o]-E),g[1][o]=Math.max(g[1][o],S[1][o]/p[o]+E)}for(s=0;s<w.length;s++){var C=w[s];if(C.visible){var I=l.r2l(C[T]);g[0][o]=Math.min(g[0][o],I),g[1][o]=Math.max(g[1][o],I)}}if("rangemode"in l&&"tozero"===l.rangemode&&(g[0][o]=Math.min(g[0][o],0),g[1][o]=Math.max(g[1][o],0)),g[0][o]>g[1][o])g[0][o]=-1,g[1][o]=1;else{var L=g[1][o]-g[0][o];g[0][o]-=L/32,g[1][o]+=L/32}if(x=[g[0][o],g[1][o]],x=_(x,l),g[0][o]=x[0],g[1][o]=x[1],l.isReversed()){var P=g[0][o];g[0][o]=g[1][o],g[1][o]=P}}else x=l.range,g[0][o]=l.r2l(x[0]),g[1][o]=l.r2l(x[1]);g[0][o]===g[1][o]&&(g[0][o]-=1,g[1][o]+=1),y[o]=g[1][o]-g[0][o],l.range=[g[0][o],g[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*p[o],max:l.range[1]*p[o]})}var z,O=c.aspectmode;if("cube"===O)z=[1,1,1];else if("manual"===O){var D=c.aspectratio;z=[D.x,D.y,D.z]}else{if("auto"!==O&&"data"!==O)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=[1,1,1];for(o=0;o<3;++o){var F=v[u=(l=c[A[o]]).type];R[o]=Math.pow(F.acc,1/F.count)/p[o]}z="data"===O||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}c.aspectratio.x=h.aspectratio.x=z[0],c.aspectratio.y=h.aspectratio.y=z[1],c.aspectratio.z=h.aspectratio.z=z[2],n.glplot.setAspectratio(c.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=c.aspectmode);var B=c.domain||null,N=e._size||null;if(B&&N){var j=n.container.style;j.position="absolute",j.left=N.l+B.x[0]*N.w+"px",j.top=N.t+(1-B.y[1])*N.h+"px",j.width=N.w*(B.x[1]-B.x[0])+"px",j.height=N.h*(B.y[1]-B.y[0])+"px"}n.glplot.redraw()}},T.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},T.getCamera=function(){var t=this;return t.camera.view.recalcMatrix(t.camera.view.lastT()),function(t){return{up:{x:t.up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}}(t.camera)},T.setViewport=function(t){var e=this,r=t.camera;e.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(r)),e.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==e.camera._ortho&&(e.glplot.redraw(),e.glplot.clearRGBA(),e.glplot.dispose(),e.initializeGLPlot())},T.isCameraChanged=function(t){var e=this.getCamera(),r=c.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},T.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=c.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},T.saveLayout=function(t){var e,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(t),f=s.isAspectChanged(t),p=h||f;if(p){var d={};h&&(e=s.getCamera(),n=(r=c.nestedProperty(t,s.id+".camera")).get(),d[s.id+".camera"]=n),f&&(i=s.glplot.getAspectratio(),o=(a=c.nestedProperty(t,s.id+".aspectratio")).get(),d[s.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,l._preGUI,d),h&&(r.set(e),c.nestedProperty(l,s.id+".camera").set(e)),f&&(a.set(i),c.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return p},T.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var f=r.id+".camera.up",p={x:0,y:0,z:1},d={};d[f]=p;var m=i.layout;u.call("_storeDirectGUIEdit",m,a._preGUI,d),o.up=p,c.nestedProperty(m,f).set(p)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},T.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(r),e.glplot.redraw();var n=e.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(t,e,r){for(var n=0,i=r-1;n<i;++n,--i)for(var a=0;a<e;++a)for(var o=0;o<4;++o){var s=4*(e*n+a)+o,l=4*(e*i+a)+o,u=t[s];t[s]=t[l],t[l]=u}}(o,i,a),function(t,e,r){for(var n=0;n<r;++n)for(var i=0;i<e;++i){var a=4*(e*n+i),o=t[a+3];if(o>0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,u=s.getContext("2d",{willReadFrequently:!0}),c=u.createImageData(i,a);switch(c.data.set(o),u.putImageData(c,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(r),l},T.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[A[t]];f.setConvert(e,this.fullLayout),e.setScale=c.noop}},T.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(t._mockAxis,e)},e.exports=w}),gm=f((t,e)=>{e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),ym=f((t,e)=>{var r=q(),n=Ee(),i=D().extendFlat,a=Lt().overrideAll;e.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}),vm=f((t,e)=>{var r=ym(),n=wa().attributes,i=D().extendFlat,a=oe().counterRegex;function o(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:r,yaxis:r,zaxis:r,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),xm=f((t,e)=>{var r=O().mix,n=oe(),i=me(),a=ym(),o=vi(),s=bi(),l=["xaxis","yaxis","zaxis"],u=13600/187;e.exports=function(t,e,c){var h,f;function p(t,e){return n.coerce(h,f,a,t,e)}for(var d=0;d<l.length;d++){var m=l[d];h=t[m]||{},(f=i.newContainer(e,m))._id=m[0]+c.scene,f._name=m,o(h,f,p,c),s(h,f,p,{font:c.font,letter:m[0],data:c.data,showGrid:!0,noAutotickangles:!0,noMinorloglabels:!0,noTicklabelindex:!0,noTickson:!0,noTicklabelmode:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noTicklabelposition:!0,noTicklabeloverflow:!0,noInsiderange:!0,noUnifiedhovertitle:!0,bgColor:c.bgColor,calendar:c.calendar},c.fullLayout),p("gridcolor",r(f.color,c.bgColor,u).toRgbString()),p("title.text",m[0]),f.setScale=n.noop,p("showspikes")&&(p("spikesides"),p("spikethickness"),p("spikecolor",f.color)),p("showaxeslabels"),p("showbackground")&&p("backgroundcolor")}}}),_m=f((t,e)=>{var r=oe(),n=q(),i=Ut(),a=Vs(),o=xm(),s=vm(),l=_e().getSubplotData,u="gl3d";function c(t,e,r,a){for(var s=r("bgcolor"),c=n.combine(s,a.paper_bgcolor),h=["up","center","eye"],f=0;f<h.length;f++)r("camera."+h[f]+".x"),r("camera."+h[f]+".y"),r("camera."+h[f]+".z");r("camera.projection.type");var p=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),d=r("aspectmode",p?"manual":"auto");p||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===d&&(e.aspectmode="auto"),t.aspectmode=e.aspectmode);var m=l(a.fullData,u,a.id);o(t,e,{font:a.font,scene:a.id,data:m,bgColor:c,calendar:a.calendar,autotypenumbersDflt:a.autotypenumbersDflt,fullLayout:a.fullLayout}),i.getComponentMethod("annotations3d","handleDefaults")(t,e,a);var g=a.getDfltFromLayout("dragmode");if(!1!==g&&!g)if(g="orbit",t.camera&&t.camera.up){var y=t.camera.up.x,v=t.camera.up.y,x=t.camera.up.z;0!==x&&(!y||!v||!x||x/Math.sqrt(y*y+v*v+x*x)>.999)&&(g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}e.exports=function(t,e,n){var i=e._basePlotModules.length>1;a(t,e,n,{type:u,attributes:s,handleDefaults:c,fullLayout:e,font:e.font,fullData:n,getDfltFromLayout:function(e){if(!i&&r.validate(t[e],s[e]))return t[e]},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}}),bm=f(t=>{var e=Lt().overrideAll,r=B(),n=mm(),i=_e().getSubplotData,a=oe(),o=Te(),s="gl3d",l="scene";t.name=s,t.attr=l,t.idRoot=l,t.idRegex=t.attrRegex=a.counterRegex("scene"),t.attributes=gm(),t.layoutAttributes=vm(),t.baseLayoutAttrOverrides=e({hoverlabel:r.hoverlabel},"plot","nested"),t.supplyLayoutDefaults=_m(),t.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=e._subplots[s],o=0;o<a.length;o++){var l=a[o],u=i(r,s,l),c=e[l],h=c.camera,f=c._scene;f||(f=new n({id:l,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio,camera:h},e),c._scene=f),f.viewInitial||(f.viewInitial={up:{x:h.up.x,y:h.up.y,z:h.up.z},eye:{x:h.eye.x,y:h.eye.y,z:h.eye.z},center:{x:h.center.x,y:h.center.y,z:h.center.z}}),f.plot(u,e,t.layout)}},t.clean=function(t,e,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._scene&&(n[o]._scene.destroy(),n._infolayer&&n._infolayer.selectAll(".annotation-"+o).remove())}},t.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots[s],n=e._size,i=0;i<r.length;i++){var a=e[r[i]],l=a.domain,u=a._scene,c=u.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}},t.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),l+e}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[s],n=0;n<r.length;n++)e[r[n]]._scene.updateFx(e.dragmode,e.hovermode)}}),wm=f((t,e)=>{e.exports={plot:am(),attributes:om(),markerSymbols:nm(),supplyDefaults:sm(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:lm(),moduleType:"trace",name:"scatter3d",basePlotModule:bm(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),Tm=f((t,e)=>{e.exports=wm()}),km=f((t,e)=>{var r=q(),n=Ie(),i=Se().axisHoverFormat,a=Ot().hovertemplateAttrs,o=j(),s=D().extendFlat,l=Lt().overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:r.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:r.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var c=e.exports=l(s({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},n("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"}),Am=f((t,e)=>{var r=Ut(),n=oe(),i=Ue(),a=km();function o(t,e,r,n){var i=n("opacityscale");"max"===i?e.opacityscale=[[0,.1],[1,1]]:"min"===i?e.opacityscale=[[0,1],[1,.1]]:"extremes"===i?e.opacityscale=function(t,e){for(var r=[],n=0;n<32;n++){var i=n/31,a=e+(1-e)*(1-Math.pow(Math.sin(t*i*Math.PI),2));r.push([i,Math.max(0,Math.min(1,a))])}return r}(1,.1):function(t){var e=0;if(!Array.isArray(t)||t.length<2||!t[0]||!t[t.length-1]||0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var n=t[r];if(2!==n.length||+n[0]<e)return!1;e=+n[0]}return!0}(i)||(e.opacityscale=void 0)}e.exports={supplyDefaults:function(t,e,s,l){var u,c;function h(r,i){return n.coerce(t,e,a,r,i)}var f=h("x"),p=h("y"),d=h("z");if(!d||!d.length||f&&f.length<1||p&&p.length<1)e.visible=!1;else{e._xlength=Array.isArray(f)&&n.isArrayOrTypedArray(f[0])?d.length:d[0].length,e._ylength=d.length,r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],l),h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach(function(t){h(t)}),h("surfacecolor");var m=["x","y","z"];for(u=0;u<3;++u){var g="contours."+m[u],y=h(g+".show"),v=h(g+".highlight");if(y||v)for(c=0;c<3;++c)h(g+".project."+m[c]);y&&(h(g+".color"),h(g+".width"),h(g+".usecolormap")),v&&(h(g+".highlightcolor"),h(g+".highlightwidth")),h(g+".start"),h(g+".end"),h(g+".size")}i(t,e,l,h,{prefix:"",cLetter:"c"}),o(0,e,0,h),e._length=null}},opacityscaleDefaults:o}}),Mm=f((t,e)=>{var r=He();e.exports=function(t,e){e.surfacecolor?r(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):r(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}}),Sm=f((t,e)=>{var r=Wd().gl_surface3d,n=Wd().ndarray,i=Wd().ndarray_linear_interpolate.d2,a=Po(),o=zo(),s=oe().isArrayOrTypedArray,l=em().parseColorScale,u=tm(),c=Ge().extractOpts;function h(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var f=h.prototype;f.getXat=function(t,e,r,n){var i=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},f.getYat=function(t,e,r,n){var i=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},f.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},f.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++)null!=t.dataCoordinate[a]&&(t.dataCoordinate[a]*=this.scene.dataScale[a]);var o=this.data.hovertext||this.data.text;return s(o)&&o[i]&&void 0!==o[i][n]?t.textLabel=o[i][n]:t.textLabel=o||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var p=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function d(t,e){if(t<e)return 0;for(var r=0;0===Math.floor(t%e);)t/=e,r++;return r}function m(t){for(var e=[],r=0;r<p.length;r++){var n=p[r];e.push(d(t,n))}return e}function g(t){for(var e=m(t),r=t,n=0;n<p.length;n++)if(e[n]>0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;a<p.length;a++)i*=Math.pow(p[a],Math.max(r[a],n[a]));return i}}f.calcXnums=function(t){var e,r=[];for(e=1;e<t;e++){var n=this.getXat(e-1,0),i=this.getXat(e,0);r[e-1]=i!==n&&null!=n&&null!=i?Math.abs(i-n):0}var a=0;for(e=1;e<t;e++)a+=r[e-1];for(e=1;e<t;e++)0===r[e-1]?r[e-1]=1:r[e-1]=Math.round(a/r[e-1]);return r},f.calcYnums=function(t){var e,r=[];for(e=1;e<t;e++){var n=this.getYat(0,e-1),i=this.getYat(0,e);r[e-1]=i!==n&&null!=n&&null!=i?Math.abs(i-n):0}var a=0;for(e=1;e<t;e++)a+=r[e-1];for(e=1;e<t;e++)0===r[e-1]?r[e-1]=1:r[e-1]=Math.round(a/r[e-1]);return r};var v=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],x=v[9],_=v[13];function b(t,e,r){var n=r[8]+r[2]*e[0]+r[5]*e[1];return t[0]=(r[6]+r[0]*e[0]+r[3]*e[1])/n,t[1]=(r[7]+r[1]*e[0]+r[4]*e[1])/n,t}function w(t,e,r){return function(t,e,r,n){for(var a=[0,0],o=t.shape[0],s=t.shape[1],l=0;l<o;l++)for(var u=0;u<s;u++)r(a,[l,u],n),t.set(l,u,i(e,a[0],a[1]))}(t,e,b,r),t}function T(t,e){for(var r=!1,n=0;n<t.length;n++)if(e===t[n]){r=!0;break}!1===r&&t.push(e)}f.estimateScale=function(t,e){for(var r=1+function(t){if(0!==t.length){for(var e=1,r=0;r<t.length;r++)e=y(e,t[r]);return e}}(0===e?this.calcXnums(t):this.calcYnums(t));r<x;)r*=2;for(;r>_;)r--,r/=g(r),++r<x&&(r=_);var n=Math.round(r/t);return n>1?n:1},f.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,i=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+i+1,u=1+a+1,c=n(new Float32Array(l*u),[l,u]),h=[1/e,0,0,0,1/r,0,0,0,1],f=0;f<t.length;++f){this.surface.padField(c,t[f]);var p=n(new Float32Array(o*s),[o,s]);w(p,c,h),t[f]=p}},f.setContourLevels=function(){var t,e,r,n=[[],[],[]],i=[!1,!1,!1],a=!1;for(t=0;t<3;++t)if(this.showContour[t]&&(a=!0,this.contourSize[t]>0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];e<this.contourEnd[t];e+=this.contourSize[t])r=e*this.scene.dataScale[t],T(n[t],r);if(a){var o=[[],[],[]];for(t=0;t<3;++t)this.showContour[t]&&(o[t]=i[t]?n[t]:this.scene.contourLevels[t]);this.surface.update({levels:o})}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout,i=this.surface,s=l(t),h=e.dataScale,f=t.z[0].length,p=t._ylength,d=e.contourLevels;this.data=t;var m,g,y,v,x=[];for(m=0;m<3;m++)for(x[m]=[],g=0;g<f;g++)x[m][g]=[];for(g=0;g<f;g++)for(y=0;y<p;y++)x[0][g][y]=this.getXat(g,y,t.xcalendar,r.xaxis),x[1][g][y]=this.getYat(g,y,t.ycalendar,r.yaxis),x[2][g][y]=this.getZat(g,y,t.zcalendar,r.zaxis);if(t.connectgaps)for(t._emptypoints=o(x[2]),a(x[2],t._emptypoints),t._interpolatedZ=[],g=0;g<f;g++)for(t._interpolatedZ[g]=[],y=0;y<p;y++)t._interpolatedZ[g][y]=x[2][g][y];for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)null==(v=x[m][g][y])?x[m][g][y]=NaN:v=x[m][g][y]*=h[m];for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)null!=(v=x[m][g][y])&&(this.minValues[m]>v&&(this.minValues[m]=v),this.maxValues[m]<v&&(this.maxValues[m]=v));for(m=0;m<3;m++)this.objectOffset[m]=.5*(this.minValues[m]+this.maxValues[m]);for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)null!=(v=x[m][g][y])&&(x[m][g][y]-=this.objectOffset[m]);var b=[n(new Float32Array(f*p),[f,p]),n(new Float32Array(f*p),[f,p]),n(new Float32Array(f*p),[f,p])];for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)b[m].set(g,y,x[m][g][y]);x=[];var w={colormap:s,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacityscale:t.opacityscale,opacity:t.opacity},T=c(t);if(w.intensityBounds=[T.min,T.max],t.surfacecolor){var k=n(new Float32Array(f*p),[f,p]);for(g=0;g<f;g++)for(y=0;y<p;y++)k.set(g,y,t.surfacecolor[y][g]);b.push(k)}else w.intensityBounds[0]*=h[2],w.intensityBounds[1]*=h[2];(_<b[0].shape[0]||_<b[0].shape[1])&&(this.refineData=!1),!0===this.refineData&&(this.dataScaleX=this.estimateScale(b[0].shape[0],0),this.dataScaleY=this.estimateScale(b[0].shape[1],1),(1!==this.dataScaleX||1!==this.dataScaleY)&&this.refineCoords(b)),t.surfacecolor&&(w.intensity=b.pop());var A=[!0,!0,!0],M=["x","y","z"];for(m=0;m<3;++m){var S=t.contours[M[m]];A[m]=S.highlight,w.showContour[m]=S.show||S.highlight,w.showContour[m]&&(w.contourProject[m]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[m]=!0,w.levels[m]=d[m],i.highlightColor[m]=w.contourColor[m]=u(S.color),S.usecolormap?i.highlightTint[m]=w.contourTint[m]=0:i.highlightTint[m]=w.contourTint[m]=1,w.contourWidth[m]=S.width,this.contourStart[m]=S.start,this.contourEnd[m]=S.end,this.contourSize[m]=S.size):(this.showContour[m]=!1,this.contourStart[m]=null,this.contourEnd[m]=null,this.contourSize[m]=0),S.highlight&&(w.dynamicColor[m]=u(S.highlightcolor),w.dynamicWidth[m]=S.highlightwidth))}(function(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]})(s)&&(w.vertexColor=!0),w.objectOffset=this.objectOffset,w.coords=b,i.update(w),i.visible=t.visible,i.enableDynamic=A,i.enableHighlight=A,i.snapToData=!0,"lighting"in t&&(i.ambientLight=t.lighting.ambient,i.diffuseLight=t.lighting.diffuse,i.specularLight=t.lighting.specular,i.roughness=t.lighting.roughness,i.fresnel=t.lighting.fresnel),"lightposition"in t&&(i.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z])},f.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new h(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}),Em=f((t,e)=>{e.exports={attributes:km(),supplyDefaults:Am().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:Mm(),plot:Sm(),moduleType:"trace",name:"surface",basePlotModule:bm(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),Cm=f((t,e)=>{e.exports=Em()}),Im=f((t,e)=>{var r=Ie(),n=Se().axisHoverFormat,i=Ot().hovertemplateAttrs,a=km(),o=j(),s=D().extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},r("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},a.contours.x.show,{}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},a.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"}),showlegend:s({},o.showlegend,{dflt:!1})})}),Lm=f((t,e)=>{var r=Ie(),n=Se().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Im(),o=j(),s=D().extendFlat,l=Lt().overrideAll,u=e.exports=l(s({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),valuehoverformat:n("value",1),showlegend:s({},o.showlegend,{dflt:!1})},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,lightposition:a.lightposition,lighting:a.lighting,flatshading:a.flatshading,contour:a.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes"}),Pm=f((t,e)=>{var r=oe(),n=Ut(),i=Lm(),a=Ue();function o(t,e,r,i,o){var s=o("isomin"),l=o("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=o("x"),c=o("y"),h=o("z"),f=o("value");u&&u.length&&c&&c.length&&h&&h.length&&f&&f.length?(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),o("valuehoverformat"),["x","y","z"].forEach(function(t){o(t+"hoverformat");var e="caps."+t;o(e+".show")&&o(e+".fill");var r="slices."+t;o(r+".show")&&(o(r+".fill"),o(r+".locations"))}),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(o("contour.color"),o("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(t){o(t)}),a(t,e,i,o,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,n,a){o(t,e,0,a,function(n,a){return r.coerce(t,e,i,n,a)})},supplyIsoDefaults:o}}),zm=f((t,e)=>{var r=oe(),n=He();function i(t){var e,n,i,o,s,l,u,c,h,f,p,d,m=t._x,g=t._y,y=t._z,v=t._len,x=-1/0,_=1/0,b=-1/0,w=1/0,T=-1/0,k=1/0,A="";for(v&&(u=m[0],h=g[0],p=y[0]),v>1&&(c=m[v-1],f=g[v-1],d=y[v-1]),e=0;e<v;e++)x=Math.max(x,m[e]),_=Math.min(_,m[e]),b=Math.max(b,g[e]),w=Math.min(w,g[e]),T=Math.max(T,y[e]),k=Math.min(k,y[e]),!o&&m[e]!==u&&(o=!0,A+="x"),!s&&g[e]!==h&&(s=!0,A+="y"),!l&&y[e]!==p&&(l=!0,A+="z");o||(A+="x"),s||(A+="y"),l||(A+="z");var M=a(t._x),S=a(t._y),E=a(t._z);A=(A=(A=A.replace("x",(u>c?"-":"+")+"x")).replace("y",(h>f?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var C=function(){v=0,M=[],S=[],E=[]};(!v||v<M.length*S.length*E.length)&&C();var I=function(t){return"x"===t?m:"y"===t?g:y},L=function(t){return"x"===t?M:"y"===t?S:E},P=function(t){return t[v-1]<t[0]?-1:1},z=I(A[1]),O=I(A[3]),D=I(A[5]),R=L(A[1]).length,F=L(A[3]).length,B=L(A[5]).length,N=!1,j=function(t,e,r){return R*(F*t+e)+r},U=P(I(A[1])),V=P(I(A[3])),q=P(I(A[5]));for(e=0;e<B-1;e++){for(n=0;n<F-1;n++){for(i=0;i<R-1;i++){var H=j(e,n,i),G=j(e,n,i+1),Z=j(e,n+1,i),W=j(e+1,n,i);if(z[H]*U<z[G]*U&&O[H]*V<O[Z]*V&&D[H]*q<D[W]*q||(N=!0),N)break}if(N)break}if(N)break}return N&&(r.warn("Encountered arbitrary coordinates! Unable to input data grid."),C()),{xMin:_,yMin:w,zMin:k,xMax:x,yMax:b,zMax:T,Xs:M,Ys:S,Zs:E,len:v,fill:A}}function a(t){return r.distinctVals(t).vals}function o(t,e){if(void 0===e&&(e=t.length),r.isTypedArray(t))return t.subarray(0,e);for(var n=[],i=0;i<e;i++)n[i]=+t[i];return n}e.exports={calc:function(t,e){e._len=Math.min(e.u.length,e.v.length,e.w.length,e.x.length,e.y.length,e.z.length),e._u=o(e.u,e._len),e._v=o(e.v,e._len),e._w=o(e.w,e._len),e._x=o(e.x,e._len),e._y=o(e.y,e._len),e._z=o(e.z,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;var a,s,l,u=0;e.starts&&(a=o(e.starts.x||[]),s=o(e.starts.y||[]),l=o(e.starts.z||[]),u=Math.min(a.length,s.length,l.length)),e._startsX=a||[],e._startsY=s||[],e._startsZ=l||[];var c,h=0,f=1/0;for(c=0;c<e._len;c++){var p=e._u[c],d=e._v[c],m=e._w[c],g=Math.sqrt(p*p+d*d+m*m);h=Math.max(h,g),f=Math.min(f,g)}for(n(t,e,{vals:[f,h],containerStr:"",cLetter:"c"}),c=0;c<u;c++){var y=a[c];r.xMax=Math.max(r.xMax,y),r.xMin=Math.min(r.xMin,y);var v=s[c];r.yMax=Math.max(r.yMax,v),r.yMin=Math.min(r.yMin,v);var x=l[c];r.zMax=Math.max(r.zMax,x),r.zMin=Math.min(r.zMin,x)}e._slen=u,e._normMax=h,e._xbnds=[r.xMin,r.xMax],e._ybnds=[r.yMin,r.yMax],e._zbnds=[r.zMin,r.zMax]},filter:o,processGrid:i}}),Om=f((t,e)=>{var r=He(),n=zm().processGrid,i=zm().filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=i(e.x,e._len),e._y=i(e.y,e._len),e._z=i(e.z,e._len),e._value=i(e.value,e._len);var a=n(e);e._gridFill=a.fill,e._Xs=a.Xs,e._Ys=a.Ys,e._Zs=a.Zs,e._len=a.len;for(var o=1/0,s=-1/0,l=0;l<e._len;l++){var u=e._value[l];o=Math.min(o,u),s=Math.max(s,u)}e._minValues=o,e._maxValues=s,e._vMin=void 0===e.isomin||null===e.isomin?o:e.isomin,e._vMax=void 0===e.isomax||null===e.isomax?s:e.isomax,r(t,e,{vals:[e._vMin,e._vMax],containerStr:"",cLetter:"c"})}}),Dm=f((t,e)=>{e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;a<n;a++)i[a]=[t[a],e[a],r[a]];return i}}),Rm=f((t,e)=>{var r=Wd().gl_mesh3d,n=em().parseColorScale,i=oe().isArrayOrTypedArray,a=tm(),o=Ge().extractOpts,s=Dm(),l=function(t,e){for(var r=e.length-1;r>0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n<t&&t<=i)return{id:r,distRatio:(i-t)/(i-n)}}return{id:0,distRatio:0}};function u(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var c=u.prototype;c.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._meshX[e],n=this.data._meshY[e],a=this.data._meshZ[e],o=this.data._Ys.length,s=this.data._Zs.length,u=l(r,this.data._Xs).id,c=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=t.index=h+s*c+s*o*u;t.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[f]?t.textLabel=p[f]:p&&(t.textLabel=p),!0}},c.update=function(t){var e=this.scene,r=e.fullSceneLayout;function i(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}this.data=f(t);var l={positions:s(i(r.xaxis,t._meshX,e.dataScale[0],t.xcalendar),i(r.yaxis,t._meshY,e.dataScale[1],t.ycalendar),i(r.zaxis,t._meshZ,e.dataScale[2],t.zcalendar)),cells:s(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:a(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},u=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(t),this.mesh.update(l)},c.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var h=["xyz","xzy","yxz","yzx","zxy","zyx"];function f(t){t._meshI=[],t._meshJ=[],t._meshK=[];var e,r,n,i,a,o,s,u=t.surface.show,c=t.spaceframe.show,f=t.surface.fill,p=t.spaceframe.fill,d=!1,m=!1,g=0,y=t._Xs,v=t._Ys,x=t._Zs,_=y.length,b=v.length,w=x.length,T=h.indexOf(t._gridFill.replace(/-/g,"").replace(/\+/g,"")),k=function(t,e,r){switch(T){case 5:return r+w*e+w*b*t;case 4:return r+w*t+w*_*e;case 3:return e+b*r+b*w*t;case 2:return e+b*t+b*_*r;case 1:return t+_*r+_*w*e;default:return t+_*e+_*b*r}},A=t._minValues,M=t._maxValues,S=t._vMin,E=t._vMax;function C(t,e,s){for(var l=o.length,u=r;u<l;u++)if(t===n[u]&&e===i[u]&&s===a[u])return u;return-1}function I(){r=e}function L(){n=[],i=[],a=[],o=[],e=0,I()}function P(t,r,s,l){return n.push(t),i.push(r),a.push(s),o.push(l),++e-1}function z(e,r,n){return t._meshI.push(e),t._meshJ.push(r),t._meshK.push(n),++g-1}function O(t,e,r){for(var n=[],i=0;i<t.length;i++)n[i]=t[i]*(1-r)+r*e[i];return n}function D(t){s=t}function R(t,e){return"all"===t||null===t||t.indexOf(e)>-1}function F(t,e){return null===t?e:t}function B(t,e,r){I();var n=[e],i=[r];if(s>=1)n=[e],i=[r];else if(s>0){var a=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i<t.length;i++)n[i]=(t[i]+e[i]+r[i])/3;return n}(r,n,i),o=Math.sqrt(1-s),l=O(a,r,o),u=O(a,n,o),c=O(a,i,o),h=e[0],f=e[1],p=e[2];return{xyzv:[[r,n,u],[u,l,r],[n,i,c],[c,u,n],[i,r,l],[l,c,i]],abc:[[h,f,-1],[-1,-1,h],[f,p,-1],[-1,-1,f],[p,h,-1],[-1,-1,p]]}}(e,r);n=a.xyzv,i=a.abc}for(var o=0;o<n.length;o++){e=n[o],r=i[o];for(var l=[],u=0;u<3;u++){var c=e[u][0],h=e[u][1],f=e[u][2],p=e[u][3],d=r[u]>-1?r[u]:C(c,h,f);l[u]=d>-1?d:P(c,h,f,F(t,p))}z(l[0],l[1],l[2])}}function N(t,e,r,n){var i=t[3];i<r&&(i=r),i>n&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function j(t,e,r){return t>=e&&t<=r}function U(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function V(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function q(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[j(e[0][3],n,i),j(e[1][3],n,i),j(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return U(e[0][3])&&U(e[1][3])&&U(e[2][3])?(B(t,e,r),!0):a<3&&q(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var u=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var c=e[a[0]],h=e[a[1]],f=e[a[2]],p=N(f,c,n,i),d=N(f,h,n,i);o=l(t,[d,p,c],[-1,-1,r[a[0]]])||o,o=l(t,[c,h,d],[r[a[0]],r[a[1]],-1])||o,u=!0}}),u||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var c=e[a[0]],h=e[a[1]],f=e[a[2]],p=N(h,c,n,i),d=N(f,c,n,i);o=l(t,[d,p,c],[-1,-1,r[a[0]]])||o,u=!0}}),o}function H(t,e,r,n){var i=!1,a=V(e),o=[j(a[0][3],r,n),j(a[1][3],r,n),j(a[2][3],r,n),j(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){B(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],h=a[l[2]],f=a[l[3]];if(m)i=B(t,[u,c,h],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=N(f,u,r,n),d=N(f,c,r,n),g=N(f,h,r,n);i=B(null,[p,d,g],[-1,-1,-1])||i}s=!0}}),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],h=a[l[2]],f=a[l[3]],p=N(h,u,r,n),d=N(h,c,r,n),g=N(f,c,r,n),y=N(f,u,r,n);m?(i=B(t,[u,y,p],[e[l[0]],-1,-1])||i,i=B(t,[c,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){B(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,g,y],[-1,-1,-1,-1])||i,s=!0}}),s)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],h=a[l[2]],f=a[l[3]],p=N(c,u,r,n),d=N(h,u,r,n),g=N(f,u,r,n);m?(i=B(t,[u,p,d],[e[l[0]],-1,-1])||i,i=B(t,[u,d,g],[e[l[0]],-1,-1])||i,i=B(t,[u,g,p],[e[l[0]],-1,-1])||i):i=B(null,[p,d,g],[-1,-1,-1])||i,s=!0}}),i}function G(t,e,r,n,i,a,o,s,l,u,c){var h=!1;return d&&(R(t,"A")&&(h=H(null,[e,r,n,a],u,c)||h),R(t,"B")&&(h=H(null,[r,n,i,l],u,c)||h),R(t,"C")&&(h=H(null,[r,a,o,l],u,c)||h),R(t,"D")&&(h=H(null,[n,a,s,l],u,c)||h),R(t,"E")&&(h=H(null,[r,n,a,l],u,c)||h)),m&&(h=H(t,[r,n,a,l],u,c)||h),h}function Z(t,e,r,n,i,a,o,s){return[!0===s[0]||q(t,V([e,r,n]),[e,r,n],a,o),!0===s[1]||q(t,V([n,i,e]),[n,i,e],a,o)]}function W(t,e,r,n,i,a,o,s,l){return s?Z(t,e,r,i,n,a,o,l):Z(t,r,i,n,e,a,o,l)}function Y(t,e,r,n,i,a,o){var s,l,u,c,h=!1,f=function(){h=q(t,[s,l,u],[-1,-1,-1],i,a)||h,h=q(t,[u,c,s],[-1,-1,-1],i,a)||h},p=o[0],d=o[1],m=o[2];return p&&(s=O(V([k(e,r-0,n-0)])[0],V([k(e-1,r-0,n-0)])[0],p),l=O(V([k(e,r-0,n-1)])[0],V([k(e-1,r-0,n-1)])[0],p),u=O(V([k(e,r-1,n-1)])[0],V([k(e-1,r-1,n-1)])[0],p),c=O(V([k(e,r-1,n-0)])[0],V([k(e-1,r-1,n-0)])[0],p),f()),d&&(s=O(V([k(e-0,r,n-0)])[0],V([k(e-0,r-1,n-0)])[0],d),l=O(V([k(e-0,r,n-1)])[0],V([k(e-0,r-1,n-1)])[0],d),u=O(V([k(e-1,r,n-1)])[0],V([k(e-1,r-1,n-1)])[0],d),c=O(V([k(e-1,r,n-0)])[0],V([k(e-1,r-1,n-0)])[0],d),f()),m&&(s=O(V([k(e-0,r-0,n)])[0],V([k(e-0,r-0,n-1)])[0],m),l=O(V([k(e-0,r-1,n)])[0],V([k(e-0,r-1,n-1)])[0],m),u=O(V([k(e-1,r-1,n)])[0],V([k(e-1,r-1,n-1)])[0],m),c=O(V([k(e-1,r-0,n)])[0],V([k(e-1,r-0,n-1)])[0],m),f()),h}function X(t,e,r,n,i,a,o,s,l,u,c,h){var f=t;return h?(d&&"even"===t&&(f=null),G(f,e,r,n,i,a,o,s,l,u,c)):(d&&"odd"===t&&(f=null),G(f,l,s,o,a,i,n,r,e,u,c))}function $(t,e,r,n,i){for(var a=[],o=0,s=0;s<e.length;s++)for(var l=e[s],u=1;u<w;u++)for(var c=1;c<b;c++)a.push(W(t,k(l,c-1,u-1),k(l,c-1,u),k(l,c,u-1),k(l,c,u),r,n,(l+c+u)%2,i&&i[o]?i[o]:[])),o++;return a}function J(t,e,r,n,i){for(var a=[],o=0,s=0;s<e.length;s++)for(var l=e[s],u=1;u<_;u++)for(var c=1;c<w;c++)a.push(W(t,k(u-1,l,c-1),k(u,l,c-1),k(u-1,l,c),k(u,l,c),r,n,(u+l+c)%2,i&&i[o]?i[o]:[])),o++;return a}function K(t,e,r,n,i){for(var a=[],o=0,s=0;s<e.length;s++)for(var l=e[s],u=1;u<b;u++)for(var c=1;c<_;c++)a.push(W(t,k(c-1,u-1,l),k(c-1,u,l),k(c,u-1,l),k(c,u,l),r,n,(c+u+l)%2,i&&i[o]?i[o]:[])),o++;return a}function Q(t,e,r){for(var n=1;n<w;n++)for(var i=1;i<b;i++)for(var a=1;a<_;a++)X(t,k(a-1,i-1,n-1),k(a-1,i-1,n),k(a-1,i,n-1),k(a-1,i,n),k(a,i-1,n-1),k(a,i-1,n),k(a,i,n-1),k(a,i,n),e,r,(a+i+n)%2)}function tt(t,e,r){d=!0,Q(t,e,r),d=!1}function et(t,e,r,n,i,a){for(var o=[],s=0,l=0;l<e.length;l++)for(var u=e[l],c=1;c<w;c++)for(var h=1;h<b;h++)o.push(Y(t,u,h,c,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function rt(t,e,r,n,i,a){for(var o=[],s=0,l=0;l<e.length;l++)for(var u=e[l],c=1;c<_;c++)for(var h=1;h<w;h++)o.push(Y(t,c,u,h,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function nt(t,e,r,n,i,a){for(var o=[],s=0,l=0;l<e.length;l++)for(var u=e[l],c=1;c<b;c++)for(var h=1;h<_;h++)o.push(Y(t,h,c,u,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function it(t,e){for(var r=[],n=t;n<e;n++)r.push(n);return r}return function(){L(),function(){for(var e=0;e<_;e++)for(var r=0;r<b;r++)for(var n=0;n<w;n++){var i=k(e,r,n);P(t._x[i],t._y[i],t._z[i],t._value[i])}}();var e=null;if(c&&p&&(D(p),function(t,e,r){m=!0,Q(t,e,r),m=!1}(e,S,E)),u&&f){D(f);for(var r=t.surface.pattern,s=t.surface.count,h=0;h<s;h++){var d=1===s?.5:h/(s-1),T=(1-d)*S+d*E,C=Math.abs(T-A)>Math.abs(T-M)?[A,T]:[T,M];tt(r,C[0],C[1])}}var I=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach(function(r){for(var n=[],i=0;i<I.length;i++){var a=0,o=I[i][0],s=I[i][1],u=t.slices[r];if(u.show&&u.fill){D(u.fill);var c=[],h=[],f=[];if(u.locations.length)for(var p=0;p<u.locations.length;p++){var d=l(u.locations[p],"x"===r?y:"y"===r?v:x);0===d.distRatio?c.push(d.id):d.id>0&&(h.push(d.id),"x"===r?f.push([d.distRatio,0,0]):"y"===r?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else c=it(1,"x"===r?_-1:"y"===r?b-1:w-1);h.length>0&&(n[a]="x"===r?et(e,h,o,s,f,n[a]):"y"===r?rt(e,h,o,s,f,n[a]):nt(e,h,o,s,f,n[a]),a++),c.length>0&&(n[a]="x"===r?$(e,c,o,s,n[a]):"y"===r?J(e,c,o,s,n[a]):K(e,c,o,s,n[a]),a++)}var m=t.caps[r];m.show&&m.fill&&(D(m.fill),n[a]="x"===r?$(e,[0,_-1],o,s,n[a]):"y"===r?J(e,[0,b-1],o,s,n[a]):K(e,[0,w-1],o,s,n[a]),a++)}}),0===g&&L(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=v,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:f,createIsosurfaceTrace:function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),Fm=f((t,e)=>{e.exports={attributes:Lm(),supplyDefaults:Pm().supplyDefaults,calc:Om(),colorbar:{min:"cmin",max:"cmax"},plot:Rm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:bm(),categories:["gl3d","showLegend"],meta:{}}}),Bm=f((t,e)=>{e.exports=Fm()}),Nm=f((t,e)=>{var r=Ie(),n=Lm(),i=km(),a=j(),o=D().extendFlat,s=Lt().overrideAll,l=e.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}),jm=f((t,e)=>{var r=oe(),n=Nm(),i=Pm().supplyIsoDefaults,a=Am().opacityscaleDefaults;e.exports=function(t,e,o,s){function l(i,a){return r.coerce(t,e,n,i,a)}i(t,e,o,s,l),a(t,e,s,l)}}),Um=f((t,e)=>{var r=Wd().gl_mesh3d,n=em().parseColorScale,i=oe().isArrayOrTypedArray,a=tm(),o=Ge().extractOpts,s=Dm(),l=Rm().findNearestOnAxis,u=Rm().generateIsoMeshes;function c(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var h=c.prototype;h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._meshX[e],n=this.data._meshY[e],a=this.data._meshZ[e],o=this.data._Ys.length,s=this.data._Zs.length,u=l(r,this.data._Xs).id,c=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=t.index=h+s*c+s*o*u;t.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[f]?t.textLabel=p[f]:p&&(t.textLabel=p),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function i(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}this.data=u(t);var l={positions:s(i(r.xaxis,t._meshX,e.dataScale[0],t.xcalendar),i(r.yaxis,t._meshY,e.dataScale[1],t.ycalendar),i(r.zaxis,t._meshZ,e.dataScale[2],t.zcalendar)),cells:s(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,opacityscale:t.opacityscale,contourEnable:t.contour.show,contourColor:a(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},c=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=n(t),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}),Vm=f((t,e)=>{e.exports={attributes:Nm(),supplyDefaults:jm(),calc:Om(),colorbar:{min:"cmin",max:"cmax"},plot:Um(),moduleType:"trace",name:"volume",basePlotModule:bm(),categories:["gl3d","showLegend"],meta:{}}}),qm=f((t,e)=>{e.exports=Vm()}),Hm=f((t,e)=>{var r=Ut(),n=oe(),i=Ue(),a=Im();e.exports=function(t,e,o,s){function l(r,i){return n.coerce(t,e,a,r,i)}function u(t){var e=t.map(function(t){var e=l(t);return e&&n.isArrayOrTypedArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}u(["x","y","z"])?(u(["i","j","k"]),(!e.i||e.j&&e.k)&&(!e.j||e.k&&e.i)&&(!e.k||e.i&&e.j)?(r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(t){l(t)}),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in t?(l("intensity"),l("intensitymode"),i(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),e._length=null):e.visible=!1):e.visible=!1}}),Gm=f((t,e)=>{var r=He();e.exports=function(t,e){e.intensity&&r(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}}),Zm=f((t,e)=>{var r=Wd().gl_mesh3d,n=Wd().delaunay_triangulate,i=Wd().alpha_shape,a=Wd().convex_hull,o=em().parseColorScale,s=oe().isArrayOrTypedArray,l=tm(),u=Ge().extractOpts,c=Dm();function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n<r;n++)e[n]=l(t[n]);return e}function d(t,e,r,n){for(var i=[],a=e.length,o=0;o<a;o++)i[o]=t.d2l(e[o],0,n)*r;return i}function m(t){for(var e=[],r=t.length,n=0;n<r;n++)e[n]=Math.round(t[n]);return e}function g(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n]<=-.5||t[n]>=e-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var s,h=t.x.length,f=c(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,h)||!g(t.j,h)||!g(t.k,h))return;s=c(m(t.i),m(t.j),m(t.k))}else s=0===t.alphahull?a(f):t.alphahull>0?i(t.alphahull,f):function(t,e){for(var r=["x","y","z"].indexOf(t),i=[],a=e.length,o=0;o<a;o++)i[o]=[e[o][(r+1)%3],e[o][(r+2)%3]];return n(i)}(t.delaunayaxis,f);var y={positions:f,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:l(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};if(t.intensity){var v=u(t);this.color="#fff";var x=t.intensitymode;y[x+"Intensity"]=t.intensity,y[x+"IntensityBounds"]=[v.min,v.max],y.colormap=o(t)}else t.vertexcolor?(this.color=t.vertexcolor[0],y.vertexColors=p(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],y.cellColors=p(t.facecolor)):(this.color=t.color,y.meshColor=l(t.color));this.mesh.update(y)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new h(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}),Wm=f((t,e)=>{e.exports={attributes:Im(),supplyDefaults:Hm(),calc:Gm(),colorbar:{min:"cmin",max:"cmax"},plot:Zm(),moduleType:"trace",name:"mesh3d",basePlotModule:bm(),categories:["gl3d","showLegend"],meta:{}}}),Ym=f((t,e)=>{e.exports=Wm()}),Xm=f((t,e)=>{var r=Ie(),n=Se().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Im(),o=j(),s=D().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),uhoverformat:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:s({},o.showlegend,{dflt:!1})};s(l,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach(function(t){l[t]=a[t]}),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),e.exports=l}),$m=f((t,e)=>{var r=oe(),n=Ue(),i=Xm();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("u"),u=s("v"),c=s("w"),h=s("x"),f=s("y"),p=s("z");if(l&&l.length&&u&&u.length&&c&&c.length&&h&&h.length&&f&&f.length&&p&&p.length){var d=s("sizemode");s("sizeref","raw"===d?1:.5),s("anchor"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),n(t,e,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),e._length=null}else e.visible=!1}}),Jm=f((t,e)=>{var r=He();e.exports=function(t,e){for(var n=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,n.length,i.length,a.length),s=-1/0,l=1/0,u=0;u<o;u++){var c=n[u],h=i[u],f=a[u],p=Math.sqrt(c*c+h*h+f*f);s=Math.max(s,p),l=Math.min(l,p)}e._len=o,e._normMax=s,r(t,e,{vals:[l,s],containerStr:"",cLetter:"c"})}}),Km=f((t,e)=>{var r=Wd().gl_cone3d,n=Wd().gl_cone3d.createConeMesh,i=oe().simpleMap,a=em().parseColorScale,o=Ge().extractOpts,s=oe().isArrayOrTypedArray,l=Dm();function u(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var c=u.prototype;c.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index,r=this.data.x[e],n=this.data.y[e],i=this.data.z[e],a=this.data.u[e],o=this.data.v[e],l=this.data.w[e];t.traceCoordinate=[r,n,i,a,o,l,Math.sqrt(a*a+o*o+l*l)];var u=this.data.hovertext||this.data.text;return s(u)&&void 0!==u[e]?t.textLabel=u[e]:u&&(t.textLabel=u),!0}};var h={xaxis:0,yaxis:1,zaxis:2},f={tip:1,tail:0,cm:.25,center:.5},p={tip:1,tail:1,cm:.75,center:.5};function d(t,e){var n=t.fullSceneLayout,s=t.dataScale,u={};function c(t,e){var r=n[e],a=s[h[e]];return i(t,function(t){return r.d2l(t)*a})}u.vectors=l(c(e.u,"xaxis"),c(e.v,"yaxis"),c(e.w,"zaxis"),e._len),u.positions=l(c(e.x,"xaxis"),c(e.y,"yaxis"),c(e.z,"zaxis"),e._len);var d=o(e);u.colormap=a(e),u.vertexIntensityBounds=[d.min/e._normMax,d.max/e._normMax],u.coneOffset=f[e.anchor];var m=e.sizemode;"scaled"===m?u.coneSize=e.sizeref||.5:"absolute"===m?u.coneSize=e.sizeref&&e._normMax?e.sizeref/e._normMax:.5:"raw"===m&&(u.coneSize=e.sizeref),u.coneSizemode=m;var g=r(u),y=e.lightposition;return g.lightPosition=[y.x,y.y,y.z],g.ambient=e.lighting.ambient,g.diffuse=e.lighting.diffuse,g.specular=e.lighting.specular,g.roughness=e.lighting.roughness,g.fresnel=e.lighting.fresnel,g.opacity=e.opacity,e._pad=p[e.anchor]*g.vectorScale*g.coneScale*e._normMax,g}c.update=function(t){this.data=t;var e=d(this.scene,t);this.mesh.update(e)},c.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=d(t,e),a=n(r,i),o=new u(t,e.uid);return o.mesh=a,o.data=e,a._trace=o,t.glplot.add(a),o}}),Qm=f((t,e)=>{e.exports={moduleType:"trace",name:"cone",basePlotModule:bm(),categories:["gl3d","showLegend"],attributes:Xm(),supplyDefaults:$m(),colorbar:{min:"cmin",max:"cmax"},calc:Jm(),plot:Km(),eventData:function(t,e){return t.norm=e.traceCoordinate[6],t},meta:{}}}),tg=f((t,e)=>{e.exports=Qm()}),eg=f((t,e)=>{var r=Ie(),n=Se().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Im(),o=j(),s=D().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:s({},o.showlegend,{dflt:!1})};s(l,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach(function(t){l[t]=a[t]}),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),e.exports=l}),rg=f((t,e)=>{var r=oe(),n=Ue(),i=eg();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("u"),u=s("v"),c=s("w"),h=s("x"),f=s("y"),p=s("z");l&&l.length&&u&&u.length&&c&&c.length&&h&&h.length&&f&&f.length&&p&&p.length?(s("starts.x"),s("starts.y"),s("starts.z"),s("maxdisplayed"),s("sizeref"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),n(t,e,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),e._length=null):e.visible=!1}}),ng=f((t,e)=>{var r=Wd().gl_streamtube3d,n=r.createTubeMesh,i=oe(),a=em().parseColorScale,o=Ge().extractOpts,s=Dm(),l={xaxis:0,yaxis:1,zaxis:2};function u(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var c=u.prototype;function h(t){var e=t.length;return e>2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function f(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var n=t.fullSceneLayout,u=t.dataScale,c=e._len,p={};function d(t,e){var r=n[e],a=u[l[e]];return i.simpleMap(t,function(t){return r.d2l(t)*a})}if(p.vectors=s(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),c),!c)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),y=d(e._Zs,"zaxis");if(p.meshgrid=[m,g,y],p.gridFill=e._gridFill,e._slen)p.startingPositions=s(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),_=h(y),b=new Array(x.length*_.length),w=0,T=0;T<x.length;T++)for(var k=0;k<_.length;k++)b[w++]=[x[T],v,_[k]];p.startingPositions=b}p.colormap=a(e),p.tubeSize=e.sizeref,p.maxLength=e.maxdisplayed;var A=d(e._xbnds,"xaxis"),M=d(e._ybnds,"yaxis"),S=d(e._zbnds,"zaxis"),E=f(m),C=f(g),I=f(y),L=[[A[0]-E[0],M[0]-C[0],S[0]-I[0]],[A[1]+E[1],M[1]+C[1],S[1]+I[1]]],P=r(p,L),z=o(e);P.vertexIntensityBounds=[z.min/e._normMax,z.max/e._normMax];var O=e.lightposition;return P.lightPosition=[O.x,O.y,O.z],P.ambient=e.lighting.ambient,P.diffuse=e.lighting.diffuse,P.specular=e.lighting.specular,P.roughness=e.lighting.roughness,P.fresnel=e.lighting.fresnel,P.opacity=e.opacity,e._pad=P.tubeScale*e.sizeref*2,P}c.handlePick=function(t){var e=this.scene.fullSceneLayout,r=this.scene.dataScale;function n(t,n){var i=e[n],a=r[l[n]];return i.l2c(t)/a}if(t.object===this.mesh){var i=t.data.position,a=t.data.velocity;return t.traceCoordinate=[n(i[0],"xaxis"),n(i[1],"yaxis"),n(i[2],"zaxis"),n(a[0],"xaxis"),n(a[1],"yaxis"),n(a[2],"zaxis"),t.data.intensity*this.data._normMax,t.data.divergence],t.textLabel=this.data.hovertext||this.data.text,!0}},c.update=function(t){this.data=t;var e=p(this.scene,t);this.mesh.update(e)},c.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=p(t,e),a=n(r,i),o=new u(t,e.uid);return o.mesh=a,o.data=e,a._trace=o,t.glplot.add(a),o}}),ig=f((t,e)=>{e.exports={moduleType:"trace",name:"streamtube",basePlotModule:bm(),categories:["gl3d","showLegend"],attributes:eg(),supplyDefaults:rg(),colorbar:{min:"cmin",max:"cmax"},calc:zm().calc,plot:ng(),eventData:function(t,e){return t.tubex=t.x,t.tubey=t.y,t.tubez=t.z,t.tubeu=e.traceCoordinate[3],t.tubev=e.traceCoordinate[4],t.tubew=e.traceCoordinate[5],t.norm=e.traceCoordinate[6],t.divergence=e.traceCoordinate[7],delete t.x,delete t.y,delete t.z,t},meta:{}}}),ag=f((t,e)=>{e.exports=ig()}),og=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=bn(),o=j(),s=Ie(),l=Pt().dash,u=D().extendFlat,c=Lt().overrideAll,h=a.marker,f=a.line,p=h.line;e.exports=c({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:u({},a.mode,{dflt:"markers"}),text:u({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:u({},a.hovertext,{}),textfont:a.textfont,textposition:a.textposition,line:{color:f.color,width:f.width,dash:l},connectgaps:a.connectgaps,marker:u({symbol:h.symbol,opacity:h.opacity,angle:h.angle,angleref:u({},h.angleref,{values:["previous","up","north"]}),standoff:h.standoff,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,colorbar:h.colorbar,line:u({width:p.width},s("marker.line")),gradient:h.gradient},s("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:i(),selected:a.selected,unselected:a.unselected,hoverinfo:u({},o.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:r()},"calc","nested")}),sg=f((t,e)=>{var r=oe(),n=Ze(),i=Gn(),a=Zn(),o=Yn(),s=Xn(),l=og(),u=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");e.exports=function(t,e,c,h){function f(n,i){return r.coerce(t,e,l,n,i)}var p,d=f("locations");if(d&&d.length){var m,g=f("geojson");("string"==typeof g&&""!==g||r.isPlainObject(g))&&(m="geojson-id");var y=f("locationmode",m);"country names"===y&&r.warn(u),"geojson-id"===y&&f("featureidkey"),p=d.length}else{var v=f("lon")||[],x=f("lat")||[];p=Math.min(v.length,x.length)}p?(e._length=p,f("text"),f("hovertext"),f("hovertemplate"),f("mode"),n.hasMarkers(e)&&i(t,e,c,h,f,{gradient:!0}),n.hasLines(e)&&(a(t,e,c,h,f),f("connectgaps")),n.hasText(e)&&(f("texttemplate"),o(t,e,h,f)),f("fill"),"none"!==e.fill&&s(t,e,c,f),r.coerceSelectionMarkerOpacity(e,f)):e.visible=!1}}),lg=f((t,e)=>{var r=rr();e.exports=function(t,e,n){var i={},a=n[e.geo]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}),ug=f((t,e)=>{var r=T(),n=k().BADNUM,i=ei(),a=ri(),o=ni(),s=oe().isArrayOrTypedArray,l=oe()._;function u(t){return t&&"string"==typeof t}e.exports=function(t,e){var c,h=s(e.locations),f=h?e.locations.length:e._length,p=new Array(f);c=e.geojson?function(t){return u(t)||r(t)}:u;for(var d=0;d<f;d++){var m=p[d]={};if(h){var g=e.locations[d];m.loc=c(g)?g:null}else{var y=e.lon[d],v=e.lat[d];r(y)&&r(v)?m.lonlat=[+y,+v]:m.lonlat=[n,n]}}return a(p,e),i(t,e),o(p,e),f&&(p[0].t={labels:{lat:l(t,"lat:")+" ",lon:l(t,"lon:")+" "}}),p}}),cg=f(t=>{t.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},t.axesNames=["lonaxis","lataxis"],t.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},t.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},t.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},t.clipPad=.001,t.precision=.1,t.landColor="#F0DC82",t.waterColor="#3399FF",t.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},t.sphereSVG={type:"Sphere"},t.fillLayers={ocean:1,land:1,lakes:1},t.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},t.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],t.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],t.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),hg=f((t,e)=>{var r,n;r=t,n=function(t){function e(t){return t}function r(t){if(null==t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=2,u=t.length,c=new Array(u);for(c[0]=(r+=t[0])*i+o,c[1]=(n+=t[1])*a+s;l<u;)c[l]=t[l],++l;return c}}function n(t){var e,n=r(t.transform),i=1/0,a=i,o=-i,s=-i;function l(t){(t=n(t))[0]<i&&(i=t[0]),t[0]>o&&(o=t[0]),t[1]<a&&(a=t[1]),t[1]>s&&(s=t[1])}function u(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach(function(t){for(var e,r=-1,l=t.length;++r<l;)(e=n(t[r],r))[0]<i&&(i=e[0]),e[0]>o&&(o=e[0]),e[1]<a&&(a=e[1]),e[1]>s&&(s=e[1])}),t.objects)u(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a<o;++a)e.push(n(r[a],a));t<0&&function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r}(e,o)}function o(t){return n(t)}function s(t){for(var e=[],r=0,n=t.length;r<n;++r)a(t[r],e);return e.length<2&&e.push(e[0]),e}function l(t){for(var e=s(t);e.length<4;)e.push(e[0]);return e}function u(t){return t.map(l)}return function t(e){var r,n=e.type;switch(n){case"GeometryCollection":return{type:n,geometries:e.geometries.map(t)};case"Point":r=o(e.coordinates);break;case"MultiPoint":r=e.coordinates.map(o);break;case"LineString":r=s(e.arcs);break;case"MultiLineString":r=e.arcs.map(s);break;case"Polygon":r=u(e.arcs);break;case"MultiPolygon":r=e.arcs.map(u);break;default:return null}return{type:n,coordinates:r}}(e)}function o(t,e){var r={},n={},i={},a=[],o=-1;function s(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){r[t<0?~t:t]=1}),a.push(i)}}return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++o],e[o]=r,e[n]=i)}),e.forEach(function(e){var r,a,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=i[s])if(delete i[r.end],r.push(e),r.end=l,a=n[l]){delete n[a.start];var u=a===r?r:r.concat(a);n[u.start=r.start]=i[u.end=a.end]=u}else n[r.start]=i[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(e),r.start=s,a=i[s]){delete i[a.end];var c=a===r?r:a.concat(r);n[c.start=a.start]=i[c.end=r.end]=c}else n[r.start]=i[r.end]=r;else n[(r=[e]).start=s]=i[r.end=l]=r}),s(i,n),s(n,i),e.forEach(function(t){r[t<0?~t:t]||a.push([t])}),a}function s(t,e,r){var n,i,a;if(arguments.length>1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}function u(t){t.forEach(l)}function c(t){switch(n=t,t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":u(t.arcs)}}return c(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i<a;++i)n[i]=i;return{type:"MultiLineString",arcs:o(t,n)}}function l(t,e){var r={},n=[],i=[];function s(t){t.forEach(function(e){e.forEach(function(e){(r[e=e<0?~e:e]||(r[e]=[])).push(t)})}),n.push(t)}function l(e){return function(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}(a(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":s(e.arcs);break;case"MultiPolygon":e.arcs.forEach(s)}}),n.forEach(function(t){if(!t._){var e=[],n=[t];for(t._=1,i.push(e);t=n.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){r[t<0?~t:t].forEach(function(t){t._||(t._=1,n.push(t))})})})}}),n.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:i.map(function(e){var n,i=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){r[t<0?~t:t].length<2&&i.push(t)})})}),(n=(i=o(t,i)).length)>1)for(var a,s,u=1,c=l(i[0]);u<n;++u)(a=l(i[u]))>c&&(s=i[0],i[0]=i[u],i[u]=s,c=a);return i}).filter(function(t){return t.length>0})}}function u(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r}function c(t){if(null==t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=2,u=t.length,c=new Array(u),h=Math.round((t[0]-o)/i),f=Math.round((t[1]-s)/a);for(c[0]=h-r,r=h,c[1]=f-n,n=f;l<u;)c[l]=t[l],++l;return c}}t.bbox=n,t.feature=function(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return i(t,e)})}:i(t,e)},t.merge=function(t){return a(t,l.apply(this,arguments))},t.mergeArcs=l,t.mesh=function(t){return a(t,s.apply(this,arguments))},t.meshArcs=s,t.neighbors=function(t){var e={},r=t.map(function(){return[]});function n(t,r){t.forEach(function(t){t<0&&(t=~t);var n=e[t];n?n.push(r):e[t]=[r]})}function i(t,e){t.forEach(function(t){n(t,e)})}var a={LineString:n,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach(function(t){i(t,e)})}};for(var o in t.forEach(function t(e,r){"GeometryCollection"===e.type?e.geometries.forEach(function(e){t(e,r)}):e.type in a&&a[e.type](e.arcs,r)}),e)for(var s=e[o],l=s.length,c=0;c<l;++c)for(var h=c+1;h<l;++h){var f,p=s[c],d=s[h];(f=r[p])[o=u(f,d)]!==d&&f.splice(o,0,d),(f=r[d])[o=u(f,p)]!==p&&f.splice(o,0,p)}return r},t.quantize=function(t,e){if(t.transform)throw new Error("already quantized");if(e&&e.scale)l=t.bbox;else{if(!((r=Math.floor(e))>=2))throw new Error("n must be ≥2");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,u,h=c(e),f=t.objects,p={};function d(t){return h(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(u in f)p[u]=m(f[u]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map(function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=h(t[0],0);++r<i;)((e=h(t[r],r))[0]||e[1])&&(a[n++]=e);return 1===n&&(a[n++]=[0,0]),a.length=n,a})}},t.transform=r,t.untransform=c,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).topojson=r.topojson||{})}),fg=f((t,e)=>{var r=e.exports={},n=cg().locationmodeToLayer,i=hg().feature;r.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(t,e){return`${t+=t.endsWith("/")?"":"/"}${e}.json`},r.getTopojsonFeatures=function(t,e){var r=n[t.locationmode],a=e.objects[r];return i(e,a).features}}),pg=f(t=>{var e=k().BADNUM;t.calcTraceToLineCoords=function(t){for(var r=t[0].trace.connectgaps,n=[],i=[],a=0;a<t.length;a++){var o=t[a].lonlat;o[0]!==e?i.push(o):!r&&i.length>0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},t.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},t.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=[t[r]];return{type:"MultiPolygon",coordinates:e}},t.makeBlank=function(){return{type:"Point",coordinates:[]}}}),dg=f((t,e)=>{e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}),mg=f(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=6371008.8,r={centimeters:100*e,centimetres:100*e,degrees:360/(2*Math.PI),feet:3.28084*e,inches:39.37*e,kilometers:e/1e3,kilometres:e/1e3,meters:e,metres:e,miles:e/1609.344,millimeters:1e3*e,millimetres:1e3*e,nauticalmiles:e/1852,radians:1,yards:1.0936*e},n={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(t,e,r={}){let n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function a(t,e,r={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!m(t[0])||!m(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,r)}function o(t,e,r={}){for(let e of t){if(e.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(e[e.length-1].length!==e[0].length)throw new Error("First and last Position are not equivalent.");for(let t=0;t<e[e.length-1].length;t++)if(e[e.length-1][t]!==e[0][t])throw new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:t},e,r)}function s(t,e,r={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:t},e,r)}function l(t,e={}){let r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function u(t,e,r={}){return i({type:"MultiLineString",coordinates:t},e,r)}function c(t,e,r={}){return i({type:"MultiPoint",coordinates:t},e,r)}function h(t,e,r={}){return i({type:"MultiPolygon",coordinates:t},e,r)}function f(t,e="kilometers"){let n=r[e];if(!n)throw new Error(e+" units is invalid");return t*n}function p(t,e="kilometers"){let n=r[e];if(!n)throw new Error(e+" units is invalid");return t/n}function d(t){return t%(2*Math.PI)*180/Math.PI}function m(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}t.areaFactors=n,t.azimuthToBearing=function(t){return(t%=360)>180?t-360:t<-180?t+360:t},t.bearingToAzimuth=function(t){let e=t%360;return e<0&&(e+=360),e},t.convertArea=function(t,e="meters",r="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");let i=n[e];if(!i)throw new Error("invalid original units");let a=n[r];if(!a)throw new Error("invalid final units");return t/i*a},t.convertLength=function(t,e="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return f(p(t,e),r)},t.degreesToRadians=function(t){return t%360*Math.PI/180},t.earthRadius=e,t.factors=r,t.feature=i,t.featureCollection=l,t.geometry=function(t,e,r={}){switch(t){case"Point":return a(e).geometry;case"LineString":return s(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return c(e).geometry;case"MultiLineString":return u(e).geometry;case"MultiPolygon":return h(e).geometry;default:throw new Error(t+" is invalid")}},t.geometryCollection=function(t,e,r={}){return i({type:"GeometryCollection",geometries:t},e,r)},t.isNumber=m,t.isObject=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},t.lengthToDegrees=function(t,e){return d(p(t,e))},t.lengthToRadians=p,t.lineString=s,t.lineStrings=function(t,e,r={}){return l(t.map(t=>s(t,e)),r)},t.multiLineString=u,t.multiPoint=c,t.multiPolygon=h,t.point=a,t.points=function(t,e,r={}){return l(t.map(t=>a(t,e)),r)},t.polygon=o,t.polygons=function(t,e,r={}){return l(t.map(t=>o(t,e)),r)},t.radiansToDegrees=d,t.radiansToLength=f,t.round=function(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,e||0);return Math.round(t*r)/r},t.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(t=>{if(!m(t))throw new Error("bbox must only contain numbers")})},t.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}}),gg=f(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mg();function r(t,e,n){if(null!==t)for(var i,a,o,s,l,u,c,h,f=0,p=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,y=m?t.features.length:1,v=0;v<y;v++){l=(h=!!(c=m?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var x=0;x<l;x++){var _=0,b=0;if(null!==(s=h?c.geometries[x]:c)){u=s.coordinates;var w=s.type;switch(f=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,p,v,_,b))return!1;p++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(!1===e(u[i],p,v,_,b))return!1;p++,"MultiPoint"===w&&_++}"LineString"===w&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(a=0;a<u[i].length-f;a++){if(!1===e(u[i][a],p,v,_,b))return!1;p++}"MultiLineString"===w&&_++,"Polygon"===w&&b++}"Polygon"===w&&_++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for(b=0,a=0;a<u[i].length;a++){for(o=0;o<u[i][a].length-f;o++){if(!1===e(u[i][a][o],p,v,_,b))return!1;p++}b++}_++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(!1===r(s.geometries[i],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function n(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function i(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function a(t,e){var r,n,i,a,o,s,l,u,c,h,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,m=p?t.features.length:1;for(r=0;r<m;r++){for(s=p?t.features[r].geometry:d?t.geometry:t,u=p?t.features[r].properties:d?t.properties:{},c=p?t.features[r].bbox:d?t.bbox:void 0,h=p?t.features[r].id:d?t.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(a=l?s.geometries[i]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(a,f,u,c,h))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===e(a.geometries[n],f,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,u,c,h))return!1;f++}}function o(t,r){a(t,function(t,n,i,a,o){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==r(e.feature.call(void 0,t,i,{bbox:a,id:o}),n,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c={type:s,coordinates:t.coordinates[u]};if(!1===r(e.feature.call(void 0,c,i),n,u))return!1}})}function s(t,n){o(t,function(t,i,a){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,u=0,c=0,h=0;if(!1===r(t,function(r,s,f,p,d){if(void 0===l||i>u||p>c||d>h)return l=r,u=i,c=p,h=d,void(o=0);var m=e.lineString.call(void 0,[l,r],t.properties);if(!1===n(m,i,a,d,o))return!1;o++,l=r}))return!1}}})}function l(t,r){if(!t)throw new Error("geojson is required");o(t,function(t,n,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===r(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===r(e.lineString.call(void 0,o[s],t.properties),n,i,s))return!1}}})}t.coordAll=function(t){var e=[];return r(t,function(t){e.push(t)}),e},t.coordEach=r,t.coordReduce=function(t,e,n,i){var a=n;return r(t,function(t,r,i,o,s){a=0===r&&void 0===n?t:e(a,t,r,i,o,s)},i),a},t.featureEach=i,t.featureReduce=function(t,e,r){var n=r;return i(t,function(t,i){n=0===i&&void 0===r?t:e(n,t,i)}),n},t.findPoint=function(t,r){if(r=r||{},!e.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.coordIndex||0,l=r.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":l=l||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":return e.point.call(void 0,u,l,r);case"MultiPoint":return a<0&&(a=u.length+a),e.point.call(void 0,u[a],l,r);case"LineString":return s<0&&(s=u.length+s),e.point.call(void 0,u[s],l,r);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),e.point.call(void 0,u[o][s],l,r);case"MultiLineString":return a<0&&(a=u.length+a),s<0&&(s=u[a].length+s),e.point.call(void 0,u[a][s],l,r);case"MultiPolygon":return a<0&&(a=u.length+a),o<0&&(o=u[a].length+o),s<0&&(s=u[a][o].length-s),e.point.call(void 0,u[a][o][s],l,r)}throw new Error("geojson is invalid")},t.findSegment=function(t,r){if(r=r||{},!e.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.segmentIndex||0,l=r.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":l=l||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=u.length+s-1),e.lineString.call(void 0,[u[s],u[s+1]],l,r);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),e.lineString.call(void 0,[u[o][s],u[o][s+1]],l,r);case"MultiLineString":return a<0&&(a=u.length+a),s<0&&(s=u[a].length+s-1),e.lineString.call(void 0,[u[a][s],u[a][s+1]],l,r);case"MultiPolygon":return a<0&&(a=u.length+a),o<0&&(o=u[a].length+o),s<0&&(s=u[a][o].length-s-1),e.lineString.call(void 0,[u[a][o][s],u[a][o][s+1]],l,r)}throw new Error("geojson is invalid")},t.flattenEach=o,t.flattenReduce=function(t,e,r){var n=r;return o(t,function(t,i,a){n=0===i&&0===a&&void 0===r?t:e(n,t,i,a)}),n},t.geomEach=a,t.geomReduce=function(t,e,r){var n=r;return a(t,function(t,i,a,o,s){n=0===i&&void 0===r?t:e(n,t,i,a,o,s)}),n},t.lineEach=l,t.lineReduce=function(t,e,r){var n=r;return l(t,function(t,i,a,o){n=0===i&&void 0===r?t:e(n,t,i,a,o)}),n},t.propEach=n,t.propReduce=function(t,e,r){var i=r;return n(t,function(t,n){i=0===n&&void 0===r?t:e(i,t,n)}),i},t.segmentEach=s,t.segmentReduce=function(t,e,r){var n=r,i=!1;return s(t,function(t,a,o,s,l){n=!1===i&&void 0===r?t:e(n,t,a,o,s,l),i=!0}),n}}),yg=f(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mg(),r=gg();function n(t){return r.geomReduce.call(void 0,t,(t,e)=>t+function(t){let e,r=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=i(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e),0)}function i(t){let e=0;if(t&&t.length>0){e+=Math.abs(s(t[0]));for(let r=1;r<t.length;r++)e-=Math.abs(s(t[r]))}return e}var a=e.earthRadius*e.earthRadius/2,o=Math.PI/180;function s(t){let e=t.length-1;if(e<=2)return 0;let r=0,n=0;for(;n<e;){let i=t[n],a=t[n+1===e?0:n+1],s=t[n+2>=e?(n+2)%e:n+2],l=i[0]*o,u=a[1]*o;r+=(s[0]*o-l)*Math.sin(u),n++}return r*a}var l=n;t.area=n,t.default=l}),vg=f(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mg(),r=gg();function n(t,n={}){let i=0,a=0,o=0;return r.coordEach.call(void 0,t,function(t){i+=t[0],a+=t[1],o++},!0),e.point.call(void 0,[i/o,a/o],n.properties)}var i=n;t.centroid=n,t.default=i}),xg=f(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=gg();function r(t,r={}){if(null!=t.bbox&&!0!==r.recompute)return t.bbox;let n=[1/0,1/0,-1/0,-1/0];return e.coordEach.call(void 0,t,t=>{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])}),n}var n=r;t.bbox=r,t.default=n}),_g=f((t,e)=>{var r=v(),n=dg(),{area:i}=yg(),{centroid:a}=vg(),{bbox:o}=xg(),s=qt(),l=X(),u=M(),c=E(),h=pn(),f=Object.keys(n),p={"ISO-3":s,"USA-states":s,"country names":function(t){for(var e=0;e<f.length;e++){var r=f[e];if(new RegExp(n[r]).test(t.trim().toLowerCase()))return r}return l.log("Unrecognized country name: "+t+"."),!1}};function d(t){var e=t.geojson,r=window.PlotlyGeoAssets||{},n="string"==typeof e?r[e]:e;return u(n)?n:(l.error("Oops ... something went wrong when fetching "+e),!1)}e.exports={locationToFeature:function(t,e,r){if(!e||"string"!=typeof e)return!1;var n,i,a,o=p[t](e);if(o){if("USA-states"===t)for(n=[],a=0;a<r.length;a++)(i=r[a]).properties&&i.properties.gu&&"USA"===i.properties.gu&&n.push(i);else n=r;for(a=0;a<n.length;a++)if((i=n[a]).id===o)return i;l.log(["Location with id",o,"does not have a matching topojson feature at this resolution."].join(" "))}return!1},feature2polygons:function(t){var e,r,n,i,a=t.geometry,o=a.coordinates,s=t.id,l=[];function u(t){for(var e=0;e<t.length-1;e++)if(t[e][0]>0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;i<t.length;i++)e[i]=[t[i][0]<0?t[i][0]+360:t[i][0],t[i][1]];l.push(h.tester(e))}:"ATA"===s?function(t){var e=u(t);if(null===e)return l.push(h.tester(t));var r=new Array(t.length+1),n=0;for(i=0;i<t.length;i++)i>e?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)e(o[r][n]);break;case"Polygon":for(r=0;r<o.length;r++)e(o[r])}return l},getTraceGeojson:d,extractTraceFeature:function(t){var e=t[0].trace,r=d(e);if(!r)return!1;var n,o={},s=[];for(n=0;n<e._length;n++){var u=t[n];(u.loc||0===u.loc)&&(o[u.loc]=u)}function h(t){var r=c(t,e.featureidkey||"id").get(),n=o[r];if(n){var u=t.geometry;if("Polygon"===u.type||"MultiPolygon"===u.type){var h={type:"Feature",id:r,geometry:u,properties:{}};h.geometry.coordinates.length>0?h.properties.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},u=i(l);u>o&&(o=u,e=l)}else e=r;return a(e).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=t,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n<f.length;n++)h(f[n]);break;case"Feature":h(r);break;default:return l.warn(["Invalid GeoJSON type",(r.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var p in o)l.log(["Location *"+p+"*","does not have a matching feature with id-key","*"+e.featureidkey+"*."].join(" "));return s},fetchTraceGeoData:function(t){var e=window.PlotlyGeoAssets||{},n=[];function i(t){return new Promise(function(n,i){r.json(t,function(r,a){if(r){delete e[t];var o=404===r.status?'GeoJSON at URL "'+t+'" does not exist.':"Unexpected error while fetching from "+t;return i(new Error(o))}return e[t]=a,n(a)})})}function a(t){return new Promise(function(r,n){var i=0,a=setInterval(function(){return e[t]&&"pending"!==e[t]?(clearInterval(a),r(e[t])):i>100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++},50)})}for(var o=0;o<t.length;o++){var s=t[o][0].trace.geojson;"string"==typeof s&&(e[s]?"pending"===e[s]&&n.push(a(s)):(e[s]="pending",n.push(i(s))))}return n},computeBbox:function(t){return o(t)}}}),bg=f((t,e)=>{var r=v(),n=Je(),i=q(),a=pi(),o=a.stylePoints,s=a.styleText;e.exports=function(t,e){e&&function(t,e){var a=e[0].trace,l=e[0].node3;l.style("opacity",e[0].trace.opacity),o(l,a,t),s(l,a,t),l.selectAll("path.js-line").style("fill","none").each(function(t){var e=r.select(this),a=t.trace,o=a.line||{};e.call(i.stroke,o.color).call(n.dashLine,o.dash||"",o.width||0),"none"!==a.fill&&e.call(i.fill,a.fillcolor)})}(t,e)}}),wg=f((t,e)=>{var r=v(),n=oe(),i=fg().getTopojsonFeatures,a=pg(),o=_g(),s=er().findExtremes,l=k().BADNUM,u=ii().calcMarkerSize,c=Ze(),h=bg();e.exports={calcGeoJSON:function(t,e){var r,a,c=t[0].trace,h=e[c.geo],f=h._subplot,p=c._length;if(n.isArrayOrTypedArray(c.locations)){var d=c.locationmode,m="geojson-id"===d?o.extractTraceFeature(t):i(c,f.topojson);for(r=0;r<p;r++){a=t[r];var g="geojson-id"===d?a.fOut:o.locationToFeature(d,a.loc,m);a.lonlat=g?g.properties.ct:[l,l]}}var y,v,x={padded:!0};if("geojson"===h.fitbounds&&"geojson-id"===c.locationmode){var _=o.computeBbox(o.getTraceGeojson(c));y=[_[0],_[2]],v=[_[1],_[3]]}else{for(y=new Array(p),v=new Array(p),r=0;r<p;r++)a=t[r],y[r]=a.lonlat[0],v[r]=a.lonlat[1];x.ppad=u(c,p)}c._extremes.lon=s(h.lonaxis._ax,y,x),c._extremes.lat=s(h.lataxis._ax,v,x)},plot:function(t,e,i){var o=e.layers.frontplot.select(".scatterlayer"),s=n.makeTraceGroups(o,i,"trace scattergeo");function u(t,e){t.lonlat[0]===l&&r.select(e).remove()}s.selectAll("*").remove(),s.each(function(e){var i=r.select(this),o=e[0].trace;if(c.hasLines(o)||"none"!==o.fill){var s=a.calcTraceToLineCoords(e),l="none"!==o.fill?a.makePolygon(s):a.makeLine(s);i.selectAll("path.js-line").data([{geojson:l,trace:o}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}c.hasMarkers(o)&&i.selectAll("path.point").data(n.identity).enter().append("path").classed("point",!0).each(function(t){u(t,this)}),c.hasText(o)&&i.selectAll("g").data(n.identity).enter().append("g").append("text").each(function(t){u(t,this)}),h(t,e)})}}}),Tg=f((t,e)=>{var r=Pr(),n=k().BADNUM,i=di(),a=oe().fillText,o=og();e.exports=function(t,e,s){var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=t.subplot,p=f.projection.isLonLatOverEdges,d=f.project;if(r.getClosest(l,function(t){var r=t.lonlat;if(r[0]===n||p(r))return 1/0;var i=d(r),a=d([e,s]),o=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(o*o+l*l)-u,1-3/u)},t),!1!==t.index){var m=l[t.index],g=m.lonlat,y=[c.c2p(g),h.c2p(g)],v=m.mrc||1;t.x0=y[0]-v,t.x1=y[0]+v,t.y0=y[1]-v,t.y1=y[1]+v,t.loc=m.loc,t.lon=g[0],t.lat=g[1];var x={};x[u.geo]={_subplot:f};var _=u._module.formatLabels(m,u,x);return t.lonLabel=_.lonLabel,t.latLabel=_.latLabel,t.color=i(u,m),t.extraText=function(t,e,r,n){if(!t.hovertemplate){var i=e.hi||t.hoverinfo,s="all"===i?o.hoverinfo.flags:i.split("+"),l=-1!==s.indexOf("location")&&Array.isArray(t.locations),u=-1!==s.indexOf("lon"),c=-1!==s.indexOf("lat"),h=-1!==s.indexOf("text"),f=[];return l?f.push(e.loc):u&&c?f.push("("+p(r.latLabel)+", "+p(r.lonLabel)+")"):u?f.push(n.lon+p(r.lonLabel)):c&&f.push(n.lat+p(r.latLabel)),h&&a(e,t,f),f.join("<br>")}function p(t){return t+"°"}}(u,m,t,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}}),kg=f((t,e)=>{e.exports=function(t,e,r,n,i){t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t}}),Ag=f((t,e)=>{var r=Ze(),n=k().BADNUM;e.exports=function(t,e){var i,a,o,s,l,u=t.cd,c=t.xaxis,h=t.yaxis,f=[],p=u[0].trace;if(!r.hasMarkers(p)&&!r.hasText(p))return[];if(!1===e)for(l=0;l<u.length;l++)u[l].selected=0;else for(l=0;l<u.length;l++)(a=(i=u[l]).lonlat)[0]!==n&&(o=c.c2p(a),s=h.c2p(a),e.contains([o,s],null,l,t)?(f.push({pointNumber:l,lon:a[0],lat:a[1]}),i.selected=1):i.selected=0);return f}}),Mg=f((t,e)=>{var r;r=t,function(t){function e(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function r(t){return 1===t.length&&(t=n(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function n(t){return function(r,n){return e(t(r),n)}}var i=r(e),a=i.right,o=i.left;function s(t,e){null==e&&(e=l);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return a}function l(t,e){return[t,e]}function u(t,e,r){var n,i,a,o,s=t.length,u=e.length,c=new Array(s*u);for(null==r&&(r=l),n=a=0;n<s;++n)for(o=t[n],i=0;i<u;++i,++a)c[a]=r(o,e[i]);return c}function c(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function h(t){return null===t?NaN:+t}function f(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o<i;)isNaN(r=h(t[o]))||(l+=(n=r-s)*(r-(s+=n/++a)));else for(;++o<i;)isNaN(r=h(e(t[o],o,t)))||(l+=(n=r-s)*(r-(s+=n/++a)));if(a>1)return l/(a-1)}function p(t,e){var r=f(t,e);return r&&Math.sqrt(r)}function d(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(r=t[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=i=r;++o<a;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]}var m=Array.prototype,g=m.slice,y=m.map;function v(t){return function(){return t}}function x(t){return t}function _(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a}var b=Math.sqrt(50),w=Math.sqrt(10),T=Math.sqrt(2);function k(t,e,r){var n,i,a,o,s=-1;if(r=+r,(t=+t)===(e=+e)&&r>0)return[t];if((n=e<t)&&(i=t,t=e,e=i),0===(o=A(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(t-s)/o;return n&&a.reverse(),a}function A(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=b?10:a>=w?5:a>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=b?10:a>=w?5:a>=T?2:1)}function M(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=b?i*=10:a>=w?i*=5:a>=T&&(i*=2),e<t?-i:i}function S(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function E(){var t=x,e=d,r=S;function n(n){var i,o,s=n.length,l=new Array(s);for(i=0;i<s;++i)l[i]=t(n[i],i,n);var u=e(l),c=u[0],h=u[1],f=r(l,c,h);Array.isArray(f)||(f=M(c,h,f),f=_(Math.ceil(c/f)*f,h,f));for(var p=f.length;f[0]<=c;)f.shift(),--p;for(;f[p-1]>h;)f.pop(),--p;var d,m=new Array(p+1);for(i=0;i<=p;++i)(d=m[i]=[]).x0=i>0?f[i-1]:c,d.x1=i<p?f[i]:h;for(i=0;i<s;++i)c<=(o=l[i])&&o<=h&&m[a(f,o,0,p)].push(n[i]);return m}return n.value=function(e){return arguments.length?(t="function"==typeof e?e:v(e),n):t},n.domain=function(t){return arguments.length?(e="function"==typeof t?t:v([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r="function"==typeof t?t:Array.isArray(t)?v(g.call(t)):v(t),n):r},n}function C(t,e,r){if(null==r&&(r=h),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function I(t,r,n){return t=y.call(t,h).sort(e),Math.ceil((n-r)/(2*(C(t,.75)-C(t,.25))*Math.pow(t.length,-1/3)))}function L(t,e,r){return Math.ceil((r-e)/(3.5*p(t)*Math.pow(t.length,-1/3)))}function P(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&r>n&&(n=r);return n}function z(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=h(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=h(e(t[a],a,t)))?--i:o+=r;if(i)return o/i}function O(t,r){var n,i=t.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=h(t[a]))||o.push(n);else for(;++a<i;)isNaN(n=h(r(t[a],a,t)))||o.push(n);return C(o.sort(e),.5)}function D(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r}function R(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&n>r&&(n=r);return n}function F(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n}function B(t,r){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==r&&(r=e);++a<n;)(r(i=t[a],s)<0||0!==r(s,s))&&(s=i,o=a);if(0===r(s,s))return o}}function N(t,e,r){for(var n,i,a=(null==r?t.length:r)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t}function j(t,e){var r,n=t.length,i=-1,a=0;if(null==e)for(;++i<n;)(r=+t[i])&&(a+=r);else for(;++i<n;)(r=+e(t[i],i,t))&&(a+=r);return a}function U(t){if(!(i=t.length))return[];for(var e=-1,r=R(t,V),n=new Array(r);++e<r;)for(var i,a=-1,o=n[e]=new Array(i);++a<i;)o[a]=t[a][e];return n}function V(t){return t.length}function q(){return U(arguments)}t.bisect=a,t.bisectRight=a,t.bisectLeft=o,t.ascending=e,t.bisector=r,t.cross=u,t.descending=c,t.deviation=p,t.extent=d,t.histogram=E,t.thresholdFreedmanDiaconis=I,t.thresholdScott=L,t.thresholdSturges=S,t.max=P,t.mean=z,t.median=O,t.merge=D,t.min=R,t.pairs=s,t.permute=F,t.quantile=C,t.range=_,t.scan=B,t.shuffle=N,t.sum=j,t.ticks=k,t.tickIncrement=A,t.tickStep=M,t.transpose=U,t.variance=f,t.zip=q,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&void 0!==e?t:r.d3=r.d3||{})}),Sg=f((t,e)=>{var r,n;r=t,n=function(t,e){function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){a(i,t,this.t),a(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new n;function a(t,e,r){var n=t.s=e+r,i=n-e,a=n-i;t.t=e-a+(r-i)}var o=1e-6,s=1e-12,l=Math.PI,u=l/2,c=l/4,h=2*l,f=180/l,p=l/180,d=Math.abs,m=Math.atan,g=Math.atan2,y=Math.cos,v=Math.ceil,x=Math.exp,_=Math.log,b=Math.pow,w=Math.sin,T=Math.sign||function(t){return t>0?1:t<0?-1:0},k=Math.sqrt,A=Math.tan;function M(t){return t>1?0:t<-1?l:Math.acos(t)}function S(t){return t>1?u:t<-1?-u:Math.asin(t)}function E(t){return(t=w(t/2))*t}function C(){}function I(t,e){t&&P.hasOwnProperty(t.type)&&P[t.type](t,e)}var L={Feature:function(t,e){I(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)I(r[n].geometry,e)}},P={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){z(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)z(r[n],e,0)},Polygon:function(t,e){O(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)O(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)I(r[n],e)}};function z(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function O(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)z(t[r],e,1);e.polygonEnd()}function D(t,e){t&&L.hasOwnProperty(t.type)?L[t.type](t,e):I(t,e)}var R,F,B,N,j,U=r(),V=r(),q={point:C,lineStart:C,lineEnd:C,polygonStart:function(){U.reset(),q.lineStart=H,q.lineEnd=G},polygonEnd:function(){var t=+U;V.add(t<0?h+t:t),this.lineStart=this.lineEnd=this.point=C},sphere:function(){V.add(h)}};function H(){q.point=Z}function G(){W(R,F)}function Z(t,e){q.point=W,R=t,F=e,B=t*=p,N=y(e=(e*=p)/2+c),j=w(e)}function W(t,e){var r=(t*=p)-B,n=r>=0?1:-1,i=n*r,a=y(e=(e*=p)/2+c),o=w(e),s=j*o,l=N*a+s*y(i),u=s*n*w(i);U.add(g(u,l)),B=t,N=a,j=o}function Y(t){return[g(t[1],t[0]),S(t[2])]}function X(t){var e=t[0],r=t[1],n=y(r);return[n*y(e),n*w(e),w(r)]}function $(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function J(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function K(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tt(t){var e=k(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var et,rt,nt,it,at,ot,st,lt,ut,ct,ht=r(),ft={point:pt,lineStart:mt,lineEnd:gt,polygonStart:function(){ft.point=yt,ft.lineStart=vt,ft.lineEnd=xt,ht.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),ft.point=pt,ft.lineStart=mt,ft.lineEnd=gt,U<0?(et=-(nt=180),rt=-(it=90)):ht>o?it=90:ht<-o&&(rt=-90),ct[0]=et,ct[1]=nt},sphere:function(){et=-(nt=180),rt=-(it=90)}};function pt(t,e){ut.push(ct=[et=t,nt=t]),e<rt&&(rt=e),e>it&&(it=e)}function dt(t,e){var r=X([t*p,e*p]);if(lt){var n=J(lt,r),i=J([n[1],-n[0],0],n);tt(i),i=Y(i);var a,o=t-at,s=o>0?1:-1,l=i[0]*f*s,u=d(o)>180;u^(s*at<l&&l<s*t)?(a=i[1]*f)>it&&(it=a):u^(s*at<(l=(l+360)%360-180)&&l<s*t)?(a=-i[1]*f)<rt&&(rt=a):(e<rt&&(rt=e),e>it&&(it=e)),u?t<at?_t(et,t)>_t(et,nt)&&(nt=t):_t(t,nt)>_t(et,nt)&&(et=t):nt>=et?(t<et&&(et=t),t>nt&&(nt=t)):t>at?_t(et,t)>_t(et,nt)&&(nt=t):_t(t,nt)>_t(et,nt)&&(et=t)}else ut.push(ct=[et=t,nt=t]);e<rt&&(rt=e),e>it&&(it=e),lt=r,at=t}function mt(){ft.point=dt}function gt(){ct[0]=et,ct[1]=nt,ft.point=pt,lt=null}function yt(t,e){if(lt){var r=t-at;ht.add(d(r)>180?r+(r>0?360:-360):r)}else ot=t,st=e;q.point(t,e),dt(t,e)}function vt(){q.lineStart()}function xt(){yt(ot,st),q.lineEnd(),d(ht)>o&&(et=-(nt=180)),ct[0]=et,ct[1]=nt,lt=null}function _t(t,e){return(e-=t)<0?e+360:e}function bt(t,e){return t[0]-e[0]}function wt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var Tt,kt,At,Mt,St,Et,Ct,It,Lt,Pt,zt,Ot,Dt,Rt,Ft,Bt,Nt={sphere:C,point:jt,lineStart:Vt,lineEnd:Gt,polygonStart:function(){Nt.lineStart=Zt,Nt.lineEnd=Wt},polygonEnd:function(){Nt.lineStart=Vt,Nt.lineEnd=Gt}};function jt(t,e){t*=p;var r=y(e*=p);Ut(r*y(t),r*w(t),w(e))}function Ut(t,e,r){++Tt,At+=(t-At)/Tt,Mt+=(e-Mt)/Tt,St+=(r-St)/Tt}function Vt(){Nt.point=qt}function qt(t,e){t*=p;var r=y(e*=p);Rt=r*y(t),Ft=r*w(t),Bt=w(e),Nt.point=Ht,Ut(Rt,Ft,Bt)}function Ht(t,e){t*=p;var r=y(e*=p),n=r*y(t),i=r*w(t),a=w(e),o=g(k((o=Ft*a-Bt*i)*o+(o=Bt*n-Rt*a)*o+(o=Rt*i-Ft*n)*o),Rt*n+Ft*i+Bt*a);kt+=o,Et+=o*(Rt+(Rt=n)),Ct+=o*(Ft+(Ft=i)),It+=o*(Bt+(Bt=a)),Ut(Rt,Ft,Bt)}function Gt(){Nt.point=jt}function Zt(){Nt.point=Yt}function Wt(){Xt(Ot,Dt),Nt.point=jt}function Yt(t,e){Ot=t,Dt=e,t*=p,e*=p,Nt.point=Xt;var r=y(e);Rt=r*y(t),Ft=r*w(t),Bt=w(e),Ut(Rt,Ft,Bt)}function Xt(t,e){t*=p;var r=y(e*=p),n=r*y(t),i=r*w(t),a=w(e),o=Ft*a-Bt*i,s=Bt*n-Rt*a,l=Rt*i-Ft*n,u=k(o*o+s*s+l*l),c=S(u),h=u&&-c/u;Lt+=h*o,Pt+=h*s,zt+=h*l,kt+=c,Et+=c*(Rt+(Rt=n)),Ct+=c*(Ft+(Ft=i)),It+=c*(Bt+(Bt=a)),Ut(Rt,Ft,Bt)}function $t(t){return function(){return t}}function Jt(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Kt(t,e){return[d(t)>l?t+Math.round(-t/h)*h:t,e]}function Qt(t,e,r){return(t%=h)?e||r?Jt(ee(t),re(e,r)):ee(t):e||r?re(e,r):Kt}function te(t){return function(e,r){return[(e+=t)>l?e-h:e<-l?e+h:e,r]}}function ee(t){var e=te(t);return e.invert=te(-t),e}function re(t,e){var r=y(t),n=w(t),i=y(e),a=w(e);function o(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,u=w(e),c=u*r+s*n;return[g(l*i-c*a,s*r-u*n),S(c*i+l*a)]}return o.invert=function(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,u=w(e),c=u*i-l*a;return[g(l*i+u*a,s*r+c*n),S(c*r-s*n)]},o}function ne(t){function e(e){return(e=t(e[0]*p,e[1]*p))[0]*=f,e[1]*=f,e}return t=Qt(t[0]*p,t[1]*p,t.length>2?t[2]*p:0),e.invert=function(e){return(e=t.invert(e[0]*p,e[1]*p))[0]*=f,e[1]*=f,e},e}function ie(t,e,r,n,i,a){if(r){var o=y(e),s=w(e),l=n*r;null==i?(i=e+n*h,a=e-l/2):(i=ae(o,i),a=ae(o,a),(n>0?i<a:i>a)&&(i+=n*h));for(var u,c=i;n>0?c>a:c<a;c-=l)u=Y([o,-s*y(c),-s*w(c)]),t.point(u[0],u[1])}}function ae(t,e){(e=X(e))[0]-=t,tt(e);var r=M(-e[1]);return((-e[2]<0?-r:r)+h-o)%h}function oe(){var t,e=[];return{point:function(e,r,n){t.push([e,r,n])},lineStart:function(){e.push(t=[])},lineEnd:C,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function se(t,e){return d(t[0]-e[0])<o&&d(t[1]-e[1])<o}function le(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function ue(t,e,r,n,i){var a,s,l=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r,n=t[0],s=t[e];if(se(n,s)){if(!n[2]&&!s[2]){for(i.lineStart(),a=0;a<e;++a)i.point((n=t[a])[0],n[1]);return void i.lineEnd()}s[0]+=2*o}l.push(r=new le(n,t,null,!0)),u.push(r.o=new le(n,null,r,!1)),l.push(r=new le(s,t,null,!1)),u.push(r.o=new le(s,null,r,!0))}}),l.length){for(u.sort(e),ce(l),ce(u),a=0,s=u.length;a<s;++a)u[a].e=r=!r;for(var c,h,f=l[0];;){for(var p=f,d=!0;p.v;)if((p=p.n)===f)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(a=0,s=c.length;a<s;++a)i.point((h=c[a])[0],h[1]);else n(p.x,p.n.x,1,i);p=p.n}else{if(d)for(c=p.p.z,a=c.length-1;a>=0;--a)i.point((h=c[a])[0],h[1]);else n(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ce(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}Kt.invert=Kt;var he=r();function fe(t){return d(t[0])<=l?t[0]:T(t[0])*((d(t[0])+l)%h-l)}function pe(t,e){var r=fe(e),n=e[1],i=w(n),a=[w(r),-y(r),0],s=0,f=0;he.reset(),1===i?n=u+o:-1===i&&(n=-u-o);for(var p=0,d=t.length;p<d;++p)if(v=(m=t[p]).length)for(var m,v,x=m[v-1],_=fe(x),b=x[1]/2+c,T=w(b),k=y(b),A=0;A<v;++A,_=E,T=I,k=L,x=M){var M=m[A],E=fe(M),C=M[1]/2+c,I=w(C),L=y(C),P=E-_,z=P>=0?1:-1,O=z*P,D=O>l,R=T*I;if(he.add(g(R*z*w(O),k*L+R*y(O))),s+=D?P+z*h:P,D^_>=r^E>=r){var F=J(X(x),X(M));tt(F);var B=J(a,F);tt(B);var N=(D^P>=0?-1:1)*S(B[2]);(n>N||n===N&&(F[0]||F[1]))&&(f+=D^P>=0?1:-1)}}return(s<-o||s<o&&he<-o)^1&f}function de(t,r,n,i){return function(a){var o,s,l,u=r(a),c=oe(),h=r(c),f=!1,p={point:d,lineStart:g,lineEnd:y,polygonStart:function(){p.point=v,p.lineStart=x,p.lineEnd=_,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=g,p.lineEnd=y,s=e.merge(s);var t=pe(o,i);s.length?(f||(a.polygonStart(),f=!0),ue(s,ge,t,n,a)):t&&(f||(a.polygonStart(),f=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),f&&(a.polygonEnd(),f=!1),s=o=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function d(e,r){t(e,r)&&a.point(e,r)}function m(t,e){u.point(t,e)}function g(){p.point=m,u.lineStart()}function y(){p.point=d,u.lineEnd()}function v(t,e){l.push([t,e]),h.point(t,e)}function x(){h.lineStart(),l=[]}function _(){v(l[0][0],l[0][1]),h.lineEnd();var t,e,r,n,i=h.clean(),u=c.result(),p=u.length;if(l.pop(),o.push(l),l=null,p){if(1&i){if((e=(r=u[0]).length-1)>0){for(f||(a.polygonStart(),f=!0),a.lineStart(),t=0;t<e;++t)a.point((n=r[t])[0],n[1]);a.lineEnd()}return}p>1&&2&i&&u.push(u.pop().concat(u.shift())),s.push(u.filter(me))}}return p}}function me(t){return t.length>1}function ge(t,e){return((t=t.x)[0]<0?t[1]-u-o:u-t[1])-((e=e.x)[0]<0?e[1]-u-o:u-e[1])}var ye=de(function(){return!0},function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,s){var c=a>0?l:-l,h=d(a-r);d(h-l)<o?(t.point(r,n=(n+s)/2>0?u:-u),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(c,n),t.point(a,n),e=0):i!==c&&h>=l&&(d(r-i)<o&&(r-=i*o),d(a-c)<o&&(a-=c*o),n=function(t,e,r,n){var i,a,s=w(t-r);return d(s)>o?m((w(e)*(a=y(n))*w(r)-w(n)*(i=y(e))*w(t))/(i*a*s)):(e+n)/2}(r,n,a,s),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(c,n),e=0),t.point(r=a,n=s),i=c},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*u,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(d(t[0]-e[0])>o){var a=t[0]<e[0]?l:-l;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])},[-l,-u]);function ve(t){var e=y(t),r=6*p,n=e>0,i=d(e)>o;function a(t,r){return y(t)*y(r)>e}function s(t,r,n){var i=[1,0,0],a=J(X(t),X(r)),s=$(a,a),u=a[0],c=s-u*u;if(!c)return!n&&t;var h=e*s/c,f=-e*u/c,p=J(i,a),m=Q(i,h);K(m,Q(a,f));var g=p,y=$(m,g),v=$(g,g),x=y*y-v*($(m,m)-1);if(!(x<0)){var _=k(x),b=Q(g,(-y-_)/v);if(K(b,m),b=Y(b),!n)return b;var w,T=t[0],A=r[0],M=t[1],S=r[1];A<T&&(w=T,T=A,A=w);var E=A-T,C=d(E-l)<o;if(!C&&S<M&&(w=M,M=S,S=w),C||E<o?C?M+S>0^b[1]<(d(b[0]-T)<o?M:S):M<=b[1]&&b[1]<=S:E>l^(T<=b[0]&&b[0]<=A)){var I=Q(g,(-y+_)/v);return K(I,m),[b,Y(I)]}}}function u(e,r){var i=n?t:l-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return de(a,function(t){var e,r,o,c,h;return{lineStart:function(){c=o=!1,h=1},point:function(f,p){var d,m=[f,p],g=a(f,p),y=n?g?0:u(f,p):g?u(f+(f<0?l:-l),p):0;if(!e&&(c=o=g)&&t.lineStart(),g!==o&&(!(d=s(e,m))||se(e,d)||se(m,d))&&(m[2]=1),g!==o)h=0,g?(t.lineStart(),d=s(m,e),t.point(d[0],d[1])):(d=s(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&n^g){var v;!(y&r)&&(v=s(m,e,!0))&&(h=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}g&&(!e||!se(e,m))&&t.point(m[0],m[1]),e=m,o=g,r=y},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return h|(c&&o)<<1}}},function(e,n,i,a){ie(a,t,r,i,e,n)},n?[0,-t]:[-l,t-l])}var xe=1e9,_e=-xe;function be(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var u=0,h=0;if(null==e||(u=l(e,o))!==(h=l(a,o))||c(e,a)<0^o>0)do{s.point(0===u||3===u?t:n,u>1?i:r)}while((u=(u+o+4)%4)!==h);else s.point(a[0],a[1])}function l(e,i){return d(e[0]-t)<o?i>0?0:3:d(e[0]-n)<o?i>0?2:1:d(e[1]-r)<o?i>0?1:0:i>0?3:2}function u(t,e){return c(t.x,e.x)}function c(t,e){var r=l(t,1),n=l(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,h,f,p,d,m,g,y,v,x,_=o,b=oe(),w={point:T,lineStart:function(){w.point=k,c&&c.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(k(f,p),d&&y&&b.rejoin(),l.push(b.result())),w.point=T,y&&_.lineEnd()},polygonStart:function(){_=b,l=[],c=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=c.length;r<n;++r)for(var a,o,s=c[r],l=1,u=s.length,h=s[0],f=h[0],p=h[1];l<u;++l)a=f,o=p,h=s[l],f=h[0],p=h[1],o<=i?p>i&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ue(l,u,r,s,o),o.polygonEnd()),_=o,l=c=h=null}};function T(t,e){a(t,e)&&_.point(t,e)}function k(e,o){var s=a(e,o);if(c&&h.push([e,o]),v)f=e,p=o,d=s,v=!1,s&&(_.lineStart(),_.point(e,o));else if(s&&y)_.point(e,o);else{var l=[m=Math.max(_e,Math.min(xe,m)),g=Math.max(_e,Math.min(xe,g))],u=[e=Math.max(_e,Math.min(xe,e)),o=Math.max(_e,Math.min(xe,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],u=0,c=1,h=e[0]-s,f=e[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o<u)return;o<c&&(c=o)}else if(h>0){if(o>c)return;o>u&&(u=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>u&&(u=o)}else if(h>0){if(o<u)return;o<c&&(c=o)}if(o=n-l,f||!(o>0)){if(o/=f,f<0){if(o<u)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>u&&(u=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o<u)return;o<c&&(c=o)}return u>0&&(t[0]=s+u*h,t[1]=l+u*f),c<1&&(e[0]=s+c*h,e[1]=l+c*f),!0}}}}}(l,u,t,r,n,i)?s&&(_.lineStart(),_.point(e,o),x=!1):(y||(_.lineStart(),_.point(l[0],l[1])),_.point(u[0],u[1]),s||_.lineEnd(),x=!1)}m=e,g=o,y=s}return w}}var we,Te,ke,Ae=r(),Me={sphere:C,point:C,lineStart:function(){Me.point=Ee,Me.lineEnd=Se},lineEnd:C,polygonStart:C,polygonEnd:C};function Se(){Me.point=Me.lineEnd=C}function Ee(t,e){we=t*=p,Te=w(e*=p),ke=y(e),Me.point=Ce}function Ce(t,e){t*=p;var r=w(e*=p),n=y(e),i=d(t-we),a=y(i),o=n*w(i),s=ke*r-Te*n*a,l=Te*r+ke*n*a;Ae.add(g(k(o*o+s*s),l)),we=t,Te=r,ke=n}function Ie(t){return Ae.reset(),D(t,Me),+Ae}var Le=[null,null],Pe={type:"LineString",coordinates:Le};function ze(t,e){return Le[0]=t,Le[1]=e,Ie(Pe)}var Oe={Feature:function(t,e){return Re(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)if(Re(r[n].geometry,e))return!0;return!1}},De={Sphere:function(){return!0},Point:function(t,e){return Fe(t.coordinates,e)},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)if(Fe(r[n],e))return!0;return!1},LineString:function(t,e){return Be(t.coordinates,e)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)if(Be(r[n],e))return!0;return!1},Polygon:function(t,e){return Ne(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)if(Ne(r[n],e))return!0;return!1},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)if(Re(r[n],e))return!0;return!1}};function Re(t,e){return!(!t||!De.hasOwnProperty(t.type))&&De[t.type](t,e)}function Fe(t,e){return 0===ze(t,e)}function Be(t,e){for(var r,n,i,a=0,o=t.length;a<o;a++){if(0===(n=ze(t[a],e))||a>0&&(i=ze(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<s*i)return!0;r=n}return!1}function Ne(t,e){return!!pe(t.map(je),Ue(e))}function je(t){return(t=t.map(Ue)).pop(),t}function Ue(t){return[t[0]*p,t[1]*p]}function Ve(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map(function(e){return[t,e]})}}function qe(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map(function(e){return[e,t]})}}function He(){var t,r,n,i,a,s,l,u,c,h,f,p,m=10,g=m,y=90,x=360,_=2.5;function b(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(v(i/y)*y,n,y).map(f).concat(e.range(v(u/x)*x,l,x).map(p)).concat(e.range(v(r/m)*m,t,m).filter(function(t){return d(t%y)>o}).map(c)).concat(e.range(v(s/g)*g,a,g).filter(function(t){return d(t%x)>o}).map(h))}return b.lines=function(){return w().map(function(t){return{type:"LineString",coordinates:t}})},b.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(p(l).slice(1),f(n).reverse().slice(1),p(u).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],u=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),u>l&&(t=u,u=l,l=t),b.precision(_)):[[i,u],[n,l]]},b.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),b.precision(_)):[[r,s],[t,a]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],b):[y,x]},b.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],b):[m,g]},b.precision=function(e){return arguments.length?(_=+e,c=Ve(s,a,90),h=qe(r,t,_),f=Ve(u,l,90),p=qe(i,n,_),b):_},b.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Ge(t){return t}var Ze,We,Ye,Xe,$e=r(),Je=r(),Ke={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Ke.lineStart=Qe,Ke.lineEnd=rr},polygonEnd:function(){Ke.lineStart=Ke.lineEnd=Ke.point=C,$e.add(d(Je)),Je.reset()},result:function(){var t=$e/2;return $e.reset(),t}};function Qe(){Ke.point=tr}function tr(t,e){Ke.point=er,Ze=Ye=t,We=Xe=e}function er(t,e){Je.add(Xe*t-Ye*e),Ye=t,Xe=e}function rr(){er(Ze,We)}var nr,ir,ar,or,sr=1/0,lr=sr,ur=-sr,cr=ur,hr={point:function(t,e){t<sr&&(sr=t),t>ur&&(ur=t),e<lr&&(lr=e),e>cr&&(cr=e)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var t=[[sr,lr],[ur,cr]];return ur=cr=-(lr=sr=1/0),t}},fr=0,pr=0,dr=0,mr=0,gr=0,yr=0,vr=0,xr=0,_r=0,br={point:wr,lineStart:Tr,lineEnd:Mr,polygonStart:function(){br.lineStart=Sr,br.lineEnd=Er},polygonEnd:function(){br.point=wr,br.lineStart=Tr,br.lineEnd=Mr},result:function(){var t=_r?[vr/_r,xr/_r]:yr?[mr/yr,gr/yr]:dr?[fr/dr,pr/dr]:[NaN,NaN];return fr=pr=dr=mr=gr=yr=vr=xr=_r=0,t}};function wr(t,e){fr+=t,pr+=e,++dr}function Tr(){br.point=kr}function kr(t,e){br.point=Ar,wr(ar=t,or=e)}function Ar(t,e){var r=t-ar,n=e-or,i=k(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,wr(ar=t,or=e)}function Mr(){br.point=wr}function Sr(){br.point=Cr}function Er(){Ir(nr,ir)}function Cr(t,e){br.point=Ir,wr(nr=ar=t,ir=or=e)}function Ir(t,e){var r=t-ar,n=e-or,i=k(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,vr+=(i=or*t-ar*e)*(ar+t),xr+=i*(or+e),_r+=3*i,wr(ar=t,or=e)}function Lr(t){this._context=t}Lr.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,h)}},result:C};var Pr,zr,Or,Dr,Rr,Fr=r(),Br={point:C,lineStart:function(){Br.point=Nr},lineEnd:function(){Pr&&jr(zr,Or),Br.point=C},polygonStart:function(){Pr=!0},polygonEnd:function(){Pr=null},result:function(){var t=+Fr;return Fr.reset(),t}};function Nr(t,e){Br.point=jr,zr=Dr=t,Or=Rr=e}function jr(t,e){Dr-=t,Rr-=e,Fr.add(k(Dr*Dr+Rr*Rr)),Dr=t,Rr=e}function Ur(){this._string=[]}function Vr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function qr(t){return function(e){var r=new Hr;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Hr(){}function Gr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),D(r,t.stream(hr)),e(hr.result()),null!=n&&t.clipExtent(n),t}function Zr(t,e,r){return Gr(t,function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])},r)}function Wr(t,e,r){return Zr(t,[[0,0],e],r)}function Yr(t,e,r){return Gr(t,function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])},r)}function Xr(t,e,r){return Gr(t,function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])},r)}Ur.prototype={_radius:4.5,_circle:Vr(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Hr.prototype={constructor:Hr,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var $r=y(30*p);function Jr(t,e){return+e?function(t,e){function r(n,i,a,s,l,u,c,h,f,p,m,y,v,x){var _=c-n,b=h-i,w=_*_+b*b;if(w>4*e&&v--){var T=s+p,A=l+m,M=u+y,E=k(T*T+A*A+M*M),C=S(M/=E),I=d(d(M)-1)<o||d(a-f)<o?(a+f)/2:g(A,T),L=t(I,C),P=L[0],z=L[1],O=P-n,D=z-i,R=b*O-_*D;(R*R/w>e||d((_*O+b*D)/w-.5)>.3||s*p+l*m+u*y<$r)&&(r(n,i,a,s,l,u,P,z,I,T/=E,A/=E,M,v,x),x.point(P,z),r(P,z,I,T,A,M,c,h,f,p,m,y,v,x))}}return function(e){var n,i,a,o,s,l,u,c,h,f,p,d,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){c=NaN,m.point=v,e.lineStart()}function v(n,i){var a=X([n,i]),o=t(n,i);r(c,h,u,f,p,d,c=o[0],h=o[1],u=n,f=a[0],p=a[1],d=a[2],16,e),e.point(c,h)}function x(){m.point=g,e.lineEnd()}function _(){y(),m.point=b,m.lineEnd=w}function b(t,e){v(n=t,e),i=c,a=h,o=f,s=p,l=d,m.point=v}function w(){r(c,h,u,f,p,d,i,a,n,o,s,l,16,e),m.lineEnd=x,x()}return m}}(t,e):function(t){return qr({point:function(e,r){e=t(e,r),this.stream.point(e[0],e[1])}})}(t)}var Kr=qr({point:function(t,e){this.stream.point(t*p,e*p)}});function Qr(t,e,r,n,i){function a(a,o){return[e+t*(a*=n),r-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*n,(r-o)/t*i]},a}function tn(t,e,r,n,i,a){var o=y(a),s=w(a),l=o*t,u=s*t,c=o/t,h=s/t,f=(s*r-o*e)/t,p=(s*e+o*r)/t;function d(t,a){return[l*(t*=n)-u*(a*=i)+e,r-u*t-l*a]}return d.invert=function(t,e){return[n*(c*t-h*e+f),i*(p-h*t-c*e)]},d}function en(t){return rn(function(){return t})()}function rn(t){var e,r,n,i,a,o,s,l,u,c,h=150,d=480,m=250,g=0,y=0,v=0,x=0,_=0,b=0,w=1,T=1,A=null,M=ye,S=null,E=Ge,C=.5;function I(t){return l(t[0]*p,t[1]*p)}function L(t){return(t=l.invert(t[0],t[1]))&&[t[0]*f,t[1]*f]}function P(){var t=tn(h,0,0,w,T,b).apply(null,e(g,y)),n=(b?tn:Qr)(h,d-t[0],m-t[1],w,T,b);return r=Qt(v,x,_),s=Jt(e,n),l=Jt(r,s),o=Jr(s,C),z()}function z(){return u=c=null,I}return I.stream=function(t){return u&&c===t?u:u=Kr(function(t){return qr({point:function(e,r){var n=t(e,r);return this.stream.point(n[0],n[1])}})}(r)(M(o(E(c=t)))))},I.preclip=function(t){return arguments.length?(M=t,A=void 0,z()):M},I.postclip=function(t){return arguments.length?(E=t,S=n=i=a=null,z()):E},I.clipAngle=function(t){return arguments.length?(M=+t?ve(A=t*p):(A=null,ye),z()):A*f},I.clipExtent=function(t){return arguments.length?(E=null==t?(S=n=i=a=null,Ge):be(S=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),z()):null==S?null:[[S,n],[i,a]]},I.scale=function(t){return arguments.length?(h=+t,P()):h},I.translate=function(t){return arguments.length?(d=+t[0],m=+t[1],P()):[d,m]},I.center=function(t){return arguments.length?(g=t[0]%360*p,y=t[1]%360*p,P()):[g*f,y*f]},I.rotate=function(t){return arguments.length?(v=t[0]%360*p,x=t[1]%360*p,_=t.length>2?t[2]%360*p:0,P()):[v*f,x*f,_*f]},I.angle=function(t){return arguments.length?(b=t%360*p,P()):b*f},I.reflectX=function(t){return arguments.length?(w=t?-1:1,P()):w<0},I.reflectY=function(t){return arguments.length?(T=t?-1:1,P()):T<0},I.precision=function(t){return arguments.length?(o=Jr(s,C=t*t),z()):k(C)},I.fitExtent=function(t,e){return Zr(I,t,e)},I.fitSize=function(t,e){return Wr(I,t,e)},I.fitWidth=function(t,e){return Yr(I,t,e)},I.fitHeight=function(t,e){return Xr(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&L,P()}}function nn(t){var e=0,r=l/3,n=rn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*p,r=t[1]*p):[e*f,r*f]},i}function an(t,e){var r=w(t),n=(r+w(e))/2;if(d(n)<o)return function(t){var e=y(t);function r(t,r){return[t*e,w(r)/e]}return r.invert=function(t,r){return[t/e,S(r*e)]},r}(t);var i=1+r*(2*n-r),a=k(i)/n;function s(t,e){var r=k(i-2*n*w(e))/n;return[r*w(t*=n),a-r*y(t)]}return s.invert=function(t,e){var r=a-e,o=g(t,d(r))*T(r);return r*n<0&&(o-=l*T(t)*T(r)),[o/n,S((i-(t*t+r*r)*n*n)/(2*n))]},s}function on(){return nn(an).scale(155.424).center([0,33.6442])}function sn(){return on().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ln(t){return function(e,r){var n=y(e),i=y(r),a=t(n*i);return[a*i*w(e),a*w(r)]}}function un(t){return function(e,r){var n=k(e*e+r*r),i=t(n),a=w(i),o=y(i);return[g(e*a,n*o),S(n&&r*a/n)]}}var cn=ln(function(t){return k(2/(1+t))});cn.invert=un(function(t){return 2*S(t/2)});var hn=ln(function(t){return(t=M(t))&&t/w(t)});function fn(t,e){return[t,_(A((u+e)/2))]}function pn(t){var e,r,n,i=en(t),a=i.center,o=i.scale,s=i.translate,u=i.clipExtent,c=null;function h(){var a=l*o(),s=i(ne(i.rotate()).invert([0,0]));return u(null==c?[[s[0]-a,s[1]-a],[s[0]+a,s[1]+a]]:t===fn?[[Math.max(s[0]-a,c),e],[Math.min(s[0]+a,r),n]]:[[c,Math.max(s[1]-a,e)],[r,Math.min(s[1]+a,n)]])}return i.scale=function(t){return arguments.length?(o(t),h()):o()},i.translate=function(t){return arguments.length?(s(t),h()):s()},i.center=function(t){return arguments.length?(a(t),h()):a()},i.clipExtent=function(t){return arguments.length?(null==t?c=e=r=n=null:(c=+t[0][0],e=+t[0][1],r=+t[1][0],n=+t[1][1]),h()):null==c?null:[[c,e],[r,n]]},h()}function dn(t){return A((u+t)/2)}function mn(t,e){var r=y(t),n=t===e?w(t):_(r/y(e))/_(dn(e)/dn(t)),i=r*b(dn(t),n)/n;if(!n)return fn;function a(t,e){i>0?e<-u+o&&(e=-u+o):e>u-o&&(e=u-o);var r=i/b(dn(e),n);return[r*w(n*t),i-r*y(n*t)]}return a.invert=function(t,e){var r=i-e,a=T(n)*k(t*t+r*r),o=g(t,d(r))*T(r);return r*n<0&&(o-=l*T(t)*T(r)),[o/n,2*m(b(i/a,1/n))-u]},a}function gn(t,e){return[t,e]}function yn(t,e){var r=y(t),n=t===e?w(t):(r-y(e))/(e-t),i=r/n+t;if(d(n)<o)return gn;function a(t,e){var r=i-e,a=n*t;return[r*w(a),i-r*y(a)]}return a.invert=function(t,e){var r=i-e,a=g(t,d(r))*T(r);return r*n<0&&(a-=l*T(t)*T(r)),[a/n,i-T(n)*k(t*t+r*r)]},a}hn.invert=un(function(t){return t}),fn.invert=function(t,e){return[t,2*m(x(e))-u]},gn.invert=gn;var vn=1.340264,xn=-.081106,_n=893e-6,bn=.003796,wn=k(3)/2;function Tn(t,e){var r=S(wn*w(e)),n=r*r,i=n*n*n;return[t*y(r)/(wn*(vn+3*xn*n+i*(7*_n+9*bn*n))),r*(vn+xn*n+i*(_n+bn*n))]}function kn(t,e){var r=y(e),n=y(t)*r;return[r*w(t)/n,w(e)/n]}function An(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function Mn(t,e){return[y(e)*w(t),w(e)]}function Sn(t,e){var r=y(e),n=1+y(t)*r;return[r*w(t)/n,w(e)/n]}function En(t,e){return[_(A((u+e)/2)),-t]}Tn.invert=function(t,e){for(var r,n=e,i=n*n,a=i*i*i,o=0;o<12&&(a=(i=(n-=r=(n*(vn+xn*i+a*(_n+bn*i))-e)/(vn+3*xn*i+a*(7*_n+9*bn*i)))*n)*i*i,!(d(r)<s));++o);return[wn*t*(vn+3*xn*i+a*(7*_n+9*bn*i))/y(n),S(w(n)/wn)]},kn.invert=un(m),An.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,s=a*a;n-=r=(n*(1.007226+a*(.015085+s*(.028874*a-.044475-.005916*s)))-e)/(1.007226+a*(.045255+s*(.259866*a-.311325-.005916*11*s)))}while(d(r)>o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Mn.invert=un(S),Sn.invert=un(function(t){return 2*m(t)}),En.invert=function(t,e){return[-e,2*m(x(t))-u]},t.geoAlbers=sn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){a=[t,e]}};function h(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function f(){return t=e=null,h}return h.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?u:s).invert(t)},h.stream=function(r){return t&&e===r?t:t=function(t){var e=t.length;return{point:function(r,n){for(var i=-1;++i<e;)t[i].point(r,n)},sphere:function(){for(var r=-1;++r<e;)t[r].sphere()},lineStart:function(){for(var r=-1;++r<e;)t[r].lineStart()},lineEnd:function(){for(var r=-1;++r<e;)t[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<e;)t[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<e;)t[r].polygonEnd()}}}([s.stream(e=r),l.stream(r),u.stream(r)])},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),u.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),u.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){if(!arguments.length)return s.translate();var e=s.scale(),a=+t[0],h=+t[1];return r=s.translate(t).clipExtent([[a-.455*e,h-.238*e],[a+.455*e,h+.238*e]]).stream(c),n=l.translate([a-.307*e,h+.201*e]).clipExtent([[a-.425*e+o,h+.12*e+o],[a-.214*e-o,h+.234*e-o]]).stream(c),i=u.translate([a-.205*e,h+.212*e]).clipExtent([[a-.214*e+o,h+.166*e+o],[a-.115*e-o,h+.234*e-o]]).stream(c),f()},h.fitExtent=function(t,e){return Zr(h,t,e)},h.fitSize=function(t,e){return Wr(h,t,e)},h.fitWidth=function(t,e){return Yr(h,t,e)},h.fitHeight=function(t,e){return Xr(h,t,e)},h.scale(1070)},t.geoArea=function(t){return V.reset(),D(t,q),2*V},t.geoAzimuthalEqualArea=function(){return en(cn).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=cn,t.geoAzimuthalEquidistant=function(){return en(hn).scale(79.4188).clipAngle(179.999)},t.geoAzimuthalEquidistantRaw=hn,t.geoBounds=function(t){var e,r,n,i,a,o,s;if(it=nt=-(et=rt=1/0),ut=[],D(t,ft),r=ut.length){for(ut.sort(bt),e=1,a=[n=ut[0]];e<r;++e)wt(n,(i=ut[e])[0])||wt(n,i[1])?(_t(n[0],i[1])>_t(n[0],n[1])&&(n[1]=i[1]),_t(i[0],n[1])>_t(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=_t(n[1],i[0]))>o&&(o=s,et=i[0],nt=n[1])}return ut=ct=null,et===1/0||rt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,rt],[nt,it]]},t.geoCentroid=function(t){Tt=kt=At=Mt=St=Et=Ct=It=Lt=Pt=zt=0,D(t,Nt);var e=Lt,r=Pt,n=zt,i=e*e+r*r+n*n;return i<s&&(e=Et,r=Ct,n=It,kt<o&&(e=At,r=Mt,n=St),(i=e*e+r*r+n*n)<s)?[NaN,NaN]:[g(r,e)*f,S(n/k(i))*f]},t.geoCircle=function(){var t,e,r=$t([0,0]),n=$t(90),i=$t(6),a={point:function(r,n){t.push(r=e(r,n)),r[0]*=f,r[1]*=f}};function o(){var o=r.apply(this,arguments),s=n.apply(this,arguments)*p,l=i.apply(this,arguments)*p;return t=[],e=Qt(-o[0]*p,-o[1]*p,0).invert,ie(a,s,l,1),o={type:"Polygon",coordinates:[t]},t=e=null,o}return o.center=function(t){return arguments.length?(r="function"==typeof t?t:$t([+t[0],+t[1]]),o):r},o.radius=function(t){return arguments.length?(n="function"==typeof t?t:$t(+t),o):n},o.precision=function(t){return arguments.length?(i="function"==typeof t?t:$t(+t),o):i},o},t.geoClipAntimeridian=ye,t.geoClipCircle=ve,t.geoClipExtent=function(){var t,e,r,n=0,i=0,a=960,o=500;return r={stream:function(r){return t&&e===r?t:t=be(n,i,a,o)(e=r)},extent:function(s){return arguments.length?(n=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],t=e=null,r):[[n,i],[a,o]]}}},t.geoClipRectangle=be,t.geoConicConformal=function(){return nn(mn).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=mn,t.geoConicEqualArea=on,t.geoConicEqualAreaRaw=an,t.geoConicEquidistant=function(){return nn(yn).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=yn,t.geoContains=function(t,e){return(t&&Oe.hasOwnProperty(t.type)?Oe[t.type]:Re)(t,e)},t.geoDistance=ze,t.geoEqualEarth=function(){return en(Tn).scale(177.158)},t.geoEqualEarthRaw=Tn,t.geoEquirectangular=function(){return en(gn).scale(152.63)},t.geoEquirectangularRaw=gn,t.geoGnomonic=function(){return en(kn).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=kn,t.geoGraticule=He,t.geoGraticule10=function(){return He()()},t.geoIdentity=function(){var t,e,r,n,i,a,o,s=1,l=0,u=0,c=1,h=1,d=0,m=null,g=1,v=1,x=qr({point:function(t,e){var r=T([t,e]);this.stream.point(r[0],r[1])}}),_=Ge;function b(){return g=s*c,v=s*h,a=o=null,T}function T(r){var n=r[0]*g,i=r[1]*v;if(d){var a=i*t-n*e;n=n*t+i*e,i=a}return[n+l,i+u]}return T.invert=function(r){var n=r[0]-l,i=r[1]-u;if(d){var a=i*t+n*e;n=n*t-i*e,i=a}return[n/g,i/v]},T.stream=function(t){return a&&o===t?a:a=x(_(o=t))},T.postclip=function(t){return arguments.length?(_=t,m=r=n=i=null,b()):_},T.clipExtent=function(t){return arguments.length?(_=null==t?(m=r=n=i=null,Ge):be(m=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),b()):null==m?null:[[m,r],[n,i]]},T.scale=function(t){return arguments.length?(s=+t,b()):s},T.translate=function(t){return arguments.length?(l=+t[0],u=+t[1],b()):[l,u]},T.angle=function(r){return arguments.length?(e=w(d=r%360*p),t=y(d),b()):d*f},T.reflectX=function(t){return arguments.length?(c=t?-1:1,b()):c<0},T.reflectY=function(t){return arguments.length?(h=t?-1:1,b()):h<0},T.fitExtent=function(t,e){return Zr(T,t,e)},T.fitSize=function(t,e){return Wr(T,t,e)},T.fitWidth=function(t,e){return Yr(T,t,e)},T.fitHeight=function(t,e){return Xr(T,t,e)},T},t.geoInterpolate=function(t,e){var r=t[0]*p,n=t[1]*p,i=e[0]*p,a=e[1]*p,o=y(n),s=w(n),l=y(a),u=w(a),c=o*y(r),h=o*w(r),d=l*y(i),m=l*w(i),v=2*S(k(E(a-n)+o*l*E(i-r))),x=w(v),_=v?function(t){var e=w(t*=v)/x,r=w(v-t)/x,n=r*c+e*d,i=r*h+e*m,a=r*s+e*u;return[g(i,n)*f,g(a,k(n*n+i*i))*f]}:function(){return[r*f,n*f]};return _.distance=v,_},t.geoLength=Ie,t.geoMercator=function(){return pn(fn).scale(961/h)},t.geoMercatorRaw=fn,t.geoNaturalEarth1=function(){return en(An).scale(175.295)},t.geoNaturalEarth1Raw=An,t.geoOrthographic=function(){return en(Mn).scale(249.5).clipAngle(90+o)},t.geoOrthographicRaw=Mn,t.geoPath=function(t,e){var r,n,i=4.5;function a(t){return t&&("function"==typeof i&&n.pointRadius(+i.apply(this,arguments)),D(t,r(n))),n.result()}return a.area=function(t){return D(t,r(Ke)),Ke.result()},a.measure=function(t){return D(t,r(Br)),Br.result()},a.bounds=function(t){return D(t,r(hr)),hr.result()},a.centroid=function(t){return D(t,r(br)),br.result()},a.projection=function(e){return arguments.length?(r=null==e?(t=null,Ge):(t=e).stream,a):t},a.context=function(t){return arguments.length?(n=null==t?(e=null,new Ur):new Lr(e=t),"function"!=typeof i&&n.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(n.pointRadius(+t),+t),a):i},a.projection(t).context(e)},t.geoProjection=en,t.geoProjectionMutator=rn,t.geoRotation=ne,t.geoStereographic=function(){return en(Sn).scale(250).clipAngle(142)},t.geoStereographicRaw=Sn,t.geoStream=D,t.geoTransform=function(t){return{stream:qr(t)}},t.geoTransverseMercator=function(){var t=pn(En),e=t.center,r=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=En,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,Mg()):n((r=r||self).d3=r.d3||{},r.d3)}),Eg=f((t,e)=>{var r,n;r=t,n=function(t,e,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,u=Math.log,c=Math.max,h=Math.min,f=Math.pow,p=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,_=x/2,b=x/4,w=Math.SQRT1_2,T=I(2),k=I(x),A=2*x,M=180/x,S=x/180;function E(t){return t>1?_:t<-1?-_:Math.asin(t)}function C(t){return t>1?0:t<-1?x:Math.acos(t)}function I(t){return t>0?Math.sqrt(t):0}function L(t){return(s(t)-s(-t))/2}function P(t){return(s(t)+s(-t))/2}function z(t){var e=g(t/2),r=2*u(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=m(e),s=i*n,l=-((1-s?u((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(t),l*a]}return i.invert=function(e,i){var s,l=I(e*e+i*i),c=-t/2,h=50;if(!l)return[0,0];do{var f=c/2,p=o(f),d=m(f),g=d/p,v=-u(n(p));c-=s=(2/g*v-r*g-l)/(-v/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>y&&--h>0);var x=m(c);return[a(e*x,l*o(c)),E(i*x/l)]},i}function O(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(C(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function D(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function u(t,n){var u=o(n),c=o(t/=2);return[(1+u)*m(t),(i*n>-a(c,s)-.001?0:10*-i)+l+m(n)*r-(1+u)*e*c]}return u.invert=function(t,u){var c=0,h=0,f=50;do{var p=o(c),d=m(c),g=o(h),v=m(h),x=1+g,_=x*d-t,b=l+v*r-x*e*p-u,w=x*p/2,T=-d*v,k=e*x*d/2,A=r*g+e*p*v,M=T*k-A*w,S=(b*T-_*A)/M/2,E=(_*k-b*w)/M;n(E)>2&&(E/=2),c-=S,h-=E}while((n(S)>y||n(E)>y)&&--f>0);return i*h>-a(o(c),s)-.001?[2*c,h]:null},u}function R(t,e){var r=g(e/2),n=I(1-r*r),i=1+n*o(t/=2),a=m(t)*n/i,s=r/i,l=a*a,u=s*s;return[4/3*a*(3+l-3*u),4/3*s*(3+3*l-u)]}O.invert=function(t,e){if(!(t*t+4*e*e>x*x+y)){var r=t,i=e,a=25;do{var s,l=m(r),u=m(r/2),c=o(r/2),h=m(i),f=o(i),p=m(2*i),d=h*h,g=f*f,v=u*u,_=1-g*c*c,b=_?C(f*c)*I(s=1/_):s=0,w=2*b*f*u-t,T=b*h-e,k=s*(g*v+b*f*c*d),A=s*(.5*l*p-2*b*h*u),M=.25*s*(p*u-b*h*g*l),S=s*(d*c+b*v*f),E=A*M-S*k;if(!E)break;var L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]}},R.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=I((r-I(r*r-4*e*e))/2),s=E(i)/3,l=i?function(t){return u(t+I(t*t-1))}(n(e/i))/3:function(t){return u(t+I(t*t+1))}(n(t))/3,c=o(s),h=P(l),f=h*h-c*c;return[2*d(t)*a(L(l)*c,.25-f),2*d(e)*a(h*m(s),.25+f)]};var F=I(8),B=u(1+T);function N(t,e){var r=n(e);return r<b?[t,u(g(b+e/2))]:[t*o(r)*(2*T-1/m(r)),d(e)*(2*T*(r-b)-u(g(r/2)))]}function j(t){var r=2*x/t;function s(t,i){var s=e.geoAzimuthalEquidistantRaw(t,i);if(n(t)>_){var l=a(s[1],s[0]),u=I(s[0]*s[0]+s[1]*s[1]),c=r*p((l-_)/r)+_,h=a(m(l-=c),2-o(l));l=c+E(x/u*m(h))-h,s[0]=u*o(l),s[1]=u*m(l)}return s}return s.invert=function(t,n){var s=I(t*t+n*n);if(s>_){var l=a(n,t),u=r*p((l-_)/r)+_,c=l>u?-1:1,h=s*o(u-l),f=1/g(c*C((h-x)/I(x*(x-2*h)+s*s)));l=u+2*i((f+c*I(f*f-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function U(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function V(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function q(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+y))&&(o=a+y),r-=i=-1*y*(a-e)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function H(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=v),function(i,a,o,s){var l,u,c;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;h<e;h++){var f=t(o,s),p=f[0]-i,d=f[1]-a;if(n(p)<r&&n(d)<r)break;var m=p*p+d*d;if(m>l)o-=u/=2,s-=c/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=t(o+g,s),x=t(o,s+y),_=(v[0]-f[0])/g,b=(v[1]-f[1])/g,w=(x[0]-f[0])/y,T=(x[1]-f[1])/y,k=T*_-b*w,A=(n(k)<.5?.5:1)/k;if(o+=u=(d*w-p*T)*A,s+=c=(p*b-d*_)*A,n(u)<r&&n(c)<r)break}}return[o,s]}}function G(){var t=U(1.68,2);function e(e,r){if(e+r<-1.4){var n=(e-r+1.6)*(e+r+1.4)/8;e+=n,r-=.8*n*m(r+x/2)}var i=t(e,r),a=(1-o(e*r))/12;return i[1]<0&&(i[0]*=1+a),i[1]>0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=H(e),e}function Z(t,e){var r,i=t*m(e),a=30;do{e-=r=(e+m(e)-i)/(1+o(e))}while(n(r)>y&&--a>0);return e/2}function W(t,e,r){function n(n,i){return[t*n*o(i=Z(r,i)),e*m(i)]}return n.invert=function(n,i){return i=E(i/e),[n/(t*o(i)),E((2*i+m(2*i))/r)]},n}N.invert=function(t,e){if((a=n(e))<B)return[t,2*i(s(e))-_];var r,a,l=b,c=25;do{var h=o(l/2),f=g(l/2);l-=r=(F*(l-b)-u(f)-a)/(F-h*h/(2*f))}while(n(r)>v&&--c>0);return[t/(o(l)*(F-1/m(l))),d(e)*l]},V.invert=function(t,e){var r=2*E(e/2);return[t*o(r/2)/o(r),r]};var Y=W(T/_,T,x),X=2.00276,$=1.11072;function J(t,e){var r=Z(x,e);return[X*t/(1/o(e)+$/o(r)),(e+T*m(r))/X]}function K(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*S):r*M},i}function Q(t,e){return[t*o(e),e]}function tt(t){if(!t)return Q;var e=1/g(t);function r(r,n){var i=e+t-n,a=i&&r*o(n)/i;return[i*m(a),e-i*o(a)]}return r.invert=function(r,n){var i=I(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function et(t){function e(e,r){var n=_-r,i=n&&e*t*m(n)/n;return[n*m(i)/t,_-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=_-r,o=I(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/t,_-o]},e}J.invert=function(t,e){var r,i,a=X*e,s=e<0?-b:b,l=25;do{i=a-T*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*T*o(s))}while(n(r)>y&&--l>0);return i=a-T*m(s),[t*(1/o(i)+$/o(s))/X,i]},Q.invert=function(t,e){return[t/o(e),e]};var rt=W(1,4/x,x);function nt(t,e,r,i,s,l){var u,c=o(l);if(n(t)>1||n(l)>1)u=C(r*s+e*i*c);else{var h=m(t/2),f=m(l/2);u=2*E(I(h*h+e*i*f*f))}return n(u)>y?[u,a(i*m(l),e*s-r*i*c)]:[0,0]}function it(t,e,r){return C((t*t+e*e-r*r)/(2*t*e))}function at(t){return t-2*x*l((t+x)/(2*x))}function ot(t,e,r){for(var n,i=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=nt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=it(i[0].v[0],i[2].v[0],i[1].v[0]),u=it(i[0].v[0],i[1].v[0],i[2].v[0]),c=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(t,e){var r,n=m(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=nt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=at(s[r][1]-l.v[1])}var f=h.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=it(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(d=-d),r?1==r?(d=u-d,f[0]-=s[r][0]*o(d),f[1]-=s[r][0]*m(d)):(d=c-d,f[0]+=s[r][0]*o(d),f[1]+=s[r][0]*m(d)):(f[0]+=s[r][0]*o(d),f[1]-=s[r][0]*m(d))}return f[0]/=3,f[1]/=3,f}}function st(t){return t[0]*=S,t[1]*=S,t}function lt(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=ot(st(o(t)),st(o(r)),st(o(n)));s.invert=H(s);var l=e.geoProjection(s).rotate(a),u=l.center;return delete l.rotate,l.center=function(t){return arguments.length?u(o(t)):o.invert(u())},l.clipAngle(90)}function ut(t,e){var r=I(1-m(e));return[2/k*t*r,k*(1-r)]}function ct(t){var e=g(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*a(I(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,E(t?e*g(t)/t:e)]},r}ut.invert=function(t,e){var r=(r=e/k-1)*r;return[r>0?t*I(x/r)/2:0,E(1-r)]};var ht=I(3);function ft(t,e){return[ht*t*(2*o(2*e/3)-1)/k,ht*k*m(e/3)]}function pt(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,E(r*e)]},r}function dt(t){var e=o(t);function r(t,r){return[t*e,(1+e)*g(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function mt(t,e){var r=I(8/(3*x));return[r*t*(1-n(e)/x),r*e]}function gt(t,e){var r=I(4-3*m(n(e)));return[2/I(6*x)*t*r,d(e)*I(2*x/3)*(2-r)]}function yt(t,e){var r=I(x*(4+x));return[2/r*t*(1+I(1-4*e*e/(x*x))),4/r*e]}function vt(t,e){var r=(2+_)*m(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(e);e-=a=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/I(x*(4+x))*t*(1+o(e)),2*I(x/(4+x))*m(e)]}function xt(t,e){return[t*(1+o(e))/I(2+x),2*e/I(2+x)]}function _t(t,e){for(var r=(1+_)*m(e),i=0,a=1/0;i<10&&n(a)>y;i++)e-=a=(e+m(e)-r)/(1+o(e));return r=I(2+x),[t*(1+o(e))/r,2*e/r]}ft.invert=function(t,e){var r=3*E(e/(ht*k));return[k*t/(ht*(2*o(2*r/3)-1)),r]},mt.invert=function(t,e){var r=I(8/(3*x)),i=e/r;return[t/(r*(1-n(i)/x)),i]},gt.invert=function(t,e){var r=2-n(e)/I(2*x/3);return[t*I(6*x)/(2*r),d(e)*E((4-r*r)/3)]},yt.invert=function(t,e){var r=I(x*(4+x))/2;return[t*r/(1+I(1-e*e*(4+x)/(4*x))),e*r/2]},vt.invert=function(t,e){var r=e*I((4+x)/x)/2,n=E(r),i=o(n);return[t/(2/I(x*(4+x))*(1+i)),E((n+r*(i+2))/(2+_))]},xt.invert=function(t,e){var r=I(2+x),n=e*r/2;return[r*t/(1+o(n)),n]},_t.invert=function(t,e){var r=1+_,n=I(r/2);return[2*t*n/(1+o(e*=n)),E((e+m(e))/r)]};var bt=3+2*T;function wt(t,e){var r=m(t/=2),n=o(t),a=I(o(e)),s=o(e/=2),l=m(e)/(s+T*n*a),c=I(2/(1+l*l)),h=I((T*s+(n+r)*a)/(T*s+(n-r)*a));return[bt*(c*(h-1/h)-2*u(h)),bt*(c*l*(h+1/h)-2*i(l))]}wt.invert=function(t,e){if(!(r=R.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=bt,e/=bt;do{var f=a/2,p=s/2,d=m(f),g=o(f),v=m(p),x=o(p),b=o(s),k=I(b),A=v/(x+T*g*k),M=A*A,S=I(2/(1+M)),E=(T*x+(g+d)*k)/(T*x+(g-d)*k),C=I(E),L=C-1/C,P=C+1/C,z=S*L-2*u(C)-t,O=S*A*P-2*i(A)-e,D=v&&w*k*d*M/v,F=(T*g*x+k)/(2*(x+T*g*k)*(x+T*g*k)*k),B=-.5*A*S*S*S,N=B*D,j=B*F,U=(U=2*x+T*k*(g-d))*U*C,V=(T*g*x*k+b)/U,q=-T*d*v/(k*U),H=L*N-2*V/C+S*(V+V/E),G=L*j-2*q/C+S*(q+q/E),Z=A*P*N-2*D/(1+M)+S*P*D+S*A*(V-V/E),W=A*P*j-2*F/(1+M)+S*P*F+S*A*(q-q/E),Y=G*Z-W*H;if(!Y)break;var X=(O*G-z*W)/Y,$=(z*Z-O*H)/Y;a-=X,s=c(-_,h(_,s-$))}while((n(X)>y||n($)>y)&&--l>0);return n(n(s)-_)<y?[0,s]:l&&[a,s]};var Tt=o(35*S);function kt(t,e){var r=g(e/2);return[t*Tt*I(1-r*r),(1+Tt)*r]}function At(t,e){var r=e/2,n=o(r);return[2*t/k*o(e)*n*n,k*g(r)]}function Mt(t){var e=1-t,r=i(x,0)[0]-i(-x,0)[0],n=I(2*(i(0,_)[1]-i(0,-_)[1])/r);function i(r,n){var i=o(n),a=m(n);return[i/(e+t*i)*r,e*n+t*a]}function a(t,e){var r=i(t,e);return[r[0]*n,r[1]/n]}function s(t){return a(0,t)[1]}return a.invert=function(r,i){var a=q(s,i);return[r/n*(t+e/o(a)),a]},a}function St(t){return[t[0]/2,E(g(t[1]/2*S))*M]}function Et(t){return[2*t[0],2*i(m(t[1]*S))*M]}function Ct(t,r){var i=2*x/r,s=t*t;function l(r,l){var u=e.geoAzimuthalEquidistantRaw(r,l),c=u[0],h=u[1],f=c*c+h*h;if(f>s){var d=I(f),g=a(h,c),v=i*p(g/i),b=g-v,w=t*o(b),T=(t*m(b)-b*m(w))/(_-w),k=It(b,T),A=(x-t)/Lt(k,w,x);c=d;var M,S=50;do{c-=M=(t+Lt(k,w,c)*A-d)/(k(c)*A)}while(n(M)>y&&--S>0);h=b*m(c),c<_&&(h-=T*(c-_));var E=m(v),C=o(v);u[0]=c*C-h*E,u[1]=c*E+h*C}return u}return l.invert=function(r,l){var u=r*r+l*l;if(u>s){var c=I(u),h=a(l,r),f=i*p(h/i),d=h-f;r=c*o(d),l=c*m(d);for(var g=r-_,y=m(r),b=l/y,w=r<_?1/0:0,T=10;;){var k=t*m(b),A=t*o(b),M=m(A),S=_-A,E=(k-b*M)/S,C=It(b,E);if(n(w)<v||! --T)break;b-=w=(b*y-E*g-l)/(y-2*g*(S*(A+b*k*o(A)-M)-k*(k-b*M))/(S*S))}r=(c=t+Lt(C,A,r)*(x-t)/Lt(C,A,x))*o(h=f+b),l=c*m(h)}return e.geoAzimuthalEquidistantRaw.invert(r,l)},l}function It(t,e){return function(r){var n=t*o(r);return r<_&&(n-=e),I(1+n*n)}}function Lt(t,e,r){for(var n=(r-e)/50,i=t(e)+t(r),a=1,o=e;a<50;++a)i+=2*t(o+=n);return.5*i*n}function Pt(t,e,r,i,a,s,l,u){function c(n,c){if(!c)return[t*n/x,0];var h=c*c,f=t+h*(e+h*(r+h*i)),p=c*(a-1+h*(s-u+h*l)),d=(f*f+p*p)/(2*p),g=n*E(f/d)/x;return[d*m(g),c*(1+h*u)+d*(1-o(g))]}return arguments.length<8&&(u=0),c.invert=function(c,h){var f,p,d=x*c/t,g=h,v=50;do{var _=g*g,b=t+_*(e+_*(r+_*i)),w=g*(a-1+_*(s-u+_*l)),T=b*b+w*w,k=2*w,A=T/k,M=A*A,S=E(b/A)/x,C=d*S,L=b*b,P=(2*e+_*(4*r+6*_*i))*g,z=a+_*(3*s+5*_*l),O=(2*(b*P+w*(z-1))*k-T*(2*(z-1)))/(k*k),D=o(C),R=m(C),F=A*D,B=A*R,N=d/x*(1/I(1-L/M))*(P*A-b*O)/M,j=B-c,U=g*(1+_*u)+A-F-h,V=O*R+F*N,q=F*S,H=1+O-(O*D-B*N),G=B*S,Z=V*G-H*q;if(!Z)break;d-=f=(U*V-j*H)/Z,g-=p=(j*G-U*q)/Z}while((n(f)>y||n(p)>y)&&--v>0);return[d,g]},c}kt.invert=function(t,e){var r=e/(1+Tt);return[t&&t/(Tt*I(1-r*r)),2*i(r)]},At.invert=function(t,e){var r=i(e/k),n=o(r),a=2*r;return[t*k/2/(o(a)*n*n),a]};var zt=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Ot=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Dt=Pt(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Rt(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Rt.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>y&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var Ft=Pt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Bt(t){var e=t(_,0)[0]-t(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*x,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function Nt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,u=m(t)*s,c=m(i*e);t=n(a(u,c)),e=E(l),n(t-_)>y&&(t%=_);var h=function(t,e){if(e===_)return[0,0];var r,i,a=m(e),s=a*a,l=s*s,u=1+l,c=1+3*l,h=1-l,f=E(1/I(u)),p=h+s*u*f,d=(1-a)/p,g=I(d),v=d*u,b=I(v),w=g*h;if(0===t)return[0,-(w+s*b)];var T,k=o(e),A=1/k,M=2*a*k,S=(-3*s+f*c)*M,C=(-p*k-(1-a)*S)/(p*p),L=h*(.5*C/g)-2*s*g*M,P=s*u*C+d*c*M,z=-A*M,O=-A*P,D=-2*A*L,R=4*t/x;if(t>.222*x||e<x/4&&t>.175*x){if(r=(w+s*I(v*(1+l)-w*w))/(1+l),t>x/4)return[r,r];var F=r,B=.5*r;r=.5*(B+F),i=50;do{var N=r*(D+z*I(v-r*r))+O*E(r/b)-R;if(!N)break;N<0?B=r:F=r,r=.5*(B+F)}while(n(F-B)>y&&--i>0)}else{r=y,i=25;do{var j=r*r,U=I(v-j),V=D+z*U,q=r*V+O*E(r/b)-R;r-=T=U?q/(V+(O-z*j)/U):0}while(n(T)>y&&--i>0)}return[r,-w-s*I(v-r*r)]}(t>x/4?_-t:t,e);return t>x/4&&(c=h[0],h[0]=-h[1],h[1]=-c),h[0]*=r,h[1]*=-i,h}function jt(t,e){var r,a,l,u,c;if(e<y)return[(u=m(t))-(r=e*(t-u*(a=o(t)))/4)*a,a+r*u,1-e*u*u/2,t-r];if(e>=1-y)return r=(1-e)/4,a=P(t),u=function(t){return((t=s(2*t))-1)/(t+1)}(t),l=1/a,[u+r*((c=a*L(t))-t)/(a*a),l-r*u*l*(c-t),l+r*u*l*(c+t),2*i(s(t))-_+r*(c-t)/a];var h=[1,0,0,0,0,0,0,0,0],f=[I(e),0,0,0,0,0,0,0,0],p=0;for(a=I(1-e),c=1;n(f[p]/h[p])>y&&p<8;)r=h[p++],f[p]=(r-a)/2,h[p]=(r+a)/2,a=I(r*a),c*=2;l=c*h[p]*t;do{l=(E(u=f[p]*m(a=l)/h[p])+l)/2}while(--p);return[m(l),u=o(l),u/o(l-a),l]}function Ut(t,e){if(!e)return t;if(1===e)return u(g(t/2+b));for(var r=1,a=I(1-e),o=I(e),s=0;n(o)>y;s++){if(t%x){var l=i(a*g(t)/r);l<0&&(l+=x),t+=l+~~(t/x)*x}else t+=t;o=(r+a)/2,a=I(r*a),o=((r=o)-a)/2}return t/(f(2,s)*r)}function Vt(t,e){var r=(T-1)/(T+1),l=I(1-r*r),c=Ut(_,l*l),h=u(g(x/4+n(e)/2)),f=s(-1*h)/I(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?_:-_)-a(i,2*t)),-.25*u(i*i+4*r)+.5*u(n*n+r)]}(f*o(-1*t),f*m(-1*t)),y=function(t,e,r){var a=n(t),o=L(n(e));if(a){var s=1/m(a),l=1/(g(a)*g(a)),u=-(l+r*(o*o*s*s)-1+r),c=(-u+I(u*u-(r-1)*l*4))/2;return[Ut(i(1/I(c)),r)*d(t),Ut(i(I((c/l-1)/r)),1-r)*d(e)]}return[0,Ut(i(o),1-r)*d(e)]}(p[0],p[1],l*l);return[-y[1],(e>=0?1:-1)*(.5*c-y[0])]}function qt(t){var e=m(t),r=o(t),i=Ht(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=m(a),u=o(a),c=o(t),h=C(e*l+r*u*c),f=m(h),p=n(f)>y?h/f:1;return[p*r*m(t),(n(t)>_?p:-p)*(e*u-r*l*c)]}return i.invert=Ht(-t),s.invert=function(t,r){var n=I(t*t+r*r),s=-m(n),l=o(n),u=n*l,c=-r*s,h=n*e,f=I(u*u+c*c-h*h),p=a(u*h+c*f,c*h-u*f),d=(n>_?-1:1)*a(t*s,n*o(p)*l+r*m(p)*s);return i.invert(d,p)},s}function Ht(t){var e=m(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=m(t)*i,u=m(n);return[a(l,s*r-u*e),E(u*r+s*e)]}}Nt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),i=d(e),s=-r*t,l=-i*e,u=l/s<1,c=function(t,e){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,u=I(a),c=E(1/I(1+l)),h=1-l+a*(1+l)*c,f=(1-u)/h,p=I(f),d=f*(1+l),m=p*(1-l),g=I(d-t*t),y=e+m+a*g;if(n(i-r)<v||0===--s||0===y)break;y>0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var _=E(u),b=o(_),w=1/b,T=2*u*b,k=(-3*a+c*(1+3*l))*T,A=(-h*b-(1-u)*k)/(h*h),M=.5*A/p*(1-l)-2*a*p*T,S=-w*(a*(1+l)*A+f*(1+3*l)*T);return[x/4*(t*(-2*w*M+-w*T*g)+S*E(t/I(d))),_]}(u?l:s,u?s:l),h=c[0],f=c[1],p=o(f);return u&&(h=-_-h),[r*(a(m(h)*p,-m(f))+x),i*E(o(h)*p)]},Vt.invert=function(t,e){var r=(T-1)/(T+1),n=I(1-r*r),o=function(t,e,r){var n,i,a;return t?(n=jt(t,r),e?(a=(i=jt(e,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=jt(e,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Ut(_,n*n)-e,-t,n*n),l=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(o[0],o[1]);return[a(l[1],l[0])/-1,2*i(s(-.5*u(r*l[0]*l[0]+r*l[1]*l[1])))-_]};var Gt=E(1-1/3)*M,Zt=pt(0);function Wt(t){var e=Gt*S,r=ut(x,e)[0]-ut(-x,e)[0],i=Zt(0,e)[1],a=ut(0,e)[1],o=k-a,s=A/t,u=4/A,f=i+o*o*4/A;function p(p,d){var m,g=n(d);if(g>e){var y=h(t-1,c(0,l((p+x)/s)));(m=ut(p+=x*(t-1)/t-y*s,g))[0]=m[0]*A/r-A*(t-1)/(2*t)+y*A/t,m[1]=i+4*(m[1]-a)*o/A,d<0&&(m[1]=-m[1])}else m=Zt(p,d);return m[0]*=u,m[1]/=f,m}return p.invert=function(e,p){e/=u;var d=n(p*=f);if(d>i){var m=h(t-1,c(0,l((e+x)/s)));e=(e+x*(t-1)/t-m*s)*r/A;var g=ut.invert(e,.25*(d-i)*A/o+a);return g[0]-=x*(t-1)/t-m*s,p<0&&(g[1]=-g[1]),g}return Zt.invert(e,p)},p}function Yt(t,e){return[t,1&e?90-y:Gt]}function Xt(t,e){return[t,1&e?-90+y:-Gt]}function $t(t){return[t[0]*(1-y),t[1]]}function Jt(t){var e,r=1+t,i=E(m(1/r)),s=2*I(x/(e=x+4*i*r)),l=.5*s*(r+I(t*(2+t))),u=t*t,c=r*r;function h(h,f){var p,d,g=1-m(f);if(g&&g<2){var y,b=_-f,w=25;do{var T=m(b),k=o(b),A=i+a(T,r-k),M=1+c-2*r*k;b-=y=(b-u*i-r*T+M*A-.5*g*e)/(2*r*T*A)}while(n(y)>v&&--w>0);p=s*I(M),d=h*A/x}else p=s*(t+g),d=h*i/x;return[p*m(d),l-p*o(d)]}return h.invert=function(t,n){var o=t*t+(n-=l)*n,h=(1+c-o/(s*s))/(2*r),f=C(h),p=m(f),d=i+a(p,r-h);return[E(t/I(o))*x/d,E(1-2*(f-u*i-r*p+(1+c-2*r*h)*d)/e)]},h}var Kt=.7109889596207567,Qt=.0528035274542;function te(t,e){return e>-Kt?((t=Y(t,e))[1]+=Qt,t):Q(t,e)}function ee(t,e){return n(e)>Kt?((t=Y(t,e))[1]-=e>0?Qt:-Qt,t):Q(t,e)}function re(t,e,r,n){var i=I(4*x/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),a=I(n*m(r)*I((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*u(1);function l(r){return I(1+t*o(2*r)+e*o(4*r))}function u(n){var i=n*r;return(2*i+(1+t-e/2)*m(2*i)+(t+e)/2*m(4*i)+e/2*m(6*i))/r}function c(t){return l(t)*m(t)}var h=function(t,e){var n=r*q(u,s*m(e)/r,e/x);isNaN(n)&&(n=r*d(e));var c=i*l(n);return[c*a*t/x*o(n),c/a*m(n)]};return h.invert=function(t,e){var n=q(c,e*a/i);return[t*x/(o(n)*i*a*l(n)),E(r*u(n/r)/s)]},0===r&&(i=I(n/x),(h=function(t,e){return[t*i,m(e)/i]}).invert=function(t,e){return[t/i,E(e*i)]}),h}function ne(t,e,r,n,i,a,o,s,l,u,c){if(c.nanEncountered)return NaN;var h,f,p,d,m,g,y,v,x,_;if(f=t(e+.25*(h=r-e)),p=t(r-.25*h),isNaN(f))c.nanEncountered=!0;else{if(!isNaN(p))return _=((g=(d=h*(n+4*f+i)/12)+(m=h*(i+4*p+a)/12))-o)/15,u>l?(c.maxDepthCount++,g+_):Math.abs(_)<s?g+_:(v=ne(t,e,y=e+.5*h,n,f,i,d,.5*s,l,u+1,c),isNaN(v)?(c.nanEncountered=!0,NaN):(x=ne(t,y,r,i,p,a,m,.5*s,l,u+1,c),isNaN(x)?(c.nanEncountered=!0,NaN):v+x));c.nanEncountered=!0}}function ie(t,e,r,n,i){void 0===i&&(i=20);var a=t(e),o=t(.5*(e+r)),s=t(r);return ne(t,e,r,a,o,s,(a+4*o+s)*(r-e)/6,n,i,1,{maxDepthCount:0,nanEncountered:!1})}function ae(t,e,r){function i(r){return t+(1-t)*f(1-f(r,e),1/e)}function a(t){return ie(i,0,t,1e-4)}for(var o=1/a(1),s=1e3,l=(1+1e-8)*o,u=[],c=0;c<=s;c++)u.push(a(c/s)*l);function h(t){var e=0,r=s,n=500;do{u[n]>t?r=n:e=n,n=e+r>>1}while(n>e);var i=u[n+1]-u[n];return i&&(i=(t-u[n+1])/i),(n+1+i)/s}var p=2*h(1)/x*o/r,g=function(t,e){var r=h(n(m(e))),a=i(r)*t;return r/=p,[a,e>=0?r:-r]};return g.invert=function(t,e){var r;return n(e*=p)<1&&(r=d(e)*E(a(n(e))*o)),[t/i(n(e)),r]},g}function oe(t,e){return n(t[0]-e[0])<y&&n(t[1]-e[1])<y}function se(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){n=((r=t[a])[0]-s[0])/e,i=(r[1]-s[1])/e;for(var u=0;u<e;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function le(t,n,i){var a,o;function s(e,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;o<s&&e>a[o][2][0];++o);var l=t(e-a[o][1][0],r);return l[0]+=t(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):t.invert&&(s.invert=function(e,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,u=i.length;l<u;++l){var c=i[l];if(c[0][0]<=e&&e<c[1][0]&&c[0][1]<=r&&r<c[1][1]){var h=t.invert(e-t(a[l][1][0],0)[0],r);return h[0]+=a[l][1][0],oe(s(h[0],h[1]),[e,r])?h:null}}});var l=e.geoProjection(s),u=l.stream;return l.stream=function(t){var r=l.rotate(),n=u(t),i=(l.rotate([0,0]),u(t));return l.rotate(r),n.sphere=function(){e.geoStream(a,i)},n},l.lobes=function(e){return arguments.length?(a=function(t){var e,n,i,a,o,s,l,u=[],c=t[0].length;for(l=0;l<c;++l)n=(e=t[0][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],u.push(se([[n+y,i+y],[n+y,a-y],[o-y,a-y],[o-y,s+y]],30));for(l=t[1].length-1;l>=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],u.push(se([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(u)]}}(e),n=e.map(function(t){return t.map(function(t){return[[t[0][0]*S,t[0][1]*S],[t[1][0]*S,t[1][1]*S],[t[2][0]*S,t[2][1]*S]]})}),o=n.map(function(e){return e.map(function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),l):n.map(function(t){return t.map(function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]})})},null!=n&&l.lobes(n),l}te.invert=function(t,e){return e>-Kt?Y.invert(t,e-Qt):Q.invert(t,e)},ee.invert=function(t,e){return n(e)>Kt?Y.invert(t,e+(e>0?Qt:-Qt)):Q.invert(t,e)};var ue=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ce=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],he=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],pe=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],de=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function me(t,e){return[3/A*t*I(x*x/3-e*e),e]}function ge(t){function e(e,r){if(n(n(r)-_)<y)return[0,r<0?-2:2];var i=m(r),a=f((1+i)/(1-i),t/2),s=.5*(a+1/a)+o(e*=t);return[2*m(e)/s,(a-1/a)/s]}return e.invert=function(e,r){var i=n(r);if(n(i-2)<y)return e?null:[0,d(r)*_];if(i>2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=f((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,E((l-1)/(l+1))]},e}me.invert=function(t,e){return[A/3*t/I(x*x/3-e*e),e]};var ye=x/T;function ve(t,e){return[t*(1+I(o(e)))/2,e/(o(e/2)*o(t/6))]}function xe(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function _e(t,e){return[m(t)/o(e),g(e)*o(t)]}function be(t){var e=o(t),r=g(b+t/2);function i(i,a){var o=a-t,s=n(o)<y?i*e:n(s=b+a/2)<y||n(n(s)-_)<y?0:i*o/u(g(s)/r);return[s,o]}return i.invert=function(i,a){var o,s=a+t;return[n(a)<y?i/e:n(o=b+s/2)<y||n(n(o)-_)<y?0:i*u(g(o)/r)/a,s]},i}function we(t,e){return[t,1.25*u(g(b+.4*e))]}function Te(t){var e=t.length-1;function r(r,n){for(var i,a=o(n),s=2/(1+a*o(r)),l=s*a*m(r),u=s*m(n),c=e,h=t[c],f=h[0],p=h[1];--c>=0;)f=(h=t[c])[0]+l*(i=f)-u*p,p=h[1]+l*p+u*i;return[f=l*(i=f)-u*p,p=l*p+u*i]}return r.invert=function(r,s){var l=20,u=r,c=s;do{for(var h,f=e,p=t[f],d=p[0],g=p[1],v=0,x=0;--f>=0;)v=d+u*(h=v)-c*x,x=g+u*x+c*h,d=(p=t[f])[0]+u*(h=d)-c*g,g=p[1]+u*g+c*h;var _,b,w=(v=d+u*(h=v)-c*x)*v+(x=g+u*x+c*h)*x;u-=_=((d=u*(h=d)-c*g-r)*v+(g=u*g+c*h-s)*x)/w,c-=b=(g*v-d*x)/w}while(n(_)+n(b)>y*y&&--l>0);if(l){var T=I(u*u+c*c),k=2*i(.5*T),A=m(k);return[a(u*A,T*o(k)),T?E(c*A/T):0]}},r}ve.invert=function(t,e){var r=n(t),i=n(e),a=y,s=_;i<ye?s*=i/ye:a+=6*C(ye/i);for(var l=0;l<25;l++){var u=m(s),c=I(o(s)),h=m(s/2),f=o(s/2),p=m(a/6),d=o(a/6),g=.5*a*(1+c)-r,v=s/(f*d)-i,x=c?-.25*a*u/c:0,b=.5*(1+c),w=(1+.5*s*h/f)/(f*d),T=s/f*(p/6)/(d*d),k=x*T-w*b,A=(g*T-v*b)/k,M=(v*x-g*w)/k;if(s-=A,a-=M,n(A)<y&&n(M)<y)break}return[t<0?-a:a,e<0?-s:s]},xe.invert=function(t,e){var r=d(t)*x,i=e/2,a=50;do{var o=r*r,s=i*i,l=r*i,u=r*(.975534+s*(-.0143059*o-.119161+-.0547009*s))-t,c=i*(1.00384+o*(.0802894+-.02855*s+199025e-9*o)+s*(.0998909+-.0491032*s))-e,h=.975534-s*(.119161+3*o*.0143059+.0547009*s),f=-l*(.238322+.2188036*s+.0286118*o),p=l*(.1605788+7961e-7*o+-.0571*s),m=1.00384+o*(.0802894+199025e-9*o)+s*(3*(.0998909-.02855*o)-.245516*s),g=f*p-m*h,v=(c*f-u*m)/g,_=(u*p-c*h)/g;r-=v,i-=_}while((n(v)>y||n(_)>y)&&--a>0);return a&&[r,i]},_e.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?w*I((i-I(i*i-4*r))/r):1/I(n);return[E(t*a),d(e)*C(a)]},we.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*x]};var ke=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Ae=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Me=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Se=[[.9245,0],[0,0],[.01943,0]],Ee=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ce(t,r){var n=e.geoProjection(Te(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Ie=I(6),Le=I(7);function Pe(t,e){var r=E(7*m(e)/(3*Ie));return[Ie*t*(2*o(2*r/3)-1)/Le,9*m(r/3)/Le]}function ze(t,e){for(var r,i=(1+w)*m(e),a=e,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)<y));s++);return[t*(1+2*o(a)/o(a/2))/(3*T),2*I(3)*m(a/2)/I(2+T)]}function Oe(t,e){for(var r,i=I(6/(4+x)),a=(1+x/4)*m(e),s=e/2,l=0;l<25&&(s-=r=(s/2+m(s)-a)/(.5+o(s)),!(n(r)<y));l++);return[i*(.5+o(s))*t/1.5,i*s]}function De(t,e){var r=e*e,n=r*r,i=r*n;return[t*(.84719-.13063*r+i*i*(.05494*r-.04515-.02326*n+.00331*i)),e*(1.01183+n*n*(.01926*r-.02625-.00396*n))]}function Re(t,e){return[t*(1+o(e))/2,2*(e-g(e/2))]}Pe.invert=function(t,e){var r=3*E(e*Le/9);return[t*Le/(Ie*(2*o(2*r/3)-1)),E(3*m(r)*Ie/7)]},ze.invert=function(t,e){var r=e*I(2+T)/(2*I(3)),n=2*E(r);return[3*T*t/(1+2*o(n)/o(n/2)),E((r+m(n))/(1+w))]},Oe.invert=function(t,e){var r=I(6/(4+x)),i=e/r;return n(n(i)-_)<y&&(i=i<0?-_:_),[1.5*t/(r*(.5+o(i))),E((i/2+m(i))/(1+x/4))]},De.invert=function(t,e){var r,i,a,o,s=e,l=25;do{s-=r=(s*(1.01183+(a=(i=s*s)*i)*a*(.01926*i-.02625-.00396*a))-e)/(1.01183+a*a*(.21186*i-.23625+-.05148*a))}while(n(r)>v&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Re.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(e/2);e-=a=(e-g(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var Fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Be(t,e){var r=m(e),i=o(e),a=d(t);if(0===t||n(e)===_)return[0,e];if(0===e)return[t,0];if(n(t)===_)return[t*i,_*r];var s=x/(2*t)-2*t/x,l=2*e/x,u=(1-l*l)/(r-l),c=s*s,h=u*u,f=1+c/h,p=1+h/c,g=(s*r/u-s/2)/f,y=(h*r/c+u/2)/p,v=y*y-(h*r*r/c+u*r-1)/p;return[_*(g+I(g*g+i*i/f)*a),_*(y+I(v<0?0:v)*d(-e*s)*a)]}Be.invert=function(t,e){var r=(t/=_)*t,n=r+(e/=_)*e,i=x*x;return[t?(n-1+I((1-n)*(1-n)+4*r))/(2*t)*_:0,q(function(t){return n*(x*m(t)-2*t)*x+4*t*t*(e-m(t))+2*x*t-i*e},0)]};var Ne=1.0148,je=.23185,Ue=-.14499,Ve=.02406,qe=Ne,He=5*je,Ge=7*Ue,Ze=1.790857183;function We(t,e){var r=e*e;return[t,e*(Ne+r*r*(je+r*(Ue+Ve*r)))]}function Ye(t,e){if(n(e)<y)return[t,0];var r=g(e),i=t*m(e);return[m(i)/r,e+(1-o(i))/r]}function Xe(t,e){var r=Je(t[1],t[0]),n=Je(e[1],e[0]),i=function(t,e){return a(t[0]*e[1]-t[1]*e[0],t[0]*e[0]+t[1]*e[1])}(r,n),s=Ke(r)/Ke(n);return $e([1,0,t[0][0],0,1,t[0][1]],$e([s,0,0,0,s,0],$e([o(i),m(i),0,-m(i),o(i),0],[1,0,-e[0][0],0,1,-e[0][1]])))}function $e(t,e){return[t[0]*e[0]+t[1]*e[3],t[0]*e[1]+t[1]*e[4],t[0]*e[2]+t[1]*e[5]+t[2],t[3]*e[0]+t[4]*e[3],t[3]*e[1]+t[4]*e[4],t[3]*e[2]+t[4]*e[5]+t[5]]}function Je(t,e){return[t[0]-e[0],t[1]-e[1]]}function Ke(t){return I(t[0]*t[0]+t[1]*t[1])}function Qe(t,r,n){function i(t,e){var n,i=r(t,e),a=i.project([t*M,e*M]);return(n=i.transform)?[n[0]*a[0]+n[1]*a[1]+n[2],-(n[3]*a[0]+n[4]*a[1]+n[5])]:(a[1]=-a[1],a)}function a(t,e){var n=t.project.invert,i=t.transform,o=e;if(i&&(i=function(t){var e=1/(t[0]*t[4]-t[1]*t[3]);return[e*t[4],-e*t[1],e*(t[1]*t[5]-t[2]*t[4]),-e*t[3],e*t[0],e*(t[2]*t[3]-t[0]*t[5])]}(i),o=[i[0]*o[0]+i[1]*o[1]+i[2],i[3]*o[0]+i[4]*o[1]+i[5]]),n&&t===function(t){return r(t[0]*S,t[1]*S)}(s=n(o)))return s;for(var s,l=t.children,u=0,c=l&&l.length;u<c;++u)if(s=a(l[u],e))return s}!function t(e,r){if(e.edges=function(t){for(var e=t.length,r=[],n=t[e-1],i=0;i<e;++i)r.push([n,n=t[i]]);return r}(e.face),r.face){var n=e.shared=function(t,e){for(var r,n,i=t.length,a=null,o=0;o<i;++o){r=t[o];for(var s=e.length;--s>=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=Xe(n.map(r.project),n.map(e.project));e.transform=r.transform?$e(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o<s;++o)er(n[0],a[o][1])&&er(n[1],a[o][0])&&(a[o]=e),er(n[0],a[o][0])&&er(n[1],a[o][1])&&(a[o]=e);for(o=0,s=(a=e.edges).length;o<s;++o)er(n[0],a[o][0])&&er(n[1],a[o][1])&&(a[o]=r),er(n[0],a[o][1])&&er(n[1],a[o][0])&&(a[o]=r)}else e.transform=r.transform;return e.children&&e.children.forEach(function(r){t(r,e)}),e}(t,{transform:null}),rr(t)&&(i.invert=function(e,r){var n=a(t,[e,-r]);return n&&(n[0]*=S,n[1]*=S,n)});var o=e.geoProjection(i),s=o.stream;return o.stream=function(e){var r=o.rotate(),n=s(e),i=(o.rotate([0,0]),s(e));return o.rotate(r),n.sphere=function(){i.polygonStart(),i.lineStart(),tr(i,t),i.lineEnd(),i.polygonEnd()},n},o.angle(null==n?-30:n*M)}function tr(t,r,i){var a,o,s=r.edges,l=s.length,u={type:"MultiPoint",coordinates:r.face},c=r.face.filter(function(t){return 90!==n(t[1])}),h=e.geoBounds({type:"MultiPoint",coordinates:c}),f=!1,p=-1,d=h[1][0]-h[0][0],m=180===d||360===d?[(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]:e.geoCentroid(u);if(i)for(;++p<l&&s[p]!==i;);++p;for(var g=0;g<l;++g)o=s[(g+p)%l],Array.isArray(o)?(f||(t.point((a=e.geoInterpolate(o[0],m)(y))[0],a[1]),f=!0),t.point((a=e.geoInterpolate(o[1],m)(y))[0],a[1])):(f=!1,o!==i&&tr(t,o,r))}function er(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}function rr(t){return t.project.invert||t.children&&t.children.some(rr)}We.invert=function(t,e){e>Ze?e=Ze:e<-Ze&&(e=-Ze);var r,i=e;do{var a=i*i;i-=r=(i*(Ne+a*a*(je+a*(Ue+Ve*a)))-e)/(qe+a*a*(He+a*(Ge+.21654*a)))}while(n(r)>y);return[t,i]},Ye.invert=function(t,e){if(n(e)<y)return[t,0];var r,i=t*t+e*e,a=.5*e,s=10;do{var l=g(a),u=1/o(a),c=i-2*e*a+a*a;a-=r=(l*c+2*(a-e))/(2+c*u*u+2*(a-e)*l)}while(n(r)>y&&--s>0);return l=g(a),[(n(e)<n(a+1/l)?E(t*l):d(e)*d(t)*(C(n(t*l))+_))/m(a),a]};var nr=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],ir=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(t){return t.map(function(t){return nr[t]})}),ar=2/I(3);function or(t,e){var r=ut(t,e);return[r[0]*ar,r[1]]}function sr(t,e){for(var r=0,n=t.length,i=0;r<n;++r)i+=t[r]*e[r];return i}function lr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ur(t){return[a(t[1],t[0])*M,E(c(-1,h(1,t[2])))*M]}function cr(t){var e=t[0]*S,r=t[1]*S,n=o(r);return[n*o(e),n*m(e),m(r)]}function hr(){}function fr(t,e){return{type:"FeatureCollection",features:t.features.map(function(t){return pr(t,e)})}}function pr(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:dr(t.geometry,e)}}function dr(t,r){if(!t)return null;if("GeometryCollection"===t.type)return function(t,e){return{type:"GeometryCollection",geometries:t.geometries.map(function(t){return dr(t,e)})}}(t,r);var n;switch(t.type){case"Point":case"MultiPoint":n=yr;break;case"LineString":case"MultiLineString":n=vr;break;case"Polygon":case"MultiPolygon":case"Sphere":n=xr;break;default:return null}return e.geoStream(t,r(n)),n.result()}or.invert=function(t,e){return ut.invert(t/ar,e)};var mr=[],gr=[],yr={point:function(t,e){mr.push([t,e])},result:function(){var t=mr.length?mr.length<2?{type:"Point",coordinates:mr[0]}:{type:"MultiPoint",coordinates:mr}:null;return mr=[],t}},vr={lineStart:hr,point:function(t,e){mr.push([t,e])},lineEnd:function(){mr.length&&(gr.push(mr),mr=[])},result:function(){var t=gr.length?gr.length<2?{type:"LineString",coordinates:gr[0]}:{type:"MultiLineString",coordinates:gr}:null;return gr=[],t}},xr={polygonStart:hr,lineStart:hr,point:function(t,e){mr.push([t,e])},lineEnd:function(){var t=mr.length;if(t){do{mr.push(mr[0].slice())}while(++t<4);gr.push(mr),mr=[]}},polygonEnd:hr,result:function(){if(!gr.length)return null;var t=[],e=[];return gr.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}(r)?e.push(r):t.push([r])}),e.forEach(function(e){var r=e[0];t.some(function(t){if(function(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],p=h[1];c>n^p>n&&r<(f-u)*(n-c)/(p-c)+u&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),gr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function _r(t){var r=t(_,0)[0]-t(-_,0)[0];function i(e,i){var a=n(e)<_,o=t(a?e:e>0?e-x:e+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var u=r*w,c=s>0^l>0?-1:1;return[c*s-d(l)*u,c*l-d(s)*u]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*w,o=(i-e)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,u=a>0^o>0?-1:1,c=-u*e+(o>0?1:-1)*l,h=-u*i+(a>0?1:-1)*l;a=(-c-h)*w,o=(c-h)*w}var f=t.invert(a,o);return s||(f[0]+=a>0?x:-x),f}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function br(){return _r(Vt).scale(111.48)}function wr(t){var e=m(t);function r(r,n){var a=e?g(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)<y)return[e?2*i(e*r/2)/e:r,0];var s,l=r*r+a*a,u=0,c=10;do{var h=g(u),f=1/o(u),p=l-2*a*u+u*u;u-=s=(h*p+2*(u-a))/(2+p*f*f+2*(u-a)*h)}while(n(s)>y&&--c>0);var d=r*(h=g(u)),v=g(n(a)<n(u+1/h)?.5*E(d):.5*C(d)+x/4)/m(u);return[e?2*i(e*v)/e:2*v,u]},r}var Tr=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function kr(t,e){var r,i=h(18,36*n(e)/x),a=l(i),o=i-a,s=(r=Tr[a])[0],u=r[1],c=(r=Tr[++a])[0],f=r[1],p=(r=Tr[h(19,++a)])[0],d=r[1];return[t*(c+o*(p-s)/2+o*o*(p-2*c+s)/2),(e>0?_:-_)*(f+o*(d-u)/2+o*o*(d-2*f+u)/2)]}function Ar(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*m(e),i*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=I(n),o=(t-I(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*I(1-o*o)),i?E(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=m(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}Tr.forEach(function(t){t[1]*=1.0144}),kr.invert=function(t,e){var r=e/_,i=90*r,a=h(18,n(i/5)),o=c(0,l(a));do{var s=Tr[o][1],u=Tr[o+1][1],f=Tr[h(19,o+2)][1],p=f-s,d=f-2*u+s,m=2*(n(r)-u)/p,g=d/p,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(e>=0?5:-5)*(y+a);var x,b=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=Tr[o][1],u=Tr[o+1][1],f=Tr[h(19,o+2)][1],i-=(x=(e>=0?_:-_)*(u+y*(f-s)/2+y*y*(f-2*u+s)/2)-e)*M}while(n(x)>v&&--b>0);break}}while(--o>=0);var w=Tr[o][0],T=Tr[o+1][0],k=Tr[h(19,o+2)][0];return[t/(T+y*(k-w)/2+y*y*(k-2*T+w)/2),i*S]};var Mr=1e-4,Sr=-180,Er=Sr+Mr,Cr=180-Mr,Ir=-90+Mr,Lr=90-Mr;function Pr(t){return t.length>0}function zr(t){return Math.floor(1e4*t)/1e4}function Or(t){return-90===t||90===t?[0,t]:[Sr,zr(t)]}function Dr(t){var e=t[0],r=t[1],n=!1;return e<=Er?(e=Sr,n=!0):e>=Cr&&(e=180,n=!0),r<=Ir?(r=-90,n=!0):r>=Lr&&(r=90,n=!0),n?[e,r]:t}function Rr(t){return t.map(Dr)}function Fr(t,e,r){for(var n=0,i=t.length;n<i;++n){var a=t[n].slice();r.push({index:-1,polygon:e,ring:a});for(var o=0,s=a.length;o<s;++o){var l=a[o],u=l[0],c=l[1];if(u<=Er||u>=Cr||c<=Ir||c>=Lr){a[o]=Dr(l);for(var h=o+1;h<s;++h){var f=a[h],p=f[0],d=f[1];if(p>Er&&p<Cr&&d>Ir&&d<Lr)break}if(h===o+1)continue;if(o){var m={index:-1,polygon:e,ring:a.slice(0,o+1)};m.ring[m.ring.length-1]=Or(c),r[r.length-1]=m}else r.pop();if(h>=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(h-1)}),a[0]=Or(a[0][1]),o=-1,s=a.length}}}}function Br(t){var e,r,n,i,a,o,s=t.length,l={},u={};for(e=0;e<s;++e)n=(r=t[e]).ring[0],a=r.ring[r.ring.length-1],n[0]!==a[0]||n[1]!==a[1]?(r.index=e,l[n]=u[a]=r):(r.polygon.push(r.ring),t[e]=null);for(e=0;e<s;++e)if(r=t[e]){if(n=r.ring[0],a=r.ring[r.ring.length-1],i=u[n],o=l[a],delete l[n],delete u[a],n[0]===a[0]&&n[1]===a[1]){r.polygon.push(r.ring);continue}i?(delete u[n],delete l[i.ring[0]],i.ring.pop(),t[i.index]=null,r={index:-1,polygon:i.polygon,ring:i.ring.concat(r.ring)},i===o?r.polygon.push(r.ring):(r.index=s++,t.push(l[r.ring[0]]=u[r.ring[r.ring.length-1]]=r))):o?(delete l[a],delete u[o.ring[o.ring.length-1]],r.ring.pop(),r={index:s++,polygon:o.polygon,ring:r.ring.concat(o.ring)},t[o.index]=null,t.push(l[r.ring[0]]=u[r.ring[r.ring.length-1]]=r)):(r.ring.push(r.ring[0]),r.polygon.push(r.ring))}}function Nr(t){var e={type:"Feature",geometry:jr(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}function jr(t){if(null==t)return t;var e,r,n,i;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(jr)};break;case"Point":e={type:"Point",coordinates:Dr(t.coordinates)};break;case"MultiPoint":case"LineString":e={type:t.type,coordinates:Rr(t.coordinates)};break;case"MultiLineString":e={type:"MultiLineString",coordinates:t.coordinates.map(Rr)};break;case"Polygon":var a=[];Fr(t.coordinates,a,r=[]),Br(r),e={type:"Polygon",coordinates:a};break;case"MultiPolygon":r=[],n=-1,i=t.coordinates.length;for(var o=new Array(i);++n<i;)Fr(t.coordinates[n],o[n]=[],r);Br(r),e={type:"MultiPolygon",coordinates:o.filter(Pr)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function Ur(t,e){var r=g(e/2),n=m(b*r);return[t*(.74482-.34588*n*n),1.70711*r]}function Vr(t,r,n){var i=e.geoInterpolate(r,n),a=i(.5),o=e.geoRotation([-a[0],-a[1]])(r),s=i.distance/2,l=-E(m(o[1]*S)/m(s)),u=[-a[0],-a[1],-(o[0]>0?x-l:l)*M],c=e.geoProjection(t(s)).rotate(u),h=e.geoRotation(u),f=c.center;return delete c.rotate,c.center=function(t){return arguments.length?f(h(t)):h.invert(f())},c.clipAngle(90)}function qr(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Hr(t,e){return Vr(qr,t,e)}function Gr(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function u(e,a){var s=C(o(a)*o(e-r)),l=C(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*I(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return u.invert=function(t,e){var i,u,c=e*e,h=o(I(c+(i=t+r)*i)),f=o(I(c+(i=t+n)*i));return[a(u=h-f,i=(h+f)*s),(e<0?-1:1)*C(I(i*i+u*u)*l)]},u}function Zr(t,e){return Vr(Gr,t,e)}function Wr(t,e){if(n(e)<y)return[t,0];var r=n(e/_),i=E(r);if(n(t)<y||n(n(e)-_)<y)return[0,d(e)*x*g(i/2)];var a=o(i),s=n(x/t-t/x)/2,l=s*s,u=a/(r+a-1),c=u*(2/r-1),h=c*c,f=h+l,p=u-h,m=l+u;return[d(t)*x*(s*p+I(l*p*p-f*(u*u-h)))/f,d(e)*x*(c*m-s*I((l+1)*f-m*m))/f]}function Yr(t,e){if(n(e)<y)return[t,0];var r=n(e/_),i=E(r);if(n(t)<y||n(n(e)-_)<y)return[0,d(e)*x*g(i/2)];var a=o(i),s=n(x/t-t/x)/2,l=s*s,u=a*(I(1+l)-s*a)/(1+l*r*r);return[d(t)*x*u,d(e)*x*I(1-u*(2*s+u))]}function Xr(t,e){if(n(e)<y)return[t,0];var r=e/_,i=E(r);if(n(t)<y||n(n(e)-_)<y)return[0,x*g(i/2)];var a=(x/t-t/x)/2,s=r/(1+o(i));return[x*(d(t)*I(a*a+1-s*s)-a),x*s]}function $r(t,e){if(!e)return[t,0];var r=n(e);if(!t||r===_)return[0,e];var i=r/_,a=i*i,o=(8*i-a*(a+2)-5)/(2*a*(i-1)),s=o*o,l=i*o,u=a+s+2*l,c=i+3*o,h=t/_,f=h+1/h,p=d(n(t)-_)*I(f*f-4),m=p*p,g=(p*(u+s-1)+2*I(u*(a+s*m-1)+(1-a)*(a*(c*c+4*s)+12*l*s+4*s*s)))/(4*u+m);return[d(t)*_*g,d(e)*_*I(1+p*n(g)-g*g)]}function Jr(t,e,r,n){var i=x/3;t=c(t,y),e=c(e,y),t=h(t,_),e=h(e,x-y),r=c(r,0),r=h(r,100-y);var s=(n=c(n,y))/100,l=C((r/100+1)*o(i))/i,u=m(t)/m(l*_),f=e/x,p=I(s*m(t/2)/m(e/2));return function(t,e,r,n,i){function s(a,s){var l=r*m(n*s),u=I(1-l*l),c=I(2/(1+u*o(a*=i)));return[t*u*c*m(a),e*l*c]}return s.invert=function(o,s){var l=o/t,u=s/e,c=I(l*l+u*u),h=2*E(c/2);return[a(o*g(h),t*c)/i,c&&E(s*m(h)/(e*r*c))/n]},s}(p/I(f*u*l),1/(p*I(f*u*l)),u,l,f)}function Kr(){var t=65*S,r=60*S,n=20,i=200,a=e.geoProjectionMutator(Jr),o=a(t,r,n,i);return o.poleline=function(e){return arguments.length?a(t=+e*S,r,n,i):t*M},o.parallels=function(e){return arguments.length?a(t,r=+e*S,n,i):r*M},o.inflation=function(e){return arguments.length?a(t,r,n=+e,i):n},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(163.775)}Ur.invert=function(t,e){var r=e/1.70711,n=m(b*r);return[t/(.74482-.34588*n*n),2*i(r)]},Wr.invert=function(t,e){if(n(e)<y)return[t,0];if(n(t)<y)return[0,_*m(2*i(e/x))];var r=(t/=x)*t,a=(e/=x)*e,s=r+a,l=s*s,u=-n(e)*(1+s),c=u-2*a+r,h=-2*u+1+2*a+l,f=a/h+(2*c*c*c/(h*h*h)-9*u*c/(h*h))/27,p=(u-c*c/(3*h))/h,g=2*I(-p/3),v=C(3*f/(p*g))/3;return[x*(s-1+I(1+2*(r-a)+l))/(2*t),d(e)*x*(-g*o(v+x/3)-c/(3*h))]},Yr.invert=function(t,e){if(!t)return[0,_*m(2*i(e/x))];var r=n(t/x),o=(1-r*r-(e/=x)*e)/(2*r),s=I(o*o+1);return[d(t)*x*(s-o),d(e)*_*m(2*a(I((1-2*o*r)*(o+s)-r),I(s+o+r)))]},Xr.invert=function(t,e){if(!e)return[t,0];var r=e/x,n=(x*x*(1-r*r)-t*t)/(2*x*t);return[t?x*(d(t)*I(n*n+1)-n):0,_*m(2*i(r))]},$r.invert=function(t,e){var r;if(!t||!e)return[t,e];e/=x;var i=d(t)*t/_,a=(i*i-1+4*e*e)/n(i),o=a*a,s=2*e,l=50;do{var u=s*s,c=(8*s-u*(u+2)-5)/(2*u*(s-1)),h=(3*s-u*s-10)/(2*u*s),f=c*c,p=s*c,m=s+c,g=m*m,v=s+3*c,b=-2*m*(4*p*f+(1-4*u+3*u*u)*(1+h)+f*(14*u-6-o+(8*u-8-2*o)*h)+p*(12*u-8+(10*u-10-o)*h)),w=I(g*(u+f*o-1)+(1-u)*(u*(v*v+4*f)+f*(12*p+4*f)));s-=r=(a*(g+f-1)+2*w-i*(4*g+o))/(a*(2*c*h+2*m*(1+h))+b/w-8*m*(a*(-1+f+g)+2*w)*(1+h)/(o+4*g))}while(r>y&&--l>0);return[d(t)*(I(a*a+4)+a)*x/4,_*s]};var Qr=4*x+3*I(3),tn=2*I(2*x*I(3)/Qr),en=W(tn*I(3)/x,tn,Qr/6);function rn(t,e){return[t*I(1-3*e*e/(x*x)),e]}function nn(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(m(t)*r,-m(e))),l=m(t);return[l*(r=I(1-n*n))-s*i,-s*r-l*i]}function an(t,e){var r=O(t,e);return[(r[0]+t/_)/2,(r[1]+e)/2]}rn.invert=function(t,e){return[t/I(1-3*e*e/(x*x)),e]},nn.invert=function(t,e){var r=(t*t+e*e)/-2,n=I(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=I(o*o+i*i);return[a(n*i,s*(1+r)),s?-E(n*o/s):0]},an.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),u=m(i),c=m(2*i),h=u*u,f=l*l,p=m(r),d=o(r/2),g=m(r/2),v=g*g,x=1-f*d*d,b=x?C(l*d)*I(s=1/x):s=0,w=.5*(2*b*l*g+r/_)-t,T=.5*(b*u+i)-e,k=.5*s*(f*v+b*l*d*h)+.5/_,A=s*(p*c/4-b*u*g),M=.125*s*(c*g-b*u*f*p),S=.5*s*(h*d+b*v*l)+.5,E=A*M-S*k,L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=_,r=e.geoProjectionMutator(z),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*S):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=z,t.geoAitoff=function(){return e.geoProjection(O).scale(152.63)},t.geoAitoffRaw=O,t.geoArmadillo=function(){var t=20*S,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(D),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=g((r=(t=e*S)>=0?1:-1)*t),i(t)):t*M},s.stream=function(e){var i=s.rotate(),u=l(e),c=(s.rotate([0,0]),l(e)),h=s.precision();return s.rotate(i),u.sphere=function(){c.polygonStart(),c.lineStart();for(var e=-180*r;r*e<180;e+=90*r)c.point(e,90*r);if(t)for(;r*(e-=3*r*h)>=-180;)c.point(e,r*-a(o(e*S/2),n)*M);c.lineEnd(),c.polygonEnd()},u},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=D,t.geoAugust=function(){return e.geoProjection(R).scale(66.1603)},t.geoAugustRaw=R,t.geoBaker=function(){return e.geoProjection(N).scale(112.314)},t.geoBakerRaw=N,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(j),n=r(t),i=n.stream,s=.01,l=-o(s*S),u=m(s*S);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),c=i(e),h=(n.rotate([0,0]),i(e));return n.rotate(r),c.sphere=function(){h.polygonStart(),h.lineStart();for(var e=0,r=360/t,n=2*x/t,i=90-180/t,c=_;e<t;++e,i-=r,c-=n)h.point(a(u*o(c),l)*M,E(u*m(c))*M),i<-90?(h.point(-90,-180-i-s),h.point(-90,-180-i+s)):(h.point(90,i+s),h.point(90,i-s));h.lineEnd(),h.polygonEnd()},c},n.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},t.geoBerghausRaw=j,t.geoBertin1953=function(){return e.geoProjection(G()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])},t.geoBertin1953Raw=G,t.geoBoggs=function(){return e.geoProjection(J).scale(160.857)},t.geoBoggsRaw=J,t.geoBonne=function(){return K(tt).scale(123.082).center([0,26.1441]).parallel(45)},t.geoBonneRaw=tt,t.geoBottomley=function(){var t=.5,r=e.geoProjectionMutator(et),n=r(t);return n.fraction=function(e){return arguments.length?r(t=+e):t},n.scale(158.837)},t.geoBottomleyRaw=et,t.geoBromley=function(){return e.geoProjection(rt).scale(152.63)},t.geoBromleyRaw=rt,t.geoChamberlin=lt,t.geoChamberlinRaw=ot,t.geoChamberlinAfrica=function(){return lt([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},t.geoCollignon=function(){return e.geoProjection(ut).scale(95.6464).center([0,30])},t.geoCollignonRaw=ut,t.geoCraig=function(){return K(ct).scale(249.828).clipAngle(90)},t.geoCraigRaw=ct,t.geoCraster=function(){return e.geoProjection(ft).scale(156.19)},t.geoCrasterRaw=ft,t.geoCylindricalEqualArea=function(){return K(pt).parallel(38.58).scale(195.044)},t.geoCylindricalEqualAreaRaw=pt,t.geoCylindricalStereographic=function(){return K(dt).scale(124.75)},t.geoCylindricalStereographicRaw=dt,t.geoEckert1=function(){return e.geoProjection(mt).scale(165.664)},t.geoEckert1Raw=mt,t.geoEckert2=function(){return e.geoProjection(gt).scale(165.664)},t.geoEckert2Raw=gt,t.geoEckert3=function(){return e.geoProjection(yt).scale(180.739)},t.geoEckert3Raw=yt,t.geoEckert4=function(){return e.geoProjection(vt).scale(180.739)},t.geoEckert4Raw=vt,t.geoEckert5=function(){return e.geoProjection(xt).scale(173.044)},t.geoEckert5Raw=xt,t.geoEckert6=function(){return e.geoProjection(_t).scale(173.044)},t.geoEckert6Raw=_t,t.geoEisenlohr=function(){return e.geoProjection(wt).scale(62.5271)},t.geoEisenlohrRaw=wt,t.geoFahey=function(){return e.geoProjection(kt).scale(137.152)},t.geoFaheyRaw=kt,t.geoFoucaut=function(){return e.geoProjection(At).scale(135.264)},t.geoFoucautRaw=At,t.geoFoucautSinusoidal=function(){var t=.5,r=e.geoProjectionMutator(Mt),n=r(t);return n.alpha=function(e){return arguments.length?r(t=+e):t},n.scale(168.725)},t.geoFoucautSinusoidalRaw=Mt,t.geoGilbert=function(t){null==t&&(t=e.geoOrthographic);var r=t(),n=e.geoEquirectangular().scale(M).precision(0).clipAngle(null).translate([0,0]);function i(t){return r(St(t))}function a(t){i[t]=function(){return arguments.length?(r[t].apply(r,arguments),i):r[t]()}}return r.invert&&(i.invert=function(t){return Et(r.invert(t))}),i.stream=function(t){var e=r.stream(t),i=n.stream({point:function(t,r){e.point(t/2,E(g(-r/2*S))*M)},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}});return i.sphere=e.sphere,i},i.rotate=function(t){return arguments.length?(n.rotate(t),i):n.rotate()},i.center=function(t){return arguments.length?(r.center(St(t)),i):Et(r.center())},a("angle"),a("clipAngle"),a("clipExtent"),a("fitExtent"),a("fitHeight"),a("fitSize"),a("fitWidth"),a("scale"),a("translate"),a("precision"),i.scale(249.5)},t.geoGingery=function(){var t=6,r=30*S,n=o(r),i=m(r),s=e.geoProjectionMutator(Ct),l=s(r,t),u=l.stream,c=-o(.01*S),h=m(.01*S);return l.radius=function(e){return arguments.length?(n=o(r=e*S),i=m(r),s(r,t)):r*M},l.lobes=function(e){return arguments.length?s(r,t=+e):t},l.stream=function(e){var r=l.rotate(),s=u(e),f=(l.rotate([0,0]),u(e));return l.rotate(r),s.sphere=function(){f.polygonStart(),f.lineStart();for(var e=0,r=2*x/t,s=0;e<t;++e,s-=r)f.point(a(h*o(s),c)*M,E(h*m(s))*M),f.point(a(i*o(s-r/2),n)*M,E(i*m(s-r/2))*M);f.lineEnd(),f.polygonEnd()},s},l.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},t.geoGingeryRaw=Ct,t.geoGinzburg4=function(){return e.geoProjection(zt).scale(149.995)},t.geoGinzburg4Raw=zt,t.geoGinzburg5=function(){return e.geoProjection(Ot).scale(153.93)},t.geoGinzburg5Raw=Ot,t.geoGinzburg6=function(){return e.geoProjection(Dt).scale(130.945)},t.geoGinzburg6Raw=Dt,t.geoGinzburg8=function(){return e.geoProjection(Rt).scale(131.747)},t.geoGinzburg8Raw=Rt,t.geoGinzburg9=function(){return e.geoProjection(Ft).scale(131.087)},t.geoGinzburg9Raw=Ft,t.geoGringorten=function(){return e.geoProjection(Bt(Nt)).scale(239.75)},t.geoGringortenRaw=Nt,t.geoGuyou=function(){return e.geoProjection(Bt(Vt)).scale(151.496)},t.geoGuyouRaw=Vt,t.geoHammer=function(){var t=2,r=e.geoProjectionMutator(U),n=r(t);return n.coefficient=function(e){return arguments.length?r(t=+e):t},n.scale(169.529)},t.geoHammerRaw=U,t.geoHammerRetroazimuthal=function(){var t=0,r=e.geoProjectionMutator(qt),n=r(t),i=n.rotate,a=n.stream,o=e.geoCircle();return n.parallel=function(e){if(!arguments.length)return t*M;var i=n.rotate();return r(t=e*S).rotate(i)},n.rotate=function(e){return arguments.length?(i.call(n,[e[0],e[1]-t*M]),o.center([-e[0],-e[1]]),n):((e=i.call(n))[1]+=t*M,e)},n.stream=function(t){return(t=a(t)).sphere=function(){t.polygonStart();var e,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(t.lineStart();++i<n;)t.point((e=r[i])[0],e[1]);for(t.lineEnd(),n=(r=o.radius(90.01)().coordinates[0]).length-1,t.lineStart();--i>=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=qt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Wt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){e.geoStream(function(t){var e=[].concat(r.range(-180,180+t/2,t).map(Yt),r.range(180,-180-t/2,-t).map(Xt));return{type:"Polygon",coordinates:[180===t?e.map($t):e]}}(180/t),l)},s},i.scale(239.75)},t.geoHealpixRaw=Wt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Jt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Jt,t.geoHomolosine=function(){return e.geoProjection(ee).scale(152.63)},t.geoHomolosineRaw=ee,t.geoHufnagel=function(){var t=1,r=0,n=45*S,i=2,a=e.geoProjectionMutator(re),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*S,i):n*M},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=re,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ae),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ae,t.geoInterrupt=le,t.geoInterruptedBoggs=function(){return le(J,ue).scale(160.857)},t.geoInterruptedHomolosine=function(){return le(ee,ce).scale(152.63)},t.geoInterruptedMollweide=function(){return le(Y,he).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return le(Y,fe).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return le(te,pe,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return le(Q,de).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(me).scale(158.837)},t.geoKavrayskiy7Raw=me,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(ge),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=ge,t.geoLarrivee=function(){return e.geoProjection(ve).scale(97.2672)},t.geoLarriveeRaw=ve,t.geoLaskowski=function(){return e.geoProjection(xe).scale(139.98)},t.geoLaskowskiRaw=xe,t.geoLittrow=function(){return e.geoProjection(_e).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=_e,t.geoLoximuthal=function(){return K(be).parallel(40).scale(158.837)},t.geoLoximuthalRaw=be,t.geoMiller=function(){return e.geoProjection(we).scale(108.318)},t.geoMillerRaw=we,t.geoModifiedStereographic=Ce,t.geoModifiedStereographicRaw=Te,t.geoModifiedStereographicAlaska=function(){return Ce(ke,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ce(Ae,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ce(Me,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ce(Se,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ce(Ee,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(Y).scale(169.529)},t.geoMollweideRaw=Y,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Pe).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Pe,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(ze).scale(188.209)},t.geoMtFlatPolarQuarticRaw=ze,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(Oe).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=Oe,t.geoNaturalEarth2=function(){return e.geoProjection(De).scale(175.295)},t.geoNaturalEarth2Raw=De,t.geoNellHammer=function(){return e.geoProjection(Re).scale(152.63)},t.geoNellHammerRaw=Re,t.geoInterruptedQuarticAuthalic=function(){return le(U(1/0),Fe).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(Be).scale(127.267)},t.geoNicolosiRaw=Be,t.geoPatterson=function(){return e.geoProjection(We).scale(139.319)},t.geoPattersonRaw=We,t.geoPolyconic=function(){return e.geoProjection(Ye).scale(103.74)},t.geoPolyconicRaw=Ye,t.geoPolyhedral=Qe,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=ir.map(function(e){return{face:e,project:t(e)}});return[-1,0,0,1,0,1,4,5].forEach(function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])}),Qe(r[0],function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t<x/2?e<0?3:1:e<0?7:5]}).angle(-30).scale(101.858).center([0,45])},t.geoPolyhedralCollignon=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoProjection(or).translate([0,0]).scale(1).rotate(r[1]>0?[-r[0],0]:[180-r[0],180])};var r=ir.map(function(e){return{face:e,project:t(e)}});return[-1,0,0,1,0,1,4,5].forEach(function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])}),Qe(r[0],function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t<x/2?e<0?3:1:e<0?7:5]}).angle(-30).scale(121.906).center([0,48.5904])},t.geoPolyhedralWaterman=function(t){t=t||function(t){var r=6===t.length?e.geoCentroid({type:"MultiPoint",coordinates:t}):t[0];return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=ir.map(function(t){for(var e,r=t.map(cr),n=r.length,i=r[n-1],a=[],o=0;o<n;++o)e=r[o],a.push(ur([.9486832980505138*i[0]+.31622776601683794*e[0],.9486832980505138*i[1]+.31622776601683794*e[1],.9486832980505138*i[2]+.31622776601683794*e[2]]),ur([.9486832980505138*e[0]+.31622776601683794*i[0],.9486832980505138*e[1]+.31622776601683794*i[1],.9486832980505138*e[2]+.31622776601683794*i[2]])),i=e;return a}),n=[],i=[-1,0,0,1,0,1,4,5];r.forEach(function(t,e){for(var a=ir[e],o=a.length,s=n[e]=[],l=0;l<o;++l)r.push([a[l],t[(2*l+2)%(2*o)],t[(2*l+1)%(2*o)]]),i.push(e),s.push(lr(cr(t[(2*l+2)%(2*o)]),cr(t[(2*l+1)%(2*o)])))});var a=r.map(function(e){return{project:t(e),face:e}});return i.forEach(function(t,e){var r=a[t];r&&(r.children||(r.children=[])).push(a[e])}),Qe(a[0],function(t,e){var r=o(e),i=[r*o(t),r*m(t),m(e)],s=t<-x/2?e<0?6:4:t<0?e<0?2:0:t<x/2?e<0?3:1:e<0?7:5,l=n[s];return a[sr(l[0],i)<0?8+3*s:sr(l[1],i)<0?8+3*s+1:sr(l[2],i)<0?8+3*s+2:s]}).angle(-30).scale(110.625).center([0,45])},t.geoProject=function(t,e){var r,n=e.stream;if(!n)throw new Error("invalid projection");switch(t&&t.type){case"Feature":r=pr;break;case"FeatureCollection":r=fr;break;default:r=dr}return r(t,n)},t.geoGringortenQuincuncial=function(){return _r(Nt).scale(176.423)},t.geoPeirceQuincuncial=br,t.geoPierceQuincuncial=br,t.geoQuantize=function(t,e){if(!(0<=(e=+e)&&e<=20))throw new Error("invalid digits");function r(t){var r=t.length,n=2,i=new Array(r);for(i[0]=+t[0].toFixed(e),i[1]=+t[1].toFixed(e);n<r;)i[n]=t[n],++n;return i}function n(t){return t.map(r)}function i(t){for(var e=r(t[0]),n=[e],i=1;i<t.length;i++){var a=r(t[i]);(a.length>2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=_r,t.geoRectangularPolyconic=function(){return K(wr).scale(131.215)},t.geoRectangularPolyconicRaw=wr,t.geoRobinson=function(){return e.geoProjection(kr).scale(152.63)},t.geoRobinsonRaw=kr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(Ar),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*S):r*M},i.scale(432.147).clipAngle(C(1/t)*M-1e-6)},t.geoSatelliteRaw=Ar,t.geoSinuMollweide=function(){return e.geoProjection(te).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=te,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return Nr(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(Nr)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return jr(t)}},t.geoTimes=function(){return e.geoProjection(Ur).scale(146.153)},t.geoTimesRaw=Ur,t.geoTwoPointAzimuthal=Hr,t.geoTwoPointAzimuthalRaw=qr,t.geoTwoPointAzimuthalUsa=function(){return Hr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Zr,t.geoTwoPointEquidistantRaw=Gr,t.geoTwoPointEquidistantUsa=function(){return Zr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(Wr).scale(79.4183)},t.geoVanDerGrintenRaw=Wr,t.geoVanDerGrinten2=function(){return e.geoProjection(Yr).scale(79.4183)},t.geoVanDerGrinten2Raw=Yr,t.geoVanDerGrinten3=function(){return e.geoProjection(Xr).scale(79.4183)},t.geoVanDerGrinten3Raw=Xr,t.geoVanDerGrinten4=function(){return e.geoProjection($r).scale(127.16)},t.geoVanDerGrinten4Raw=$r,t.geoWagner=Kr,t.geoWagner7=function(){return Kr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=Jr,t.geoWagner4=function(){return e.geoProjection(en).scale(176.84)},t.geoWagner4Raw=en,t.geoWagner6=function(){return e.geoProjection(rn).scale(152.63)},t.geoWagner6Raw=rn,t.geoWiechel=function(){return e.geoProjection(nn).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=nn,t.geoWinkel3=function(){return e.geoProjection(an).scale(158.837)},t.geoWinkel3Raw=an,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,Sg(),Mg()):n(r.d3=r.d3||{},r.d3,r.d3)}),Cg=f((t,e)=>{var r=v(),n=oe(),i=Ut(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function u(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function c(t,e,r){var a=t.id,o=t.graphDiv,s=o.layout,l=s[a],u=o._fullLayout,c=u[a],h={},f={};function p(t,e){h[a+"."+t]=n.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,u._preGUI,h);var r=n.nestedProperty(c,t);r.get()!==e&&(r.set(e),n.nestedProperty(l,t).set(e),f[a+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",f)}function h(t,e){var n=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",function(){r.select(this).style(s)}).on("zoom",function(){e.scale(r.event.scale).translate(r.event.translate),t.render(!0);var n=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})}).on("zoomend",function(){r.select(this).style(l),c(t,e,i)}),n}function f(t,e){var n,i,a,o,h,f,p,d,m,g=u(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",function(){r.select(this).style(s),n=r.mouse(this),i=e.rotate(),a=e.translate(),o=i,h=y(n)}).on("zoom",function(){if(f=r.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(n))return g.scale(e.scale()),void g.translate(e.translate());e.scale(r.event.scale),e.translate([a[0],r.event.translate[1]]),h?y(f)&&(d=y(f),p=[o[0]+(d[0]-h[0]),i[1],i[2]],e.rotate(p),o=p):h=y(n=f),m=!0,t.render(!0);var s=e.rotate(),l=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})}).on("zoomend",function(){r.select(this).style(l),m&&c(t,e,v)}),g}function p(t,e){e.rotate(),e.scale();var n,i=u(0,e),h=function(t){for(var e=0,n=arguments.length,i=[];++e<n;)i.push(arguments[e]);var a=r.dispatch.apply(null,i);return a.of=function(e,n){return function(i){var o;try{o=i.sourceEvent=r.event,i.target=t,r.event=i,a[i.type].apply(e,n)}finally{r.event=o}}},a}(i,"zoomstart","zoom","zoomend"),f=0,p=i.on;function g(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}return i.on("zoomstart",function(){r.select(this).style(s);var t=r.mouse(this),l=e.rotate(),u=l,c=e.translate(),g=function(t){var e=.5*t[0]*a,r=.5*t[1]*a,n=.5*t[2]*a,i=Math.sin(e),o=Math.cos(e),s=Math.sin(r),l=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return[o*l*c+i*s*u,i*l*c-o*s*u,o*s*c+i*l*u,o*l*u-i*s*c]}(l);n=d(e,t),p.call(i,"zoom",function(){var i=r.mouse(this);if(e.scale(r.event.scale),n){if(d(e,i)){e.rotate(l).translate(c);var a=d(e,i),s=function(t,e){if(t&&e){var r=function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}(t,e),n=Math.sqrt(x(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,x(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}(n,a),f=function(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*o,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*o,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*o]}(function(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}(g,s)),p=function(t,e,r){var n=y(e,2,t[0]);n=y(n,1,t[1]),n=y(n,0,t[2]-r[2]);var i,a,s=e[0],l=e[1],u=e[2],c=n[0],h=n[1],f=n[2],p=Math.atan2(l,s)*o,d=Math.sqrt(s*s+l*l);Math.abs(h)>d?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/d)*o-p,i=Math.sqrt(d*d-h*h));var g=180-a-2*p,v=(Math.atan2(f,c)-Math.atan2(u,i))*o,x=(Math.atan2(f,c)-Math.atan2(u,-i))*o,_=m(r[0],r[1],a,v),b=m(r[0],r[1],g,x);return _<=b?[a,v,r[2]]:[g,x,r[2]]}(f,n,u);(!isFinite(p[0])||!isFinite(p[1])||!isFinite(p[2]))&&(p=u),e.rotate(p),u=p}}else n=d(e,t=i);!function(t){t({type:"zoom"})}(h.of(this,arguments))}),function(t){f++||t({type:"zoomstart"})}(h.of(this,arguments))}).on("zoomend",function(){var n;r.select(this).style(l),p.call(i,"zoom",null),n=h.of(this,arguments),--f||n({type:"zoomend"}),c(t,e,g)}).on("zoom.redraw",function(){t.render(!0);var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})}),r.rebind(i,h,"on")}function d(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*a,r=t[1]*a,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function m(t,e,r,n){var i=g(r-t),a=g(n-e);return Math.sqrt(i*i+a*a)}function g(t){return(t%360+540)%360-180}function y(t,e,r){var n=r*a,i=t.slice(),o=0===e?1:0,s=2===e?1:2,l=Math.cos(n),u=Math.sin(n);return i[o]=t[o]*l-t[s]*u,i[s]=t[s]*l+t[o]*u,i}function x(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}e.exports=function(t,e){var r=t.projection;return(e._isScoped?h:e._isClipped?p:f)(t,r)}}),Ig=f((t,e)=>{var r=v(),n=Sg(),i=n.geoPath,a=n.geoDistance,o=Eg(),s=Ut(),l=oe(),u=l.strTranslate,c=q(),h=Je(),f=Pr(),p=we(),d=rr(),m=er().getAutoRange,g=cr(),y=Mn().prepSelect,x=Mn().clearOutline,_=Mn().selectOnClick,b=Cg(),w=cg(),T=_g(),k=fg(),A=hg().feature;function M(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.isStatic=t.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var S=M.prototype;function E(t,e){var r=w.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var u=!1,c=0;c<t.length;c++){var h=t[0][0].trace;h._geo=i,h.locationmode&&(s=!0);var f=h.marker;if(f){var p=f.angle,d=f.angleref;(p||"north"===d||"previous"===d)&&(u=!0)}}if(this._hasMarkerAngles=u,s){var m=k.getTopojsonName(a);(null===i.topojson||m!==i.topojsonName)&&(i.topojsonName=m,void 0===PlotlyGeoAssets.topojson[i.topojsonName]&&o.push(i.fetchTopojson()))}o=o.concat(T.fetchTraceGeoData(t)),r.push(new Promise(function(r,n){Promise.all(o).then(function(){i.topojson=PlotlyGeoAssets.topojson[i.topojsonName],i.update(t,e),r()}).catch(n)}))},S.fetchTopojson=function(){var t=this,e=k.getTopojsonPath(t.topojsonURL,t.topojsonName);return new Promise(function(n,i){r.json(e,function(r,a){if(r)return 404===r.status?i(new Error(["plotly.js could not find topojson file at",e+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):i(new Error(["unexpected error while fetching topojson file at",e].join(" ")));PlotlyGeoAssets.topojson[t.topojsonName]=a,n()})})},S.update=function(t,e,r){var n=e[this.id];this.hasChoropleth=!1;for(var i=0;i<t.length;i++){var a=t[i],o=a[0].trace;"choropleth"===o.type&&(this.hasChoropleth=!0),!0===o.visible&&o._length>0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;(!this.viewInitial||this.scope!==n.scope)&&this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),p.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,s=e[this.id],u=e._size,c=s.domain,h=s.projection,f=s.lonaxis,p=s.lataxis,d=f._ax,g=p._ax,y=this.projection=function(t){var e=t.projection,r=e.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var u=(n[s]||o[s])(),c=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],f=function(t){return t?u:[]},p=0;p<h.length;p++){var d=h[p];"function"!=typeof u[d]&&(u[d]=f)}return u.isLonLatOverEdges=function(t){if(null===u(t))return!0;if(c){var e=u.rotate();return a(t,[-e[0],-e[1]])>c*Math.PI/180}return!1},u.getPath=function(){return i().projection(u)},u.getBounds=function(t){return u.getPath().bounds(t)},u.precision(w.precision),t._isSatellite&&u.tilt(e.tilt).distance(e.distance),c&&u.clipAngle(c-w.clipPad),u}(s),v=[[u.l+u.w*c.x[0],u.t+u.h*(1-c.y[1])],[u.l+u.w*c.x[1],u.t+u.h*(1-c.y[0])]],x=s.center||{},_=h.rotation||{},b=f.range||[],T=p.range||[];if(s.fitbounds){d._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],d.range=m(r,d),g.range=m(r,g);var k=(d.range[0]+d.range[1])/2,A=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:k,lat:A};else if(s._isClipped){x={lon:k,lat:A},_={lon:k,lat:A,roll:_.roll};var M=h.type,S=w.lonaxisSpan[M]/2||180,C=w.lataxisSpan[M]/2||90;b=[k-S,k+S],T=[A-C,A+C]}else x={lon:k,lat:A},_={lon:k,lat:_.lat,roll:_.roll}}y.center([x.lon-_.lon,x.lat-_.lat]).rotate([-_.lon,-_.lat,_.roll]).parallels(h.parallels);var I=E(b,T);y.fitExtent(v,I);var L=this.bounds=y.getBounds(I),P=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var O=y.getBounds(E(d.range,g.range)),D=Math.min((L[1][0]-L[0][0])/(O[1][0]-O[0][0]),(L[1][1]-L[0][1])/(O[1][1]-O[0][1]));isFinite(D)?y.scale(D*P):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*P);var R=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(y.translate([z[0]+(R[0]-z[0]),z[1]+(R[1]-z[1])]).clipExtent(L),s._isAlbersUsa){var F=y([x.lon,x.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return!!w.lineLayers[t]}function u(t){return!!w.fillLayers[t]}var f=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter(function(t){return l(t)||u(t)?e["show"+t]:!s(t)||e[t].showgrid}),p=n.framework.selectAll(".layer").data(f,String);p.exit().each(function(t){delete a[t],delete o[t],r.select(this).remove()}),p.enter().append("g").attr("class",function(t){return"layer "+t}).each(function(t){var e=a[t]=r.select(this);"bg"===t?n.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):u(t)&&(o[t]=e.append("path").style("stroke","none"))}),p.order(),p.each(function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||u(r)?n.datum(A(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=1e-6,s=2.5,l=e[t],u=w.scopeDefaults[e.scope];"lonaxis"===t?(n=u.lonaxisRange,i=u.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=u.lataxisRange,i=u.lonaxisRange,a=function(t,e){return[e,t]});var c={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};d.setConvert(c,r);var h=d.calcTicks(c);!e.isScoped&&"lonaxis"===t&&h.pop();for(var f=h.length,p=new Array(f),m=0;m<f;m++)for(var g=h[m].x,y=p[m]=[],v=i[0];v<i[1]+s;v+=s)y.push(a(g,v));return{type:"MultiLineString",coordinates:p}}(r,e,t)).call(c.stroke,e[r].gridcolor).call(h.dashLine,e[r].griddash,e[r].gridwidth),l(r)?n.call(c.stroke,e[a+"color"]).call(h.dashLine,"",e[a+"width"]):u(r)&&n.call(c.fill,e[a+"color"])})},S.updateDims=function(t,e){var r=this.bounds,n=(e.framewidth||0)/2,i=r[0][0]-n,a=r[0][1]-n,o=r[1][0]-i+n,s=r[1][1]-a+n;h.setRect(this.clipRect,i,a,o,s),this.bgRect.call(h.setRect,i,a,o,s).call(c.fill,e.bgcolor),this.xaxis._offset=i,this.xaxis._length=o,this.yaxis._offset=a,this.yaxis._length=s},S.updateFx=function(t,e){var n=this,i=n.graphDiv,a=n.bgRect,o=t.dragmode,u=t.clickmode;if(!n.isStatic){var c={element:n.bgRect.node(),gd:i,plotinfo:{id:n.id,xaxis:n.xaxis,yaxis:n.yaxis,fillRangeItems:function(t,e){e.isRect?(t.range={})[n.id]=[h([e.xmin,e.ymin]),h([e.xmax,e.ymax])]:(t.lassoPoints={})[n.id]=e.map(h)}},xaxes:[n.xaxis],yaxes:[n.yaxis],subplot:n.id,clickFn:function(t){2===t&&x(i)}};"pan"===o?(a.node().onmousedown=null,a.call(b(n,e)),a.on("dblclick.zoom",function(){var t=n.viewInitial,e={};for(var r in t)e[n.id+"."+r]=t[r];s.call("_guiRelayout",i,e),i.emit("plotly_doubleclick",null)}),i._context._scrollZoom.geo||a.on("wheel.zoom",null)):("select"===o||"lasso"===o)&&(a.on(".zoom",null),c.prepFn=function(t,e,r){y(t,e,r,c,o)},g.init(c)),a.on("mousemove",function(){var t=n.projection.invert(l.getPositionFromD3Event());if(!t)return g.unhover(i,r.event);n.xaxis.p2c=function(){return t[0]},n.yaxis.p2c=function(){return t[1]},f.hover(i,r.event,n.id)}),a.on("mouseout",function(){i._dragging||g.unhover(i,r.event)}),a.on("click",function(){"select"!==o&&"lasso"!==o&&(u.indexOf("select")>-1&&_(r.event,i,[n.xaxis],[n.yaxis],n.id,c),u.indexOf("event")>-1&&f.click(i,r.event))})}function h(t){return n.projection.invert([t[0]+n.xaxis._offset,t[1]+n.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,n=e._fullLayout,i="clip"+n._uid+t.id;t.clipDef=n._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=r.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(t.mockAxis,n)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",function(t){return r(t.geojson)});for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}}),Lg=f((t,e)=>{var r=V(),n=wa().attributes,i=Pt().dash,a=cg(),o=Lt().overrideAll,s=Gt(),l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(e.exports=o({domain:n({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}),Pg=f((t,e)=>{var r=oe(),n=Vs(),i=_e().getSubplotData,a=cg(),o=Lg(),s=a.axesNames;function l(t,e,n,o){var l=i(o.fullData,"geo",o.id).map(function(t){return t.index}),u=n("resolution"),c=n("scope"),h=a.scopeDefaults[c],f=n("projection.type",h.projType),p=e._isAlbersUsa="albers usa"===f;p&&(c=e.scope="usa");var d=e._isScoped="world"!==c,m=e._isSatellite="satellite"===f,g=e._isConic=-1!==f.indexOf("conic")||"albers"===f,y=e._isClipped=!!a.lonaxisSpan[f];if(!1===t.visible){var v=r.extendDeep({},e._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),e._template=v}for(var x=n("visible"),_=0;_<s.length;_++){var b,w=s[_],T=[30,10][_];if(d)b=h[w+"Range"];else{var k=a[w+"Span"],A=(k[f]||k["*"])/2,M=n("projection.rotation."+w.substr(0,3),h.projRotate[_]);b=[M-A,M+A]}var S=n(w+".range",b);n(w+".tick0"),n(w+".dtick",T),n(w+".showgrid",!!x&&void 0)&&(n(w+".gridcolor"),n(w+".gridwidth"),n(w+".griddash")),e[w]._ax={type:"linear",_id:w.slice(0,3),_traceIndices:l,setScale:r.identity,c2l:r.identity,r2l:r.identity,autorange:!0,range:S.slice(),_m:1,_input:{}}}var E=e.lonaxis.range,C=e.lataxis.range,I=E[0],L=E[1];I>0&&L<0&&(L+=360);var P,z,O,D=(I+L)/2;if(!p){var R=d?h.projRotate:[D,0,0];P=n("projection.rotation.lon",R[0]),n("projection.rotation.lat",R[1]),n("projection.rotation.roll",R[2]),n("showcoastlines",!d&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}p?(z=-96.6,O=38.7):(z=d?D:P,O=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",O),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",d&&"usa"!==c&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===c||"north america"===c&&50===u)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),d||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}),zg=f((t,e)=>{var r=_e().getSubplotCalcData,n=oe().counterRegex,i=Ig(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},e.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:Lg(),supplyLayoutDefaults:Pg(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,o=e._subplots[a],s=0;s<o.length;s++){var l=o[s],u=r(n,a,l),c=e[l]._subplot;c||(c=i({id:l,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL,staticPlot:t._context.staticPlot}),e[l]._subplot=c),c.plot(u,e,t._promises)}},updateFx:function(t){for(var e=t._fullLayout,r=e._subplots[a],n=0;n<r.length;n++){var i=e[r[n]];i._subplot.updateFx(e,i)}},clean:function(t,e,r,n){for(var i=n._subplots[a]||[],o=0;o<i.length;o++){var s=i[o],l=n[s]._subplot;!e[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}}}),Og=f((t,e)=>{e.exports={attributes:og(),supplyDefaults:sg(),colorbar:hi(),formatLabels:lg(),calc:ug(),calcGeoJSON:wg().calcGeoJSON,plot:wg().plot,style:bg(),styleOnSelect:pi().styleOnSelect,hoverPoints:Tg(),eventData:kg(),selectPoints:Ag(),moduleType:"trace",name:"scattergeo",basePlotModule:zg(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),Dg=f((t,e)=>{e.exports=Og()}),Rg=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=og(),i=Ie(),a=j(),o=V().defaultLine,s=D().extendFlat,l=n.marker.line;e.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},n.geojson,{}),featureidkey:n.featureidkey,text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),marker:{line:{color:s({},l.color,{dflt:o}),width:s({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},a.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:r(),showlegend:s({},a.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))}),Fg=f((t,e)=>{var r=oe(),n=Ue(),i=Rg(),a=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");e.exports=function(t,e,o,s){function l(n,a){return r.coerce(t,e,i,n,a)}var u=l("locations"),c=l("z");if(u&&u.length&&r.isArrayOrTypedArray(c)&&c.length){e._length=Math.min(u.length,c.length);var h,f=l("geojson");("string"==typeof f&&""!==f||r.isPlainObject(f))&&(h="geojson-id");var p=l("locationmode",h);"country names"===p&&r.warn(a),"geojson-id"===p&&l("featureidkey"),l("text"),l("hovertext"),l("hovertemplate"),l("marker.line.width")&&l("marker.line.color"),l("marker.opacity"),n(t,e,s,l,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,l)}else e.visible=!1}}),Bg=f((t,e)=>{var r=T(),n=k().BADNUM,i=He(),a=ri(),o=ni();function s(t){return t&&"string"==typeof t}e.exports=function(t,e){var l,u=e._length,c=new Array(u);l=e.geojson?function(t){return s(t)||r(t)}:s;for(var h=0;h<u;h++){var f=c[h]={},p=e.locations[h],d=e.z[h];l(p)&&r(d)?(f.loc=p,f.z=d):(f.loc=null,f.z=n),f.index=h}return a(c,e),i(t,e,{vals:e.z,containerStr:"",cLetter:"z"}),o(c,e),c}}),Ng=f((t,e)=>{var r=v(),n=q(),i=Je(),a=Ge();function o(t,e){var o=e[0].trace,s=e[0].node3.selectAll(".choroplethlocation"),l=o.marker||{},u=l.line||{},c=a.makeColorScaleFuncFromTrace(o);s.each(function(t){r.select(this).attr("fill",c(t.z)).call(n.stroke,t.mlc||u.color).call(i.dashLine,"",t.mlw||u.width||0).style("opacity",l.opacity)}),i.selectedPointStyle(s,o)}e.exports={style:function(t,e){e&&o(0,e)},styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?i.selectedPointStyle(r.selectAll(".choroplethlocation"),n):o(0,e)}}}),jg=f((t,e)=>{var r=v(),n=oe(),i=_g(),a=fg().getTopojsonFeatures,o=er().findExtremes,s=Ng().style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],s=n._subplot,l=r.locationmode,u=r._length,c="geojson-id"===l?i.extractTraceFeature(t):a(r,s.topojson),h=[],f=[],p=0;p<u;p++){var d=t[p],m="geojson-id"===l?d.fOut:i.locationToFeature(l,d.loc,c);if(m){d.geojson=m,d.ct=m.properties.ct,d._polygons=i.feature2polygons(m);var g=i.computeBbox(m);h.push(g[0],g[2]),f.push(g[1],g[3])}else d.geojson=null}if("geojson"===n.fitbounds&&"geojson-id"===l){var y=i.computeBbox(i.getTraceGeojson(r));h=[y[0],y[2]],f=[y[1],y[3]]}var v={padded:!0};r._extremes.lon=o(n.lonaxis._ax,h,v),r._extremes.lat=o(n.lataxis._ax,f,v)},plot:function(t,e,i){var a=e.layers.backplot.select(".choroplethlayer");n.makeTraceGroups(a,i,"trace choropleth").each(function(e){var i=r.select(this).selectAll("path.choroplethlocation").data(n.identity);i.enter().append("path").classed("choroplethlocation",!0),i.exit().remove(),s(t,e)})}}}),Ug=f((t,e)=>{var r=rr(),n=Rg(),i=oe().fillText;e.exports=function(t,e,a){var o,s,l,u,c=t.cd,h=c[0].trace,f=t.subplot,p=[e,a],d=[e+360,a];for(s=0;s<c.length;s++)if(u=!1,(o=c[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains(p)&&(u=!u),o._polygons[l].contains(d)&&(u=!u);if(u)break}if(u&&o)return t.x0=t.x1=t.xa.c2p(o.ct),t.y0=t.y1=t.ya.c2p(o.ct),t.index=o.index,t.location=o.loc,t.z=o.z,t.zLabel=r.tickText(f.mockAxis,f.mockAxis.c2l(o.z),"hover").text,t.hovertemplate=o.hovertemplate,function(t,e,r){if(!e.hovertemplate){var a=r.hi||e.hoverinfo,o=String(r.loc),s="all"===a?n.hoverinfo.flags:a.split("+"),l=-1!==s.indexOf("name"),u=-1!==s.indexOf("location"),c=-1!==s.indexOf("z"),h=-1!==s.indexOf("text"),f=[];!l&&u?t.nameOverride=o:(l&&(t.nameOverride=e.name),u&&f.push(o)),c&&f.push(t.zLabel),h&&i(r,e,f),t.extraText=f.join("<br>")}}(t,h,o),[t]}}),Vg=f((t,e)=>{e.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}}),qg=f((t,e)=>{e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=u.c2p(i),e.contains([a,o],null,r,t)?(c.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return c}}),Hg=f((t,e)=>{e.exports={attributes:Rg(),supplyDefaults:Fg(),colorbar:No(),calc:Bg(),calcGeoJSON:jg().calcGeoJSON,plot:jg().plot,style:Ng().style,styleOnSelect:Ng().styleOnSelect,hoverPoints:Ug(),eventData:Vg(),selectPoints:qg(),moduleType:"trace",name:"choropleth",basePlotModule:zg(),categories:["geo","noOpacity","showLegend"],meta:{}}}),Gg=f((t,e)=>{e.exports=Hg()}),Zg=f((t,e)=>{var r=Ut(),n=oe(),i=di();function a(t,e,a,o){var s=t.xa,l=t.ya,u=t.distance,c=t.dxy,h=t.index,f={pointNumber:h,x:e[h],y:a[h]};f.tx=n.isArrayOrTypedArray(o.text)?o.text[h]:o.text,f.htx=Array.isArray(o.hovertext)?o.hovertext[h]:o.hovertext,f.data=Array.isArray(o.customdata)?o.customdata[h]:o.customdata,f.tp=Array.isArray(o.textposition)?o.textposition[h]:o.textposition;var p=o.textfont;p&&(f.ts=n.isArrayOrTypedArray(p.size)?p.size[h]:p.size,f.tc=n.isArrayOrTypedArray(p.color)?p.color[h]:p.color,f.tf=Array.isArray(p.family)?p.family[h]:p.family,f.tw=Array.isArray(p.weight)?p.weight[h]:p.weight,f.ty=Array.isArray(p.style)?p.style[h]:p.style,f.tv=Array.isArray(p.variant)?p.variant[h]:p.variant);var d=o.marker;d&&(f.ms=n.isArrayOrTypedArray(d.size)?d.size[h]:d.size,f.mo=n.isArrayOrTypedArray(d.opacity)?d.opacity[h]:d.opacity,f.mx=n.isArrayOrTypedArray(d.symbol)?d.symbol[h]:d.symbol,f.ma=n.isArrayOrTypedArray(d.angle)?d.angle[h]:d.angle,f.mc=n.isArrayOrTypedArray(d.color)?d.color[h]:d.color);var m=d&&d.line;m&&(f.mlc=Array.isArray(m.color)?m.color[h]:m.color,f.mlw=n.isArrayOrTypedArray(m.width)?m.width[h]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(f.mgt=Array.isArray(g.type)?g.type[h]:g.type,f.mgc=Array.isArray(g.color)?g.color[h]:g.color);var y=s.c2p(f.x,!0),v=l.c2p(f.y,!0),x=f.mrc||1,_=o.hoverlabel;_&&(f.hbg=Array.isArray(_.bgcolor)?_.bgcolor[h]:_.bgcolor,f.hbc=Array.isArray(_.bordercolor)?_.bordercolor[h]:_.bordercolor,f.hts=n.isArrayOrTypedArray(_.font.size)?_.font.size[h]:_.font.size,f.htc=Array.isArray(_.font.color)?_.font.color[h]:_.font.color,f.htf=Array.isArray(_.font.family)?_.font.family[h]:_.font.family,f.hnl=n.isArrayOrTypedArray(_.namelength)?_.namelength[h]:_.namelength);var b=o.hoverinfo;b&&(f.hi=Array.isArray(b)?b[h]:b);var w=o.hovertemplate;w&&(f.ht=Array.isArray(w)?w[h]:w);var T={};T[t.index]=f;var k=o._origX,A=o._origY,M=n.extendFlat({},t,{color:i(o,f),x0:y-x,x1:y+x,xLabelVal:k?k[h]:f.x,y0:v-x,y1:v+x,yLabelVal:A?A[h]:f.y,cd:T,distance:u,spikeDistance:c,hovertemplate:f.ht});return f.htx?M.text=f.htx:f.tx?M.text=f.tx:o.text&&(M.text=o.text),n.fillText(f,o,M),r.getComponentMethod("errorbars","hoverInfo")(f,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var i,o=t.cd,s=o[0].t,l=o[0].trace,u=t.xa,c=t.ya,h=s.x,f=s.y,p=u.c2p(e),d=c.c2p(r),m=t.distance;if(s.tree){var g=u.p2c(p-m),y=u.p2c(p+m),v=c.p2c(d-m),x=c.p2c(d+m);i="x"===n?s.tree.range(Math.min(g,y),Math.min(c._rl[0],c._rl[1]),Math.max(g,y),Math.max(c._rl[0],c._rl[1])):s.tree.range(Math.min(g,y),Math.min(v,x),Math.max(g,y),Math.max(v,x))}else i=s.ids;var _,b,w,T,k,A,M,S,E,C=m;if("x"===n){var I=!!l.xperiodalignment,L=!!l.yperiodalignment;for(k=0;k<i.length;k++){if(w=h[_=i[k]],A=Math.abs(u.c2p(w)-p),I){var P=u.c2p(l._xStarts[_]),z=u.c2p(l._xEnds[_]);A=p>=Math.min(P,z)&&p<=Math.max(P,z)?0:1/0}if(A<C){if(C=A,T=f[_],M=c.c2p(T)-d,L){var O=c.c2p(l._yStarts[_]),D=c.c2p(l._yEnds[_]);M=d>=Math.min(O,D)&&d<=Math.max(O,D)?0:1/0}E=Math.sqrt(A*A+M*M),b=i[k]}}}else for(k=i.length-1;k>-1;k--)w=h[_=i[k]],T=f[_],A=u.c2p(w)-p,M=c.c2p(T)-d,(S=Math.sqrt(A*A+M*M))<C&&(C=E=S,b=_);return t.index=b,t.distance=C,t.dxy=E,void 0===b?[t]:[a(t,h,f,l)]},calcHover:a}}),Wg=f((t,e)=>{e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),Yg=f((t,e)=>{var r=j(),n=R(),i=_n(),a=bn(),o=Se().axisHoverFormat,s=Ie(),l=Gt(),u=D().extendFlat,c=Lt().overrideAll,h=Wg().DASHES,f=a.line,p=a.marker,d=p.line,m=e.exports=c({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:n({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:f.color,width:f.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:l(h),dflt:"solid"}},marker:u({},s("marker"),{symbol:p.symbol,angle:p.angle,size:p.size,sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:p.opacity,colorbar:p.colorbar,line:u({},s("marker.line"),{width:d.width})}),connectgaps:a.connectgaps,fill:u({},a.fill,{dflt:"none"}),fillcolor:i(),selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:r.opacity},"calc","nested");m.x.editType=m.y.editType=m.x0.editType=m.y0.editType="calc+clearAxisTypes",m.hovertemplate=a.hovertemplate,m.texttemplate=a.texttemplate}),Xg=f(t=>{var e=Wg();t.isOpenSymbol=function(t){return"string"==typeof t?e.OPEN_RE.test(t):t%200>100},t.isDotSymbol=function(t){return"string"==typeof t?e.DOT_RE.test(t):t>200}}),$g=f((t,e)=>{var r=oe(),n=Ut(),i=Xg(),a=Yg(),o=xn(),s=Ze(),l=Vn(),u=qn(),c=Gn(),h=Zn(),f=Xn(),p=Yn();e.exports=function(t,e,d,m){function g(n,i){return r.coerce(t,e,a,n,i)}var y=!!t.marker&&i.isOpenSymbol(t.marker.symbol),v=s.isBubble(t),x=l(t,e,m,g);if(x){u(t,e,m,g),g("xhoverformat"),g("yhoverformat");var _=x<o.PTS_LINESONLY?"lines+markers":"lines";g("text"),g("hovertext"),g("hovertemplate"),g("mode",_),s.hasMarkers(e)&&(c(t,e,d,m,g,{noAngleRef:!0,noStandOff:!0}),g("marker.line.width",y||v?1:0)),s.hasLines(e)&&(g("connectgaps"),h(t,e,d,m,g),g("line.shape")),s.hasText(e)&&(g("texttemplate"),p(t,e,m,g,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var b=(e.line||{}).color,w=(e.marker||{}).color;g("fill"),"none"!==e.fill&&f(t,e,d,g);var T=n.getComponentMethod("errorbars","supplyDefaults");T(t,e,b||w||d,{axis:"y"}),T(t,e,b||w||d,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(e,g)}else e.visible=!1}}),Jg=f((t,e)=>{var r=fi();e.exports=function(t,e,n){var i=t.i;return"x"in t||(t.x=e._x[i]),"y"in t||(t.y=e._y[i]),r(t,e,n)}}),Kg=f((t,e)=>{function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,n,i,a){return s(t,e,n,i,a,r)},gt:function(t,e,r,i,a){return s(t,e,r,i,a,n)},lt:function(t,e,r,n,a){return s(t,e,r,n,a,i)},le:function(t,e,r,n,i){return s(t,e,r,n,i,a)},eq:function(t,e,r,n,i){return s(t,e,r,n,i,o)}}}),Qg=f((t,e)=>{e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a<e.length;a++)s[e[a]]=!0;e=s}for(i in e)e[i]=n(e[i]);var l={};for(i in e){var u=e[i];if(Array.isArray(u))for(a=0;a<u.length;a++){var c=u[a];if(r&&(l[c]=!0),c in t){if(o[i]=t[c],r)for(var h=a;h<u.length;h++)l[u[h]]=!0;break}}else i in t&&(e[i]&&(o[i]=t[i]),r&&(l[i]=!0))}if(r)for(i in t)l[i]||(o[i]=t[i]);return o};var r={};function n(t){return r[t]?r[t]:("string"==typeof t&&(t=r[t]=t.split(/\s*,\s*|\s+/)),t)}}),ty=f((t,e)=>{var r=Qg();e.exports=function(t){var e;return arguments.length>1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=r(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}}),ey=f((t,e)=>{e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var i=-1/0,a=1/0,o=n,s=t.length;o<s;o+=e)t[o]>i&&(i=t[o]),t[o]<a&&(a=t[o]);r[n]=a,r[e+n]=i}return r}}),ry=f((t,e)=>{e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}}),ny=f((t,e)=>{var r=Kd();e.exports=function(t,e,n){if(!t)throw new TypeError("must specify data as first parameter");if(n=0|+(n||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var i,a,o,s,l=t[0].length,u=t.length*l;(!e||"string"==typeof e)&&(e=new(r(e||"float32"))(u+n));var c=e.length-n;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+t.length+") does not match destination length "+c);for(i=0,o=n;i<t.length;i++)for(a=0;a<l;a++)e[o++]=null===t[i][a]?NaN:t[i][a]}else if(e&&"string"!=typeof e)e.set(t,n);else{var h=r(e||"float32");if(Array.isArray(t)||"array"===e)for(i=0,o=n,s=(e=new h(t.length+n)).length;o<s;o++,i++)e[o]=null===t[i]?NaN:t[i];else 0===n?e=new h(t):(e=new h(t.length+n)).set(t,n)}return e}}),iy=f((t,e)=>{e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}}),ay=f((t,e)=>{e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}}),oy=f((t,e)=>{var r=Kg(),n=Jd(),i=ty(),a=ey(),o=Qg(),s=ry(),l=ny(),u=iy(),c=Kd(),h=ay();function f(t,e){let[r,i,a,o]=e,s=1/(a-r),l=1/(o-i),u=new Array(t.length);for(let e=0,a=t.length/2;e<a;e++)u[2*e]=n((t[2*e]-r)*s,0,1),u[2*e+1]=n((t[2*e+1]-i)*l,0,1);return u}e.exports=function(t,e){e||(e={}),t=l(t,"float64"),e=o(e,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let n=s(e.maxDepth,255),p=s(e.bounds,a(t,2));p[0]===p[2]&&p[2]++,p[1]===p[3]&&p[3]++;let d,m=f(t,p),g=t.length>>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(c(e.dtype))(g):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=g));for(let t=0;t<g;++t)d[t]=t;let y=[],v=[],x=[],_=[];!function t(e,r,i,a,o,s){if(!a.length)return null;let l=y[o]||(y[o]=[]),u=x[o]||(x[o]=[]),c=v[o]||(v[o]=[]),h=l.length;if(++o>n||s>1073741824){for(let t=0;t<a.length;t++)l.push(a[t]),u.push(s),c.push(null,null,null,null);return h}if(l.push(a[0]),u.push(s),a.length<=1)return c.push(null,null,null,null),h;let f=.5*i,p=e+f,d=r+f,g=[],_=[],b=[],w=[];for(let t=1,e=a.length;t<e;t++){let e=a[t],r=m[2*e],n=m[2*e+1];r<p?n<d?g.push(e):_.push(e):n<d?b.push(e):w.push(e)}return s<<=2,c.push(t(e,r,f,g,o,s),t(e,d,f,_,o,s+1),t(p,r,f,b,o,s+2),t(p,d,f,w,o,s+3)),h}(0,0,1,d,0,1);let b=0;for(let t=0;t<y.length;t++){let e=y[t];if(d.set)d.set(e,b);else for(let t=0,r=e.length;t<r;t++)d[t+b]=e[t];let r=b+y[t].length;_[t]=[b,r],b=r}return d.range=function(...e){let n;if(u(e[e.length-1])){let t=e.pop();!e.length&&(null!=t.x||null!=t.l||null!=t.left)&&(e=[t],n={}),n=o(t,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else n={};e.length||(e=p);let a=i(...e),[l,c,d,m]=[Math.min(a.x,a.x+a.width),Math.min(a.y,a.y+a.height),Math.max(a.x,a.x+a.width),Math.max(a.y,a.y+a.height)],[g,b,T,k]=f([l,c,d,m],p),A=s(n.level,y.length);if(null!=n.d){let t;"number"==typeof n.d?t=[n.d,n.d]:n.d.length&&(t=n.d),A=Math.min(Math.max(Math.ceil(-h(Math.abs(t[0])/(p[2]-p[0]))),Math.ceil(-h(Math.abs(t[1])/(p[3]-p[1])))),A)}if(A=Math.min(A,y.length),n.lod)return function(t,e,n,i,a){let o=[];for(let s=0;s<a;s++){let a=x[s],l=_[s][0],u=w(t,e,s),c=w(n,i,s),h=r.ge(a,u),f=r.gt(a,c,h,a.length-1);o[s]=[h+l,f+l]}return o}(g,b,T,k,A);let M=[];return function e(r,n,i,a,o,s){if(null===o||null===s)return;let u=n+i;if(g>r+i||b>u||T<r||k<n||a>=A||o===s)return;let h=y[a];void 0===s&&(s=h.length);for(let e=o;e<s;e++){let r=h[e],n=t[2*r],i=t[2*r+1];n>=l&&n<=d&&i>=c&&i<=m&&M.push(r)}let f=v[a],p=f[4*o+0],x=f[4*o+1],_=f[4*o+2],w=f[4*o+3],S=function(t,e){let r=null,n=0;for(;null===r;)if(r=t[4*e+n],n++,n>t.length)return null;return r}(f,o+1),E=.5*i,C=a+1;e(r,n,E,C,p,x||_||w||S),e(r,n+E,E,C,x,_||w||S),e(r+E,n,E,C,_,w||S),e(r+E,n+E,E,C,w,S)}(0,0,1,0,0,1),M},d;function w(t,e,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s<r;s++)n<<=2,n+=t<i?e<a?0:1:e<a?2:3,o*=.5,i+=t<i?-o:o,a+=e<a?-o:o;return n}}}),sy=f((t,e)=>{e.exports=oy()}),ly=f((t,e)=>{e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=i}switch(o){case"Z":n=e,i=r;break;case"H":n=t[1];break;case"V":i=t[1];break;case"M":n=e=t[1],i=r=t[2];break;default:n=t[t.length-2],i=t[t.length-1]}return t})}}),uy=f((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=2*Math.PI,i=function(t,e,r,n,i,a,o){var s=t.x,l=t.y;return{x:n*(s*=e)-i*(l*=r)+a,y:i*s+n*l+o}},a=function(t,e){var r=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:1.3333333333333333*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-i*r,y:i+n*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]},o=function(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};t.default=function(t){var e=t.px,s=t.py,l=t.cx,u=t.cy,c=t.rx,h=t.ry,f=t.xAxisRotation,p=void 0===f?0:f,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,y=void 0===g?0:g,v=[];if(0===c||0===h)return[];var x=Math.sin(p*n/360),_=Math.cos(p*n/360),b=_*(e-l)/2+x*(s-u)/2,w=-x*(e-l)/2+_*(s-u)/2;if(0===b&&0===w)return[];c=Math.abs(c),h=Math.abs(h);var T=Math.pow(b,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(h,2);T>1&&(c*=Math.sqrt(T),h*=Math.sqrt(T));var k=function(t,e,r,i,a,s,l,u,c,h,f,p){var d=Math.pow(a,2),m=Math.pow(s,2),g=Math.pow(f,2),y=Math.pow(p,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var x=(v=Math.sqrt(v)*(l===u?-1:1))*a/s*p,_=v*-s/a*f,b=h*x-c*_+(t+r)/2,w=c*x+h*_+(e+i)/2,T=(f-x)/a,k=(p-_)/s,A=(-f-x)/a,M=(-p-_)/s,S=o(1,0,T,k),E=o(T,k,A,M);return 0===u&&E>0&&(E-=n),1===u&&E<0&&(E+=n),[b,w,S,E]}(e,s,l,u,c,h,m,y,x,_,b,w),A=r(k,4),M=A[0],S=A[1],E=A[2],C=A[3],I=Math.abs(C)/(n/4);Math.abs(1-I)<1e-7&&(I=1);var L=Math.max(Math.ceil(I),1);C/=L;for(var P=0;P<L;P++)v.push(a(E,C)),E+=C;return v.map(function(t){var e=i(t[0],c,h,_,x,M,S),r=e.x,n=e.y,a=i(t[1],c,h,_,x,M,S),o=a.x,s=a.y,l=i(t[2],c,h,_,x,M,S);return{x1:r,y1:n,x2:o,y2:s,x:l.x,y:l.y}})},e.exports=t.default}),cy=f((t,e)=>{e.exports=function(t){for(var e,a=[],o=0,s=0,l=0,u=0,c=null,h=null,f=0,p=0,d=0,m=t.length;d<m;d++){var g=t[d],y=g[0];switch(y){case"M":l=g[1],u=g[2];break;case"A":var v=r({px:f,py:p,cx:g[6],cy:g[7],rx:g[1],ry:g[2],xAxisRotation:g[3],largeArcFlag:g[4],sweepFlag:g[5]});if(!v.length)continue;for(var x,_=0;_<v.length;_++)g=["C",(x=v[_]).x1,x.y1,x.x2,x.y2,x.x,x.y],_<v.length-1&&a.push(g);break;case"S":var b=f,w=p;("C"==e||"S"==e)&&(b+=b-o,w+=w-s),g=["C",b,w,g[1],g[2],g[3],g[4]];break;case"T":"Q"==e||"T"==e?(c=2*f-c,h=2*p-h):(c=f,h=p),g=i(f,p,c,h,g[1],g[2]);break;case"Q":c=g[1],h=g[2],g=i(f,p,g[1],g[2],g[3],g[4]);break;case"L":g=n(f,p,g[1],g[2]);break;case"H":g=n(f,p,g[1],p);break;case"V":g=n(f,p,f,g[1]);break;case"Z":g=n(f,p,l,u)}e=y,f=g[g.length-2],p=g[g.length-1],g.length>4?(o=g[g.length-4],s=g[g.length-3]):(o=f,s=p),a.push(g)}return a};var r=uy();function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}),hy=f((t,e)=>{e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}}),fy=f((t,e)=>{var r=Xe(),n=ly(),i=cy(),a=hy(),o=xc();e.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]),"string"==typeof t&&(o(a(t),"String is not an SVG path."),t=r(t)),o(Array.isArray(t),"Argument should be a string or an array of path segments."),t=n(t),!(t=i(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],s=0,l=t.length;s<l;s++)for(var u=t[s].slice(1),c=0;c<u.length;c+=2)u[c+0]<e[0]&&(e[0]=u[c+0]),u[c+1]<e[1]&&(e[1]=u[c+1]),u[c+0]>e[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}}),py=f((t,e)=>{var r=Math.PI,n=l(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(t,e,i,a,l,u,c,h,f,p){if(p)T=p[0],k=p[1],b=p[2],w=p[3];else{var d=s(t,e,-l);t=d.x,e=d.y;var m=(t-(h=(d=s(h,f,-l)).x))/2,g=(e-(f=d.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,_=(u==c?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));_==1/0&&(_=1);var b=_*i*g/a+(t+h)/2,w=_*-a*m/i+(e+f)/2,T=Math.asin(((e-w)/a).toFixed(9)),k=Math.asin(((f-w)/a).toFixed(9));(T=t<b?r-T:T)<0&&(T=2*r+T),(k=h<b?r-k:k)<0&&(k=2*r+k),c&&T>k&&(T-=2*r),!c&&k>T&&(k-=2*r)}if(Math.abs(k-T)>n){var A=k,M=h,S=f;k=T+n*(c&&k>T?1:-1);var E=o(h=b+i*Math.cos(k),f=w+a*Math.sin(k),i,a,l,0,c,M,S,[k,A,b,w])}var C=Math.tan((k-T)/4),I=4/3*i*C,L=4/3*a*C,P=[2*t-(t+I*Math.sin(T)),2*e-(e-L*Math.cos(T)),h+I*Math.sin(k),f-L*Math.cos(k),h,f];if(p)return P;E&&(P=P.concat(E));for(var z=0;z<P.length;){var O=s(P[z],P[z+1],l);P[z++]=O.x,P[z++]=O.y}return P}function s(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function l(t){return t*(r/180)}e.exports=function(t){for(var e,r=[],n=0,s=0,u=0,c=0,h=null,f=null,p=0,d=0,m=0,g=t.length;m<g;m++){var y=t[m],v=y[0];switch(v){case"M":u=y[1],c=y[2];break;case"A":(y=o(p,d,y[1],y[2],l(y[3]),y[4],y[5],y[6],y[7])).unshift("C"),y.length>7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=p,_=d;("C"==e||"S"==e)&&(x+=x-n,_+=_-s),y=["C",x,_,y[1],y[2],y[3],y[4]];break;case"T":"Q"==e||"T"==e?(h=2*p-h,f=2*d-f):(h=p,f=d),y=a(p,d,h,f,y[1],y[2]);break;case"Q":h=y[1],f=y[2],y=a(p,d,y[1],y[2],y[3],y[4]);break;case"L":y=i(p,d,y[1],y[2]);break;case"H":y=i(p,d,y[1],d);break;case"V":y=i(p,d,p,y[1]);break;case"Z":y=i(p,d,u,c)}e=v,p=y[y.length-2],d=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=p,s=d),r.push(y)}return r}}),dy=f((t,e)=>{var r=ly(),n=py(),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),n(r(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)}),t.closePath()}}),my=f((t,e)=>{var r=Jd();e.exports=function(t,e){e||(e={});var a,o,s,l,u,c,h,f,p,d,m,g=null==e.cutoff?.25:e.cutoff,y=null==e.radius?8:e.radius,v=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");a=e.width,o=e.height,l=t,c=e.stride?e.stride:Math.floor(t.length/a/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(f=t).getContext("2d"),a=f.width,o=f.height,p=h.getImageData(0,0,a,o),l=p.data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(f=t.canvas,h=t,a=f.width,o=f.height,p=h.getImageData(0,0,a,o),l=p.data,c=4):window.ImageData&&t instanceof window.ImageData&&(p=t,a=t.width,o=t.height,l=p.data,c=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(a*o),d=0,m=u.length;d<m;d++)l[d]=u[d*c+v]/255;else if(1!==c)throw Error("Raw data can have only 1 value per pixel");var x=Array(a*o),_=Array(a*o),b=Array(s),w=Array(s),T=Array(s+1),k=Array(s);for(d=0,m=a*o;d<m;d++){var A=l[d];x[d]=1===A?0:0===A?n:Math.pow(Math.max(0,.5-A),2),_[d]=1===A?n:0===A?0:Math.pow(Math.max(0,A-.5),2)}i(x,a,o,b,w,k,T),i(_,a,o,b,w,k,T);var M=window.Float32Array?new Float32Array(a*o):new Array(a*o);for(d=0,m=a*o;d<m;d++)M[d]=r(1-((x[d]-_[d])/y+g),0,1);return M};var n=1e20;function i(t,e,r,n,i,o,s){for(var l=0;l<e;l++){for(var u=0;u<r;u++)n[u]=t[u*e+l];for(a(n,i,o,s,r),u=0;u<r;u++)t[u*e+l]=i[u]}for(u=0;u<r;u++){for(l=0;l<e;l++)n[l]=t[u*e+l];for(a(n,i,o,s,e),l=0;l<e;l++)t[u*e+l]=Math.sqrt(i[l])}}function a(t,e,r,i,a){r[0]=0,i[0]=-n,i[1]=+n;for(var o=1,s=0;o<a;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=i[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,i[s]=l,i[s+1]=+n}for(o=0,s=0;o<a;o++){for(;i[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}}),gy=f((t,e)=>{var r,n=fy(),i=Xe(),a=dy(),o=hy(),s=my(),l=document.createElement("canvas"),u=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");var c,h;e||(e={}),e.shape?(c=e.shape[0],h=e.shape[1]):(c=l.width=e.w||e.width||200,h=l.height=e.h||e.height||200);var f=Math.min(c,h),p=e.stroke||0,d=e.viewbox||e.viewBox||n(t),m=[c/(d[2]-d[0]),h/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(u.fillStyle="black",u.fillRect(0,0,c,h),u.fillStyle="white",p&&("number"!=typeof p&&(p=1),u.strokeStyle=p>0?"white":"black",u.lineWidth=Math.abs(p)),u.translate(.5*c,.5*h),u.scale(g,g),function(){if(null!=r)return r;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return r=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var n=t.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(t);u.fill(y),p&&u.stroke(y)}else{var v=i(t);a(u,v),u.fill(),p&&u.stroke()}return u.setTransform(1,0,0,1,0,0),s(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*f})}}),yy=f((t,e)=>{var r=T(),n=gy(),i=Qd(),a=Ut(),o=oe(),s=o.isArrayOrTypedArray,l=Je(),u=ye(),c=em().formatColor,h=Ze(),f=We(),p=Xg(),d=Wg(),m=H().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=Ye().appendArrayPointValue;function v(t,e){var n,i=t._fullLayout,a=e._length,l=e.textfont,u=e.textposition,c=s(u)?u:[u],h=l.color,f=l.size,p=l.family,d=l.weight,m=l.style,g=l.variant,v={},_=t._context.plotGlPixelRatio,b=e.texttemplate;if(b){v.text=[];var w=i._d3locale,T=Array.isArray(b),k=T?Math.min(b.length,a):a,A=T?function(t){return b[t]}:function(){return b};for(n=0;n<k;n++){var M={i:n},S=e._module.formatLabels(M,e,i),E={};y(E,e,n);var C=e._meta||{};v.text.push(o.texttemplateString(A(n),S,w,E,M,C))}}else s(e.text)&&e.text.length<a?v.text=e.text.slice():v.text=e.text;if(s(v.text))for(n=v.text.length;n<a;n++)v.text[n]="";for(v.opacity=e.opacity,v.font={},v.align=[],v.baseline=[],n=0;n<c.length;n++){var I=c[n].split(/\s+/);switch(I[1]){case"left":v.align.push("right");break;case"right":v.align.push("left");break;default:v.align.push(I[1])}switch(I[0]){case"top":v.baseline.push("bottom");break;case"bottom":v.baseline.push("top");break;default:v.baseline.push(I[0])}}if(s(h))for(v.color=new Array(a),n=0;n<a;n++)v.color[n]=h[n];else v.color=h;if(s(f)||Array.isArray(p)||s(d)||Array.isArray(m)||Array.isArray(g))for(v.font=new Array(a),n=0;n<a;n++){var L=v.font[n]={};L.size=(o.isTypedArray(f)?f[n]:s(f)?r(f[n])?f[n]:0:f)*_,L.family=Array.isArray(p)?p[n]:p,L.weight=x(s(d)?d[n]:d),L.style=Array.isArray(m)?m[n]:m,L.variant=Array.isArray(g)?g[n]:g}else v.font={size:f*_,family:p,weight:x(d),style:m,variant:g};return v}function x(t){return t<=1e3?t>500?"bold":"normal":t}function _(t,e){var r,n,a=e._length,o=e.marker,l={},u=s(o.symbol),h=s(o.angle),d=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(u||(n=p.isOpenSymbol(o.symbol)),u||d||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,_=o.angle,b=c(o,o.opacity,a),w=c(o.line,o.opacity,a);if(!s(w[0])){var T=w;for(w=Array(a),r=0;r<a;r++)w[r]=T}if(!s(b[0])){var k=b;for(b=Array(a),r=0;r<a;r++)b[r]=k}if(!s(x)){var A=x;for(x=Array(a),r=0;r<a;r++)x[r]=A}if(!s(_)){var M=_;for(_=Array(a),r=0;r<a;r++)_[r]=M}for(l.symbols=x,l.angles=_,l.colors=b,l.borderColors=w,r=0;r<a;r++)u&&(n=p.isOpenSymbol(o.symbol[r])),n&&(w[r]=b[r].slice(),b[r]=b[r].slice(),b[r][3]=0);for(l.opacity=e.opacity,l.markers=new Array(a),r=0;r<a;r++)l.markers[r]=I({mx:l.symbols[r],ma:l.angles[r]},e)}else n?(l.color=i(o.color,"uint8"),l.color[3]=0,l.borderColor=i(o.color,"uint8")):(l.color=i(o.color,"uint8"),l.borderColor=i(o.line.color,"uint8")),l.opacity=e.opacity*o.opacity,l.marker=I({mx:o.symbol,ma:o.angle},e);var S,E=f(e,1);if(y||v){var C,L=l.sizes=new Array(a),P=l.borderSizes=new Array(a),z=0;if(y){for(r=0;r<a;r++)L[r]=E(o.size[r]),z+=L[r];C=z/a}else for(S=E(o.size),r=0;r<a;r++)L[r]=S;if(v)for(r=0;r<a;r++)P[r]=o.line.width[r];else for(S=o.line.width,r=0;r<a;r++)P[r]=S;l.sizeAvg=C}else l.size=E(o&&o.size||10),l.borderSizes=E(o.line.width);return l}function b(t,e,r){var n=e.marker,i={};return r&&(r.marker&&r.marker.symbol?i=_(0,o.extendFlat({},n,r.marker)):r.marker&&(r.marker.size&&(i.size=r.marker.size),r.marker.color&&(i.colors=r.marker.color),void 0!==r.marker.opacity&&(i.opacity=r.marker.opacity))),i}function w(t,e,r){var n={};if(!r)return n;if(r.textfont){var i={opacity:1,text:e.text,texttemplate:e.texttemplate,textposition:e.textposition,textfont:o.extendFlat({},e.textfont)};r.textfont&&o.extendFlat(i.textfont,r.textfont),n=v(t,i)}return n}function k(t,e,r){var n={capSize:2*e.width*r,lineWidth:e.thickness*r,color:e.color};return e.copy_ystyle&&(n=t.error_y),n}var A=d.SYMBOL_SDF_SIZE,M=d.SYMBOL_SIZE,S=d.SYMBOL_STROKE,E={},C=l.symbolFuncs[0](.05*M);function I(t,e){var r=t.mx;if("circle"===r)return null;var i,a,o=l.symbolNumber(r),s=l.symbolFuncs[o%100],u=!!l.symbolNoDot[o%100],c=!!l.symbolNoFill[o%100],h=p.isDotSymbol(r);if(t.ma&&(r+="_"+t.ma),E[r])return E[r];var f=l.getMarkerAngle(t,e);return i=h&&!u?s(1.1*M,f)+C:s(M,f),a=n(i,{w:A,h:A,viewBox:[-M,-M,M,M],stroke:c?S:-S}),E[r]=a,a||null}e.exports={style:function(t,e){var r,n={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},i=t._context.plotGlPixelRatio;if(!0!==e.visible)return n;if(h.hasText(e)&&(n.text=v(t,e),n.textSel=w(t,e,e.selected),n.textUnsel=w(t,e,e.unselected)),h.hasMarkers(e)&&(n.marker=_(0,e),n.markerSel=b(0,e,e.selected),n.markerUnsel=b(0,e,e.unselected),!e.unselected&&s(e.marker.opacity))){var a=e.marker.opacity;for(n.markerUnsel.opacity=new Array(a.length),r=0;r<a.length;r++)n.markerUnsel.opacity[r]=m*a[r]}if(h.hasLines(e)){n.line={overlay:!0,thickness:e.line.width*i,color:e.line.color,opacity:e.opacity};var o=(d.DASHES[e.line.dash]||[1]).slice();for(r=0;r<o.length;++r)o[r]*=e.line.width*i;n.line.dashes=o}return e.error_x&&e.error_x.visible&&(n.errorX=k(e,e.error_x,i)),e.error_y&&e.error_y.visible&&(n.errorY=k(e,e.error_y,i)),e.fill&&"none"!==e.fill&&(n.fill={closed:!0,fill:e.fillcolor,thickness:0}),n},markerStyle:_,markerSelection:b,linePositions:function(t,e,r){var n,i,a=r.length,o=a/2;if(h.hasLines(e)&&o)if("hv"===e.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i+2],r[2*i+1]));n.push(r[a-2],r[a-1])}else if("hvh"===e.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var s=(r[2*i]+r[2*i+2])/2;n.push(r[2*i],r[2*i+1],s,r[2*i+1],s,r[2*i+3])}n.push(r[a-2],r[a-1])}else if("vhv"===e.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var l=(r[2*i+1]+r[2*i+3])/2;n.push(r[2*i],r[2*i+1],r[2*i],l,r[2*i+2],l)}n.push(r[a-2],r[a-1])}else if("vh"===e.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+3]));n.push(r[a-2],r[a-1])}else n=r;var u=!1;for(i=0;i<n.length;i++)if(isNaN(n[i])){u=!0;break}var c=u||n.length>d.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var f=n[0],p=n[1];for(i=0;i<n.length;i+=2)isNaN(n[i])||isNaN(n[i+1])?(n[i]=f,n[i+1]=p):(f=n[i],p=n[i+1])}return{join:c,positions:n}},errorBarPositions:function(t,e,n,i,o){var s=a.getComponentMethod("errorbars","makeComputeError"),l=u.getFromId(t,e.xaxis,"x"),c=u.getFromId(t,e.yaxis,"y"),h=n.length/2,f={};function p(t,i){var a=i._id.charAt(0),o=e["error_"+a];if(o&&o.visible&&("linear"===i.type||"log"===i.type)){for(var l=s(o),u={x:0,y:1}[a],c={x:[0,1,2,3],y:[2,3,0,1]}[a],p=new Float64Array(4*h),d=1/0,m=-1/0,g=0,y=0;g<h;g++,y+=4){var v=t[g];if(r(v)){var x=n[2*g+u],_=l(v,g),b=_[0],w=_[1];if(r(b)&&r(w)){var T=v-b,k=v+w;p[y+c[0]]=x-i.c2l(T),p[y+c[1]]=i.c2l(k)-x,p[y+c[2]]=0,p[y+c[3]]=0,d=Math.min(d,v-b),m=Math.max(m,v+w)}}}f[a]={positions:n,errors:p,_bnds:[d,m]}}}return p(i,l),p(o,c),f},textPosition:function(t,e,r,n){var i,a=e._length,o={};if(h.hasMarkers(e)){var l=r.font,u=r.align,c=r.baseline;for(o.offset=new Array(a),i=0;i<a;i++){var f=n.sizes?n.sizes[i]:n.size,p=s(l)?l[i].size:l.size,d=s(u)?u.length>1?u[i]:u[0]:u,m=s(c)?c.length>1?c[i]:c[0]:c,y=g[d],v=g[m],x=f?f/.8+1:0,_=-v*x-.5*v;o.offset[i]=[y*x/p,_/p]}}return o}}}),vy=f((t,e)=>{var r=oe();e.exports=function(t,e){var n=e._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((n=e._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(t){var e=r.repeat(t,n.count);if(n.fill2d&&n.fill2d.update(e),n.scatter2d&&n.scatter2d.update(e),n.line2d&&n.line2d.update(e),n.error2d&&n.error2d.update(e.concat(e)),n.select2d&&n.select2d.update(e),n.glText)for(var i=0;i<n.count;i++)n.glText[i].update(t)},n.draw=function(){for(var t=n.count,e=n.fill2d,i=n.error2d,a=n.line2d,o=n.scatter2d,s=n.glText,l=n.select2d,u=n.selectBatch,c=n.unselectBatch,h=0;h<t;h++){if(e&&n.fillOrder[h]&&e.draw(n.fillOrder[h]),a&&n.lineOptions[h]&&a.draw(h),i&&(n.errorXOptions[h]&&i.draw(h),n.errorYOptions[h]&&i.draw(h+t)),o&&n.markerOptions[h])if(c[h].length){var f=r.repeat([],n.count);f[h]=c[h],o.draw(f)}else u[h].length||o.draw(h);s[h]&&n.textOptions[h]&&s[h].render()}l&&l.draw(u),n.dirty=!1},n.destroy=function(){n.fill2d&&n.fill2d.destroy&&n.fill2d.destroy(),n.scatter2d&&n.scatter2d.destroy&&n.scatter2d.destroy(),n.error2d&&n.error2d.destroy&&n.error2d.destroy(),n.line2d&&n.line2d.destroy&&n.line2d.destroy(),n.select2d&&n.select2d.destroy&&n.select2d.destroy(),n.glText&&n.glText.forEach(function(t){t.destroy&&t.destroy()}),n.lineOptions=null,n.fillOptions=null,n.markerOptions=null,n.markerSelectedOptions=null,n.markerUnselectedOptions=null,n.errorXOptions=null,n.errorYOptions=null,n.textOptions=null,n.textSelectedOptions=null,n.textUnselectedOptions=null,n.selectBatch=null,n.unselectBatch=null,e._scene=null}),n.dirty||r.extendFlat(n,i),n}}),xy=f((t,e)=>{var r=sy(),n=oe(),i=ye(),a=er().findExtremes,o=ti(),s=ii(),l=s.calcMarkerSize,u=s.calcAxisExpansion,c=s.setFirstScatter,h=ei(),f=yy(),p=vy(),d=k().BADNUM,m=Wg().TOO_MANY_POINTS;function g(t,e,r){var n=t._extremes[e._id],i=a(e,r._bnds,{padded:!0});n.min=n.min.concat(i.min),n.max=n.max.concat(i.max)}e.exports=function(t,e){var a,s=t._fullLayout,y=e._xA=i.getFromId(t,e.xaxis,"x"),v=e._yA=i.getFromId(t,e.yaxis,"y"),x=s._plots[e.xaxis+e.yaxis],_=e._length,b=_>=m,w=2*_,T={},k=y.makeCalcdata(e,"x"),A=v.makeCalcdata(e,"y"),M=o(e,y,"x",k),S=o(e,v,"y",A),E=M.vals,C=S.vals;e._x=E,e._y=C,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=A,e._yStarts=S.starts,e._yEnds=S.ends);var I=new Array(w),L=new Array(_);for(a=0;a<_;a++)I[2*a]=E[a]===d?NaN:E[a],I[2*a+1]=C[a]===d?NaN:C[a],L[a]=a;if("log"===y.type)for(a=0;a<w;a+=2)I[a]=y.c2l(I[a]);if("log"===v.type)for(a=1;a<w;a+=2)I[a]=v.c2l(I[a]);b&&"log"!==y.type&&"log"!==v.type?T.tree=r(I):T.ids=L,h(t,e);var P,z=function(t,e,r,i,a,o){var s=f.style(t,r);if(s.marker&&(s.marker.positions=i),s.line&&i.length>1&&n.extendFlat(s.line,f.linePositions(t,r,i)),s.errorX||s.errorY){var l=f.errorBarPositions(t,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},f.textPosition(t,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},f.textPosition(t,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},f.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,I,E,C),O=p(t,x);return c(s,e),b?z.marker&&(P=z.marker.sizeAvg||Math.max(z.marker.size,3)):P=l(e,_),u(t,e,y,v,E,C,P),z.errorX&&g(e,y,z.errorX),z.errorY&&g(e,v,z.errorY),z.fill&&!O.fill2d&&(O.fill2d=!0),z.marker&&!O.scatter2d&&(O.scatter2d=!0),z.line&&!O.line2d&&(O.line2d=!0),(z.errorX||z.errorY)&&!O.error2d&&(O.error2d=!0),z.text&&!O.glText&&(O.glText=!0),z.marker&&(z.marker.snap=_),O.lineOptions.push(z.line),O.errorXOptions.push(z.errorX),O.errorYOptions.push(z.errorY),O.fillOptions.push(z.fill),O.markerOptions.push(z.marker),O.markerSelectedOptions.push(z.markerSel),O.markerUnselectedOptions.push(z.markerUnsel),O.textOptions.push(z.text),O.textSelectedOptions.push(z.textSel),O.textUnselectedOptions.push(z.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),T._scene=O,T.index=O.count,T.x=E,T.y=C,T.positions=I,O.count++,[{x:!1,y:!1,t:T,trace:e}]}}),_y=f((t,e)=>{var r=oe(),n=q(),i=H().DESELECTDIM;e.exports={styleTextSelection:function(t){var e,a,o=t[0],s=o.trace,l=o.t,u=l._scene,c=l.index,h=u.selectBatch[c],f=u.unselectBatch[c],p=u.textOptions[c],d=u.textSelectedOptions[c]||{},m=u.textUnselectedOptions[c]||{},g=r.extendFlat({},p);if(h.length||f.length){var y=d.color,v=m.color,x=p.color,_=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),e=0;e<h.length;e++)a=h[e],g.color[a]=y||(_?x[a]:x);for(e=0;e<f.length;e++){a=f[e];var b=_?x[a]:x;g.color[a]=v||(y?b:n.addOpacity(b,i))}}u.glText[c].update(g)}}}),by=f((t,e)=>{var r=Ze(),n=_y().styleTextSelection;e.exports=function(t,e){var i=t.cd,a=t.xaxis,o=t.yaxis,s=[],l=i[0].trace,u=i[0].t,c=l._length,h=u.x,f=u.y,p=u._scene,d=u.index;if(!p)return s;var m=r.hasText(l),g=r.hasMarkers(l),y=!g&&!m;if(!0!==l.visible||y)return s;var v=[],x=[];if(!1!==e&&!e.degenerate)for(var _=0;_<c;_++)e.contains([u.xpx[_],u.ypx[_]],!1,_,t)?(v.push(_),s.push({pointNumber:_,x:a.c2d(h[_]),y:o.c2d(f[_])})):x.push(_);if(g){var b=p.scatter2d;if(v.length||x.length){if(!p.selectBatch[d].length&&!p.unselectBatch[d].length){var w=new Array(p.count);w[d]=p.markerUnselectedOptions[d],b.update.apply(b,w)}}else{var T=new Array(p.count);T[d]=p.markerOptions[d],b.update.apply(b,T)}}return p.selectBatch[d]=v,p.unselectBatch[d]=x,m&&n(i),s}}),wy=f((t,e)=>{var r=Zg();e.exports={moduleType:"trace",name:"scattergl",basePlotModule:Ai(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Yg(),supplyDefaults:$g(),crossTraceDefaults:Kn(),colorbar:hi(),formatLabels:Jg(),calc:xy(),hoverPoints:r.hoverPoints,selectPoints:by(),meta:{}}}),Ty=f((t,e)=>{var r=Jd();function n(t,e){null==e&&(e=!0);var n=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(n*=255,i*=255,a*=255,o*=255),16777216*(n=255&r(n,0,255))+((i=255&r(i,0,255))<<16)+((a=255&r(a,0,255))<<8)+(o=255&r(o,0,255))}e.exports=n,e.exports.to=n,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}),ky=f((t,e)=>{var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var a,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l<arguments.length;l++){for(var u in a=Object(arguments[l]))n.call(a,u)&&(s[u]=a[u]);if(r){o=r(a);for(var c=0;c<o.length;c++)i.call(a,o[c])&&(s[o[c]]=a[o[c]])}}return s}}),Ay=f((t,e)=>{e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}}),My=f((t,e)=>{e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n<i;n++){var a=r[n];for(var o in a)if((void 0===e[o]||Array.isArray(e[o])||t[o]!==e[o])&&o in e){var s;if(!0===a[o])s=e[o];else{if(!1===a[o])continue;if("function"==typeof a[o]&&void 0===(s=a[o](e[o],t,e)))continue}t[o]=s}}return t}}),Sy=f((t,e)=>{e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),Ey=f((t,e)=>{e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=n(t));for(var r=0,i=e.length;r<i;r++)e[r]=t[r]-e[r];return e}return n(t-n(t))};var r=new Float32Array(1);function n(t){return t.length?t instanceof Float32Array?t:new Float32Array(t):(r[0]=t,r[0])}}),Cy=f((t,e)=>{function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e);else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){u=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=Qd(),s=ey(),l=Ty(),u=sy(),c=ky(),h=Ay(),f=Qg(),p=My(),d=ny(),m=Sy(),g=Ey(),y=ty(),v=x;function x(t,e){var r=this;if(!(this instanceof x))return new x(t,e);"function"==typeof t?(e||(e={}),e.regl=t):(e=t,t=null),e&&e.length&&(e.positions=e);var n,i=(t=e.regl)._gl,a=[],o=255;this.tooManyColors=m,n=t.texture({data:new Uint8Array(4*o),width:o,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),c(this,{regl:t,gl:i,groups:[],markerCache:[null],markerTextures:[null],palette:a,paletteIds:{},paletteTexture:n,maxColors:o,maxSize:100,canvas:i.canvas}),this.update(e);var s={uniforms:{constPointSize:!!e.constPointSize,opacity:t.prop("opacity"),paletteSize:function(t,e){return[r.tooManyColors?0:o,n.height]},pixelRatio:t.context("pixelRatio"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),markerTexture:t.prop("markerTexture"),paletteTexture:n},attributes:{x:function(t,e){return e.xAttr||{buffer:e.positionBuffer,stride:8,offset:0}},y:function(t,e){return e.yAttr||{buffer:e.positionBuffer,stride:8,offset:4}},xFract:function(t,e){return e.xAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:0}},yFract:function(t,e){return e.yAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:4}},size:function(t,e){return e.size.length?{buffer:e.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*e.size/r.maxSize)]}},borderSize:function(t,e){return e.borderSize.length?{buffer:e.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*e.borderSize/r.maxSize)]}},colorId:function(t,e){return e.color.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:0}:{constant:r.tooManyColors?a.slice(4*e.color,4*e.color+4):[e.color]}},borderColorId:function(t,e){return e.borderColor.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:r.tooManyColors?4:2}:{constant:r.tooManyColors?a.slice(4*e.borderColor,4*e.borderColor+4):[e.borderColor]}},isActive:function(t,e){return!0===e.activation?{constant:[1]}:e.activation?e.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:t.prop("elements"),count:t.prop("count"),offset:t.prop("offset"),primitive:"points"},l=c({},s);l.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\nuniform sampler2D markerTexture;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;\n\n // max-distance alpha\n if (dist < 0.003) discard;\n\n // null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);\n }\n else {\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n }\n\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 scale, scaleFract, translate, translateFract, paletteSize;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pointSizeScale;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),this.drawMarker=t(l);var u=c({},s);u.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nuniform float opacity;\n\nfloat smoothStep(float edge0, float edge1, float x) {\n\tfloat t;\n\tt = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n\treturn t * t * (3.0 - 2.0 * t);\n}\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif (radius > 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),u.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(u.frag=u.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(u)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=this.groups;if(1===r.length&&Array.isArray(r[0])&&(null===r[0][0]||Array.isArray(r[0][0]))&&(r=r[0]),this.regl._refresh(),r.length)for(var a=0;a<r.length;a++)this.drawItem(a,r[a]);else i.forEach(function(e,r){t.drawItem(r)});return this},x.prototype.drawItem=function(t,e){var r=this.groups,i=r[t];if("number"==typeof e&&(t=e,i=r[e],e=null),i&&i.count&&i.opacity){i.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,i,e));for(var a=[],o=1;o<i.activation.length;o++)!i.activation[o]||!0!==i.activation[o]&&!i.activation[o].data.length||a.push.apply(a,n(this.getMarkerDrawOptions(o,i,e)));a.length&&this.drawMarker(a)}},x.prototype.getMarkerDrawOptions=function(t,e,n){var i=e.range,a=e.tree,o=e.viewport,s=e.activation,l=e.selectionBuffer,u=e.count;if(this.regl,!a)return n?[c({},e,{markerTexture:this.markerTextures[t],activation:s[t],count:n.length,elements:n,offset:0})]:[c({},e,{markerTexture:this.markerTextures[t],activation:s[t],offset:0})];var h=[],f=a.range(i,{lod:!0,px:[(i[2]-i[0])/o.width,(i[3]-i[1])/o.height]});if(n){for(var p=s[t].data,d=new Uint8Array(u),m=0;m<n.length;m++){var g=n[m];d[g]=p?p[g]:1}l.subdata(d)}for(var y=f.length;y--;){var v=r(f[y],2),x=v[0],_=v[1];h.push(c({},e,{markerTexture:this.markerTextures[t],activation:n?l:s[t],offset:x,count:_-x}))}return h},x.prototype.update=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length){1===r.length&&Array.isArray(r[0])&&(r=r[0]);var i=this.groups,a=this.gl,o=this.regl,l=this.maxSize,h=this.maxColors,m=this.palette;this.groups=i=r.map(function(e,r){var n=i[r];if(void 0===e)return n;null===e?e={positions:null}:"function"==typeof e?e={ondraw:e}:"number"==typeof e[0]&&(e={positions:e}),null===(e=f(e,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"})).positions&&(e.positions=[]),null!=e.tooManyColors&&(t.tooManyColors=e.tooManyColors),n||(i[r]=n={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:o.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},e=c({},x.defaults,e)),e.positions&&!("marker"in e)&&(e.marker=n.marker,delete n.marker),e.marker&&!("positions"in e)&&(e.positions=n.positions,delete n.positions);var v=0,_=0;if(p(n,e,[{snap:!0,size:function(t,e){return null==t&&(t=x.defaults.size),v+=t&&t.length?1:0,t},borderSize:function(t,e){return null==t&&(t=x.defaults.borderSize),v+=t&&t.length?1:0,t},opacity:parseFloat,color:function(e,r){return null==e&&(e=x.defaults.color),e=t.updateColor(e),_++,e},borderColor:function(e,r){return null==e&&(e=x.defaults.borderColor),e=t.updateColor(e),_++,e},bounds:function(t,e,r){return"range"in r||(r.range=null),t},positions:function(t,e,r){var n=e.snap,i=e.positionBuffer,a=e.positionFractBuffer,l=e.selectionBuffer;if(t.x||t.y)return t.x.length?e.xAttr={buffer:o.buffer(t.x),offset:0,stride:4,count:t.x.length}:e.xAttr={buffer:t.x.buffer,offset:4*t.x.offset||0,stride:4*(t.x.stride||1),count:t.x.count},t.y.length?e.yAttr={buffer:o.buffer(t.y),offset:0,stride:4,count:t.y.length}:e.yAttr={buffer:t.y.buffer,offset:4*t.y.offset||0,stride:4*(t.y.stride||1),count:t.y.count},e.count=Math.max(e.xAttr.count,e.yAttr.count),t;t=d(t,"float64");var c=e.count=Math.floor(t.length/2),h=e.bounds=c?s(t,2):null;if(!r.range&&!e.range&&(delete e.range,r.range=h),!r.marker&&!e.marker&&(delete e.marker,r.marker=null),n&&(!0===n||c>n)?e.tree=u(t,{bounds:h}):n&&n.length&&(e.tree=n),e.tree){var f={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(f):e.elements=o.elements(f)}var p=g.float32(t);return i({data:p,usage:"dynamic"}),a({data:g.fract32(t,p),usage:"dynamic"}),l({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach(function(t){return t&&t.destroy&&t.destroy()}),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s<l;s++){var u=t.addMarker(e[s]);a[u]||(a[u]=new Uint8Array(r.count)),a[u][s]=1}for(var c=0;c<a.length;c++)if(a[c]){var h={data:a[c],type:"uint8",usage:"static"};i[c]?i[c](h):i[c]=o.buffer(h),i[c].data=a[c]}}else i[t.addMarker(e)]=!0;return e},range:function(t,e,r){var n=e.bounds;if(n)return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=g.fract(e.scale),e.translateFract=g.fract(e.translate),t},viewport:function(t){return y(t||[a.drawingBufferWidth,a.drawingBufferHeight])}}]),v){var b=n,w=b.count,T=b.size,k=b.borderSize,A=b.sizeBuffer,M=new Uint8Array(2*w);if(T.length||k.length)for(var S=0;S<w;S++)M[2*S]=Math.round(255*(null==T[S]?T:T[S])/l),M[2*S+1]=Math.round(255*(null==k[S]?k:k[S])/l);A({data:M,usage:"dynamic"})}if(_){var E,C=n,I=C.count,L=C.color,P=C.borderColor,z=C.colorBuffer;if(t.tooManyColors){if(L.length||P.length){E=new Uint8Array(8*I);for(var O=0;O<I;O++){var D=L[O];E[8*O]=m[4*D],E[8*O+1]=m[4*D+1],E[8*O+2]=m[4*D+2],E[8*O+3]=m[4*D+3];var R=P[O];E[8*O+4]=m[4*R],E[8*O+5]=m[4*R+1],E[8*O+6]=m[4*R+2],E[8*O+7]=m[4*R+3]}}}else if(L.length||P.length){E=new Uint8Array(4*I+2);for(var F=0;F<I;F++)null!=L[F]&&(E[4*F]=L[F]%h,E[4*F+1]=Math.floor(L[F]/h)),null!=P[F]&&(E[4*F+2]=P[F]%h,E[4*F+3]=Math.floor(P[F]/h))}z({data:E||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return n})}},x.prototype.addMarker=function(t){var e,r=this.markerTextures,n=this.regl,i=this.markerCache,a=null==t?0:i.indexOf(t);if(a>=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o<s;o++)e[o]=255*t[o]}var l=Math.floor(Math.sqrt(e.length));return a=r.length,i.push(t),r.push(n.texture({channels:1,data:e,radius:l,mag:"linear",min:"linear"})),a},x.prototype.updateColor=function(t){var e=this.paletteIds,r=this.palette,n=this.maxColors;Array.isArray(t)||(t=[t]);var i=[];if("number"==typeof t[0]){var a=[];if(Array.isArray(t))for(var s=0;s<t.length;s+=4)a.push(t.slice(s,s+4));else for(var u=0;u<t.length;u+=4)a.push(t.subarray(u,u+4));t=a}for(var c=0;c<t.length;c++){var h=t[c];h=o(h,"uint8");var f=l(h,!1);if(null==e[f]){var p=r.length;e[f]=Math.floor(p/4),r[p]=h[0],r[p+1]=h[1],r[p+2]=h[2],r[p+3]=h[3]}i[c]=e[f]}return!this.tooManyColors&&r.length>4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i<n*e;i++)t.push(0,0,0,0);r.height<n&&r.resize(e,n),r.subimage({width:Math.min(.25*t.length,e),height:n,data:t},0,0)}},x.prototype.destroy=function(){return this.groups.forEach(function(t){t.sizeBuffer.destroy(),t.positionBuffer.destroy(),t.positionFractBuffer.destroy(),t.colorBuffer.destroy(),t.activation.forEach(function(t){return t&&t.destroy&&t.destroy()}),t.selectionBuffer.destroy(),t.elements&&t.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(function(t){return t&&t.destroy&&t.destroy()}),this};var _=ky();e.exports=function(t,e){var r=new v(t,e),n=r.render.bind(r);return _(n,{render:n,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),n}}),Iy=f((t,e)=>{function r(t,e,r){r=r||2;var i,o,s,l,u,f,p,m=e&&e.length,g=m?e[0]*r:t.length,y=n(t,0,g,r,!0),v=[];if(!y||y.next===y.prev)return v;if(m&&(y=function(t,e,r,i){var a,o,s,l,u,f=[];for(a=0,o=e.length;a<o;a++)s=e[a]*i,l=a<o-1?e[a+1]*i:t.length,(u=n(t,s,l,i,!1))===u.next&&(u.steiner=!0),f.push(d(u));for(f.sort(c),a=0;a<f.length;a++)r=h(f[a],r);return r}(t,e,y,r)),t.length>80*r){i=s=t[0],o=l=t[1];for(var x=r;x<g;x+=r)(u=t[x])<i&&(i=u),(f=t[x+1])<o&&(o=f),u>s&&(s=u),f>l&&(l=f);p=0!==(p=Math.max(s-i,l-o))?32767/p:0}return a(y,v,r,i,o,p,0),v}function n(t,e,r,n,i){var a,o;if(i===S(t,e,r,n)>0)for(a=e;a<r;a+=n)o=k(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=k(a,t[a],t[a+1],o);return o&&v(o,o.next)&&(A(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,c,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=p(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,n,c,h);for(var d,m,g=t;t.prev!==t.next;)if(d=t.prev,m=t.next,h?s(t,n,c,h):o(t))e.push(d.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),A(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?a(t=l(i(t),e,r),e,r,n,c,h,2):2===f&&u(t,e,r,n,c,h):a(i(t),e,r,n,c,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,u=n.y,c=i<a?i<o?i:o:a<o?a:o,h=s<l?s<u?s:u:l<u?l:u,f=i>a?i>o?i:o:a>o?a:o,p=s>l?s>u?s:u:l>u?l:u,d=n.next;d!==e;){if(d.x>=c&&d.x<=f&&d.y>=h&&d.y<=p&&m(i,s,a,l,o,u,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function s(t,e,r,n){var i=t.prev,a=t,o=t.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,u=o.x,c=i.y,h=a.y,f=o.y,d=s<l?s<u?s:u:l<u?l:u,g=c<h?c<f?c:f:h<f?h:f,v=s>l?s>u?s:u:l>u?l:u,x=c>h?c>f?c:f:h>f?h:f,_=p(d,g,e,r,n),b=p(v,x,e,r,n),w=t.prevZ,T=t.nextZ;w&&w.z>=_&&T&&T.z<=b;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,c,l,h,u,f,w.x,w.y)&&y(w.prev,w,w.next)>=0||(w=w.prevZ,T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,c,l,h,u,f,T.x,T.y)&&y(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;w&&w.z>=_;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,c,l,h,u,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=b;){if(T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,c,l,h,u,f,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function l(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(e.push(a.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),A(n),A(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function u(t,e,r,n,o,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=T(l,u);return l=i(l,l.next),c=i(c,c.next),a(l,e,r,n,o,s,0),void a(c,e,r,n,o,s,0)}u=u.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next}while(n!==e);if(!r)return null;var l,u=r,c=r.x,h=r.y,p=1/0;n=r;do{i>=n.x&&n.x>=c&&i!==n.x&&m(a<h?i:o,a,c,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),w(n,t)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&f(r,n)))&&(r=n,p=l)),n=n.next}while(n!==u);return r}(t,e);if(!r)return e;var n=T(r,t);return i(n,n.next),i(r,r.next)}function f(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function m(t,e,r,n,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||v(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var i=b(y(t,e,r)),a=b(y(t,e,n)),o=b(y(r,n,t)),s=b(y(r,n,e));return!!(i!==a&&o!==s||0===i&&_(t,r,e)||0===a&&_(t,n,e)||0===o&&_(r,t,n)||0===s&&_(r,e,n))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function b(t){return t>0?1:t<0?-1:0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function T(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function k(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}e.exports=r,e.exports.default=r,r.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(S(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;o-=Math.abs(S(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}}),Ly=f((t,e)=>{var r=ey();e.exports=function(t,e,n){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1),null==n&&(n=r(t,e));for(var i=0;i<e;i++){var a=n[e+i],o=n[i],s=i,l=t.length;if(a===1/0&&o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:t[s]===o?0:.5;else if(a===1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:0;else if(o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===o?0:1;else{var u=a-o;for(s=i;s<l;s+=e)isNaN(t[s])||(t[s]=0===u?.5:(t[s]-o)/u)}}return t}}),Py=f((t,e)=>{e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return!("[object WeakMap]"!==String(t)||"function"!=typeof t.set||t.set({},1)!==t||"function"!=typeof t.delete||"function"!=typeof t.has||"one"!==t.get(e))}}),zy=f((t,e)=>{e.exports=function(){}}),Oy=f((t,e)=>{var r=zy()();e.exports=function(t){return t!==r&&null!==t}}),Dy=f((t,e)=>{var r=Object.create,n=Object.getPrototypeOf,i={};e.exports=function(){var t=Object.setPrototypeOf;return"function"==typeof t&&n(t((arguments[0]||r)(null),i))===i}}),Ry=f((t,e)=>{var r=Oy(),n={function:!0,object:!0};e.exports=function(t){return r(t)&&n[typeof t]||!1}}),Fy=f((t,e)=>{var r=Oy();e.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}}),By=f((t,e)=>{var r,n,i,a,o=Object.create;Dy()()||(r=Ny()),e.exports=r&&1===r.level?(n={},i={},a={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){i[t]="__proto__"!==t?a:{configurable:!0,enumerable:!1,writable:!0,value:void 0}}),Object.defineProperties(n,i),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:n}),function(t,e){return o(null===t?n:t,e)}):o}),Ny=f((t,e)=>{var r,n,i,a,o=Ry(),s=Fy(),l=Object.prototype.isPrototypeOf,u=Object.defineProperty,c={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(t,e){if(s(t),null===e||o(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=(n=function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}(),n?(2===n.level?n.set?(a=n.set,i=function(t,e){return a.call(r(t,e),e),t}):i=function(t,e){return r(t,e).__proto__=e,t}:i=function t(e,n){var i;return r(e,n),(i=l.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===n&&(n=t.nullPolyfill),e.__proto__=n,i&&u(t.nullPolyfill,"__proto__",c),e},Object.defineProperty(i,"level",{configurable:!1,enumerable:!1,writable:!1,value:n.level})):null),By()}),jy=f((t,e)=>{e.exports=Dy()()?Object.setPrototypeOf:Ny()}),Uy=f((t,e)=>{var r=Ry();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not an Object");return t}}),Vy=f((t,e)=>{var r=Object.create(null),n=Math.random;e.exports=function(){var t;do{t=n().toString(36).slice(2)}while(r[t]);return t}}),qy=f((t,e)=>{e.exports=function(t){return null!=t}}),Hy=f((t,e)=>{var r=qy(),n={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!r(t)&&hasOwnProperty.call(n,typeof t)}}),Gy=f((t,e)=>{var r=Hy();e.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}}),Zy=f((t,e)=>{var r=Gy();e.exports=function(t){if("function"!=typeof t||!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length||"function"!=typeof t.call||"function"!=typeof t.apply)return!1}catch(t){return!1}return!r(t)}}),Wy=f((t,e)=>{var r=Zy(),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!(!r(t)||n.test(i.call(t)))}}),Yy=f((t,e)=>{e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}}),Xy=f((t,e)=>{e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}}),$y=f((t,e)=>{var r=Oy(),n=Object.keys;e.exports=function(t){return n(r(t)?Object(t):t)}}),Jy=f((t,e)=>{e.exports=Xy()()?Object.keys:$y()}),Ky=f((t,e)=>{var r=Jy(),n=Fy(),i=Math.max;e.exports=function(t,e){var a,o,s,l=i(arguments.length,2);for(t=Object(n(t)),s=function(r){try{t[r]=e[r]}catch(t){a||(a=t)}},o=1;o<l;++o)r(e=arguments[o]).forEach(s);if(void 0!==a)throw a;return t}}),Qy=f((t,e)=>{e.exports=Yy()()?Object.assign:Ky()}),tv=f((t,e)=>{var r=Oy(),n=Array.prototype.forEach,i=Object.create;e.exports=function(t){var e=i(null);return n.call(arguments,function(t){r(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)}),e}}),ev=f((t,e)=>{var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}}),rv=f((t,e)=>{var r=String.prototype.indexOf;e.exports=function(t){return r.call(this,t,arguments[1])>-1}}),nv=f((t,e)=>{e.exports=ev()()?String.prototype.contains:rv()}),iv=f((t,e)=>{var r=qy(),n=Wy(),i=Qy(),a=tv(),o=nv(),s=e.exports=function(t,e){var n,s,l,u,c;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],r(t)?(n=o.call(t,"c"),s=o.call(t,"e"),l=o.call(t,"w")):(n=l=!0,s=!1),c={value:e,configurable:n,enumerable:s,writable:l},u?i(a(u),c):c};s.gs=function(t,e,s){var l,u,c,h;return"string"!=typeof t?(c=s,s=e,e=t,t=null):c=arguments[3],r(e)?n(e)?r(s)?n(s)||(c=s,s=void 0):s=void 0:(c=e,e=s=void 0):e=void 0,r(t)?(l=o.call(t,"c"),u=o.call(t,"e")):(l=!0,u=!1),h={get:e,set:s,configurable:l,enumerable:u},c?i(a(c),h):h}}),av=f((t,e)=>{var r=Object.prototype.toString,n=r.call(function(){return arguments}());e.exports=function(t){return r.call(t)===n}}),ov=f((t,e)=>{var r=Object.prototype.toString,n=r.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===n)||!1}}),sv=f((t,e)=>{e.exports=function(){return!("object"!=typeof globalThis||!globalThis)&&globalThis.Array===Array}}),lv=f((t,e)=>{var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}),uv=f((t,e)=>{e.exports=sv()()?globalThis:lv()}),cv=f((t,e)=>{var r=uv(),n={object:!0,symbol:!0};e.exports=function(){var t,e=r.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!(!n[typeof e.iterator]||!n[typeof e.toPrimitive]||!n[typeof e.toStringTag])}}),hv=f((t,e)=>{e.exports=function(t){return!(!t||"symbol"!=typeof t&&(!t.constructor||"Symbol"!==t.constructor.name||"Symbol"!==t[t.constructor.toStringTag]))}}),fv=f((t,e)=>{var r=hv();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}}),pv=f((t,e)=>{var r=iv(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);e.exports=function(t){for(var e,n,s=0;o[t+(s||"")];)++s;return o[t+=s||""]=!0,i(a,e="@@"+t,r.gs(null,function(t){n||(n=!0,i(this,e,r(t)),n=!1)})),e}}),dv=f((t,e)=>{var r=iv(),n=uv().Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:r("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:r("",n&&n.iterator||t("iterator")),match:r("",n&&n.match||t("match")),replace:r("",n&&n.replace||t("replace")),search:r("",n&&n.search||t("search")),species:r("",n&&n.species||t("species")),split:r("",n&&n.split||t("split")),toPrimitive:r("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:r("",n&&n.toStringTag||t("toStringTag")),unscopables:r("",n&&n.unscopables||t("unscopables"))})}}),mv=f((t,e)=>{var r=iv(),n=fv(),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:r(function(e){return i[e]?i[e]:i[e]=t(String(e))}),keyFor:r(function(t){var e;for(e in n(t),i)if(i[e]===t)return e})})}}),gv=f((t,e)=>{var r,n,i,a=iv(),o=fv(),s=uv().Symbol,l=pv(),u=dv(),c=mv(),h=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof s)try{String(s()),i=!0}catch(t){}else s=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?s(e):(r=h(n.prototype),e=void 0===e?"":String(e),f(r,{__description__:a("",e),__name__:a("",l(e))}))},u(r),c(r),f(n.prototype,{constructor:a(r),toString:a("",function(){return this.__name__})}),f(r.prototype,{toString:a(function(){return"Symbol ("+o(this).__description__+")"}),valueOf:a(function(){return o(this)})}),p(r.prototype,r.toPrimitive,a("",function(){var t=o(this);return"symbol"==typeof t?t:t.toString()})),p(r.prototype,r.toStringTag,a("c","Symbol")),p(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),p(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}),yv=f((t,e)=>{e.exports=cv()()?uv().Symbol:gv()}),vv=f((t,e)=>{var r=Fy();e.exports=function(){return r(this).length=0,this}}),xv=f((t,e)=>{e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}),_v=f((t,e)=>{var r=qy(),n=Hy(),i=Object.prototype.toString;e.exports=function(t){if(!r(t))return null;if(n(t)){var e=t.toString;if("function"!=typeof e||e===i)return null}try{return""+t}catch(t){return null}}}),bv=f((t,e)=>{e.exports=function(t){try{return t.toString()}catch(e){try{return String(t)}catch(t){return null}}}}),wv=f((t,e)=>{var r=bv(),n=/[\n\r\u2028\u2029]/g;e.exports=function(t){var e=r(t);return null===e?"<Non-coercible to string value>":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(n,function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}))}}),Tv=f((t,e)=>{var r=qy(),n=Hy(),i=_v(),a=wv(),o=function(t,e){return t.replace("%v",a(e))};e.exports=function(t,e,a){if(!n(a))throw new TypeError(o(e,t));if(!r(t)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=e),new TypeError(o(s,t))}}),kv=f((t,e)=>{var r=Tv(),n=qy();e.exports=function(t){return n(t)?t:r(t,"Cannot use %v",arguments[1])}}),Av=f((t,e)=>{var r=Tv(),n=Wy();e.exports=function(t){return n(t)?t:r(t,"%v is not a plain function",arguments[1])}}),Mv=f((t,e)=>{e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&!(!(e=r(t=["raz","dwa"]))||e===t||"dwa"!==e[1])}}),Sv=f((t,e)=>{var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"==typeof t&&n(r.call(t))}}),Ev=f((t,e)=>{e.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}}),Cv=f((t,e)=>{e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}}),Iv=f((t,e)=>{e.exports=Ev()()?Math.sign:Cv()}),Lv=f((t,e)=>{var r=Iv(),n=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*i(n(t)):t}}),Pv=f((t,e)=>{var r=Lv(),n=Math.max;e.exports=function(t){return n(0,r(t))}}),zv=f((t,e)=>{var r=yv().iterator,n=av(),i=Sv(),a=Pv(),o=xv(),s=Fy(),l=Oy(),u=ov(),c=Array.isArray,h=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(t){var e,d,m,g,y,v,x,_,b,w,T=arguments[1],k=arguments[2];if(t=Object(s(t)),l(T)&&o(T),this&&this!==Array&&i(this))e=this;else{if(!T){if(n(t))return 1!==(y=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(c(t)){for(g=new Array(y=t.length),d=0;d<y;++d)g[d]=t[d];return g}}g=[]}if(!c(t))if(void 0!==(b=t[r])){for(x=o(b).call(t),e&&(g=new e),_=x.next(),d=0;!_.done;)w=T?h.call(T,k,_.value,d):_.value,e?(f.value=w,p(g,d,f)):g[d]=w,_=x.next(),++d;y=d}else if(u(t)){for(y=t.length,e&&(g=new e),d=0,m=0;d<y;++d)w=t[d],d+1<y&&(v=w.charCodeAt(0))>=55296&&v<=56319&&(w+=t[++d]),w=T?h.call(T,k,w,m):w,e?(f.value=w,p(g,m,f)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(t.length),e&&(g=new e(y)),d=0;d<y;++d)w=T?h.call(T,k,t[d],d):t[d],e?(f.value=w,p(g,d,f)):g[d]=w;return e&&(f.value=null,g.length=y),g}}),Ov=f((t,e)=>{e.exports=Mv()()?Array.from:zv()}),Dv=f((t,e)=>{var r=Ov(),n=Qy(),i=Fy();e.exports=function(t){var e=Object(i(t)),a=arguments[1],o=Object(arguments[2]);if(e!==t&&!a)return e;var s={};return a?r(a,function(e){(o.ensure||e in t)&&(s[e]=t[e])}):n(s,t),s}}),Rv=f((t,e)=>{var r=xv(),n=Fy(),i=Function.prototype.bind,a=Function.prototype.call,o=Object.keys,s=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(l,u){var c,h=arguments[2],f=arguments[3];return l=Object(n(l)),r(u),c=o(l),f&&c.sort("function"==typeof f?i.call(f,l):void 0),"function"!=typeof t&&(t=c[t]),a.call(t,c,function(t,r){return s.call(l,t)?a.call(u,h,l[t],t,l,r):e})}}}),Fv=f((t,e)=>{e.exports=Rv()("forEach")}),Bv=f((t,e)=>{var r=xv(),n=Fv(),i=Function.prototype.call;e.exports=function(t,e){var a={},o=arguments[2];return r(e),n(t,function(t,r,n,s){a[r]=i.call(e,o,t,r,n,s)}),a}}),Nv=f((t,e)=>{var r,n=qy(),i=kv(),a=Av(),o=Dv(),s=tv(),l=Bv(),u=Function.prototype.bind,c=Object.defineProperty,h=Object.prototype.hasOwnProperty;r=function(t,e,r){var n,s=i(e)&&a(e.value);return delete(n=o(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?s:(e.value=u.call(s,r.resolveContext?r.resolveContext(this):this),c(this,t,e),this[t])},n},e.exports=function(t){var e=s(arguments[1]);return n(e.resolveContext)&&a(e.resolveContext),l(t,function(t,n){return r(n,t,e)})}}),jv=f((t,e)=>{var r,n=vv(),i=Qy(),a=xv(),o=Fy(),s=iv(),l=Nv(),u=yv(),c=Object.defineProperty,h=Object.defineProperties;e.exports=r=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");h(this,{__list__:s("w",o(t)),__context__:s("w",e),__nextIndex__:s("w",0)}),e&&(a(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete r.prototype.constructor,h(r.prototype,i({_next:s(function(){var t;if(this.__list__){if(this.__redo__&&void 0!==(t=this.__redo__.shift()))return t;if(this.__nextIndex__<this.__list__.length)return this.__nextIndex__++;this._unBind()}}),next:s(function(){return this._createResult(this._next())}),_createResult:s(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:s(function(t){return this.__list__[t]}),_unBind:s(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:s(function(){return"[object "+(this[u.toStringTag]||"Object")+"]"})},l({_onAdd:s(function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void c(this,"__redo__",s("c",[t]));this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)}}),_onDelete:s(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:s(function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0})}))),c(r.prototype,u.iterator,s(function(){return this}))}),Uv=f((t,e)=>{var r,n=jy(),i=nv(),a=iv(),o=yv(),s=jv(),l=Object.defineProperty;r=e.exports=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",l(this,"__kind__",a("",e))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}),Vv=f((t,e)=>{var r,n=jy(),i=iv(),a=yv(),o=jv(),s=Object.defineProperty;r=e.exports=function(t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t=String(t),o.call(this,t),s(this,"__length__",i("",t.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i(function(){if(this.__list__){if(this.__nextIndex__<this.__length__)return this.__nextIndex__++;this._unBind()}}),_resolve:i(function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}),qv=f((t,e)=>{var r=av(),n=Oy(),i=ov(),a=yv().iterator,o=Array.isArray;e.exports=function(t){return!(!n(t)||!(o(t)||i(t)||r(t))&&"function"!=typeof t[a])}}),Hv=f((t,e)=>{var r=qv();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not iterable");return t}}),Gv=f((t,e)=>{var r=av(),n=ov(),i=Uv(),a=Vv(),o=Hv(),s=yv().iterator;e.exports=function(t){return"function"==typeof o(t)[s]?t[s]():r(t)?new i(t):n(t)?new a(t):new i(t)}}),Zv=f((t,e)=>{var r=av(),n=xv(),i=ov(),a=Gv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;e.exports=function(t,e){var u,c,h,f,p,d,m,g,y=arguments[2];if(o(t)||r(t)?u="array":i(t)?u="string":t=a(t),n(e),h=function(){f=!0},"array"!==u)if("string"!==u)for(c=t.next();!c.done;){if(s.call(e,y,c.value,h),f)return;c=t.next()}else for(d=t.length,p=0;p<d&&(m=t[p],p+1<d&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=t[++p]),s.call(e,y,m,h),!f);++p);else l.call(t,function(t){return s.call(e,y,t,h),f})}}),Wv=f((t,e)=>{e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}),Yv=f((t,e)=>{var r,n=Oy(),i=jy(),a=Uy(),o=Fy(),s=Vy(),l=iv(),u=Gv(),c=Zv(),h=yv().toStringTag,f=Wv(),p=Array.isArray,d=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;e.exports=r=function(){var t,e=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return t=f&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(e)&&(p(e)||(e=u(e))),d(t,"__weakMapData__",l("c","$weakMap$"+s())),e&&c(e,function(e){o(e),t.set(e[0],e[1])}),t},f&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l(function(t){return!!m.call(a(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:l(function(t){if(m.call(a(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:l(function(t){return m.call(a(t),this.__weakMapData__)}),set:l(function(t,e){return d(a(t),this.__weakMapData__,l("c",e)),this}),toString:l(function(){return"[object WeakMap]"})}),d(r.prototype,h,l("c","WeakMap"))}),Xv=f((t,e)=>{e.exports=Py()()?WeakMap:Yv()}),$v=f((t,e)=>{e.exports=function(t,e,r){if("function"==typeof Array.prototype.findIndex)return t.findIndex(e,r);if("function"!=typeof e)throw new TypeError("predicate must be a function");var n=Object(t),i=n.length;if(0===i)return-1;for(var a=0;a<i;a++)if(e.call(r,n[a],a,n))return a;return-1}}),Jv=f((t,e)=>{var r=Qd(),n=ey(),i=ky(),a=Qg(),o=ny(),s=Iy(),l=Ly(),{float32:u,fract32:c}=Ey(),h=Xv(),f=ty(),p=$v();function d(t,e){if(!(this instanceof d))return new d(t,e);if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=t._gl,this.regl=t,this.passes=[],this.shaders=d.shaders.has(t)?d.shaders.get(t):d.shaders.set(t,d.createShaders(t)).get(t),this.update(e)}e.exports=d,d.dashMult=2,d.maxPatternLength=256,d.precisionThreshold=3e6,d.maxPoints=1e4,d.maxLines=2048,d.shaders=new h,d.createShaders=function(t){let e,r=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:(t,e)=>"round"===e.join?2:1,miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight],depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(t,e)=>!e.overlay},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},a=t(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=a}return{fill:t({primitive:"triangle",elements:(t,e)=>e.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},d.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},d.prototype.render=function(...t){t.length&&this.update(...t),this.draw()},d.prototype.draw=function(...t){return(t.length?t:this.passes).forEach((t,e)=>{if(t&&Array.isArray(t))return this.draw(...t);"number"==typeof t&&(t=this.passes[t]),t&&t.count>1&&t.opacity&&(this.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&this.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>d.precisionThreshold||t.scale[1]*t.viewport.height>d.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=d.maxPoints)?this.shaders.rect(t):this.shaders.miter(t)))}),this},d.prototype.update=function(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let{regl:e,gl:h}=this;if(t.forEach((t,m)=>{let g=this.passes[m];if(void 0!==t){if(null===t)return void(this.passes[m]=null);if("number"==typeof t[0]&&(t={positions:t}),t=a(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:e.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},d.defaults,t)),null!=t.thickness&&(g.thickness=parseFloat(t.thickness)),null!=t.opacity&&(g.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(g.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(g.overlay=!!t.overlay,m<d.maxLines&&(g.depth=2*(d.maxLines-1-m%d.maxLines)/d.maxLines-1)),null!=t.join&&(g.join=t.join),null!=t.hole&&(g.hole=t.hole),null!=t.fill&&(g.fill=t.fill?r(t.fill,"uint8"):null),null!=t.viewport&&(g.viewport=f(t.viewport)),g.viewport||(g.viewport=f([h.drawingBufferWidth,h.drawingBufferHeight])),null!=t.close&&(g.close=t.close),null===t.positions&&(t.positions=[]),t.positions){let e,r;if(t.positions.x&&t.positions.y){let n=t.positions.x,i=t.positions.y;r=g.count=Math.max(n.length,i.length),e=new Float64Array(2*r);for(let t=0;t<r;t++)e[2*t]=n[t],e[2*t+1]=i[t]}else e=o(t.positions,"float64"),r=g.count=Math.floor(e.length/2);let i=g.bounds=n(e,2);if(g.fill){let r=[],n={},i=0;for(let t=0,a=0,o=g.count;t<o;t++){let o=e[2*t],s=e[2*t+1];isNaN(o)||isNaN(s)||null==o||null==s?(o=e[2*i],s=e[2*i+1],n[t]=i):i=t,r[a++]=o,r[a++]=s}if(t.splitNull){g.count-1 in n||(n[g.count]=g.count-1);let t=Object.keys(n).map(Number).sort((t,e)=>t-e),e=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let e=p(t,t=>t>=a);t=t.slice(0,e),t.push(a)}for(let n=0;n<t.length;n++){let o=r.slice(2*i,2*t[n]).concat(a?r.slice(2*a):[]),l=(g.hole||[]).map(e=>e-a+(t[n]-i)),u=s(o,l);u=u.map(e=>e+i+(e+i<t[n]?0:a-t[n])),e.push(...u),i=t[n]+1}for(let t=0,r=e.length;t<r;t++)null!=n[e[t]]&&(e[t]=n[e[t]]);g.triangles=e}else{let t=s(r,g.hole||[]);for(let e=0,r=t.length;e<r;e++)null!=n[t[e]]&&(t[e]=n[t[e]]);g.triangles=t}}let a=new Float64Array(e);l(a,2,i);let h=new Float64Array(2*r+6);g.close?e[0]===e[2*r-2]&&e[1]===e[2*r-1]?(h[0]=a[2*r-4],h[1]=a[2*r-3]):(h[0]=a[2*r-2],h[1]=a[2*r-1]):(h[0]=a[0],h[1]=a[1]),h.set(a,2),g.close?e[0]===e[2*r-2]&&e[1]===e[2*r-1]?(h[2*r+2]=a[2],h[2*r+3]=a[3],g.count-=1):(h[2*r+2]=a[0],h[2*r+3]=a[1],h[2*r+4]=a[2],h[2*r+5]=a[3]):(h[2*r+2]=a[2*r-2],h[2*r+3]=a[2*r-1],h[2*r+4]=a[2*r-2],h[2*r+5]=a[2*r-1]);var y=u(h);g.positionBuffer(y);var v=c(h,y);g.positionFractBuffer(v)}if(t.range?g.range=t.range:g.range||(g.range=g.bounds),(t.range||t.positions)&&g.count){let t=g.bounds,e=t[2]-t[0],r=t[3]-t[1],n=g.range[2]-g.range[0],i=g.range[3]-g.range[1];g.scale=[e/n,r/i],g.translate=[-g.range[0]/n+t[0]/n||0,-g.range[1]/i+t[1]/i||0],g.scaleFract=c(g.scale),g.translateFract=c(g.translate)}if(t.dashes){let e,r=0;if(!t.dashes||t.dashes.length<2)r=1,e=new Uint8Array([255,255,255,255,255,255,255,255]);else{r=0;for(let e=0;e<t.dashes.length;++e)r+=t.dashes[e];e=new Uint8Array(r*d.dashMult);let n=0,i=255;for(let r=0;r<2;r++)for(let r=0;r<t.dashes.length;++r){for(let a=0,o=t.dashes[r]*d.dashMult*.5;a<o;++a)e[n++]=i;i^=255}}g.dashLength=r,g.dashTexture({channels:1,data:e,width:e.length,height:1,mag:"linear",min:"linear"},0,0)}if(t.color){let e=g.count,n=t.color;n||(n="transparent");let i=new Uint8Array(4*e+4);if(Array.isArray(n)&&"number"!=typeof n[0]){for(let t=0;t<e;t++){let e=r(n[t],"uint8");i.set(e,4*t)}i.set(r(n[0],"uint8"),4*e)}else{let t=r(n,"uint8");for(let r=0;r<e+1;r++)i.set(t,4*r)}g.colorBuffer({usage:"dynamic",type:"uint8",data:i})}}}),t.length<this.passes.length){for(let e=t.length;e<this.passes.length;e++){let t=this.passes[e];t&&(t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy())}this.passes.length=t.length}let m=[];for(let t=0;t<this.passes.length;t++)null!==this.passes[t]&&m.push(this.passes[t]);return this.passes=m,this},d.prototype.destroy=function(){return this.passes.forEach(t=>{t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()}),this.passes.length=0,this}}),Kv=f((t,e)=>{var r=ey(),n=Qd(),i=My(),a=Qg(),o=ky(),s=ny(),{float32:l,fract32:u}=Ey();e.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,f,p,d,m,g,y=t._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),f=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:c}),T(e),h=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{color:{buffer:d,offset:(t,e)=>4*e.offset,divisor:1},position:{buffer:f,offset:(t,e)=>8*e.offset,divisor:1},positionFract:{buffer:p,offset:(t,e)=>8*e.offset,divisor:1},error:{buffer:m,offset:(t,e)=>16*e.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:c.length}),o(_,{update:T,draw:b,destroy:k,regl:t,gl:y,canvas:y.canvas,groups:x}),_;function _(t){t?T(t):null===t&&k(),b()}function b(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach((t,r)=>{if(t){if(e&&(e[r]?t.draw=!0:t.draw=!1),!t.draw)return void(t.draw=!0);w(r)}})}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],h(t),t.after&&t.after(t))}function T(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let e=0,c=0;if(_.groups=x=t.map((t,l)=>{let h=x[l];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=a(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=o({},v,t)),i(h,t,[{lineWidth:t=>.5*+t,capSize:t=>.5*+t,opacity:parseFloat,errors:t=>(t=s(t),c+=t.length,t),positions:(t,n)=>(t=s(t,"float64"),n.count=Math.floor(t.length/2),n.bounds=r(t,2),n.offset=e,e+=n.count,t)},{color:(t,e)=>{let r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){let e=t;t=Array(r);for(let n=0;n<r;n++)t[n]=e}if(t.length<r)throw Error("Not enough colors");let i=new Uint8Array(4*r);for(let e=0;e<r;e++){let r=n(t[e],"uint8");i.set(r,4*e)}return i},range:(t,e,r)=>{let n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=u(e.scale),e.translateFract=u(e.translate),t},viewport:t=>{let e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},e}}]),h):h}),e||c){let t=x.reduce((t,e,r)=>t+(e?e.count:0),0),e=new Float64Array(2*t),r=new Uint8Array(4*t),n=new Float32Array(4*t);x.forEach((t,i)=>{if(!t)return;let{positions:a,count:o,offset:s,color:l,errors:u}=t;o&&(r.set(l,4*s),n.set(u,4*s),e.set(a,2*s))});var h=l(e);f(h);var g=u(e,h);p(g),d(r),m(n)}}function k(){f.destroy(),p.destroy(),d.destroy(),m.destroy(),g.destroy()}};var c=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}),Qv=f((t,e)=>{var r=/[\'\"]/;e.exports=function(t){return t?(r.test(t.charAt(0))&&(t=t.substr(1)),r.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}}),tx=f((t,e)=>{e.exports=["inherit","initial","unset"]}),ex=f((t,e)=>{e.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),rx=f((t,e)=>{e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),nx=f((t,e)=>{e.exports=["normal","italic","oblique"]}),ix=f((t,e)=>{e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),ax=f((t,e)=>{function r(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach(function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach(function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t}),n=n.reverse(),r=r.map(function(e){return n.forEach(function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])}),e})});var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function n(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce(function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r},"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?n(t,e):r(t,e)}i.parse=r,i.stringify=n,e.exports=i}),ox=f((t,e)=>{var r=ax();e.exports=function(t,e,n){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");n?("string"==typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map(function(t){return 1===t.length&&(t+=t),t}));var i=r.parse(t,{flat:!0,brackets:n.ignore}),a=i[0].split(e);if(n.escape){for(var o=[],s=0;s<a.length;s++){var l=a[s],u=a[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+e+u),s++):o.push(l)}a=o}for(s=0;s<a.length;s++)i[0]=a[s],a[s]=r.stringify(i,{flat:!0});return a}}),sx=f((t,e)=>{e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),lx=f((t,e)=>{var r=sx();e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==r.indexOf(t)}}}),ux=f((t,e)=>{var r=Qv(),n=tx(),i=ex(),a=rx(),o=nx(),s=ix(),l=ox(),u=lx().isSize;e.exports=h;var c=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(c[t])return c[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return c[t]={system:t};for(var e,h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},p=l(t,/\s+/);e=p.shift();){if(-1!==n.indexOf(e))return["style","variant","weight","stretch"].forEach(function(t){h[t]=e}),c[t]=h;if(-1===o.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===s.indexOf(e)){if(-1===a.indexOf(e)){if(u(e)){var d=l(e,"/");if(h.size=d[0],null!=d[1]?h.lineHeight=f(d[1]):"/"===p[0]&&(p.shift(),h.lineHeight=f(p.shift())),!p.length)throw new Error("Missing required font-family.");return h.family=l(p.join(" "),/\s*,\s*/).map(r),c[t]=h}throw new Error("Unknown or unsupported font token: "+e)}h.weight=e}else h.stretch=e;else h.variant=e;else h.style=e}throw new Error("Missing required font-size.")}function f(t){var e=parseFloat(t);return e.toString()===t?e:t}}),cx=f((t,e)=>{var r=Qg(),n=lx().isSize,i=d(tx()),a=d(ex()),o=d(rx()),s=d(nx()),l=d(ix()),u={normal:1,"small-caps":1},c={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",f="serif";function p(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function d(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=1;return e}e.exports=function(t){if((t=r(t,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return t.system&&p(t.system,a),t.system;if(p(t.style,s),p(t.variant,u),p(t.weight,o),p(t.stretch,l),null==t.size&&(t.size=h),"number"==typeof t.size&&(t.size+="px"),!n)throw Error("Bad size value `"+t.size+"`");t.family||(t.family=f),Array.isArray(t.family)&&(t.family.length||(t.family=[f]),t.family=t.family.map(function(t){return c[t]?t:'"'+t+'"'}).join(", "));var e=[];return e.push(t.style),t.variant!==t.style&&e.push(t.variant),t.weight!==t.variant&&t.weight!==t.style&&e.push(t.weight),t.stretch!==t.weight&&t.stretch!==t.variant&&t.stretch!==t.style&&e.push(t.stretch),e.push(t.size+(null==t.lineHeight||"normal"===t.lineHeight||t.lineHeight+""=="1"?"":"/"+t.lineHeight)),e.push(t.family),e.filter(Boolean).join(" ")}}),hx=f((t,e)=>{e.exports={parse:ux(),stringify:cx()}}),fx=f((t,e)=>{var r,n;r=t,n=function(){var t=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},e=0;function r(t,r){this.id=e++,this.type=t,this.data=r}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(t){if(0===t.length)return[];var e=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&e===r&&('"'===e||"'"===e))return['"'+n(t.substr(1,t.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(a)return i(t.substr(0,a.index)).concat(i(a[1])).concat(i(t.substr(a.index+a[0].length)));var o=t.split(".");if(1===o.length)return['"'+n(t)+'"'];for(var s=[],l=0;l<o.length;++l)s=s.concat(i(o[l]));return s}function a(t){return"["+i(t).join("][")+"]"}var o={DynamicVariable:r,define:function(t,e){return new r(t,a(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof r},unbox:function t(e,n){return"function"==typeof e?new r(0,e):"number"==typeof e||"boolean"==typeof e?new r(5,e):Array.isArray(e)?new r(6,e.map(function(e,r){return t(e)})):e instanceof r?e:void 0},accessor:a},s={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},l="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function u(t){return"string"==typeof t?t.split():t}function c(t){return"string"==typeof t?document.querySelector(t):t}function h(e){var r,n,i,a,o=e||{},s={},l=[],h=[],f="undefined"==typeof window?1:window.devicePixelRatio,p=!1,d={},m=function(t){},g=function(){};if("string"==typeof o?r=document.querySelector(o):"object"==typeof o&&(function(t){return"string"==typeof t.nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect}(o)?r=o:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(o)?i=(a=o).canvas:("gl"in o?a=o.gl:"canvas"in o?i=c(o.canvas):"container"in o&&(n=c(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=u(o.extensions)),"optionalExtensions"in o&&(h=u(o.optionalExtensions)),"onDone"in o&&(m=o.onDone),"profile"in o&&(p=!!o.profile),"pixelRatio"in o&&(f=+o.pixelRatio),"cachedCode"in o&&(d=o.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!a){if(!i){var y=function(e,r,n){var i,a=document.createElement("canvas");function o(){var t=window.innerWidth,r=window.innerHeight;if(e!==document.body){var i=a.getBoundingClientRect();t=i.right-i.left,r=i.bottom-i.top}a.width=n*t,a.height=n*r}return t(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),e.appendChild(a),e===document.body&&(a.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver(function(){setTimeout(o)})).observe(e):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),e.removeChild(a)}}}(n||document.body,0,f);if(!y)return null;i=y.canvas,g=y.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),a=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,s)}return a?{gl:a,canvas:i,container:n,extensions:l,optionalExtensions:h,pixelRatio:f,profile:p,cachedCode:d,onDone:m,onDestroy:g}:(g(),m("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function f(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function p(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function d(){var t=f(8,function(){return[]});function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[p(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[p(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var m=d();m.zero=d();var g=3553,y=6408,v=5126,x=36160,_=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray};function b(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||_(t.data))}var w=function(t){return Object.keys(t).map(function(e){return t[e]})},T={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var a=0;a<e.length;++a)i*=e[a];else i=0;var o=n||m.allocType(r,i);switch(e.length){case 0:break;case 1:!function(t,e,r){for(var n=0;n<e;++n)r[n]=t[n]}(t,e[0],o);break;case 2:!function(t,e,r,n){for(var i=0,a=0;a<e;++a)for(var o=t[a],s=0;s<r;++s)n[i++]=o[s]}(t,e[0],e[1],o);break;case 3:k(t,e[0],e[1],e[2],o,0);break;default:A(t,e,0,o,0)}return o}};function k(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],u=0;u<r;++u)for(var c=l[u],h=0;h<n;++h)i[o++]=c[h]}function A(t,e,r,n,i){for(var a=1,o=r+1;o<e.length;++o)a*=e[o];var s=e[r];if(e.length-r===4){var l=e[r+1],u=e[r+2],c=e[r+3];for(o=0;o<s;++o)k(t[o],l,u,c,n,i),i+=a}else for(o=0;o<s;++o)A(t[o],e,r+1,n,i),i+=a}var M={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},S={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},E={dynamic:35048,stream:35040,static:35044},C=T.flatten,I=T.shape,L=5121,P=5126,z=[];function O(t){return 0|M[Object.prototype.toString.call(t)]}function D(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function R(t,e,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var u=0;u<n;++u)t[s++]=e[i*l+a*u+o]}z[5120]=1,z[5122]=2,z[5124]=4,z[5121]=1,z[5123]=2,z[5125]=4,z[5126]=4;var F={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},B=5121,N=5123,j=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function H(t){for(var e=m.allocType(5123,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(t[r]===1/0)e[r]=31744;else if(t[r]===-1/0)e[r]=64512;else{V[0]=t[r];var n=q[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function G(t){return Array.isArray(t)||_(t)}var Z=3553,W=34067,Y=34069,X=6408,$=6406,J=6407,K=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ut=5121,ct=5123,ht=5125,ft=5126,pt=33071,dt=9728,mt=9984,gt=9987,yt=4352,vt=33984,xt=[mt,9986,9985,gt],_t=[0,K,Q,J,X],bt={};function wt(t){return"[object "+t+"]"}bt[K]=bt[$]=bt[et]=1,bt[rt]=bt[Q]=2,bt[J]=bt[nt]=3,bt[X]=bt[it]=4;var Tt=wt("HTMLCanvasElement"),kt=wt("OffscreenCanvas"),At=wt("CanvasRenderingContext2D"),Mt=wt("ImageBitmap"),St=wt("HTMLImageElement"),Et=wt("HTMLVideoElement"),Ct=Object.keys(M).concat([Tt,kt,At,Mt,St,Et]),It=[];It[ut]=1,It[ft]=4,It[at]=2,It[ct]=2,It[ht]=4;var Lt=[];function Pt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function zt(t){return!!Array.isArray(t)&&!(0===t.length||!G(t[0]))}function Ot(t){return Object.prototype.toString.call(t)}function Dt(t){return Ot(t)===Tt}function Rt(t){return Ot(t)===kt}function Ft(t){if(!t)return!1;var e=Ot(t);return Ct.indexOf(e)>=0||Pt(t)||zt(t)||b(t)}function Bt(t){return 0|M[Object.prototype.toString.call(t)]}function Nt(t,e){return m.allocType(t.type===at?ft:t.type,e)}function jt(t,e){t.type===at?(t.data=H(e),m.freeType(e)):t.data=e}function Ut(t,e,r,n,i,a){var o;if(o=void 0!==Lt[t]?Lt[t]:bt[t]*It[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function Vt(e,r,n,i,a,o,s){var l={"don't care":yt,"dont care":yt,nice:4354,fast:4353},u={repeat:10497,clamp:pt,mirror:33648},c={nearest:dt,linear:9729},h=t({mipmap:gt,"nearest mipmap nearest":mt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":gt},c),f={none:0,browser:37444},p={uint8:ut,rgba4:32819,rgb565:33635,"rgb5 a1":32820},d={alpha:$,luminance:K,"luminance alpha":Q,rgb:J,rgba:X,rgba4:32854,"rgb5 a1":tt,rgb565:36194},g={};r.ext_srgb&&(d.srgb=nt,d.srgba=it),r.oes_texture_float&&(p.float32=p.float=ft),r.oes_texture_half_float&&(p.float16=p["half float"]=at),r.webgl_depth_texture&&(t(d,{depth:et,"depth stencil":rt}),t(p,{uint16:ct,uint32:ht,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(g,{"rgb s3tc dxt1":ot,"rgba s3tc dxt1":st,"rgba s3tc dxt3":lt,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&t(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(e.getParameter(34467));Object.keys(g).forEach(function(t){var e=g[t];y.indexOf(e)>=0&&(d[t]=e)});var v=Object.keys(d);n.textureFormats=v;var x=[];Object.keys(d).forEach(function(t){var e=d[t];x[e]=t});var k=[];Object.keys(p).forEach(function(t){var e=p[t];k[e]=t});var A=[];Object.keys(c).forEach(function(t){A[c[t]]=t});var M=[];Object.keys(h).forEach(function(t){var e=h[t];M[e]=t});var S=[];Object.keys(u).forEach(function(t){S[u[t]]=t});var E=v.reduce(function(t,e){var n=d[e];return n===K||n===$||n===K||n===Q||n===et||n===rt||r.ext_srgb&&(n===nt||n===it)?t[n]=n:n===tt||e.indexOf("rgba")>=0?t[n]=X:t[n]=J,t},{});function C(){this.internalformat=X,this.format=X,this.type=ut,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function L(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=f[e.colorSpace]),"type"in e){var r=e.type;t.type=p[r]}var n=t.width,i=t.height,a=t.channels,o=!1;"shape"in e?(n=e.shape[0],i=e.shape[1],3===e.shape.length&&(a=e.shape[2],o=!0)):("radius"in e&&(n=i=e.radius),"width"in e&&(n=e.width),"height"in e&&(i=e.height),"channels"in e&&(a=e.channels,o=!0)),t.width=0|n,t.height=0|i,t.channels=0|a;var s=!1;if("format"in e){var l=e.format,u=t.internalformat=d[l];t.format=E[u],l in p&&("type"in e||(t.type=p[l])),l in g&&(t.compressed=!0),s=!0}!o&&s?t.channels=bt[t.format]:o&&!s&&t.channels!==_t[t.format]&&(t.format=t.internalformat=_t[t.channels])}}function P(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function z(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(t,e){var r=null;if(Ft(e)?r=e:e&&(L(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),Ft(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(_(r))t.channels=t.channels||4,t.data=r,!("type"in e)&&t.type===ut&&(t.type=Bt(r));else if(Pt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ut:case ct:case ht:case ft:var n=m.allocType(t.type,r);n.set(e),t.data=n;break;case at:t.data=H(e)}}(t,r),t.alignment=1,t.needsFree=!0;else if(b(r)){var o=r.data;!Array.isArray(o)&&t.type===ut&&(t.type=Bt(o));var s,l,u,c,h,f,p=r.shape,d=r.stride;3===p.length?(u=p[2],f=d[2]):(u=1,f=1),s=p[0],l=p[1],c=d[0],h=d[1],t.alignment=1,t.width=s,t.height=l,t.channels=u,t.format=t.internalformat=_t[u],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,u=Nt(t,o*s*l),c=0,h=0;h<s;++h)for(var f=0;f<o;++f)for(var p=0;p<l;++p)u[c++]=e[r*f+n*h+i*p+a];jt(t,u)}(t,o,c,h,f,r.offset)}else if(Dt(r)||Rt(r)||function(t){return Ot(t)===At}(r))Dt(r)||Rt(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(function(t){return Ot(t)===Mt}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(t){return Ot(t)===St}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(t){return Ot(t)===Et}(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(zt(r)){var g=t.width||r[0].length,y=t.height||r.length,v=t.channels;v=G(r[0][0])?v||r[0][0].length:v||1;for(var x=T.shape(r),w=1,k=0;k<x.length;++k)w*=x[k];var A=Nt(t,w);T.flatten(r,x,"",A),jt(t,A),t.alignment=1,t.width=g,t.height=y,t.channels=v,t.format=t.internalformat=_t[v],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===ft||t.type}function D(t,r,n){var a=t.element,o=t.data,s=t.internalformat,l=t.format,u=t.type,c=t.width,h=t.height;P(t),a?e.texImage2D(r,n,l,l,u,a):t.compressed?e.compressedTexImage2D(r,n,s,c,h,0,o):t.needsCopy?(i(),e.copyTexImage2D(r,n,l,t.xOffset,t.yOffset,c,h,0)):e.texImage2D(r,n,l,c,h,0,l,u,o||null)}function R(t,r,n,a,o){var s=t.element,l=t.data,u=t.internalformat,c=t.format,h=t.type,f=t.width,p=t.height;P(t),s?e.texSubImage2D(r,o,n,a,c,h,s):t.compressed?e.compressedTexSubImage2D(r,o,n,a,u,f,p,l):t.needsCopy?(i(),e.copyTexSubImage2D(r,o,n,a,t.xOffset,t.yOffset,f,p)):e.texSubImage2D(r,o,n,a,f,p,c,h,l)}var F=[];function B(){return F.pop()||new z}function N(t){t.needsFree&&m.freeType(t.data),z.call(t),F.push(t)}function j(){C.call(this),this.genMipmaps=!1,this.mipmapHint=yt,this.mipmask=0,this.images=Array(16)}function U(t,e,r){var n=t.images[0]=B();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function V(t,e){var r=null;if(Ft(e))I(r=t.images[0]=B(),t),O(r,e),t.mipmask=1;else if(L(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)I(r=t.images[i]=B(),t),r.width>>=i,r.height>>=i,O(r,n[i]),t.mipmask|=1<<i;else I(r=t.images[0]=B(),t),O(r,e),t.mipmask=1;I(t,t.images[0]),t.compressed&&(t.internalformat===ot||t.internalformat===st||t.internalformat===lt||t.internalformat)}function q(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;D(r[n],e,n)}}var wt=[];function Tt(){var t=wt.pop()||new j;C.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function kt(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&N(e[r]),e[r]=null;wt.push(t)}function Ct(){this.minFilter=dt,this.magFilter=dt,this.wrapS=pt,this.wrapT=pt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=yt}function It(t,e){if("min"in e){var r=e.min;t.minFilter=h[r],xt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;t.magFilter=c[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"==typeof o?i=a=u[o]:Array.isArray(o)&&(i=u[o[0]],a=u[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=u[s]}if("wrapT"in e){var f=e.wrapT;a=u[f]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e&&(e.anisotropic,t.anisotropic=e.anisotropic),"mipmap"in e){var p=!1;switch(typeof e.mipmap){case"string":t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,p=!0;break;case"boolean":p=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,p=!0}p&&!("min"in e)&&(t.minFilter=mt)}}function Lt(t,n){e.texParameteri(n,10241,t.minFilter),e.texParameteri(n,10240,t.magFilter),e.texParameteri(n,10242,t.wrapS),e.texParameteri(n,10243,t.wrapT),r.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,t.anisotropic),t.genMipmaps&&(e.hint(33170,t.mipmapHint),e.generateMipmap(n))}var Vt=0,qt={},Ht=n.maxTextureUnits,Gt=Array(Ht).map(function(){return null});function Zt(t){C.call(this),this.mipmask=0,this.internalformat=X,this.id=Vt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ct,s.profile&&(this.stats={size:0})}function Wt(t){e.activeTexture(vt),e.bindTexture(t.target,t.texture)}function Yt(){var t=Gt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(Z,null)}function Xt(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(vt+n),e.bindTexture(i,null),Gt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete qt[t.id],o.textureCount--}return t(Zt.prototype,{bind:function(){var t=this;t.bindCount+=1;var r=t.unit;if(r<0){for(var n=0;n<Ht;++n){var i=Gt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}Gt[n]=t,r=n;break}s.profile&&o.maxTextureUnits<r+1&&(o.maxTextureUnits=r+1),t.unit=r,e.activeTexture(vt+r),e.bindTexture(t.target,t.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Xt(this)}}),s.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(qt).forEach(function(e){t+=qt[e].stats.size}),t}),{create2D:function(t,r){var n=new Zt(Z);function i(t,e){var r=n.texInfo;Ct.call(r);var a=Tt();return"number"==typeof t?U(a,0|t,"number"==typeof e?0|e:0|t):t?(It(r,t),V(a,t)):U(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,I(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Wt(n),q(a,Z),Lt(r,Z),Yt(),kt(a),s.profile&&(n.stats.size=Ut(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=x[n.internalformat],i.type=k[n.type],i.mag=A[r.magFilter],i.min=M[r.minFilter],i.wrapS=S[r.wrapS],i.wrapT=S[r.wrapT],i}return qt[n.id]=n,o.textureCount++,i(t,r),i.subimage=function(t,e,r,a){var o=0|e,s=0|r,l=0|a,u=B();return I(u,n),u.width=0,u.height=0,O(u,t),u.width=u.width||(n.width>>l)-o,u.height=u.height||(n.height>>l)-s,Wt(n),R(u,Z,o,s,l),Yt(),N(u),i},i.resize=function(t,r){var a=0|t,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Wt(n);for(var l=0;n.mipmask>>l;++l){var u=a>>l,c=o>>l;if(!u||!c)break;e.texImage2D(Z,l,n.format,u,c,0,n.format,n.type,null)}return Yt(),s.profile&&(n.stats.size=Ut(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(t,r,n,i,a,l){var u=new Zt(W);qt[u.id]=u,o.cubeCount++;var c=new Array(6);function h(t,e,r,n,i,a){var o,l=u.texInfo;for(Ct.call(l),o=0;o<6;++o)c[o]=Tt();if("number"!=typeof t&&t){if("object"==typeof t)if(e)V(c[0],t),V(c[1],e),V(c[2],r),V(c[3],n),V(c[4],i),V(c[5],a);else if(It(l,t),L(u,t),"faces"in t){var f=t.faces;for(o=0;o<6;++o)I(c[o],u),V(c[o],f[o])}else for(o=0;o<6;++o)V(c[o],t)}else{var p=0|t||1;for(o=0;o<6;++o)U(c[o],p,p)}for(I(u,c[0]),l.genMipmaps?u.mipmask=(c[0].width<<1)-1:u.mipmask=c[0].mipmask,u.internalformat=c[0].internalformat,h.width=c[0].width,h.height=c[0].height,Wt(u),o=0;o<6;++o)q(c[o],Y+o);for(Lt(l,W),Yt(),s.profile&&(u.stats.size=Ut(u.internalformat,u.type,h.width,h.height,l.genMipmaps,!0)),h.format=x[u.internalformat],h.type=k[u.type],h.mag=A[l.magFilter],h.min=M[l.minFilter],h.wrapS=S[l.wrapS],h.wrapT=S[l.wrapT],o=0;o<6;++o)kt(c[o]);return h}return h(t,r,n,i,a,l),h.subimage=function(t,e,r,n,i){var a=0|r,o=0|n,s=0|i,l=B();return I(l,u),l.width=0,l.height=0,O(l,e),l.width=l.width||(u.width>>s)-a,l.height=l.height||(u.height>>s)-o,Wt(u),R(l,Y+t,a,o,s),Yt(),N(l),h},h.resize=function(t){var r=0|t;if(r!==u.width){h.width=u.width=r,h.height=u.height=r,Wt(u);for(var n=0;n<6;++n)for(var i=0;u.mipmask>>i;++i)e.texImage2D(Y+n,i,u.format,r>>i,r>>i,0,u.format,u.type,null);return Yt(),s.profile&&(u.stats.size=Ut(u.internalformat,u.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=u,s.profile&&(h.stats=u.stats),h.destroy=function(){u.decRef()},h},clear:function(){for(var t=0;t<Ht;++t)e.activeTexture(vt+t),e.bindTexture(Z,null),Gt[t]=null;w(qt).forEach(Xt),o.cubeCount=0,o.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Ht;++t){var r=Gt[t];r&&(r.bindCount=0,r.unit=-1,Gt[t]=null)}w(qt).forEach(function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var r=0;r<32;++r)if(t.mipmask&1<<r)if(t.target===Z)e.texImage2D(Z,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)e.texImage2D(Y+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);Lt(t.texInfo,t.target)})},refresh:function(){for(var t=0;t<Ht;++t){var r=Gt[t];r&&(r.bindCount=0,r.unit=-1,Gt[t]=null),e.activeTexture(vt+t),e.bindTexture(Z,null),e.bindTexture(W,null)}}}}Lt[32854]=2,Lt[tt]=2,Lt[36194]=2,Lt[rt]=4,Lt[ot]=.5,Lt[st]=.5,Lt[lt]=1,Lt[33779]=1,Lt[35986]=.5,Lt[35987]=1,Lt[34798]=1,Lt[35840]=.5,Lt[35841]=.25,Lt[35842]=.5,Lt[35843]=.25,Lt[36196]=.5;var qt=36161,Ht=32854,Gt=[];function Zt(t,e,r){return Gt[t]*e*r}Gt[Ht]=2,Gt[32855]=2,Gt[36194]=2,Gt[33189]=2,Gt[36168]=1,Gt[34041]=4,Gt[35907]=4,Gt[34836]=16,Gt[34842]=8,Gt[34843]=6;var Wt=36160,Yt=36161,Xt=3553,$t=[];$t[6408]=4,$t[6407]=3;var Jt=[];Jt[5121]=1,Jt[5126]=4,Jt[36193]=2;var Kt=34963;function Qt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function te(t,e,r,n,i,a,o){function s(i){var a;a=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,u=n.framebufferHeight,c=null;_(i)?c=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),u=0|(i.height||n.framebufferHeight-s),c=i.data||null),r();var h=l*u*4;return c||(5121===a?c=new Uint8Array(h):5126===a&&(c=c||new Float32Array(h))),t.pixelStorei(3333,4),t.readPixels(o,s,l,u,6408,a,c),c}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=s(t)}),r}(t):s(t)}}function ee(t){return function(t){for(var e,r="0123456789abcdef",n="",i=0;i<t.length;i++)e=t.charCodeAt(i),n+=r.charAt(e>>>4&15)+r.charAt(15&e);return n}(function(t){return function(t){for(var e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t,e){var r,n,i,a,o,s,l,u,c,h,f,p,d=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),m=new Array(64);for(t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e,c=0;c<t.length;c+=16){for(r=d[0],n=d[1],i=d[2],a=d[3],o=d[4],s=d[5],l=d[6],u=d[7],h=0;h<64;h++)m[h]=h<16?t[h+c]:he(he(he(ue(m[h-2]),m[h-7]),le(m[h-15])),m[h-16]),f=he(he(he(he(u,se(o)),ie(o,s,l)),ce[h]),m[h]),p=he(oe(r),ae(r,n,i)),u=l,l=s,s=o,o=he(a,f),a=i,i=n,n=r,r=he(f,p);d[0]=he(r,d[0]),d[1]=he(n,d[1]),d[2]=he(i,d[2]),d[3]=he(a,d[3]),d[4]=he(o,d[4]),d[5]=he(s,d[5]),d[6]=he(l,d[6]),d[7]=he(u,d[7])}return d}(function(t){for(var e=Array(t.length>>2),r=0;r<e.length;r++)e[r]=0;for(r=0;r<8*t.length;r+=8)e[r>>5]|=(255&t.charCodeAt(r/8))<<24-r%32;return e}(t),8*t.length))}(function(t){for(var e,r,n="",i=-1;++i<t.length;)e=t.charCodeAt(i),r=i+1<t.length?t.charCodeAt(i+1):0,55296<=e&&e<=56319&&56320<=r&&r<=57343&&(e=65536+((1023&e)<<10)+(1023&r),i++),e<=127?n+=String.fromCharCode(e):e<=2047?n+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(t)))}function re(t,e){return t>>>e|t<<32-e}function ne(t,e){return t>>>e}function ie(t,e,r){return t&e^~t&r}function ae(t,e,r){return t&e^t&r^e&r}function oe(t){return re(t,2)^re(t,13)^re(t,22)}function se(t){return re(t,6)^re(t,11)^re(t,25)}function le(t){return re(t,7)^re(t,18)^ne(t,3)}function ue(t){return re(t,17)^re(t,19)^ne(t,10)}var ce=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function he(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function fe(t){return Array.prototype.slice.call(t)}function pe(t){return fe(t).join("")}var de="xyzw".split(""),me="dither",ge="blend.enable",ye="blend.color",ve="blend.equation",xe="blend.func",_e="depth.enable",be="depth.func",we="depth.range",Te="depth.mask",ke="colorMask",Ae="cull.enable",Me="cull.face",Se="frontFace",Ee="lineWidth",Ce="polygonOffset.enable",Ie="polygonOffset.offset",Le="sample.alpha",Pe="sample.enable",ze="sample.coverage",Oe="stencil.enable",De="stencil.mask",Re="stencil.func",Fe="stencil.opFront",Be="stencil.opBack",Ne="scissor.enable",je="scissor.box",Ue="viewport",Ve="profile",qe="framebuffer",He="vert",Ge="frag",Ze="elements",We="primitive",Ye="count",Xe="offset",$e="instances",Je="vao",Ke="Width",Qe="Height",tr=qe+Ke,er=qe+Qe,rr=Ue+Ke,nr=Ue+Qe,ir="drawingBuffer",ar=ir+Ke,or=ir+Qe,sr=[xe,ve,Re,Fe,Be,ze,Ue,je,Ie],lr=34962,ur=34963,cr=35664,hr=35665,fr=35666,pr=35667,dr=35668,mr=35669,gr=35671,yr=35672,vr=35673,xr=35674,_r=35675,br=35676,wr=35678,Tr=35680,kr=1028,Ar=1029,Mr=2305,Sr=7680,Er={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Cr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ir={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Lr={cw:2304,ccw:Mr};function Pr(t){return Array.isArray(t)||_(t)||b(t)}function zr(t){return t.sort(function(t,e){return t===Ue?-1:e===Ue?1:t<e?-1:1})}function Or(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function Dr(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Rr(t){return new Or(!1,!1,!1,t)}function Fr(t,e){var r=t.type;if(0===r){var n=t.data.length;return new Or(!0,n>=1,n>=2,e)}if(4===r){var i=t.data;return new Or(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new Or(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<t.data.length;++l){var u=t.data[l];if(1===u.type)s=!0;else if(2===u.type)o=!0;else if(3===u.type)a=!0;else if(0===u.type){a=!0;var c=u.data;c>=1&&(o=!0),c>=2&&(s=!0)}else 4===u.type&&(a=a||u.data.thisDep,o=o||u.data.contextDep,s=s||u.data.propDep)}return new Or(a,o,s,e)}return new Or(3===r,2===r,1===r,e)}var Br=new Or(!1,!1,!1,function(){});function Nr(e,r,n,i,a,s,l,u,c,h,p,d,m,g,y,v){var x=h.Record,_={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(_.min=32775,_.max=32776);var b=n.angle_instanced_arrays,w=n.webgl_draw_buffers,T=n.oes_vertex_array_object,k={dirty:!0,profile:v.profile},A={},M=[],E={},C={};function I(t){return t.replace(".","_")}function L(t,e,r){var n=I(t);M.push(t),A[n]=k[n]=!!r,E[n]=e}function P(t,e,r){var n=I(t);M.push(t),Array.isArray(r)?(k[n]=r.slice(),A[n]=r.slice()):k[n]=A[n]=r,C[n]=e}function z(t){return!!isNaN(t)}L(me,3024),L(ge,3042),P(ye,"blendColor",[0,0,0,0]),P(ve,"blendEquationSeparate",[32774,32774]),P(xe,"blendFuncSeparate",[1,0,1,0]),L(_e,2929,!0),P(be,"depthFunc",513),P(we,"depthRange",[0,1]),P(Te,"depthMask",!0),P(ke,ke,[!0,!0,!0,!0]),L(Ae,2884),P(Me,"cullFace",Ar),P(Se,Se,Mr),P(Ee,Ee,1),L(Ce,32823),P(Ie,"polygonOffset",[0,0]),L(Le,32926),L(Pe,32928),P(ze,"sampleCoverage",[1,!1]),L(Oe,2960),P(De,"stencilMask",-1),P(Re,"stencilFunc",[519,0,-1]),P(Fe,"stencilOpSeparate",[kr,Sr,Sr,Sr]),P(Be,"stencilOpSeparate",[Ar,Sr,Sr,Sr]),L(Ne,3089),P(je,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(Ue,Ue,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var O={gl:e,context:m,strings:r,next:A,current:k,draw:d,elements:s,buffer:a,shader:p,attributes:h.state,vao:h,uniforms:c,framebuffer:u,extensions:n,timer:g,isBufferArgs:Pr},D={primTypes:F,compareFuncs:Cr,blendFuncs:Er,blendEquations:_,stencilOps:Ir,glTypes:S,orientationType:Lr};w&&(D.backBuffer=[Ar],D.drawBuffer=f(i.maxDrawbuffers,function(t){return 0===t?[0]:f(t,function(t){return 36064+t})}));var R=0;function B(){var e=function(e){var r=e&&e.cache,n=0,i=[],a=[],o=[];function s(){var e=[],r=[];return t(function(){e.push.apply(e,fe(arguments))},{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,fe(arguments)),e.push(";")),t},toString:function(){return pe([r.length>0?"var "+r.join(",")+";":"",pe(e)])}})}function l(){var e=s(),r=s(),n=e.toString,i=r.toString;function a(t,n){r(t,n,"=",e.def(t,n),";")}return t(function(){e.apply(e,fe(arguments))},{def:e.def,entry:e,exit:r,save:a,set:function(t,r,n){a(t,r),e(t,r,"=",n,";")},toString:function(){return n()+i()}})}var u=s(),c={};return{global:u,link:function(t,e){var r=e&&e.stable;if(!r)for(var s=0;s<a.length;++s)if(a[s]===t&&!o[s])return i[s];var l="g"+n++;return i.push(l),a.push(t),o.push(r),l},block:s,proc:function(e,r){var n=[];function i(){var t="a"+n.length;return n.push(t),t}r=r||0;for(var a=0;a<r;++a)i();var o=l(),s=o.toString;return c[e]=t(o,{arg:i,toString:function(){return pe(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var e=pe(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return t(r,{then:function(){return r.apply(r,fe(arguments)),this},else:function(){return n.apply(n,fe(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),pe(["if(",e,"){",i(),"}",t])}})},compile:function(){var t=['"use strict";',u,"return {"];Object.keys(c).forEach(function(e){t.push('"',e,'":',c[e].toString(),",")}),t.push("}");var e,n=pe(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(e=ee(n),r[e]))return r[e].apply(null,a);var o=Function.apply(null,i.concat(n));return r&&(r[e]=o),o.apply(null,a)}}}({cache:y}),n=e.link,i=e.global;e.id=R++,e.batchId="0";var a=n(O),o=e.shared={props:"a0"};Object.keys(O).forEach(function(t){o[t]=i.def(a,".",t)});var s=e.next={},l=e.current={};Object.keys(C).forEach(function(t){Array.isArray(k[t])&&(s[t]=i.def(o.next,".",t),l[t]=i.def(o.current,".",t))});var u=e.constants={};Object.keys(D).forEach(function(t){u[t]=i.def(JSON.stringify(D[t]))}),e.invoke=function(t,r){switch(r.type){case 0:var i=["this",o.context,o.props,e.batchId];return t.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return t.def(o.props,r.data);case 2:return t.def(o.context,r.data);case 3:return t.def("this",r.data);case 4:return r.data.append(e,t),r.data.ref;case 5:return r.data.toString();case 6:return r.data.map(function(r){return e.invoke(t,r)})}},e.attribCache={};var c={};return e.scopeAttrib=function(t){var e=r.id(t);if(e in c)return c[e];var i=h.scope[e];return i||(i=h.scope[e]=new x),c[e]=n(i)},e}function N(t,e,i,o,l){t.static,t.dynamic;var c=function(t,e){var r=t.static;if("string"==typeof r[Ge]&&"string"==typeof r[He]){if(Object.keys(e.dynamic).length>0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var a=[],o=0;o<i.length;++o)a.push([0|n[i[o]],i[o]]);return a}}return null}(t,e),d=function(t){var e=t.static,r=t.dynamic;if(qe in e){var n=e[qe];return n?(n=u.getFramebuffer(n),Rr(function(t,e){var r=t.link(n),i=t.shared;e.set(i.framebuffer,".next",r);var a=i.context;return e.set(a,"."+tr,r+".width"),e.set(a,"."+er,r+".height"),r})):Rr(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+tr,n+"."+ar),e.set(n,"."+er,n+"."+or),"null"})}if(qe in r){var i=r[qe];return Fr(i,function(t,e){var r=t.invoke(e,i),n=t.shared,a=n.framebuffer,o=e.def(a,".getFramebuffer(",r,")");e.set(a,".next",o);var s=n.context;return e.set(s,"."+tr,o+"?"+o+".width:"+s+"."+ar),e.set(s,"."+er,o+"?"+o+".height:"+s+"."+or),o})}return null}(t),m=function(t,e){var r=t.static,n=t.dynamic;function i(t){if(t in r){var i,a,o=r[t],s=!0,l=0|o.x,u=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Or(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,function(t,e){var r=t.shared.context,n=i;"width"in o||(n=e.def(r,".",tr,"-",l));var s=a;return"height"in o||(s=e.def(r,".",er,"-",u)),[l,u,n,s]})}if(t in n){var c=n[t],h=Fr(c,function(t,e){var r=t.invoke(e,c),n=t.shared.context,i=e.def(r,".x|0"),a=e.def(r,".y|0");return[i,a,e.def('"width" in ',r,"?",r,".width|0:","(",n,".",tr,"-",i,")"),e.def('"height" in ',r,"?",r,".height|0:","(",n,".",er,"-",a,")")]});return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new Or(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",tr),e.def(r,".",er)]}):null}var a=i(Ue);if(a){var o=a;a=new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,"."+rr,r[2]),e.set(n,"."+nr,r[3]),r})}return{viewport:a,scissor_box:i(je)}}(t,d),g=function(t){var e=t.static,r=t.dynamic,n={},i=!1,a=function(){if(Je in e){var t=e[Je];return null!==t&&null===h.getVAO(t)&&(t=h.createVAO(t)),i=!0,n.vao=t,Rr(function(e){var r=h.getVAO(t);return r?e.link(r):"null"})}if(Je in r){i=!0;var a=r[Je];return Fr(a,function(t,e){var r=t.invoke(e,a);return e.def(t.shared.vao+".getVAO("+r+")")})}return null}(),o=!1,l=function(){if(Ze in e){var t=e[Ze];if(n.elements=t,Pr(t)){var l=n.elements=s.create(t,!0);t=s.getElements(l),o=!0}else t&&(t=s.getElements(t),o=!0);var u=Rr(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return u.value=t,u}if(Ze in r){o=!0;var c=r[Ze];return Fr(c,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,c),o=e.def("null"),s=e.def(n,"(",a,")"),l=t.cond(s).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return e.entry(l),e.exit(t.cond(s).then(i,".destroyStream(",o,");")),t.ELEMENTS=o,o})}return i?new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.elements+".getElements("+t.shared.vao+".currentVAO.elements):null")}):null}();function u(t,s){if(t in e){var l=0|e[t];return s?n.offset=l:n.instances=l,Rr(function(t,e){return s&&(t.OFFSET=l),l})}if(t in r){var u=r[t];return Fr(u,function(t,e){var r=t.invoke(e,u);return s&&(t.OFFSET=r),r})}if(s){if(o)return Rr(function(t,e){return t.OFFSET=0,0});if(i)return new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.offset:0")})}else if(i)return new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.instances:-1")});return null}var c=u(Xe,!0),f=function(){if(We in e){var t=e[We];return n.primitive=t,Rr(function(e,r){return F[t]})}if(We in r){var s=r[We];return Fr(s,function(t,e){var r=t.constants.primTypes,n=t.invoke(e,s);return e.def(r,"[",n,"]")})}return o?Dr(l)?l.value?Rr(function(t,e){return e.def(t.ELEMENTS,".primType")}):Rr(function(){return 4}):new Or(l.thisDep,l.contextDep,l.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)}):i?new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.primitive:4")}):null}(),p=function(){if(Ye in e){var t=0|e[Ye];return n.count=t,Rr(function(){return t})}if(Ye in r){var s=r[Ye];return Fr(s,function(t,e){return t.invoke(e,s)})}return o?Dr(l)?l?c?new Or(c.thisDep,c.contextDep,c.propDep,function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)}):Rr(function(t,e){return e.def(t.ELEMENTS,".vertCount")}):Rr(function(){return-1}):new Or(l.thisDep||c.thisDep,l.contextDep||c.contextDep,l.propDep||c.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")}):i?new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao,".currentVAO?",t.shared.vao,".currentVAO.count:-1")}):null}(),d=u($e,!1);return{elements:l,primitive:f,count:p,instances:d,offset:c,vao:a,vaoActive:i,elementsActive:o,static:n}}(t),y=function(t){var e=t.static,r=t.dynamic,n={};return M.forEach(function(t){var i=I(t);function a(a,o){if(t in e){var s=a(e[t]);n[i]=Rr(function(){return s})}else if(t in r){var l=r[t];n[i]=Fr(l,function(t,e){return o(t,e,t.invoke(e,l))})}}switch(t){case Ae:case ge:case me:case Oe:case _e:case Ne:case Ce:case Le:case Pe:case Te:return a(function(t){return t},function(t,e,r){return r});case be:return a(function(t){return Cr[t]},function(t,e,r){var n=t.constants.compareFuncs;return e.def(n,"[",r,"]")});case we:return a(function(t){return t},function(t,e,r){return[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case xe:return a(function(t){var e="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,n="dstRGB"in t?t.dstRGB:t.dst,i="dstAlpha"in t?t.dstAlpha:t.dst;return[Er[e],Er[n],Er[r],Er[i]]},function(t,e,r){var n=t.constants.blendFuncs;function i(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}var a=i("src","RGB"),o=i("dst","RGB"),s=e.def(n,"[",a,"]"),l=e.def(n,"[",i("src","Alpha"),"]");return[s,e.def(n,"[",o,"]"),l,e.def(n,"[",i("dst","Alpha"),"]")]});case ve:return a(function(t){return"string"==typeof t?[_[t],_[t]]:"object"==typeof t?[_[t.rgb],_[t.alpha]]:void 0},function(t,e,r){var n=t.constants.blendEquations,i=e.def(),a=e.def(),o=t.cond("typeof ",r,'==="string"');return o.then(i,"=",a,"=",n,"[",r,"];"),o.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),e(o),[i,a]});case ye:return a(function(t){return f(4,function(e){return+t[e]})},function(t,e,r){return f(4,function(t){return e.def("+",r,"[",t,"]")})});case De:return a(function(t){return 0|t},function(t,e,r){return e.def(r,"|0")});case Re:return a(function(t){var e=t.cmp||"keep",r=t.ref||0,n="mask"in t?t.mask:-1;return[Cr[e],r,n]},function(t,e,r){var n=t.constants.compareFuncs;return[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Sr),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Fe:case Be:return a(function(e){var r=e.fail||"keep",n=e.zfail||"keep",i=e.zpass||"keep";return[t===Be?Ar:kr,Ir[r],Ir[n],Ir[i]]},function(e,r,n){var i=e.constants.stencilOps;function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",Sr)}return[t===Be?Ar:kr,a("fail"),a("zfail"),a("zpass")]});case Ie:return a(function(t){return[0|t.factor,0|t.units]},function(t,e,r){return[e.def(r,".factor|0"),e.def(r,".units|0")]});case Me:return a(function(t){var e=0;return"front"===t?e=kr:"back"===t&&(e=Ar),e},function(t,e,r){return e.def(r,'==="front"?',kr,":",Ar)});case Ee:return a(function(t){return t},function(t,e,r){return r});case Se:return a(function(t){return Lr[t]},function(t,e,r){return e.def(r+'==="cw"?2304:'+Mr)});case ke:return a(function(t){return t.map(function(t){return!!t})},function(t,e,r){return f(4,function(t){return"!!"+r+"["+t+"]"})});case ze:return a(function(t){return["value"in t?t.value:1,!!t.invert]},function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),n}(t),v=function(t,e,n){var i=t.static,a=t.dynamic;function o(t){if(t in i){var e=r.id(i[t]),n=Rr(function(){return e});return n.id=e,n}if(t in a){var o=a[t];return Fr(o,function(t,e){var r=t.invoke(e,o);return e.def(t.shared.strings,".id(",r,")")})}return null}var s,l=o(Ge),u=o(He),c=null;return Dr(l)&&Dr(u)?(c=p.program(u.id,l.id,null,n),s=Rr(function(t,e){return t.link(c)})):s=new Or(l&&l.thisDep||u&&u.thisDep,l&&l.contextDep||u&&u.contextDep,l&&l.propDep||u&&u.propDep,function(t,e){var r,n=t.shared.shader;r=l?l.append(t,e):e.def(n,".",Ge);var i=n+".program("+(u?u.append(t,e):e.def(n,".",He))+","+r;return e.def(i+")")}),{frag:l,vert:u,progVar:s,program:c}}(t,0,c);function b(t){var e=m[t];e&&(y[t]=e)}b(Ue),b(I(je));var w=Object.keys(y).length>0,T={framebuffer:d,draw:g,shader:v,state:y,dirty:w,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(T.profile=function(t){var e,r=t.static,n=t.dynamic;if(Ve in r){var i=!!r[Ve];(e=Rr(function(t,e){return i})).enable=i}else if(Ve in n){var a=n[Ve];e=Fr(a,function(t,e){return t.invoke(e,a)})}return e}(t),T.uniforms=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r,i=e[t];if("number"==typeof i||"boolean"==typeof i)r=Rr(function(){return i});else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Rr(function(t){return t.link(i)}):("framebuffer"===a||"framebufferCube"===a)&&(r=Rr(function(t){return t.link(i.color[0])}))}else G(i)&&(r=Rr(function(t){return t.global.def("[",f(i.length,function(t){return i[t]}),"]")}));r.value=i,n[t]=r}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Fr(e,function(t,r){return t.invoke(r,e)})}),n}(i),T.drawVAO=T.scopeVAO=g.vao,!T.drawVAO&&v.program&&!c&&n.angle_instanced_arrays&&g.static.elements){var k=!0,A=v.program.attributes.map(function(t){var r=e.static[t];return k=k&&!!r,r});if(k&&A.length>0){var E=h.getVAO(h.createVAO({attributes:A,elements:g.static.elements}));T.drawVAO=new Or(null,null,null,function(t,e){return t.link(E)}),T.useVAO=!0}}return c?T.useVAO=!0:T.attributes=function(t){var e=t.static,n=t.dynamic,i={};return Object.keys(e).forEach(function(t){var n=e[t],o=r.id(t),s=new x;if(Pr(n))s.state=1,s.buffer=a.getBuffer(a.create(n,lr,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var u=n.constant;s.buffer="null",s.state=2,"number"==typeof u?s.x=u:de.forEach(function(t,e){e<u.length&&(s[t]=u[e])})}else{l=Pr(n.buffer)?a.getBuffer(a.create(n.buffer,lr,!1,!0)):a.getBuffer(n.buffer);var c=0|n.offset,h=0|n.stride,f=0|n.size,p=!!n.normalized,d=0;"type"in n&&(d=S[n.type]);var m=0|n.divisor;s.buffer=l,s.state=1,s.size=f,s.normalized=p,s.type=d||l.dtype,s.offset=c,s.stride=h,s.divisor=m}}i[t]=Rr(function(t,e){var r=t.attribCache;if(o in r)return r[o];var n={isStream:!1};return Object.keys(s).forEach(function(t){n[t]=s[t]}),s.buffer&&(n.buffer=t.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[o]=n,n})}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=Fr(e,function(t,r){var n=t.invoke(r,e),i=t.shared,a=t.constants,o=i.isBufferArgs,s=i.buffer,l={isStream:r.def(!1)},u=new x;u.state=1,Object.keys(u).forEach(function(t){l[t]=r.def(""+u[t])});var c=l.buffer,h=l.type;function f(t){r(l[t],"=",n,".",t,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",c,"=",s,".createStream(",lr,",",n,");",h,"=",c,".dtype;","}else{",c,"=",s,".getBuffer(",n,");","if(",c,"){",h,"=",c,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[de[0]],"=",n,".constant;",de.slice(1).map(function(t){return l[t]}).join("="),"=0;","}else{",de.map(function(t,e){return l[t]+"="+n+".constant.length>"+e+"?"+n+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",n,".buffer)){",c,"=",s,".createStream(",lr,",",n,".buffer);","}else{",c,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",c,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",c,");","}"),l})}),i}(e),T.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=Rr(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Fr(e,function(t,r){return t.invoke(r,e)})}),n}(o),T}function j(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a);var o=r[a].append(t,e);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")}),e(i)}function U(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;w&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,u=t.constants,c=u.drawBuffer,h=u.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&e(i,".drawBuffersWEBGL(",c,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",36160,",null);"),w&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function V(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,u=t.cond(s,".dirty");M.forEach(function(e){var n,c,h=I(e);if(!(h in r.state))if(h in o){n=o[h],c=a[h];var p=f(k[h].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(p.map(function(t,e){return t+"!=="+c+"["+e+"]"}).join("||")).then(i,".",C[h],"(",p,");",p.map(function(t,e){return c+"["+e+"]="+t}).join(";"),";"))}else{n=u.def(l,".",h);var d=t.cond(n,"!==",s,".",h);u(d),h in E?d(t.cond(n).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",n,";"):d(i,".",C[h],"(",n,");",s,".",h,"=",n,";")}}),0===Object.keys(r.state).length&&u(s,".dirty=false;"),e(u)}function q(t,e,r,n){var i,a=t.shared,o=t.current,s=a.current,l=a.gl;zr(Object.keys(r)).forEach(function(a){var u=r[a];if(!n||n(u)){var c=u.append(t,e);if(E[a]){var h=E[a];Dr(u)?(i=t.link(c,{stable:!0}),e(t.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",i,";")):(e(t.cond(c).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",c,";"))}else if(G(c)){var f=o[a];e(l,".",C[a],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else Dr(u)?(i=t.link(c,{stable:!0}),e(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):e(l,".",C[a],"(",c,");",s,".",a,"=",c,";")}})}function H(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function Z(t,e,r,n,i){var a,o,s,l=t.shared,u=t.stats,c=l.current,h=l.timer,f=r.profile;function p(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(a=e.def(),"=",p(),";"),"string"==typeof i?t(u,".count+=",i,";"):t(u,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",u,");"))}function m(t){t(u,".cpuTime+=",p(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",u,");"):t(h,".endQuery();"))}function y(t){var r=e.def(c,".profile");e(c,".profile=",t,";"),e.exit(c,".profile=",r,";")}if(f){if(Dr(f))return void(f.enable?(d(e),m(e.exit),y("true")):y("false"));y(s=f.append(t,e))}else s=e.def(c,".profile");var v=t.block();d(v),e("if(",s,"){",v,"}");var x=t.block();m(x),e.exit("if(",s,"){",x,"}")}function W(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(Br))return;var u=t.scopeAttrib(s);o={},Object.keys(new x).forEach(function(t){o[t]=e.def(u,".",t)})}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),u=i.state,c=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function p(){e("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",l,".type!==",a,"||",l,".size!==",r,"||",f.map(function(t){return l+"."+t+"!=="+i[t]}).join("||"),"){",o,".bindBuffer(",lr,",",c,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",f.map(function(t){return l+"."+t+"="+i[t]+";"}).join(""),"}"),b){var u=i.divisor;e("if(",l,".divisor!==",u,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,u],");",l,".divisor=",u,";}")}}function d(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",de.map(function(t,e){return l+"."+t+"!=="+h[e]}).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",de.map(function(t,e){return l+"."+t+"="+h[e]+";"}).join(""),"}")}1===u?p():2===u?d():(e("if(",u,"===",1,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case cr:case pr:case gr:return 2;case hr:case dr:case yr:return 3;case fr:case mr:case vr:return 4;default:return 1}}(n.info.type),o)})}function Y(t,e,n,i,a,o){for(var s,l=t.shared,u=l.gl,c=0;c<i.length;++c){var h,p=i[c],d=p.name,m=p.info.type,g=n.uniforms[d],y=t.link(p)+".location";if(g){if(!a(g))continue;if(Dr(g)){var v=g.value;if(m===wr||m===Tr){var x=t.link(v._texture||v.color[0]._texture);e(u,".uniform1i(",y,",",x+".bind());"),e.exit(x,".unbind();")}else if(m===xr||m===_r||m===br){var _=t.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;m===_r?b=3:m===br&&(b=4),e(u,".uniformMatrix",b,"fv(",y,",false,",_,");")}else{switch(m){case 5126:s="1f";break;case cr:s="2f";break;case hr:s="3f";break;case fr:s="4f";break;case 35670:case 5124:s="1i";break;case gr:case pr:s="2i";break;case yr:case dr:s="3i";break;case vr:case mr:s="4i"}e(u,".uniform",s,"(",y,",",G(v)?Array.prototype.slice.call(v):v,");")}continue}h=g.append(t,e)}else{if(!a(Br))continue;h=e.def(l.uniforms,"[",r.id(d),"]")}m===wr?e("if(",h,"&&",h,'._reglType==="framebuffer"){',h,"=",h,".color[0];","}"):m===Tr&&e("if(",h,"&&",h,'._reglType==="framebufferCube"){',h,"=",h,".color[0];","}");var w=1;switch(m){case wr:case Tr:var T=e.def(h,"._texture");e(u,".uniform1i(",y,",",T,".bind());"),e.exit(T,".unbind();");continue;case 5124:case 35670:s="1i";break;case pr:case gr:s="2i",w=2;break;case dr:case yr:s="3i",w=3;break;case mr:case vr:s="4i",w=4;break;case 5126:s="1f";break;case cr:s="2f",w=2;break;case hr:s="3f",w=3;break;case fr:s="4f",w=4;break;case xr:s="Matrix2fv";break;case _r:s="Matrix3fv";break;case br:s="Matrix4fv"}if("M"===s.charAt(0)){e(u,".uniform",s,"(",y,",");var k=Math.pow(m-xr+2,2),A=t.global.def("new Float32Array(",k,")");Array.isArray(h)?e("false,(",f(k,function(t){return A+"["+t+"]="+h[t]}),",",A,")"):e("false,(Array.isArray(",h,")||",h," instanceof Float32Array)?",h,":(",f(k,function(t){return A+"["+t+"]="+h+"["+t+"]"}),",",A,")"),e(");")}else if(w>1){for(var M=[],S=[],E=0;E<w;++E)Array.isArray(h)?S.push(h[E]):S.push(e.def(h+"["+E+"]")),o&&M.push(e.def());o&&e("if(!",t.batchId,"||",M.map(function(t,e){return t+"!=="+S[e]}).join("||"),"){",M.map(function(t,e){return t+"="+S[e]+";"}).join("")),e(u,".uniform",s,"(",y,",",S.join(","),");"),o&&e("}")}else{if(o){var C=e.def();e("if(!",t.batchId,"||",C,"!==",h,"){",C,"=",h,";")}e(u,".uniform",s,"(",y,",",h,");"),o&&e("}")}}}function X(t,e,r,n){var i,a,o,s=t.shared,l=s.gl,u=s.draw,c=n.draw,h=(a=c.elements,o=e,a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),c.elementsActive&&o("if("+i+")"+l+".bindBuffer("+ur+","+i+".buffer.buffer);")):(i=o.def(),o(i,"=",u,".",Ze,";","if(",i,"){",l,".bindBuffer(",ur,",",i,".buffer.buffer);}","else if(",s.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+s.vao,".currentVAO.elements);",T?"":"if("+i+")"+l+".bindBuffer("+ur+","+i+".buffer.buffer);","}")),i);function f(i){var a=c[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(u,".",i)}var p,d,m=f(We),g=f(Xe),y=function(){var i,a=c.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(u,".",Ye),i}();if("number"==typeof y){if(0===y)return}else r("if(",y,"){"),r.exit("}");b&&(p=f($e),d=t.instancing);var v=h+".type",x=c.elements&&Dr(c.elements)&&!c.vaoActive;function _(){function t(){r(d,".drawElementsInstancedANGLE(",[m,y,v,g+"<<(("+v+"-5121)>>1)",p],");")}function e(){r(d,".drawArraysInstancedANGLE(",[m,g,y,p],");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function w(){function t(){r(l+".drawElements("+[m,y,v,g+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[m,g,y]+");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof p||p>=0)?"string"==typeof p?(r("if(",p,">0){"),_(),r("}else if(",p,"<0){"),w(),r("}")):_():w()}function $(t,e,r,n,i){var a=B(),o=a.proc("body",i);return b&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function J(t,e,r,n){H(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,r,n.attributes,function(){return!0})),Y(t,e,r,n.uniforms,function(){return!0},!1),X(t,e,e,r)}function K(t,e,r,n){function i(){return!0}t.batchId="a1",H(t,e),W(t,e,r,n.attributes,i),Y(t,e,r,n.uniforms,i,!1),X(t,e,e,r)}function Q(t,e,r,n){H(t,e);var i=r.contextDep,a=e.def(),o=e.def();t.shared.props=o,t.batchId=a;var s=t.scope(),l=t.scope();function u(t){return t.contextDep&&i||t.propDep}function c(t){return!u(t)}if(e(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&j(t,l,r.context),r.needsFramebuffer&&U(t,l,r.framebuffer),q(t,l,r.state,u),r.profile&&u(r.profile)&&Z(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?u(r.drawVAO)?l(t.shared.vao,".setVAO(",r.drawVAO.append(t,l),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),W(t,s,r,n.attributes,c),W(t,l,r,n.attributes,u)),Y(t,s,r,n.uniforms,c,!1),Y(t,l,r,n.uniforms,u,!0),X(t,s,l,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,l),p=l.def(f,".id"),d=l.def(h,"[",p,"]");l(t.shared.gl,".useProgram(",f,".program);","if(!",d,"){",d,"=",h,"[",p,"]=",t.link(function(t){return $(K,0,r,t,2)}),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function tt(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!G(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(o.isDynamic(t[e[r]]))return!0;return!1}}(n)){var i=t.global,a=Object.keys(n),s=!1,l=!1,u=!1,c=t.global.def("{}");a.forEach(function(e){var r=n[e];if(o.isDynamic(r)){"function"==typeof r&&(r=n[e]=o.unbox(r));var a=Fr(r,null);s=s||a.thisDep,u=u||a.propDep,l=l||a.contextDep}else{switch(i(c,".",e,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(t.link(r))}i(";")}}),e.dynamic[r]=new o.DynamicVariable(4,{thisDep:s,contextDep:l,propDep:u,ref:c,append:function(t,e){a.forEach(function(r){var i=n[r];if(o.isDynamic(i)){var a=t.invoke(e,i);e(c,".",r,"=",a,";")}})}}),delete e.static[r]}}return{next:A,current:k,procs:function(){var t=B(),e=t.proc("poll"),r=t.proc("refresh"),a=t.block();e(a),r(a);var o,s=t.shared,l=s.gl,u=s.next,c=s.current;a(c,".dirty=false;"),U(t,e),U(t,r,null,!0),b&&(o=t.link(b)),n.oes_vertex_array_object&&r(t.link(n.oes_vertex_array_object),".bindVertexArrayOES(null);");var h=r.def(s.attributes),p=r.def(0),d=t.cond(p,".buffer");d.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",lr,",",p,".buffer.buffer);",l,".vertexAttribPointer(i,",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(l,".disableVertexAttribArray(i);",l,".vertexAttrib4f(i,",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;");var m=t.link(i.maxAttributes,{stable:!0});return r("for(var i=0;i<",m,";++i){",p,"=",h,"[i];",d,"}"),b&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",h,"[i].divisor);","}"),r(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(E).forEach(function(n){var i=E[n],o=a.def(u,".",n),s=t.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",c,".",n,"=",o,";"),r(s),e("if(",o,"!==",c,".",n,"){",s,"}")}),Object.keys(C).forEach(function(n){var i,o,s=C[n],h=k[n],p=t.block();if(p(l,".",s,"("),G(h)){var d=h.length;i=t.global.def(u,".",n),o=t.global.def(c,".",n),p(f(d,function(t){return i+"["+t+"]"}),");",f(d,function(t){return o+"["+t+"]="+i+"["+t+"];"}).join("")),e("if(",f(d,function(t){return i+"["+t+"]!=="+o+"["+t+"]"}).join("||"),"){",p,"}")}else i=a.def(u,".",n),o=a.def(c,".",n),p(i,");",c,".",n,"=",i,";"),e("if(",i,"!==",o,"){",p,"}");r(p)}),t.compile()}(),compile:function(e,n,i,a,o){var s=B();s.stats=s.link(o),Object.keys(n.static).forEach(function(t){tt(s,n,t)}),sr.forEach(function(t){tt(s,e,t)});var l=N(e,n,i,a);return l.shader.program&&(l.shader.program.attributes.sort(function(t,e){return t.name<e.name?-1:1}),l.shader.program.uniforms.sort(function(t,e){return t.name<e.name?-1:1})),function(t,e){var r=t.proc("draw",1);H(t,r),j(t,r,e.context),U(t,r,e.framebuffer),V(t,r,e),q(t,r,e.state),Z(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)J(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link(function(t){return $(J,0,e,t,1)}),"(",n,");",o,".call(this,a0);"))}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,a=i.current;if(j(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),zr(Object.keys(e.state)).forEach(function(r){var a=e.state[r],o=a.append(t,n);G(o)?o.forEach(function(e,i){z(e)?n.set(t.next[r],"["+i+"]",e):n.set(t.next[r],"["+i+"]",t.link(e,{stable:!0}))}):Dr(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)}),Z(t,n,e,!0,!0),[Ze,Xe,Ye,$e,We].forEach(function(r){var a=e.draw[r];if(a){var o=a.append(t,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,t.link(o),{stable:!0})}}),Object.keys(e.uniforms).forEach(function(a){var o=e.uniforms[a].append(t,n);Array.isArray(o)&&(o="["+o.map(function(e){return z(e)?e:t.link(e,{stable:!0})})+"]"),n.set(i.uniforms,"["+t.link(r.id(a),{stable:!0})+"]",o)}),Object.keys(e.attributes).forEach(function(r){var i=e.attributes[r].append(t,n),a=t.scopeAttrib(r);Object.keys(new x).forEach(function(t){n.set(a,"."+t,i[t])})}),e.scopeVAO){var o=e.scopeVAO.append(t,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",t.link(o,{stable:!0}))}function s(r){var a=e.shader[r];if(a){var o=a.append(t,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,t.link(o,{stable:!0}))}}s(He),s(Ge),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,l),function(t,e){var r=t.proc("batch",2);t.batchId="0",H(t,r);var n=!1,i=!0;Object.keys(e.context).forEach(function(t){n=n||e.context[t].propDep}),n||(j(t,r,e.context),i=!1);var a=e.framebuffer,o=!1;function s(t){return t.contextDep&&n||t.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||U(t,r,a)):U(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),V(t,r,e),q(t,r,e.state,function(t){return!s(t)}),(!e.profile||!s(e.profile))&&Z(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=o;var l=e.shader.progVar;if(l.contextDep&&n||l.propDep)Q(t,r,e,null);else{var u=l.append(t,r);if(r(t.shared.gl,".useProgram(",u,".program);"),e.shader.program)Q(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var c=t.global.def("{}"),h=r.def(u,".id"),f=r.def(c,"[",h,"]");r(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",c,"[",h,"]=",t.link(function(t){return $(Q,0,e,t,2)}),"(",u,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),t(s.compile(),{destroy:function(){l.shader.program.destroy()}})}}}var jr=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[];function s(t){o.push(t)}var l=[];function u(t,e,r){var n=o.pop()||new a;n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,l.push(n)}var c=[],h=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),u(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:u,update:function(){var t,r,a=i.length;if(0!==a){h.length=Math.max(h.length,a+1),c.length=Math.max(c.length,a+1),c[0]=0,h[0]=0;var o=0;for(t=0,r=0;r<i.length;++r){var u=i[r];e.ext_disjoint_timer_query.getQueryObjectEXT(u,34919)?(o+=e.ext_disjoint_timer_query.getQueryObjectEXT(u,34918),n(u)):i[t++]=u,c[r+1]=o,h[r+1]=t}for(i.length=t,t=0,r=0;r<l.length;++r){var f=l[r],p=f.startQueryIndex,d=f.endQueryIndex;f.sum+=c[d]-c[p];var m=h[p],g=h[d];g===m?(f.stats.gpuTime+=f.sum/1e6,s(f)):(f.startQueryIndex=m,f.endQueryIndex=g,l[t++]=f)}l.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){r.push.apply(r,i);for(var t=0;t<r.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(r[t]);i.length=0,r.length=0},restore:function(){i.length=0,r.length=0}}},Ur="webglcontextlost",Vr="webglcontextrestored";function qr(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}return function(e){var r=h(e);if(!r)return null;var n=r.gl,i=n.getContextAttributes();n.isContextLost();var a=function(t,e){var r={};function n(e){var n,i=e.toLowerCase();try{n=r[i]=t.getExtension(i)}catch(t){}return!!n}for(var i=0;i<e.extensions.length;++i){var a=e.extensions[i];if(!n(a))return e.onDestroy(),e.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach(function(t){if(r[t]&&!n(t))throw new Error("(regl): error restoring extension "+t)})}}}(n,r);if(!a)return null;var u=function(){var t={"":0},e=[""];return{id:function(r){var n=t[r];return n||(n=t[r]=e.length,e.push(r),n)},str:function(t){return e[t]}}}(),c={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},f=r.cachedCode||{},p=a.extensions,d=jr(0,p),T=l(),k=n.drawingBufferWidth,A=n.drawingBufferHeight,M={tick:0,time:0,viewportWidth:k,viewportHeight:A,framebufferWidth:k,framebufferHeight:A,drawingBufferWidth:k,drawingBufferHeight:A,pixelRatio:r.pixelRatio},V={elements:null,primitive:4,count:-1,offset:0,instances:-1},q=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063));var a=!!e.oes_texture_float;if(a){var o=t.createTexture();t.bindTexture(g,o),t.texImage2D(g,0,y,1,1,0,y,v,null);var s=t.createFramebuffer();if(t.bindFramebuffer(x,s),t.framebufferTexture2D(x,36064,g,o,0),t.bindTexture(g,null),36053!==t.checkFramebufferStatus(x))a=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var l=m.allocType(v,4);t.readPixels(0,0,1,1,y,v,l),t.getError()?a=!1:(t.deleteFramebuffer(s),t.deleteTexture(o),a=1===l[0]),m.freeType(l)}}var u=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var c=t.createTexture(),h=m.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,c),t.texImage2D(34069,0,y,3,3,0,y,5121,h),m.freeType(h),t.bindTexture(34067,null),t.deleteTexture(c),u=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:a,npotTextureCube:u}}(n,p),H=function(t,e,r,n){var i=0,a={};function o(e){this.id=i++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=L,this.persistentData=null,r.profile&&(this.stats={size:0})}o.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},o.prototype.destroy=function(){c(this)};var s=[];function l(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function u(t,e,r,n,i,a){var o,s;if(t.usage=r,Array.isArray(e)){if(t.dtype=n||P,e.length>0)if(Array.isArray(e[0])){o=I(e);for(var u=1,c=1;c<o.length;++c)u*=o[c];t.dimension=u,l(t,s=C(e,o,t.dtype),r),a?t.persistentData=s:m.freeType(s)}else if("number"==typeof e[0]){t.dimension=i;var h=m.allocType(t.dtype,e.length);D(h,e),l(t,h,r),a?t.persistentData=h:m.freeType(h)}else _(e[0])&&(t.dimension=e[0].length,t.dtype=n||O(e[0])||P,l(t,s=C(e,[e.length,e[0].length],t.dtype),r),a?t.persistentData=s:m.freeType(s))}else if(_(e))t.dtype=n||O(e),t.dimension=i,l(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(b(e)){o=e.shape;var f=e.stride,p=e.offset,d=0,g=0,y=0,v=0;1===o.length?(d=o[0],g=1,y=f[0],v=0):2===o.length&&(d=o[0],g=o[1],y=f[0],v=f[1]),t.dtype=n||O(e.data)||P,t.dimension=g;var x=m.allocType(t.dtype,d*g);R(x,e.data,d,g,y,v,p),l(t,x,r),a?t.persistentData=x:m.freeType(x)}else e instanceof ArrayBuffer&&(t.dtype=L,t.dimension=i,l(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e))))}function c(r){e.bufferCount--,n(r);var i=r.buffer;t.deleteBuffer(i),r.buffer=null,delete a[r.id]}return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach(function(e){t+=a[e].stats.size}),t}),{create:function(n,i,s,l){e.bufferCount++;var h=new o(i);function f(e){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(e)||_(e)||b(e)||e instanceof ArrayBuffer?i=e:"number"==typeof e?a=0|e:e&&("data"in e&&(i=e.data),"usage"in e&&(n=E[e.usage]),"type"in e&&(o=S[e.type]),"dimension"in e&&(s=0|e.dimension),"length"in e&&(a=0|e.length)),h.bind(),i?u(h,i,n,o,s,l):(a&&t.bufferData(h.type,a,n),h.dtype=o||L,h.usage=n,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*z[h.dtype]),f}function p(e,r){t.bufferSubData(h.type,r,e)}return a[h.id]=h,s||f(n),f._reglType="buffer",f._buffer=h,f.subdata=function(t,e){var r,n=0|(e||0);if(h.bind(),_(t)||t instanceof ArrayBuffer)p(t,n);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var i=m.allocType(h.dtype,t.length);D(i,t),p(i,n),m.freeType(i)}else if(Array.isArray(t[0])||_(t[0])){r=I(t);var a=C(t,r,h.dtype);p(a,n),m.freeType(a)}}else if(b(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,c=0;1===r.length?(s=r[0],l=1,u=o[0],c=0):2===r.length&&(s=r[0],l=r[1],u=o[0],c=o[1]);var d=Array.isArray(t.data)?h.dtype:O(t.data),g=m.allocType(d,s*l);R(g,t.data,s,l,u,c,t.offset),p(g,n),m.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){c(h)},f},createStream:function(t,e){var r=s.pop();return r||(r=new o(t)),r.bind(),u(r,e,35040,0,1,!1),r},destroyStream:function(t){s.push(t)},clear:function(){w(a).forEach(c),s.forEach(c)},getBuffer:function(t){return t&&t._buffer instanceof o?t._buffer:null},restore:function(){w(a).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})},_initBuffer:u}}(n,c,r,function(t){return Z.destroyBuffer(t)}),G=function(t,e,r,n){var i={},a=0,o={uint8:B,uint16:N};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}e.oes_element_index_uint&&(o.uint32=j),s.prototype.bind=function(){this.buffer.bind()};var l=[];function u(n,i,a,o,s,l,u){var c;if(n.buffer.bind(),i){var h=u;!u&&(!_(i)||b(i)&&!_(i.data))&&(h=e.oes_element_index_uint?j:N),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=c||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(c=u,!u){switch(n.buffer.dtype){case B:case 5120:c=B;break;case N:case 5122:c=N;break;case j:case 5124:c=j}n.buffer.dtype=c}n.type=c;var f=s;f<0&&(f=n.buffer.byteLength,c===N?f>>=1:c===j&&(f>>=2)),n.vertCount=f;var p=o;if(o<0){p=4;var d=n.buffer.dimension;1===d&&(p=0),2===d&&(p=1),3===d&&(p=4)}n.primType=p}function c(t){n.elementsCount--,delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,e){var i=r.create(null,U,!0),a=new s(i._buffer);function l(t){if(t)if("number"==typeof t)i(t),a.primType=4,a.vertCount=0|t,a.type=B;else{var e=null,r=35044,n=-1,s=-1,c=0,h=0;Array.isArray(t)||_(t)||b(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=E[t.usage]),"primitive"in t&&(n=F[t.primitive]),"count"in t&&(s=0|t.count),"type"in t&&(h=o[t.type]),"length"in t?c=0|t.length:(c=s,h===N||5122===h?c*=2:(h===j||5124===h)&&(c*=4))),u(a,e,r,n,s,c,h)}else i(),a.primType=4,a.vertCount=0,a.type=B;return l}return n.elementsCount++,l(t),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return i.subdata(t,e),l},l.destroy=function(){c(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),u(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){w(i).forEach(c)}}}(n,p,H,c),Z=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),u=0;u<s;++u)l[u]=new Qt;var c=0,h={},f={Record:Qt,scope:{},state:l,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&w(h).forEach(function(t){t.refresh()})}:function(){},createVAO:function(t){var e=new m;function r(t){var n;if(Array.isArray(t))n=t,e.elements&&e.ownsElements&&e.elements.destroy(),e.elements=null,e.ownsElements=!1,e.offset=0,e.count=0,e.instances=-1,e.primitive=4;else{if(t.elements){var o=t.elements;e.ownsElements?"function"==typeof o&&"elements"===o._reglType?(e.elements.destroy(),e.ownsElements=!1):(e.elements(o),e.ownsElements=!1):a.getElements(t.elements)?(e.elements=t.elements,e.ownsElements=!1):(e.elements=a.create(t.elements),e.ownsElements=!0)}else e.elements=null,e.ownsElements=!1;n=t.attributes,e.offset=0,e.count=-1,e.instances=-1,e.primitive=4,e.elements&&(e.count=e.elements._elements.vertCount,e.primitive=e.elements._elements.primType),"offset"in t&&(e.offset=0|t.offset),"count"in t&&(e.count=0|t.count),"instances"in t&&(e.instances=0|t.instances),"primitive"in t&&(e.primitive=F[t.primitive])}var s={},l=e.attributes;l.length=n.length;for(var u=0;u<n.length;++u){var c,h=n[u],f=l[u]=new Qt,p=h.data||h;Array.isArray(p)||_(p)||b(p)?(e.buffers[u]&&(c=e.buffers[u],_(p)&&c._buffer.byteLength>=p.byteLength?c.subdata(p):(c.destroy(),e.buffers[u]=null)),e.buffers[u]||(c=e.buffers[u]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,s[u]=1):i.getBuffer(h)?(f.buffer=i.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(h.buffer)?(f.buffer=i.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,f.type="type"in h?S[h.type]:f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1):"x"in h&&(f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2)}for(var d=0;d<e.buffers.length;++d)!s[d]&&e.buffers[d]&&(e.buffers[d].destroy(),e.buffers[d]=null);return e.refresh(),r}return n.vaoCount+=1,r.destroy=function(){for(var t=0;t<e.buffers.length;++t)e.buffers[t]&&e.buffers[t].destroy();e.buffers.length=0,e.ownsElements&&(e.elements.destroy(),e.elements=null,e.ownsElements=!1),e.destroy()},r._vao=e,r._reglType="vao",r(t)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(e){for(var r=0;r<l.length;++r){var n=l[r];n.buffer===e&&(t.disableVertexAttribArray(r),n.buffer=null)}},setVAO:p()?function(t){if(t!==f.currentVAO){var e=p();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),f.currentVAO=t}}:function(e){if(e!==f.currentVAO){if(e)e.bindAttrs();else{for(var r=d(),n=0;n<l.length;++n){var i=l[n];i.buffer?(t.enableVertexAttribArray(n),i.buffer.bind(),t.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offfset),r&&i.divisor&&r.vertexAttribDivisorANGLE(n,i.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}o.elements?t.bindBuffer(Kt,o.elements.buffer.buffer):t.bindBuffer(Kt,null)}f.currentVAO=e}},clear:p()?function(){w(h).forEach(function(t){t.destroy()})}:function(){}};function p(){return e.oes_vertex_array_object}function d(){return e.angle_instanced_arrays}function m(){this.id=++c,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var t=p();this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}return m.prototype.bindAttrs=function(){for(var e=d(),r=this.attributes,n=0;n<r.length;++n){var i=r[n];i.buffer?(t.enableVertexAttribArray(n),t.bindBuffer(34962,i.buffer.buffer),t.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offset),e&&i.divisor&&e.vertexAttribDivisorANGLE(n,i.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}for(var o=r.length;o<s;++o)t.disableVertexAttribArray(o);var l=a.getElements(this.elements);l?t.bindBuffer(Kt,l.buffer.buffer):t.bindBuffer(Kt,null)},m.prototype.refresh=function(){var t=p();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=null,t.bindVertexArrayOES(null))},m.prototype.destroy=function(){if(this.vao){var t=p();this===f.currentVAO&&(f.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),h[this.id]&&(delete h[this.id],n.vaoCount-=1)},f}(n,p,q,c,H,G,V),W=function(e,r,n,i){var a={},o={};function s(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function l(t,e){for(var r=0;r<t.length;++r)if(t[r].id===e.id)return void(t[r].location=e.location);t.push(e)}function u(t,n,i){var s=35632===t?a:o,l=s[n];if(!l){var u=r.str(n);l=e.createShader(t),e.shaderSource(l,u),e.compileShader(l),s[n]=l}return l}var c={},h=[],f=0;function p(t,e){this.id=f++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function d(t,n,a){var o,c,h=u(35632,t.fragId),f=u(35633,t.vertId),p=t.program=e.createProgram();if(e.attachShader(p,h),e.attachShader(p,f),a)for(o=0;o<a.length;++o){var d=a[o];e.bindAttribLocation(p,d[0],d[1])}e.linkProgram(p);var m=e.getProgramParameter(p,35718);i.profile&&(t.stats.uniformsCount=m);var g=t.uniforms;for(o=0;o<m;++o)if(c=e.getActiveUniform(p,o))if(c.size>1)for(var y=0;y<c.size;++y){var v=c.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),e.getUniformLocation(p,v),c))}else l(g,new s(c.name,r.id(c.name),e.getUniformLocation(p,c.name),c));var x=e.getProgramParameter(p,35721);i.profile&&(t.stats.attributesCount=x);var _=t.attributes;for(o=0;o<x;++o)(c=e.getActiveAttrib(p,o))&&l(_,new s(c.name,r.id(c.name),e.getAttribLocation(p,c.name),c))}return i.profile&&(n.getMaxUniformsCount=function(){var t=0;return h.forEach(function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var t=e.deleteShader.bind(e);w(a).forEach(t),a={},w(o).forEach(t),o={},h.forEach(function(t){e.deleteProgram(t.program)}),h.length=0,c={},n.shaderCount=0},program:function(r,i,s,l){var u=c[i];u||(u=c[i]={});var f=u[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(u[r]=m),h.push(m),t(m,{destroy:function(){if(m.refCount--,m.refCount<=0){e.deleteProgram(m.program);var t=h.indexOf(m);h.splice(t,1),n.shaderCount--}u[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete c[m.fragId][m.vertId]),Object.keys(c[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete c[m.fragId])}})},restore:function(){a={},o={};for(var t=0;t<h.length;++t)d(h[t],0,h[t].attributes.map(function(t){return[t.location,t.name]}))},shader:u,frag:-1,vert:-1}}(n,u,c,r),Y=Vt(n,p,q,function(){J.procs.poll()},M,c,r),X=function(t,e,r,n,i){var a={rgba4:Ht,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(a.srgba=35907),e.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),e.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach(function(t){var e=a[t];o[e]=t});var s=0,l={};function u(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=Ht,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function c(e){var r=e.renderbuffer;t.bindRenderbuffer(qt,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete l[e.id],n.renderbufferCount--}return u.prototype.decRef=function(){--this.refCount<=0&&c(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(l).forEach(function(e){t+=l[e].stats.size}),t}),{create:function(e,r){var s=new u(t.createRenderbuffer());function c(e,r){var n=0,l=0,u=Ht;if("object"==typeof e&&e){var h=e;if("shape"in h){var f=h.shape;n=0|f[0],l=0|f[1]}else"radius"in h&&(n=l=0|h.radius),"width"in h&&(n=0|h.width),"height"in h&&(l=0|h.height);"format"in h&&(u=a[h.format])}else"number"==typeof e?(n=0|e,l="number"==typeof r?0|r:n):e||(n=l=1);if(n!==s.width||l!==s.height||u!==s.format)return c.width=s.width=n,c.height=s.height=l,s.format=u,t.bindRenderbuffer(qt,s.renderbuffer),t.renderbufferStorage(qt,u,n,l),i.profile&&(s.stats.size=Zt(s.format,s.width,s.height)),c.format=o[s.format],c}return l[s.id]=s,n.renderbufferCount++,c(e,r),c.resize=function(e,r){var n=0|e,a=0|r||n;return n===s.width&&a===s.height||(c.width=s.width=n,c.height=s.height=a,t.bindRenderbuffer(qt,s.renderbuffer),t.renderbufferStorage(qt,s.format,n,a),i.profile&&(s.stats.size=Zt(s.format,s.width,s.height))),c},c._reglType="renderbuffer",c._renderbuffer=s,i.profile&&(c.stats=s.stats),c.destroy=function(){s.decRef()},c},clear:function(){w(l).forEach(c)},restore:function(){w(l).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(qt,e.renderbuffer),t.renderbufferStorage(qt,e.format,e.width,e.height)}),t.bindRenderbuffer(qt,null)}}}(n,p,0,c,r),$=function(e,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],u=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&u.push("srgba"),r.ext_color_buffer_half_float&&u.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&u.push("rgba32f");var c=["uint8"];function h(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function f(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function p(t,e,r){if(t)if(t.texture){var n=t.texture._texture;Math.max(1,n.width),Math.max(1,n.height),n.refCount+=1}else t.renderbuffer._renderbuffer.refCount+=1}function d(t,r){r&&(r.texture?e.framebufferTexture2D(Wt,t,r.target,r.texture._texture.texture,0):e.framebufferRenderbuffer(Wt,t,Yt,r.renderbuffer._renderbuffer.renderbuffer))}function m(t){var e=Xt,r=null,n=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target));var a=i._reglType;return"texture2d"===a||"textureCube"===a?r=i:"renderbuffer"===a&&(n=i,e=Yt),new h(e,r,n)}function g(t,e,r,n,o){if(r){var s=i.create2D({width:t,height:e,format:n,type:o});return s._texture.refCount=0,new h(Xt,s,null)}var l=a.create({width:t,height:e,format:n});return l._renderbuffer.refCount=0,new h(Yt,null,l)}function y(t){return t&&(t.texture||t.renderbuffer)}function v(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}r.oes_texture_half_float&&c.push("half float","float16"),r.oes_texture_float&&c.push("float","float32");var x=0,_={};function b(){this.id=x++,_[this.id]=this,this.framebuffer=e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function T(t){t.colorAttachments.forEach(f),f(t.depthAttachment),f(t.stencilAttachment),f(t.depthStencilAttachment)}function k(t){var r=t.framebuffer;e.deleteFramebuffer(r),t.framebuffer=null,o.framebufferCount--,delete _[t.id]}function A(t){var r;e.bindFramebuffer(Wt,t.framebuffer);var i=t.colorAttachments;for(r=0;r<i.length;++r)d(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)e.framebufferTexture2D(Wt,36064+r,Xt,null,0);e.framebufferTexture2D(Wt,33306,Xt,null,0),e.framebufferTexture2D(Wt,36096,Xt,null,0),e.framebufferTexture2D(Wt,36128,Xt,null,0),d(36096,t.depthAttachment),d(36128,t.stencilAttachment),d(33306,t.depthStencilAttachment),e.checkFramebufferStatus(Wt),e.isContextLost(),e.bindFramebuffer(Wt,s.next?s.next.framebuffer:null),s.cur=s.next,e.getError()}function M(e,r){var n=new b;function i(t,e){var r,a=0,o=0,s=!0,c=!0,h=null,f=!0,d="rgba",v="uint8",x=1,_=null,b=null,w=null,k=!1;if("number"==typeof t)a=0|t,o=0|e||a;else if(t){var M=t;if("shape"in M){var S=M.shape;a=S[0],o=S[1]}else"radius"in M&&(a=o=M.radius),"width"in M&&(a=M.width),"height"in M&&(o=M.height);("color"in M||"colors"in M)&&(h=M.color||M.colors,Array.isArray(h)),h||("colorCount"in M&&(x=0|M.colorCount),"colorTexture"in M&&(f=!!M.colorTexture,d="rgba4"),"colorType"in M&&(v=M.colorType,f||("half float"===v||"float16"===v?d="rgba16f":("float"===v||"float32"===v)&&(d="rgba32f"))),"colorFormat"in M&&(d=M.colorFormat,l.indexOf(d)>=0?f=!0:u.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(k=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,c=!1)),"stencil"in M&&("boolean"==typeof M.stencil?c=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=c=M.depthStencil:(w=M.depthStencil,s=!1,c=!1))}else a=o=1;var E=null,C=null,I=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r<x;++r)E[r]=g(a,o,f,d,v);for(a=a||E[0].width,o=o||E[0].height,_?C=m(_):s&&!c&&(C=g(a,o,k,"depth","uint32")),b?I=m(b):c&&!s&&(I=g(a,o,!1,"stencil","uint8")),w?L=m(w):!_&&!b&&c&&s&&(L=g(a,o,k,"depth stencil","depth stencil")),r=0;r<E.length;++r)p(E[r]),E[r]&&E[r].texture&&($t[E[r].texture._texture.format],Jt[E[r].texture._texture.type]);return p(C),p(I),p(L),T(n),n.width=a,n.height=o,n.colorAttachments=E,n.depthAttachment=C,n.stencilAttachment=I,n.depthStencilAttachment=L,i.color=E.map(y),i.depth=y(C),i.stencil=y(I),i.depthStencil=y(L),i.width=n.width,i.height=n.height,A(n),i}return o.framebufferCount++,i(e,r),t(i,{resize:function(t,e){var r=Math.max(0|t,1),a=Math.max(0|e||r,1);if(r===n.width&&a===n.height)return i;for(var o=n.colorAttachments,s=0;s<o.length;++s)v(o[s],r,a);return v(n.depthAttachment,r,a),v(n.stencilAttachment,r,a),v(n.depthStencilAttachment,r,a),n.width=i.width=r,n.height=i.height=a,A(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){k(n),T(n)},use:function(t){s.setFBO({framebuffer:i},t)}})}return t(s,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof b)return e}return null},create:M,createCube:function(e){var r=Array(6);function n(e){var a,o,s={color:null},l=0,u=null,c="rgba",h="uint8",f=1;if("number"==typeof e)l=0|e;else if(e){var p=e;"shape"in p?l=p.shape[0]:("radius"in p&&(l=0|p.radius),"width"in p?l=0|p.width:"height"in p&&(l=0|p.height)),("color"in p||"colors"in p)&&(u=p.color||p.colors,Array.isArray(u)),u||("colorCount"in p&&(f=0|p.colorCount),"colorType"in p&&(h=p.colorType),"colorFormat"in p&&(c=p.colorFormat)),"depth"in p&&(s.depth=p.depth),"stencil"in p&&(s.stencil=p.stencil),"depthStencil"in p&&(s.depthStencil=p.depthStencil)}else l=1;if(u)if(Array.isArray(u))for(o=[],a=0;a<u.length;++a)o[a]=u[a];else o=[u];else{o=Array(f);var d={radius:l,format:c,type:h};for(a=0;a<f;++a)o[a]=i.createCube(d)}for(s.color=Array(o.length),a=0;a<o.length;++a){var m=o[a];l=l||m.width,s.color[a]={target:34069,data:o[a]}}for(a=0;a<6;++a){for(var g=0;g<o.length;++g)s.color[g].target=34069+a;a>0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=M(s)}return t(n,{width:l,height:l,color:o})}return n(e),t(n,{faces:r,resize:function(t){var e,i=0|t;if(i===n.width)return n;var a=n.color;for(e=0;e<a.length;++e)a[e].resize(i);for(e=0;e<6;++e)r[e].resize(i);return n.width=n.height=i,n},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){w(_).forEach(k)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,w(_).forEach(function(t){t.framebuffer=e.createFramebuffer(),A(t)})}})}(n,p,q,Y,X,c),J=Nr(n,u,p,q,H,G,0,$,{},Z,W,V,M,d,f,r),K=te(n,$,J.procs.poll,M),Q=J.next,tt=n.canvas,et=[],rt=[],nt=[],it=[r.onDestroy],at=null;function ot(){if(0===et.length)return d&&d.update(),void(at=null);at=s.next(ot),gt();for(var t=et.length-1;t>=0;--t){var e=et[t];e&&e(M,null,0)}n.flush(),d&&d.update()}function st(){!at&&et.length>0&&(at=s.next(ot))}function lt(){at&&(s.cancel(ot),at=null)}function ut(t){t.preventDefault(),lt(),rt.forEach(function(t){t()})}function ct(t){n.getError(),a.restore(),W.restore(),H.restore(),Y.restore(),X.restore(),$.restore(),Z.restore(),d&&d.restore(),J.procs.refresh(),st(),nt.forEach(function(t){t()})}function ht(e){function r(t,e){var r={},n={};return Object.keys(t).forEach(function(i){var a=t[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(e&&Array.isArray(a))for(var s=0;s<a.length;++s)if(o.isDynamic(a[s]))return void(n[i]=o.unbox(a,i));r[i]=a}}),{dynamic:n,static:r}}var n=r(e.context||{},!0),i=r(e.uniforms||{},!0),a=r(e.attributes||{},!1),s=r(function(e){var r=t({},e);function n(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),n("blend"),n("depth"),n("cull"),n("stencil"),n("polygonOffset"),n("scissor"),n("sample"),"vao"in e&&(r.vao=e.vao),r}(e),!1),l={gpuTime:0,cpuTime:0,count:0},u=J.compile(s,a,i,n,l),c=u.draw,h=u.batch,f=u.scope,p=[];return t(function(t,e){var r;if("function"==typeof t)return f.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(r=0;r<t;++r)f.call(this,null,e,r);else{if(!Array.isArray(t))return f.call(this,t,e,0);for(r=0;r<t.length;++r)f.call(this,t[r],e,r)}else if("number"==typeof t){if(t>0)return h.call(this,function(t){for(;p.length<t;)p.push(null);return p}(0|t),0|t)}else{if(!Array.isArray(t))return c.call(this,t);if(t.length)return h.call(this,t,t.length)}},{stats:l,destroy:function(){u.destroy()}})}tt&&(tt.addEventListener(Ur,ut,!1),tt.addEventListener(Vr,ct,!1));var ft=$.setFBO=ht({framebuffer:o.define.call(null,1,"framebuffer")});function pt(t,e){var r=0;J.procs.poll();var i=e.color;i&&(n.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),r|=16384),"depth"in e&&(n.clearDepth(+e.depth),r|=256),"stencil"in e&&(n.clearStencil(0|e.stencil),r|=1024),n.clear(r)}function dt(t){return et.push(t),st(),{cancel:function(){var e=qr(et,t);et[e]=function t(){var e=qr(et,t);et[e]=et[et.length-1],et.length-=1,et.length<=0&&lt()}}}}function mt(){var t=Q.viewport,e=Q.scissor_box;t[0]=t[1]=e[0]=e[1]=0,M.viewportWidth=M.framebufferWidth=M.drawingBufferWidth=t[2]=e[2]=n.drawingBufferWidth,M.viewportHeight=M.framebufferHeight=M.drawingBufferHeight=t[3]=e[3]=n.drawingBufferHeight}function gt(){M.tick+=1,M.time=vt(),mt(),J.procs.poll()}function yt(){Y.refresh(),mt(),J.procs.refresh(),d&&d.update()}function vt(){return(l()-T)/1e3}yt();var xt=t(ht,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var r=0;r<6;++r)ft(t({framebuffer:e.framebuffer.faces[r]},e),pt);else ft(e,pt);else pt(0,e)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:ht({}),buffer:function(t){return H.create(t,34962,!1,!1)},elements:function(t){return G.create(t,!1)},texture:Y.create2D,cube:Y.createCube,renderbuffer:X.create,framebuffer:$.create,framebufferCube:$.createCube,vao:Z.createVAO,attributes:i,frame:dt,on:function(t,e){var r;switch(t){case"frame":return dt(e);case"lost":r=rt;break;case"restore":r=nt;break;case"destroy":r=it}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e)return r[t]=r[r.length-1],void r.pop()}}},limits:q,hasExtension:function(t){return q.extensions.indexOf(t.toLowerCase())>=0},read:K,destroy:function(){et.length=0,lt(),tt&&(tt.removeEventListener(Ur,ut),tt.removeEventListener(Vr,ct)),W.clear(),$.clear(),X.clear(),Z.clear(),Y.clear(),G.clear(),H.clear(),d&&d.clear(),it.forEach(function(t){t()})},_gl:n,_refresh:yt,poll:function(){gt(),d&&d.update()},now:vt,stats:c,getCachedCode:function(){return f},preloadCachedCode:function(t){Object.entries(t).forEach(function(t){f[t[0]]=t[1]})}});return r.onDone(null,xt),xt}},"object"==typeof t&&void 0!==e?e.exports=n():r.createREGL=n()}),px=f((t,e)=>{var r=Qg();function n(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function a(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){if(t?"string"==typeof t&&(t={container:t}):t={},(t=i(t)||"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:r(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;var e;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var o=document.querySelector(t.container);if(!o)throw Error("Element "+t.container+" is not found");t.container=o}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=a(),t.container.appendChild(t.canvas),n(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=a(),t.container.appendChild(t.canvas),n(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl}),t.gl}}),dx=f((t,e)=>{var r=cx(),n=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],i=t.canvas||document.createElement("canvas"),a=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||n;if(a&&"string"!=typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],u=s[0],c=0;u<=s[1];u++)l[c++]=String.fromCharCode(u);s=l}}else s=String(s).split("");e=e.slice(),i.width=e[0],i.height=e[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var f=o[0]/2,p=o[1]/2;for(u=0;u<s.length;u++)h.fillText(s[u],f,p),(f+=o[0])>e[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return i}}),mx=f(t=>{function e(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(t){return(t>0)-(t<0)},t.abs=function(t){var e=t>>31;return(t^e)-e},t.min=function(t,e){return e^(t^e)&-(t<e)},t.max=function(t,e){return t^(t^e)&-(t<e)},t.isPow2=function(t){return!(t&t-1||!t)},t.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},t.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},t.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},t.countTrailingZeros=e,t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},t.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},t.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(r),t.reverse=function(t){return r[255&t]<<24|r[t>>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},t.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},t.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},t.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},t.nextCombination=function(t){var r=t|t-1;return r+1|(~r&-~r)-1>>>e(t)+1}}),gx=f((t,e)=>{function r(t,e,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a<i;++a)o[a]=e;else for(a=0;a<i;++a)o[a]=r(t,e,n+1);return o}e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case"object":if("number"==typeof t.length)return r(t,e,0)}return[]}}),yx=f(t=>{var e=mx(),r=gx(),n=Ul().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:r([32,0]),UINT16:r([32,0]),UINT32:r([32,0]),BIGUINT64:r([32,0]),INT8:r([32,0]),INT16:r([32,0]),INT32:r([32,0]),BIGINT64:r([32,0]),FLOAT:r([32,0]),DOUBLE:r([32,0]),DATA:r([32,0]),UINT8C:r([32,0]),BUFFER:r([32,0])});var i="undefined"!=typeof Uint8ClampedArray,a="undefined"!=typeof BigUint64Array,o="undefined"!=typeof BigInt64Array,s=window.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=r([32,0])),s.BIGUINT64||(s.BIGUINT64=r([32,0])),s.BIGINT64||(s.BIGINT64=r([32,0])),s.BUFFER||(s.BUFFER=r([32,0]));var l=s.DATA,u=s.BUFFER;function c(t){if(t){var r=t.length||t.byteLength,n=e.log2(r);l[n].push(t)}}function h(t){t=e.nextPow2(t);var r=e.log2(t),n=l[r];return n.length>0?n.pop():new ArrayBuffer(t)}function f(t){return new Uint8Array(h(t),0,t)}function p(t){return new Uint16Array(h(2*t),0,t)}function d(t){return new Uint32Array(h(4*t),0,t)}function m(t){return new Int8Array(h(t),0,t)}function g(t){return new Int16Array(h(2*t),0,t)}function y(t){return new Int32Array(h(4*t),0,t)}function v(t){return new Float32Array(h(4*t),0,t)}function x(t){return new Float64Array(h(8*t),0,t)}function _(t){return i?new Uint8ClampedArray(h(t),0,t):f(t)}function b(t){return a?new BigUint64Array(h(8*t),0,t):null}function w(t){return o?new BigInt64Array(h(8*t),0,t):null}function T(t){return new DataView(h(t),0,t)}function k(t){t=e.nextPow2(t);var r=e.log2(t),i=u[r];return i.length>0?i.pop():new n(t)}t.free=function(t){if(n.isBuffer(t))u[e.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,i=0|e.log2(r);l[i].push(t)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(t){c(t.buffer)},t.freeArrayBuffer=c,t.freeBuffer=function(t){u[e.log2(t.length)].push(t)},t.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return f(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return m(t);case"int16":return g(t);case"int32":return y(t);case"float":case"float32":return v(t);case"double":case"float64":return x(t);case"uint8_clamped":return _(t);case"bigint64":return w(t);case"biguint64":return b(t);case"buffer":return k(t);case"data":case"dataview":return T(t);default:return null}return null},t.mallocArrayBuffer=h,t.mallocUint8=f,t.mallocUint16=p,t.mallocUint32=d,t.mallocInt8=m,t.mallocInt16=g,t.mallocInt32=y,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=x,t.mallocUint8Clamped=_,t.mallocBigUint64=b,t.mallocBigInt64=w,t.mallocDataView=T,t.mallocBuffer=k,t.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.BIGUINT64[t].length=0,s.BIGINT64[t].length=0,s.UINT8C[t].length=0,l[t].length=0,u[t].length=0}}),vx=f((t,e)=>{var r=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===r.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}}),xx=f((t,e)=>{e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}}),_x=f((t,e)=>{var r=xx();e.exports=a;var n=96;function i(t,e){var n=r(getComputedStyle(t).getPropertyValue(e));return n[0]*a(n[1],t)}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),(e===window||e===document)&&(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=i(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return i(e,"font-size");case"rem":return i(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return n;case"cm":return n/2.54;case"mm":return n/25.4;case"pt":return n/72;case"pc":return n/6}return 1}}),bx=f((t,e)=>{e.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var i,o={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?i=a(e):Array.isArray(e)?i=e:(e.o?i=a(e.o):e.pairs&&(i=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),i||(i=n),r.font=s+"px "+t;for(var u=0;u<i.length;u++){var c=i[u],h=r.measureText(c[0]).width+r.measureText(c[1]).width,f=r.measureText(c).width;if(Math.abs(h-f)>s*l){var p=(f-h)/s;o[c]=1e3*p}}return o}function a(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i<t[1];i++){var a=n+String.fromCharCode(i);e.push(a)}return e}i.createPairs=a,i.ascii=n}),wx=f((t,e)=>{function r(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var o=Array.isArray(e.family)?e.family.join(", "):e.family;if(!o)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",u=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+o,e.origin||"top");if(r.cache[o]&&s<=r.cache[o].em)return n(r.cache[o],u);var c=e.canvas||r.canvas,h=c.getContext("2d"),f={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},p=Math.ceil(1.5*s);c.height=p,c.width=.5*p,h.font=t;var d="H",m={top:0};h.clearRect(0,0,p,p),h.textBaseline="top",h.fillStyle="black",h.fillText(d,0,0);var g=i(h.getImageData(0,0,p,p));h.clearRect(0,0,p,p),h.textBaseline="bottom",h.fillText(d,0,p);var y=i(h.getImageData(0,0,p,p));m.lineHeight=m.bottom=p-y+g,h.clearRect(0,0,p,p),h.textBaseline="alphabetic",h.fillText(d,0,p);var v=p-i(h.getImageData(0,0,p,p))-1+g;m.baseline=m.alphabetic=v,h.clearRect(0,0,p,p),h.textBaseline="middle",h.fillText(d,0,.5*p);var x=i(h.getImageData(0,0,p,p));m.median=m.middle=p-x-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="hanging",h.fillText(d,0,.5*p);var _=i(h.getImageData(0,0,p,p));m.hanging=p-_-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="ideographic",h.fillText(d,0,p);var b=i(h.getImageData(0,0,p,p));if(m.ideographic=p-b-1+g,f.upper&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.upper,0,0),m.upper=i(h.getImageData(0,0,p,p)),m.capHeight=m.baseline-m.upper),f.lower&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.lower,0,0),m.lower=i(h.getImageData(0,0,p,p)),m.xHeight=m.baseline-m.lower),f.tittle&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.tittle,0,0),m.tittle=i(h.getImageData(0,0,p,p))),f.ascent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.ascent,0,0),m.ascent=i(h.getImageData(0,0,p,p))),f.descent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.descent,0,0),m.descent=a(h.getImageData(0,0,p,p))),f.overshoot){h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.overshoot,0,0);var w=a(h.getImageData(0,0,p,p));m.overshoot=w-v}for(var T in m)m[T]/=s;return m.em=s,r.cache[o]=m,n(m,u)}function n(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function i(t){for(var e=t.height,r=t.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}function a(t){for(var e=t.height,r=t.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}),Tx=f((t,e)=>{var r=hx(),n=Qg(),i=fx(),a=px(),o=Xv(),s=Qd(),l=dx(),u=yx(),c=ty(),h=vx(),f=xx(),p=_x(),d=bx(),m=ky(),g=wx(),y=ny(),v=mx().nextPow2,x=new o,_=!1;document.body&&((b=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(b).fontStretch&&(_=!0),document.body.removeChild(b));var b,w=function(t){var e;"function"==typeof(e=t)&&e._gl&&e.prop&&e.texture&&e.buffer?(t={regl:t},this.gl=t.regl._gl):this.gl=a(t),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||i({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(h(t)?t:{})};w.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},w.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=n(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map(function(t){return parseFloat(t)}):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=c(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!t.font&&(t.font=w.baseFontSize+"px sans-serif");var i,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach(function(t,n){if("string"==typeof t)try{t=r.parse(t)}catch(e){t=r.parse(w.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,u=t.variant;t=r.parse(r.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),u&&(t.variant=u)}var c=r.stringify({size:w.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),h=f(t.size),d=Math.round(h[0]*p(h[1]));if(d!==e.fontSize[n]&&(o=!0,e.fontSize[n]=d),!(e.font[n]&&c==e.font[n].baseString||(a=!0,e.font[n]=w.fonts[c],e.font[n]))){var m=t.family.join(", "),y=[t.style];t.style!=t.variant&&y.push(t.variant),t.variant!=t.weight&&y.push(t.weight),_&&t.weight!=t.stretch&&y.push(t.stretch),e.font[n]={baseString:c,family:m,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:g(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:y.join(" ")})},w.fonts[c]=e.font[n]}}),(a||o)&&this.font.forEach(function(n,i){var a=r.stringify({size:e.fontSize[i],family:n.family,stretch:_?n.stretch:void 0,variant:n.variant,weight:n.weight,style:n.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=n.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)}),"string"==typeof t.text&&t.position&&t.position.length>2){for(var h=Array(.5*t.position.length),x=0;x<h.length;x++)h[x]=t.text;t.text=h}if(null!=t.text||a){if(this.textOffsets=[0],Array.isArray(t.text)){this.count=t.text[0].length,this.counts=[this.count];for(var b=1;b<t.text.length;b++)this.textOffsets[b]=this.textOffsets[b-1]+t.text[b-1].length,this.count+=t.text[b].length,this.counts.push(t.text[b].length);this.text=t.text.join("")}else this.text=t.text,this.count=this.text.length,this.counts=[this.count];i=[],this.font.forEach(function(t,r){w.atlasContext.font=t.baseString;for(var n=e.fontAtlas[r],a=0;a<e.text.length;a++){var o=e.text.charAt(a);if(null==n.ids[o]&&(n.ids[o]=n.chars.length,n.chars.push(o),i.push(o)),null==t.width[o]&&(t.width[o]=w.atlasContext.measureText(o).width/w.baseFontSize,e.kerning)){var s=[];for(var l in t.width)s.push(l+o,o+l);m(t.kerning,d(t.family,{pairs:s}))}}})}if(t.position)if(t.position.length>2){for(var T=!t.position[0].length,k=u.mallocFloat(2*this.count),A=0,M=0;A<this.counts.length;A++){var S=this.counts[A];if(T)for(var E=0;E<S;E++)k[M++]=t.position[2*A],k[M++]=t.position[2*A+1];else for(var C=0;C<S;C++)k[M++]=t.position[A][0],k[M++]=t.position[A][1]}this.position.call?this.position({type:"float",data:k}):this.position=this.regl.buffer({type:"float",data:k}),u.freeFloat(k)}else this.position.destroy&&this.position.destroy(),this.position={constant:t.position};if(t.text||a){var I=u.mallocUint8(this.count),L=u.mallocFloat(2*this.count);this.textWidth=[];for(var P=0,z=0;P<this.counts.length;P++){for(var O=this.counts[P],D=this.font[P]||this.font[0],R=this.fontAtlas[P]||this.fontAtlas[0],F=0;F<O;F++){var B=this.text.charAt(z),N=this.text.charAt(z-1);if(I[z]=R.ids[B],L[2*z]=D.width[B],F){var j=L[2*z-2],U=L[2*z],V=L[2*z-1]+.5*j+.5*U;if(this.kerning){var q=D.kerning[N+B];q&&(V+=.001*q)}L[2*z+1]=V}else L[2*z+1]=.5*L[2*z];z++}this.textWidth.push(L.length?.5*L[2*z-2]+L[2*z-1]:0)}t.align||(t.align=this.align),this.charBuffer({data:I,type:"uint8",usage:"stream"}),this.sizeBuffer({data:L,type:"float",usage:"stream"}),u.freeUint8(I),u.freeFloat(L),i.length&&this.font.forEach(function(t,r){var n=e.fontAtlas[r],i=n.step,a=Math.floor(w.maxAtlasSize/i),o=Math.min(a,n.chars.length),s=Math.ceil(n.chars.length/o),u=v(o*i),c=v(s*i);n.width=u,n.height=c,n.rows=s,n.cols=o,n.em&&n.texture({data:l({canvas:w.atlasCanvas,font:n.fontString,chars:n.chars,shape:[u,c],step:[i,i]})})})}if(t.align&&(this.align=t.align,this.alignOffset=this.textWidth.map(function(t,r){var n=Array.isArray(e.align)?e.align.length>1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0})),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"==typeof t?t-n.baseline:-n[t],i*=-1})),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var H;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;H=u.mallocUint8(G);for(var Z=(t.color.subarray||t.color.slice).bind(t.color),W=0;W<G;W+=4)H.set(s(Z(W,W+4),"uint8"),W)}else{var Y=t.color.length;H=u.mallocUint8(4*Y);for(var X=0;X<Y;X++)H.set(s(t.color[X]||0,"uint8"),4*X)}this.color=H}else this.color=s(t.color,"uint8");if(t.position||t.text||t.color||t.baseline||t.align||t.font||t.offset||t.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var $=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array($);for(var J=0;J<this.batch.length;J++)this.batch[J]={count:this.counts.length>1?this.counts[J]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[J]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*J,4*J+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[J]:this.opacity,baseline:null!=this.baselineOffset[J]?this.baselineOffset[J]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[J]?this.alignOffset[J]:this.alignOffset[0]:0,atlas:this.fontAtlas[J]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*J,2*J+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},e.exports=w}),kx=f((t,e)=>{var r,n;r=t,n=function(){var t=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},e=0;function r(t,r){this.id=e++,this.type=t,this.data=r}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(t){if(0===t.length)return[];var e=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&e===r&&('"'===e||"'"===e))return['"'+n(t.substr(1,t.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(a)return i(t.substr(0,a.index)).concat(i(a[1])).concat(i(t.substr(a.index+a[0].length)));var o=t.split(".");if(1===o.length)return['"'+n(t)+'"'];for(var s=[],l=0;l<o.length;++l)s=s.concat(i(o[l]));return s}function a(t){return"["+i(t).join("][")+"]"}var o={DynamicVariable:r,define:function(t,e){return new r(t,a(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof r},unbox:function t(e,n){return"function"==typeof e?new r(0,e):"number"==typeof e||"boolean"==typeof e?new r(5,e):Array.isArray(e)?new r(6,e.map(function(e,r){return t(e)})):e instanceof r?e:void 0},accessor:a},s={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},l="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function u(t){return"string"==typeof t?t.split():t}function c(t){return"string"==typeof t?document.querySelector(t):t}function h(e){var r,n,i,a,o=e||{},s={},l=[],h=[],f="undefined"==typeof window?1:window.devicePixelRatio,p=!1,d={},m=function(t){},g=function(){};if("string"==typeof o?r=document.querySelector(o):"object"==typeof o&&(function(t){return"string"==typeof t.nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect}(o)?r=o:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(o)?i=(a=o).canvas:("gl"in o?a=o.gl:"canvas"in o?i=c(o.canvas):"container"in o&&(n=c(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=u(o.extensions)),"optionalExtensions"in o&&(h=u(o.optionalExtensions)),"onDone"in o&&(m=o.onDone),"profile"in o&&(p=!!o.profile),"pixelRatio"in o&&(f=+o.pixelRatio),"cachedCode"in o&&(d=o.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!a){if(!i){var y=function(e,r,n){var i,a=document.createElement("canvas");function o(){var t=window.innerWidth,r=window.innerHeight;if(e!==document.body){var i=a.getBoundingClientRect();t=i.right-i.left,r=i.bottom-i.top}a.width=n*t,a.height=n*r}return t(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),e.appendChild(a),e===document.body&&(a.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver(function(){setTimeout(o)})).observe(e):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),e.removeChild(a)}}}(n||document.body,0,f);if(!y)return null;i=y.canvas,g=y.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),a=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,s)}return a?{gl:a,canvas:i,container:n,extensions:l,optionalExtensions:h,pixelRatio:f,profile:p,cachedCode:d,onDone:m,onDestroy:g}:(g(),m("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function f(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function p(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function d(){var t=f(8,function(){return[]});function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[p(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[p(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var m=d();m.zero=d();var g=3553,y=6408,v=5126,x=36160,_=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray};function b(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||_(t.data))}var w=function(t){return Object.keys(t).map(function(e){return t[e]})},T={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var a=0;a<e.length;++a)i*=e[a];else i=0;var o=n||m.allocType(r,i);switch(e.length){case 0:break;case 1:!function(t,e,r){for(var n=0;n<e;++n)r[n]=t[n]}(t,e[0],o);break;case 2:!function(t,e,r,n){for(var i=0,a=0;a<e;++a)for(var o=t[a],s=0;s<r;++s)n[i++]=o[s]}(t,e[0],e[1],o);break;case 3:k(t,e[0],e[1],e[2],o,0);break;default:A(t,e,0,o,0)}return o}};function k(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],u=0;u<r;++u)for(var c=l[u],h=0;h<n;++h)i[o++]=c[h]}function A(t,e,r,n,i){for(var a=1,o=r+1;o<e.length;++o)a*=e[o];var s=e[r];if(e.length-r===4){var l=e[r+1],u=e[r+2],c=e[r+3];for(o=0;o<s;++o)k(t[o],l,u,c,n,i),i+=a}else for(o=0;o<s;++o)A(t[o],e,r+1,n,i),i+=a}var M={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},S={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},E={dynamic:35048,stream:35040,static:35044},C=T.flatten,I=T.shape,L=5121,P=5126,z=[];function O(t){return 0|M[Object.prototype.toString.call(t)]}function D(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function R(t,e,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var u=0;u<n;++u)t[s++]=e[i*l+a*u+o]}z[5120]=1,z[5122]=2,z[5124]=4,z[5121]=1,z[5123]=2,z[5125]=4,z[5126]=4;var F={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},B=5121,N=5123,j=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function H(t){for(var e=m.allocType(5123,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(t[r]===1/0)e[r]=31744;else if(t[r]===-1/0)e[r]=64512;else{V[0]=t[r];var n=q[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function G(t){return Array.isArray(t)||_(t)}var Z=3553,W=34067,Y=34069,X=6408,$=6406,J=6407,K=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ut=5121,ct=5123,ht=5125,ft=5126,pt=33071,dt=9728,mt=9984,gt=9987,yt=4352,vt=33984,xt=[mt,9986,9985,gt],_t=[0,K,Q,J,X],bt={};function wt(t){return"[object "+t+"]"}bt[K]=bt[$]=bt[et]=1,bt[rt]=bt[Q]=2,bt[J]=bt[nt]=3,bt[X]=bt[it]=4;var Tt=wt("HTMLCanvasElement"),kt=wt("OffscreenCanvas"),At=wt("CanvasRenderingContext2D"),Mt=wt("ImageBitmap"),St=wt("HTMLImageElement"),Et=wt("HTMLVideoElement"),Ct=Object.keys(M).concat([Tt,kt,At,Mt,St,Et]),It=[];It[ut]=1,It[ft]=4,It[at]=2,It[ct]=2,It[ht]=4;var Lt=[];function Pt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function zt(t){return!!Array.isArray(t)&&!(0===t.length||!G(t[0]))}function Ot(t){return Object.prototype.toString.call(t)}function Dt(t){return Ot(t)===Tt}function Rt(t){return Ot(t)===kt}function Ft(t){if(!t)return!1;var e=Ot(t);return Ct.indexOf(e)>=0||Pt(t)||zt(t)||b(t)}function Bt(t){return 0|M[Object.prototype.toString.call(t)]}function Nt(t,e){return m.allocType(t.type===at?ft:t.type,e)}function jt(t,e){t.type===at?(t.data=H(e),m.freeType(e)):t.data=e}function Ut(t,e,r,n,i,a){var o;if(o=void 0!==Lt[t]?Lt[t]:bt[t]*It[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function Vt(e,r,n,i,a,o,s){var l={"don't care":yt,"dont care":yt,nice:4354,fast:4353},u={repeat:10497,clamp:pt,mirror:33648},c={nearest:dt,linear:9729},h=t({mipmap:gt,"nearest mipmap nearest":mt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":gt},c),f={none:0,browser:37444},p={uint8:ut,rgba4:32819,rgb565:33635,"rgb5 a1":32820},d={alpha:$,luminance:K,"luminance alpha":Q,rgb:J,rgba:X,rgba4:32854,"rgb5 a1":tt,rgb565:36194},g={};r.ext_srgb&&(d.srgb=nt,d.srgba=it),r.oes_texture_float&&(p.float32=p.float=ft),r.oes_texture_half_float&&(p.float16=p["half float"]=at),r.webgl_depth_texture&&(t(d,{depth:et,"depth stencil":rt}),t(p,{uint16:ct,uint32:ht,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(g,{"rgb s3tc dxt1":ot,"rgba s3tc dxt1":st,"rgba s3tc dxt3":lt,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&t(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(e.getParameter(34467));Object.keys(g).forEach(function(t){var e=g[t];y.indexOf(e)>=0&&(d[t]=e)});var v=Object.keys(d);n.textureFormats=v;var x=[];Object.keys(d).forEach(function(t){var e=d[t];x[e]=t});var k=[];Object.keys(p).forEach(function(t){var e=p[t];k[e]=t});var A=[];Object.keys(c).forEach(function(t){A[c[t]]=t});var M=[];Object.keys(h).forEach(function(t){var e=h[t];M[e]=t});var S=[];Object.keys(u).forEach(function(t){S[u[t]]=t});var E=v.reduce(function(t,e){var n=d[e];return n===K||n===$||n===K||n===Q||n===et||n===rt||r.ext_srgb&&(n===nt||n===it)?t[n]=n:n===tt||e.indexOf("rgba")>=0?t[n]=X:t[n]=J,t},{});function C(){this.internalformat=X,this.format=X,this.type=ut,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function L(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=f[e.colorSpace]),"type"in e){var r=e.type;t.type=p[r]}var n=t.width,i=t.height,a=t.channels,o=!1;"shape"in e?(n=e.shape[0],i=e.shape[1],3===e.shape.length&&(a=e.shape[2],o=!0)):("radius"in e&&(n=i=e.radius),"width"in e&&(n=e.width),"height"in e&&(i=e.height),"channels"in e&&(a=e.channels,o=!0)),t.width=0|n,t.height=0|i,t.channels=0|a;var s=!1;if("format"in e){var l=e.format,u=t.internalformat=d[l];t.format=E[u],l in p&&("type"in e||(t.type=p[l])),l in g&&(t.compressed=!0),s=!0}!o&&s?t.channels=bt[t.format]:o&&!s&&t.channels!==_t[t.format]&&(t.format=t.internalformat=_t[t.channels])}}function P(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function z(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(t,e){var r=null;if(Ft(e)?r=e:e&&(L(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),Ft(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(_(r))t.channels=t.channels||4,t.data=r,!("type"in e)&&t.type===ut&&(t.type=Bt(r));else if(Pt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ut:case ct:case ht:case ft:var n=m.allocType(t.type,r);n.set(e),t.data=n;break;case at:t.data=H(e)}}(t,r),t.alignment=1,t.needsFree=!0;else if(b(r)){var o=r.data;!Array.isArray(o)&&t.type===ut&&(t.type=Bt(o));var s,l,u,c,h,f,p=r.shape,d=r.stride;3===p.length?(u=p[2],f=d[2]):(u=1,f=1),s=p[0],l=p[1],c=d[0],h=d[1],t.alignment=1,t.width=s,t.height=l,t.channels=u,t.format=t.internalformat=_t[u],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,u=Nt(t,o*s*l),c=0,h=0;h<s;++h)for(var f=0;f<o;++f)for(var p=0;p<l;++p)u[c++]=e[r*f+n*h+i*p+a];jt(t,u)}(t,o,c,h,f,r.offset)}else if(Dt(r)||Rt(r)||function(t){return Ot(t)===At}(r))Dt(r)||Rt(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(function(t){return Ot(t)===Mt}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(t){return Ot(t)===St}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(t){return Ot(t)===Et}(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(zt(r)){var g=t.width||r[0].length,y=t.height||r.length,v=t.channels;v=G(r[0][0])?v||r[0][0].length:v||1;for(var x=T.shape(r),w=1,k=0;k<x.length;++k)w*=x[k];var A=Nt(t,w);T.flatten(r,x,"",A),jt(t,A),t.alignment=1,t.width=g,t.height=y,t.channels=v,t.format=t.internalformat=_t[v],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===ft||t.type}function D(t,r,n){var a=t.element,o=t.data,s=t.internalformat,l=t.format,u=t.type,c=t.width,h=t.height;P(t),a?e.texImage2D(r,n,l,l,u,a):t.compressed?e.compressedTexImage2D(r,n,s,c,h,0,o):t.needsCopy?(i(),e.copyTexImage2D(r,n,l,t.xOffset,t.yOffset,c,h,0)):e.texImage2D(r,n,l,c,h,0,l,u,o||null)}function R(t,r,n,a,o){var s=t.element,l=t.data,u=t.internalformat,c=t.format,h=t.type,f=t.width,p=t.height;P(t),s?e.texSubImage2D(r,o,n,a,c,h,s):t.compressed?e.compressedTexSubImage2D(r,o,n,a,u,f,p,l):t.needsCopy?(i(),e.copyTexSubImage2D(r,o,n,a,t.xOffset,t.yOffset,f,p)):e.texSubImage2D(r,o,n,a,f,p,c,h,l)}var F=[];function B(){return F.pop()||new z}function N(t){t.needsFree&&m.freeType(t.data),z.call(t),F.push(t)}function j(){C.call(this),this.genMipmaps=!1,this.mipmapHint=yt,this.mipmask=0,this.images=Array(16)}function U(t,e,r){var n=t.images[0]=B();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function V(t,e){var r=null;if(Ft(e))I(r=t.images[0]=B(),t),O(r,e),t.mipmask=1;else if(L(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)I(r=t.images[i]=B(),t),r.width>>=i,r.height>>=i,O(r,n[i]),t.mipmask|=1<<i;else I(r=t.images[0]=B(),t),O(r,e),t.mipmask=1;I(t,t.images[0]),t.compressed&&(t.internalformat===ot||t.internalformat===st||t.internalformat===lt||t.internalformat)}function q(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;D(r[n],e,n)}}var wt=[];function Tt(){var t=wt.pop()||new j;C.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function kt(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&N(e[r]),e[r]=null;wt.push(t)}function Ct(){this.minFilter=dt,this.magFilter=dt,this.wrapS=pt,this.wrapT=pt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=yt}function It(t,e){if("min"in e){var r=e.min;t.minFilter=h[r],xt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;t.magFilter=c[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"==typeof o?i=a=u[o]:Array.isArray(o)&&(i=u[o[0]],a=u[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=u[s]}if("wrapT"in e){var f=e.wrapT;a=u[f]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e&&(e.anisotropic,t.anisotropic=e.anisotropic),"mipmap"in e){var p=!1;switch(typeof e.mipmap){case"string":t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,p=!0;break;case"boolean":p=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,p=!0}p&&!("min"in e)&&(t.minFilter=mt)}}function Lt(t,n){e.texParameteri(n,10241,t.minFilter),e.texParameteri(n,10240,t.magFilter),e.texParameteri(n,10242,t.wrapS),e.texParameteri(n,10243,t.wrapT),r.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,t.anisotropic),t.genMipmaps&&(e.hint(33170,t.mipmapHint),e.generateMipmap(n))}var Vt=0,qt={},Ht=n.maxTextureUnits,Gt=Array(Ht).map(function(){return null});function Zt(t){C.call(this),this.mipmask=0,this.internalformat=X,this.id=Vt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ct,s.profile&&(this.stats={size:0})}function Wt(t){e.activeTexture(vt),e.bindTexture(t.target,t.texture)}function Yt(){var t=Gt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(Z,null)}function Xt(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(vt+n),e.bindTexture(i,null),Gt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete qt[t.id],o.textureCount--}return t(Zt.prototype,{bind:function(){var t=this;t.bindCount+=1;var r=t.unit;if(r<0){for(var n=0;n<Ht;++n){var i=Gt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}Gt[n]=t,r=n;break}s.profile&&o.maxTextureUnits<r+1&&(o.maxTextureUnits=r+1),t.unit=r,e.activeTexture(vt+r),e.bindTexture(t.target,t.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Xt(this)}}),s.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(qt).forEach(function(e){t+=qt[e].stats.size}),t}),{create2D:function(t,r){var n=new Zt(Z);function i(t,e){var r=n.texInfo;Ct.call(r);var a=Tt();return"number"==typeof t?U(a,0|t,"number"==typeof e?0|e:0|t):t?(It(r,t),V(a,t)):U(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,I(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Wt(n),q(a,Z),Lt(r,Z),Yt(),kt(a),s.profile&&(n.stats.size=Ut(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=x[n.internalformat],i.type=k[n.type],i.mag=A[r.magFilter],i.min=M[r.minFilter],i.wrapS=S[r.wrapS],i.wrapT=S[r.wrapT],i}return qt[n.id]=n,o.textureCount++,i(t,r),i.subimage=function(t,e,r,a){var o=0|e,s=0|r,l=0|a,u=B();return I(u,n),u.width=0,u.height=0,O(u,t),u.width=u.width||(n.width>>l)-o,u.height=u.height||(n.height>>l)-s,Wt(n),R(u,Z,o,s,l),Yt(),N(u),i},i.resize=function(t,r){var a=0|t,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Wt(n);for(var l=0;n.mipmask>>l;++l){var u=a>>l,c=o>>l;if(!u||!c)break;e.texImage2D(Z,l,n.format,u,c,0,n.format,n.type,null)}return Yt(),s.profile&&(n.stats.size=Ut(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(t,r,n,i,a,l){var u=new Zt(W);qt[u.id]=u,o.cubeCount++;var c=new Array(6);function h(t,e,r,n,i,a){var o,l=u.texInfo;for(Ct.call(l),o=0;o<6;++o)c[o]=Tt();if("number"!=typeof t&&t){if("object"==typeof t)if(e)V(c[0],t),V(c[1],e),V(c[2],r),V(c[3],n),V(c[4],i),V(c[5],a);else if(It(l,t),L(u,t),"faces"in t){var f=t.faces;for(o=0;o<6;++o)I(c[o],u),V(c[o],f[o])}else for(o=0;o<6;++o)V(c[o],t)}else{var p=0|t||1;for(o=0;o<6;++o)U(c[o],p,p)}for(I(u,c[0]),l.genMipmaps?u.mipmask=(c[0].width<<1)-1:u.mipmask=c[0].mipmask,u.internalformat=c[0].internalformat,h.width=c[0].width,h.height=c[0].height,Wt(u),o=0;o<6;++o)q(c[o],Y+o);for(Lt(l,W),Yt(),s.profile&&(u.stats.size=Ut(u.internalformat,u.type,h.width,h.height,l.genMipmaps,!0)),h.format=x[u.internalformat],h.type=k[u.type],h.mag=A[l.magFilter],h.min=M[l.minFilter],h.wrapS=S[l.wrapS],h.wrapT=S[l.wrapT],o=0;o<6;++o)kt(c[o]);return h}return h(t,r,n,i,a,l),h.subimage=function(t,e,r,n,i){var a=0|r,o=0|n,s=0|i,l=B();return I(l,u),l.width=0,l.height=0,O(l,e),l.width=l.width||(u.width>>s)-a,l.height=l.height||(u.height>>s)-o,Wt(u),R(l,Y+t,a,o,s),Yt(),N(l),h},h.resize=function(t){var r=0|t;if(r!==u.width){h.width=u.width=r,h.height=u.height=r,Wt(u);for(var n=0;n<6;++n)for(var i=0;u.mipmask>>i;++i)e.texImage2D(Y+n,i,u.format,r>>i,r>>i,0,u.format,u.type,null);return Yt(),s.profile&&(u.stats.size=Ut(u.internalformat,u.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=u,s.profile&&(h.stats=u.stats),h.destroy=function(){u.decRef()},h},clear:function(){for(var t=0;t<Ht;++t)e.activeTexture(vt+t),e.bindTexture(Z,null),Gt[t]=null;w(qt).forEach(Xt),o.cubeCount=0,o.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Ht;++t){var r=Gt[t];r&&(r.bindCount=0,r.unit=-1,Gt[t]=null)}w(qt).forEach(function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var r=0;r<32;++r)if(t.mipmask&1<<r)if(t.target===Z)e.texImage2D(Z,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)e.texImage2D(Y+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);Lt(t.texInfo,t.target)})},refresh:function(){for(var t=0;t<Ht;++t){var r=Gt[t];r&&(r.bindCount=0,r.unit=-1,Gt[t]=null),e.activeTexture(vt+t),e.bindTexture(Z,null),e.bindTexture(W,null)}}}}Lt[32854]=2,Lt[tt]=2,Lt[36194]=2,Lt[rt]=4,Lt[ot]=.5,Lt[st]=.5,Lt[lt]=1,Lt[33779]=1,Lt[35986]=.5,Lt[35987]=1,Lt[34798]=1,Lt[35840]=.5,Lt[35841]=.25,Lt[35842]=.5,Lt[35843]=.25,Lt[36196]=.5;var qt=36161,Ht=32854,Gt=[];function Zt(t,e,r){return Gt[t]*e*r}Gt[Ht]=2,Gt[32855]=2,Gt[36194]=2,Gt[33189]=2,Gt[36168]=1,Gt[34041]=4,Gt[35907]=4,Gt[34836]=16,Gt[34842]=8,Gt[34843]=6;var Wt=36160,Yt=36161,Xt=3553,$t=[];$t[6408]=4,$t[6407]=3;var Jt=[];Jt[5121]=1,Jt[5126]=4,Jt[36193]=2;var Kt=34963;function Qt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function te(t,e,r,n,i,a,o){function s(i){var a;a=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,u=n.framebufferHeight,c=null;_(i)?c=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),u=0|(i.height||n.framebufferHeight-s),c=i.data||null),r();var h=l*u*4;return c||(5121===a?c=new Uint8Array(h):5126===a&&(c=c||new Float32Array(h))),t.pixelStorei(3333,4),t.readPixels(o,s,l,u,6408,a,c),c}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=s(t)}),r}(t):s(t)}}function ee(t){return function(t){for(var e,r="0123456789abcdef",n="",i=0;i<t.length;i++)e=t.charCodeAt(i),n+=r.charAt(e>>>4&15)+r.charAt(15&e);return n}(function(t){return function(t){for(var e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t,e){var r,n,i,a,o,s,l,u,c,h,f,p,d=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),m=new Array(64);for(t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e,c=0;c<t.length;c+=16){for(r=d[0],n=d[1],i=d[2],a=d[3],o=d[4],s=d[5],l=d[6],u=d[7],h=0;h<64;h++)m[h]=h<16?t[h+c]:he(he(he(ue(m[h-2]),m[h-7]),le(m[h-15])),m[h-16]),f=he(he(he(he(u,se(o)),ie(o,s,l)),ce[h]),m[h]),p=he(oe(r),ae(r,n,i)),u=l,l=s,s=o,o=he(a,f),a=i,i=n,n=r,r=he(f,p);d[0]=he(r,d[0]),d[1]=he(n,d[1]),d[2]=he(i,d[2]),d[3]=he(a,d[3]),d[4]=he(o,d[4]),d[5]=he(s,d[5]),d[6]=he(l,d[6]),d[7]=he(u,d[7])}return d}(function(t){for(var e=Array(t.length>>2),r=0;r<e.length;r++)e[r]=0;for(r=0;r<8*t.length;r+=8)e[r>>5]|=(255&t.charCodeAt(r/8))<<24-r%32;return e}(t),8*t.length))}(function(t){for(var e,r,n="",i=-1;++i<t.length;)e=t.charCodeAt(i),r=i+1<t.length?t.charCodeAt(i+1):0,55296<=e&&e<=56319&&56320<=r&&r<=57343&&(e=65536+((1023&e)<<10)+(1023&r),i++),e<=127?n+=String.fromCharCode(e):e<=2047?n+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(t)))}function re(t,e){return t>>>e|t<<32-e}function ne(t,e){return t>>>e}function ie(t,e,r){return t&e^~t&r}function ae(t,e,r){return t&e^t&r^e&r}function oe(t){return re(t,2)^re(t,13)^re(t,22)}function se(t){return re(t,6)^re(t,11)^re(t,25)}function le(t){return re(t,7)^re(t,18)^ne(t,3)}function ue(t){return re(t,17)^re(t,19)^ne(t,10)}var ce=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function he(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function fe(t){return Array.prototype.slice.call(t)}function pe(t){return fe(t).join("")}var de="xyzw".split(""),me="dither",ge="blend.enable",ye="blend.color",ve="blend.equation",xe="blend.func",_e="depth.enable",be="depth.func",we="depth.range",Te="depth.mask",ke="colorMask",Ae="cull.enable",Me="cull.face",Se="frontFace",Ee="lineWidth",Ce="polygonOffset.enable",Ie="polygonOffset.offset",Le="sample.alpha",Pe="sample.enable",ze="sample.coverage",Oe="stencil.enable",De="stencil.mask",Re="stencil.func",Fe="stencil.opFront",Be="stencil.opBack",Ne="scissor.enable",je="scissor.box",Ue="viewport",Ve="profile",qe="framebuffer",He="vert",Ge="frag",Ze="elements",We="primitive",Ye="count",Xe="offset",$e="instances",Je="vao",Ke="Width",Qe="Height",tr=qe+Ke,er=qe+Qe,rr=Ue+Ke,nr=Ue+Qe,ir="drawingBuffer",ar=ir+Ke,or=ir+Qe,sr=[xe,ve,Re,Fe,Be,ze,Ue,je,Ie],lr=34962,ur=34963,cr=35664,hr=35665,fr=35666,pr=35667,dr=35668,mr=35669,gr=35671,yr=35672,vr=35673,xr=35674,_r=35675,br=35676,wr=35678,Tr=35680,kr=1028,Ar=1029,Mr=2305,Sr=7680,Er={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Cr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ir={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Lr={cw:2304,ccw:Mr};function Pr(t){return Array.isArray(t)||_(t)||b(t)}function zr(t){return t.sort(function(t,e){return t===Ue?-1:e===Ue?1:t<e?-1:1})}function Or(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function Dr(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Rr(t){return new Or(!1,!1,!1,t)}function Fr(t,e){var r=t.type;if(0===r){var n=t.data.length;return new Or(!0,n>=1,n>=2,e)}if(4===r){var i=t.data;return new Or(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new Or(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<t.data.length;++l){var u=t.data[l];if(1===u.type)s=!0;else if(2===u.type)o=!0;else if(3===u.type)a=!0;else if(0===u.type){a=!0;var c=u.data;c>=1&&(o=!0),c>=2&&(s=!0)}else 4===u.type&&(a=a||u.data.thisDep,o=o||u.data.contextDep,s=s||u.data.propDep)}return new Or(a,o,s,e)}return new Or(3===r,2===r,1===r,e)}var Br=new Or(!1,!1,!1,function(){});function Nr(e,r,n,i,a,s,l,u,c,h,p,d,m,g,y,v){var x=h.Record,_={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(_.min=32775,_.max=32776);var b=n.angle_instanced_arrays,w=n.webgl_draw_buffers,T=n.oes_vertex_array_object,k={dirty:!0,profile:v.profile},A={},M=[],E={},C={};function I(t){return t.replace(".","_")}function L(t,e,r){var n=I(t);M.push(t),A[n]=k[n]=!!r,E[n]=e}function P(t,e,r){var n=I(t);M.push(t),Array.isArray(r)?(k[n]=r.slice(),A[n]=r.slice()):k[n]=A[n]=r,C[n]=e}function z(t){return!!isNaN(t)}L(me,3024),L(ge,3042),P(ye,"blendColor",[0,0,0,0]),P(ve,"blendEquationSeparate",[32774,32774]),P(xe,"blendFuncSeparate",[1,0,1,0]),L(_e,2929,!0),P(be,"depthFunc",513),P(we,"depthRange",[0,1]),P(Te,"depthMask",!0),P(ke,ke,[!0,!0,!0,!0]),L(Ae,2884),P(Me,"cullFace",Ar),P(Se,Se,Mr),P(Ee,Ee,1),L(Ce,32823),P(Ie,"polygonOffset",[0,0]),L(Le,32926),L(Pe,32928),P(ze,"sampleCoverage",[1,!1]),L(Oe,2960),P(De,"stencilMask",-1),P(Re,"stencilFunc",[519,0,-1]),P(Fe,"stencilOpSeparate",[kr,Sr,Sr,Sr]),P(Be,"stencilOpSeparate",[Ar,Sr,Sr,Sr]),L(Ne,3089),P(je,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(Ue,Ue,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var O={gl:e,context:m,strings:r,next:A,current:k,draw:d,elements:s,buffer:a,shader:p,attributes:h.state,vao:h,uniforms:c,framebuffer:u,extensions:n,timer:g,isBufferArgs:Pr},D={primTypes:F,compareFuncs:Cr,blendFuncs:Er,blendEquations:_,stencilOps:Ir,glTypes:S,orientationType:Lr};w&&(D.backBuffer=[Ar],D.drawBuffer=f(i.maxDrawbuffers,function(t){return 0===t?[0]:f(t,function(t){return 36064+t})}));var R=0;function B(){var e=function(e){var r=e&&e.cache,n=0,i=[],a=[],o=[];function s(){var e=[],r=[];return t(function(){e.push.apply(e,fe(arguments))},{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,fe(arguments)),e.push(";")),t},toString:function(){return pe([r.length>0?"var "+r.join(",")+";":"",pe(e)])}})}function l(){var e=s(),r=s(),n=e.toString,i=r.toString;function a(t,n){r(t,n,"=",e.def(t,n),";")}return t(function(){e.apply(e,fe(arguments))},{def:e.def,entry:e,exit:r,save:a,set:function(t,r,n){a(t,r),e(t,r,"=",n,";")},toString:function(){return n()+i()}})}var u=s(),c={};return{global:u,link:function(t,e){var r=e&&e.stable;if(!r)for(var s=0;s<a.length;++s)if(a[s]===t&&!o[s])return i[s];var l="g"+n++;return i.push(l),a.push(t),o.push(r),l},block:s,proc:function(e,r){var n=[];function i(){var t="a"+n.length;return n.push(t),t}r=r||0;for(var a=0;a<r;++a)i();var o=l(),s=o.toString;return c[e]=t(o,{arg:i,toString:function(){return pe(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var e=pe(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return t(r,{then:function(){return r.apply(r,fe(arguments)),this},else:function(){return n.apply(n,fe(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),pe(["if(",e,"){",i(),"}",t])}})},compile:function(){var t=['"use strict";',u,"return {"];Object.keys(c).forEach(function(e){t.push('"',e,'":',c[e].toString(),",")}),t.push("}");var e,n=pe(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(e=ee(n),r[e]))return r[e].apply(null,a);var o=Function.apply(null,i.concat(n));return r&&(r[e]=o),o.apply(null,a)}}}({cache:y}),n=e.link,i=e.global;e.id=R++,e.batchId="0";var a=n(O),o=e.shared={props:"a0"};Object.keys(O).forEach(function(t){o[t]=i.def(a,".",t)});var s=e.next={},l=e.current={};Object.keys(C).forEach(function(t){Array.isArray(k[t])&&(s[t]=i.def(o.next,".",t),l[t]=i.def(o.current,".",t))});var u=e.constants={};Object.keys(D).forEach(function(t){u[t]=i.def(JSON.stringify(D[t]))}),e.invoke=function(t,r){switch(r.type){case 0:var i=["this",o.context,o.props,e.batchId];return t.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return t.def(o.props,r.data);case 2:return t.def(o.context,r.data);case 3:return t.def("this",r.data);case 4:return r.data.append(e,t),r.data.ref;case 5:return r.data.toString();case 6:return r.data.map(function(r){return e.invoke(t,r)})}},e.attribCache={};var c={};return e.scopeAttrib=function(t){var e=r.id(t);if(e in c)return c[e];var i=h.scope[e];return i||(i=h.scope[e]=new x),c[e]=n(i)},e}function N(t,e,i,o,l){t.static,t.dynamic;var c=function(t,e){var r=t.static;if("string"==typeof r[Ge]&&"string"==typeof r[He]){if(Object.keys(e.dynamic).length>0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var a=[],o=0;o<i.length;++o)a.push([0|n[i[o]],i[o]]);return a}}return null}(t,e),d=function(t){var e=t.static,r=t.dynamic;if(qe in e){var n=e[qe];return n?(n=u.getFramebuffer(n),Rr(function(t,e){var r=t.link(n),i=t.shared;e.set(i.framebuffer,".next",r);var a=i.context;return e.set(a,"."+tr,r+".width"),e.set(a,"."+er,r+".height"),r})):Rr(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+tr,n+"."+ar),e.set(n,"."+er,n+"."+or),"null"})}if(qe in r){var i=r[qe];return Fr(i,function(t,e){var r=t.invoke(e,i),n=t.shared,a=n.framebuffer,o=e.def(a,".getFramebuffer(",r,")");e.set(a,".next",o);var s=n.context;return e.set(s,"."+tr,o+"?"+o+".width:"+s+"."+ar),e.set(s,"."+er,o+"?"+o+".height:"+s+"."+or),o})}return null}(t),m=function(t,e){var r=t.static,n=t.dynamic;function i(t){if(t in r){var i,a,o=r[t],s=!0,l=0|o.x,u=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Or(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,function(t,e){var r=t.shared.context,n=i;"width"in o||(n=e.def(r,".",tr,"-",l));var s=a;return"height"in o||(s=e.def(r,".",er,"-",u)),[l,u,n,s]})}if(t in n){var c=n[t],h=Fr(c,function(t,e){var r=t.invoke(e,c),n=t.shared.context,i=e.def(r,".x|0"),a=e.def(r,".y|0");return[i,a,e.def('"width" in ',r,"?",r,".width|0:","(",n,".",tr,"-",i,")"),e.def('"height" in ',r,"?",r,".height|0:","(",n,".",er,"-",a,")")]});return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new Or(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",tr),e.def(r,".",er)]}):null}var a=i(Ue);if(a){var o=a;a=new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,"."+rr,r[2]),e.set(n,"."+nr,r[3]),r})}return{viewport:a,scissor_box:i(je)}}(t,d),g=function(t){var e=t.static,r=t.dynamic,n={},i=!1,a=function(){if(Je in e){var t=e[Je];return null!==t&&null===h.getVAO(t)&&(t=h.createVAO(t)),i=!0,n.vao=t,Rr(function(e){var r=h.getVAO(t);return r?e.link(r):"null"})}if(Je in r){i=!0;var a=r[Je];return Fr(a,function(t,e){var r=t.invoke(e,a);return e.def(t.shared.vao+".getVAO("+r+")")})}return null}(),o=!1,l=function(){if(Ze in e){var t=e[Ze];if(n.elements=t,Pr(t)){var l=n.elements=s.create(t,!0);t=s.getElements(l),o=!0}else t&&(t=s.getElements(t),o=!0);var u=Rr(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return u.value=t,u}if(Ze in r){o=!0;var c=r[Ze];return Fr(c,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,c),o=e.def("null"),s=e.def(n,"(",a,")"),l=t.cond(s).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return e.entry(l),e.exit(t.cond(s).then(i,".destroyStream(",o,");")),t.ELEMENTS=o,o})}return i?new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.elements+".getElements("+t.shared.vao+".currentVAO.elements):null")}):null}();function u(t,s){if(t in e){var l=0|e[t];return s?n.offset=l:n.instances=l,Rr(function(t,e){return s&&(t.OFFSET=l),l})}if(t in r){var u=r[t];return Fr(u,function(t,e){var r=t.invoke(e,u);return s&&(t.OFFSET=r),r})}if(s){if(o)return Rr(function(t,e){return t.OFFSET=0,0});if(i)return new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.offset:0")})}else if(i)return new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.instances:-1")});return null}var c=u(Xe,!0),f=function(){if(We in e){var t=e[We];return n.primitive=t,Rr(function(e,r){return F[t]})}if(We in r){var s=r[We];return Fr(s,function(t,e){var r=t.constants.primTypes,n=t.invoke(e,s);return e.def(r,"[",n,"]")})}return o?Dr(l)?l.value?Rr(function(t,e){return e.def(t.ELEMENTS,".primType")}):Rr(function(){return 4}):new Or(l.thisDep,l.contextDep,l.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)}):i?new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.primitive:4")}):null}(),p=function(){if(Ye in e){var t=0|e[Ye];return n.count=t,Rr(function(){return t})}if(Ye in r){var s=r[Ye];return Fr(s,function(t,e){return t.invoke(e,s)})}return o?Dr(l)?l?c?new Or(c.thisDep,c.contextDep,c.propDep,function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)}):Rr(function(t,e){return e.def(t.ELEMENTS,".vertCount")}):Rr(function(){return-1}):new Or(l.thisDep||c.thisDep,l.contextDep||c.contextDep,l.propDep||c.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")}):i?new Or(a.thisDep,a.contextDep,a.propDep,function(t,e){return e.def(t.shared.vao,".currentVAO?",t.shared.vao,".currentVAO.count:-1")}):null}(),d=u($e,!1);return{elements:l,primitive:f,count:p,instances:d,offset:c,vao:a,vaoActive:i,elementsActive:o,static:n}}(t),y=function(t){var e=t.static,r=t.dynamic,n={};return M.forEach(function(t){var i=I(t);function a(a,o){if(t in e){var s=a(e[t]);n[i]=Rr(function(){return s})}else if(t in r){var l=r[t];n[i]=Fr(l,function(t,e){return o(t,e,t.invoke(e,l))})}}switch(t){case Ae:case ge:case me:case Oe:case _e:case Ne:case Ce:case Le:case Pe:case Te:return a(function(t){return t},function(t,e,r){return r});case be:return a(function(t){return Cr[t]},function(t,e,r){var n=t.constants.compareFuncs;return e.def(n,"[",r,"]")});case we:return a(function(t){return t},function(t,e,r){return[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case xe:return a(function(t){var e="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,n="dstRGB"in t?t.dstRGB:t.dst,i="dstAlpha"in t?t.dstAlpha:t.dst;return[Er[e],Er[n],Er[r],Er[i]]},function(t,e,r){var n=t.constants.blendFuncs;function i(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}var a=i("src","RGB"),o=i("dst","RGB"),s=e.def(n,"[",a,"]"),l=e.def(n,"[",i("src","Alpha"),"]");return[s,e.def(n,"[",o,"]"),l,e.def(n,"[",i("dst","Alpha"),"]")]});case ve:return a(function(t){return"string"==typeof t?[_[t],_[t]]:"object"==typeof t?[_[t.rgb],_[t.alpha]]:void 0},function(t,e,r){var n=t.constants.blendEquations,i=e.def(),a=e.def(),o=t.cond("typeof ",r,'==="string"');return o.then(i,"=",a,"=",n,"[",r,"];"),o.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),e(o),[i,a]});case ye:return a(function(t){return f(4,function(e){return+t[e]})},function(t,e,r){return f(4,function(t){return e.def("+",r,"[",t,"]")})});case De:return a(function(t){return 0|t},function(t,e,r){return e.def(r,"|0")});case Re:return a(function(t){var e=t.cmp||"keep",r=t.ref||0,n="mask"in t?t.mask:-1;return[Cr[e],r,n]},function(t,e,r){var n=t.constants.compareFuncs;return[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Sr),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Fe:case Be:return a(function(e){var r=e.fail||"keep",n=e.zfail||"keep",i=e.zpass||"keep";return[t===Be?Ar:kr,Ir[r],Ir[n],Ir[i]]},function(e,r,n){var i=e.constants.stencilOps;function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",Sr)}return[t===Be?Ar:kr,a("fail"),a("zfail"),a("zpass")]});case Ie:return a(function(t){return[0|t.factor,0|t.units]},function(t,e,r){return[e.def(r,".factor|0"),e.def(r,".units|0")]});case Me:return a(function(t){var e=0;return"front"===t?e=kr:"back"===t&&(e=Ar),e},function(t,e,r){return e.def(r,'==="front"?',kr,":",Ar)});case Ee:return a(function(t){return t},function(t,e,r){return r});case Se:return a(function(t){return Lr[t]},function(t,e,r){return e.def(r+'==="cw"?2304:'+Mr)});case ke:return a(function(t){return t.map(function(t){return!!t})},function(t,e,r){return f(4,function(t){return"!!"+r+"["+t+"]"})});case ze:return a(function(t){return["value"in t?t.value:1,!!t.invert]},function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),n}(t),v=function(t,e,n){var i=t.static,a=t.dynamic;function o(t){if(t in i){var e=r.id(i[t]),n=Rr(function(){return e});return n.id=e,n}if(t in a){var o=a[t];return Fr(o,function(t,e){var r=t.invoke(e,o);return e.def(t.shared.strings,".id(",r,")")})}return null}var s,l=o(Ge),u=o(He),c=null;return Dr(l)&&Dr(u)?(c=p.program(u.id,l.id,null,n),s=Rr(function(t,e){return t.link(c)})):s=new Or(l&&l.thisDep||u&&u.thisDep,l&&l.contextDep||u&&u.contextDep,l&&l.propDep||u&&u.propDep,function(t,e){var r,n=t.shared.shader;r=l?l.append(t,e):e.def(n,".",Ge);var i=n+".program("+(u?u.append(t,e):e.def(n,".",He))+","+r;return e.def(i+")")}),{frag:l,vert:u,progVar:s,program:c}}(t,0,c);function b(t){var e=m[t];e&&(y[t]=e)}b(Ue),b(I(je));var w=Object.keys(y).length>0,T={framebuffer:d,draw:g,shader:v,state:y,dirty:w,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(T.profile=function(t){var e,r=t.static,n=t.dynamic;if(Ve in r){var i=!!r[Ve];(e=Rr(function(t,e){return i})).enable=i}else if(Ve in n){var a=n[Ve];e=Fr(a,function(t,e){return t.invoke(e,a)})}return e}(t),T.uniforms=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r,i=e[t];if("number"==typeof i||"boolean"==typeof i)r=Rr(function(){return i});else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Rr(function(t){return t.link(i)}):("framebuffer"===a||"framebufferCube"===a)&&(r=Rr(function(t){return t.link(i.color[0])}))}else G(i)&&(r=Rr(function(t){return t.global.def("[",f(i.length,function(t){return i[t]}),"]")}));r.value=i,n[t]=r}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Fr(e,function(t,r){return t.invoke(r,e)})}),n}(i),T.drawVAO=T.scopeVAO=g.vao,!T.drawVAO&&v.program&&!c&&n.angle_instanced_arrays&&g.static.elements){var k=!0,A=v.program.attributes.map(function(t){var r=e.static[t];return k=k&&!!r,r});if(k&&A.length>0){var E=h.getVAO(h.createVAO({attributes:A,elements:g.static.elements}));T.drawVAO=new Or(null,null,null,function(t,e){return t.link(E)}),T.useVAO=!0}}return c?T.useVAO=!0:T.attributes=function(t){var e=t.static,n=t.dynamic,i={};return Object.keys(e).forEach(function(t){var n=e[t],o=r.id(t),s=new x;if(Pr(n))s.state=1,s.buffer=a.getBuffer(a.create(n,lr,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var u=n.constant;s.buffer="null",s.state=2,"number"==typeof u?s.x=u:de.forEach(function(t,e){e<u.length&&(s[t]=u[e])})}else{l=Pr(n.buffer)?a.getBuffer(a.create(n.buffer,lr,!1,!0)):a.getBuffer(n.buffer);var c=0|n.offset,h=0|n.stride,f=0|n.size,p=!!n.normalized,d=0;"type"in n&&(d=S[n.type]);var m=0|n.divisor;s.buffer=l,s.state=1,s.size=f,s.normalized=p,s.type=d||l.dtype,s.offset=c,s.stride=h,s.divisor=m}}i[t]=Rr(function(t,e){var r=t.attribCache;if(o in r)return r[o];var n={isStream:!1};return Object.keys(s).forEach(function(t){n[t]=s[t]}),s.buffer&&(n.buffer=t.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[o]=n,n})}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=Fr(e,function(t,r){var n=t.invoke(r,e),i=t.shared,a=t.constants,o=i.isBufferArgs,s=i.buffer,l={isStream:r.def(!1)},u=new x;u.state=1,Object.keys(u).forEach(function(t){l[t]=r.def(""+u[t])});var c=l.buffer,h=l.type;function f(t){r(l[t],"=",n,".",t,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",c,"=",s,".createStream(",lr,",",n,");",h,"=",c,".dtype;","}else{",c,"=",s,".getBuffer(",n,");","if(",c,"){",h,"=",c,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[de[0]],"=",n,".constant;",de.slice(1).map(function(t){return l[t]}).join("="),"=0;","}else{",de.map(function(t,e){return l[t]+"="+n+".constant.length>"+e+"?"+n+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",n,".buffer)){",c,"=",s,".createStream(",lr,",",n,".buffer);","}else{",c,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",c,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",c,");","}"),l})}),i}(e),T.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=Rr(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Fr(e,function(t,r){return t.invoke(r,e)})}),n}(o),T}function j(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a);var o=r[a].append(t,e);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")}),e(i)}function U(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;w&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,u=t.constants,c=u.drawBuffer,h=u.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&e(i,".drawBuffersWEBGL(",c,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",36160,",null);"),w&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function V(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,u=t.cond(s,".dirty");M.forEach(function(e){var n,c,h=I(e);if(!(h in r.state))if(h in o){n=o[h],c=a[h];var p=f(k[h].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(p.map(function(t,e){return t+"!=="+c+"["+e+"]"}).join("||")).then(i,".",C[h],"(",p,");",p.map(function(t,e){return c+"["+e+"]="+t}).join(";"),";"))}else{n=u.def(l,".",h);var d=t.cond(n,"!==",s,".",h);u(d),h in E?d(t.cond(n).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",n,";"):d(i,".",C[h],"(",n,");",s,".",h,"=",n,";")}}),0===Object.keys(r.state).length&&u(s,".dirty=false;"),e(u)}function q(t,e,r,n){var i,a=t.shared,o=t.current,s=a.current,l=a.gl;zr(Object.keys(r)).forEach(function(a){var u=r[a];if(!n||n(u)){var c=u.append(t,e);if(E[a]){var h=E[a];Dr(u)?(i=t.link(c,{stable:!0}),e(t.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",i,";")):(e(t.cond(c).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",c,";"))}else if(G(c)){var f=o[a];e(l,".",C[a],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else Dr(u)?(i=t.link(c,{stable:!0}),e(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):e(l,".",C[a],"(",c,");",s,".",a,"=",c,";")}})}function H(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function Z(t,e,r,n,i){var a,o,s,l=t.shared,u=t.stats,c=l.current,h=l.timer,f=r.profile;function p(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(a=e.def(),"=",p(),";"),"string"==typeof i?t(u,".count+=",i,";"):t(u,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",u,");"))}function m(t){t(u,".cpuTime+=",p(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",u,");"):t(h,".endQuery();"))}function y(t){var r=e.def(c,".profile");e(c,".profile=",t,";"),e.exit(c,".profile=",r,";")}if(f){if(Dr(f))return void(f.enable?(d(e),m(e.exit),y("true")):y("false"));y(s=f.append(t,e))}else s=e.def(c,".profile");var v=t.block();d(v),e("if(",s,"){",v,"}");var x=t.block();m(x),e.exit("if(",s,"){",x,"}")}function W(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(Br))return;var u=t.scopeAttrib(s);o={},Object.keys(new x).forEach(function(t){o[t]=e.def(u,".",t)})}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),u=i.state,c=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function p(){e("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",l,".type!==",a,"||",l,".size!==",r,"||",f.map(function(t){return l+"."+t+"!=="+i[t]}).join("||"),"){",o,".bindBuffer(",lr,",",c,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",f.map(function(t){return l+"."+t+"="+i[t]+";"}).join(""),"}"),b){var u=i.divisor;e("if(",l,".divisor!==",u,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,u],");",l,".divisor=",u,";}")}}function d(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",de.map(function(t,e){return l+"."+t+"!=="+h[e]}).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",de.map(function(t,e){return l+"."+t+"="+h[e]+";"}).join(""),"}")}1===u?p():2===u?d():(e("if(",u,"===",1,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case cr:case pr:case gr:return 2;case hr:case dr:case yr:return 3;case fr:case mr:case vr:return 4;default:return 1}}(n.info.type),o)})}function Y(t,e,n,i,a,o){for(var s,l=t.shared,u=l.gl,c=0;c<i.length;++c){var h,p=i[c],d=p.name,m=p.info.type,g=n.uniforms[d],y=t.link(p)+".location";if(g){if(!a(g))continue;if(Dr(g)){var v=g.value;if(m===wr||m===Tr){var x=t.link(v._texture||v.color[0]._texture);e(u,".uniform1i(",y,",",x+".bind());"),e.exit(x,".unbind();")}else if(m===xr||m===_r||m===br){var _=t.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;m===_r?b=3:m===br&&(b=4),e(u,".uniformMatrix",b,"fv(",y,",false,",_,");")}else{switch(m){case 5126:s="1f";break;case cr:s="2f";break;case hr:s="3f";break;case fr:s="4f";break;case 35670:case 5124:s="1i";break;case gr:case pr:s="2i";break;case yr:case dr:s="3i";break;case vr:case mr:s="4i"}e(u,".uniform",s,"(",y,",",G(v)?Array.prototype.slice.call(v):v,");")}continue}h=g.append(t,e)}else{if(!a(Br))continue;h=e.def(l.uniforms,"[",r.id(d),"]")}m===wr?e("if(",h,"&&",h,'._reglType==="framebuffer"){',h,"=",h,".color[0];","}"):m===Tr&&e("if(",h,"&&",h,'._reglType==="framebufferCube"){',h,"=",h,".color[0];","}");var w=1;switch(m){case wr:case Tr:var T=e.def(h,"._texture");e(u,".uniform1i(",y,",",T,".bind());"),e.exit(T,".unbind();");continue;case 5124:case 35670:s="1i";break;case pr:case gr:s="2i",w=2;break;case dr:case yr:s="3i",w=3;break;case mr:case vr:s="4i",w=4;break;case 5126:s="1f";break;case cr:s="2f",w=2;break;case hr:s="3f",w=3;break;case fr:s="4f",w=4;break;case xr:s="Matrix2fv";break;case _r:s="Matrix3fv";break;case br:s="Matrix4fv"}if("M"===s.charAt(0)){e(u,".uniform",s,"(",y,",");var k=Math.pow(m-xr+2,2),A=t.global.def("new Float32Array(",k,")");Array.isArray(h)?e("false,(",f(k,function(t){return A+"["+t+"]="+h[t]}),",",A,")"):e("false,(Array.isArray(",h,")||",h," instanceof Float32Array)?",h,":(",f(k,function(t){return A+"["+t+"]="+h+"["+t+"]"}),",",A,")"),e(");")}else if(w>1){for(var M=[],S=[],E=0;E<w;++E)Array.isArray(h)?S.push(h[E]):S.push(e.def(h+"["+E+"]")),o&&M.push(e.def());o&&e("if(!",t.batchId,"||",M.map(function(t,e){return t+"!=="+S[e]}).join("||"),"){",M.map(function(t,e){return t+"="+S[e]+";"}).join("")),e(u,".uniform",s,"(",y,",",S.join(","),");"),o&&e("}")}else{if(o){var C=e.def();e("if(!",t.batchId,"||",C,"!==",h,"){",C,"=",h,";")}e(u,".uniform",s,"(",y,",",h,");"),o&&e("}")}}}function X(t,e,r,n){var i,a,o,s=t.shared,l=s.gl,u=s.draw,c=n.draw,h=(a=c.elements,o=e,a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),c.elementsActive&&o("if("+i+")"+l+".bindBuffer("+ur+","+i+".buffer.buffer);")):(i=o.def(),o(i,"=",u,".",Ze,";","if(",i,"){",l,".bindBuffer(",ur,",",i,".buffer.buffer);}","else if(",s.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+s.vao,".currentVAO.elements);",T?"":"if("+i+")"+l+".bindBuffer("+ur+","+i+".buffer.buffer);","}")),i);function f(i){var a=c[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(u,".",i)}var p,d,m=f(We),g=f(Xe),y=function(){var i,a=c.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(u,".",Ye),i}();if("number"==typeof y){if(0===y)return}else r("if(",y,"){"),r.exit("}");b&&(p=f($e),d=t.instancing);var v=h+".type",x=c.elements&&Dr(c.elements)&&!c.vaoActive;function _(){function t(){r(d,".drawElementsInstancedANGLE(",[m,y,v,g+"<<(("+v+"-5121)>>1)",p],");")}function e(){r(d,".drawArraysInstancedANGLE(",[m,g,y,p],");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function w(){function t(){r(l+".drawElements("+[m,y,v,g+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[m,g,y]+");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof p||p>=0)?"string"==typeof p?(r("if(",p,">0){"),_(),r("}else if(",p,"<0){"),w(),r("}")):_():w()}function $(t,e,r,n,i){var a=B(),o=a.proc("body",i);return b&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function J(t,e,r,n){H(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,r,n.attributes,function(){return!0})),Y(t,e,r,n.uniforms,function(){return!0},!1),X(t,e,e,r)}function K(t,e,r,n){function i(){return!0}t.batchId="a1",H(t,e),W(t,e,r,n.attributes,i),Y(t,e,r,n.uniforms,i,!1),X(t,e,e,r)}function Q(t,e,r,n){H(t,e);var i=r.contextDep,a=e.def(),o=e.def();t.shared.props=o,t.batchId=a;var s=t.scope(),l=t.scope();function u(t){return t.contextDep&&i||t.propDep}function c(t){return!u(t)}if(e(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&j(t,l,r.context),r.needsFramebuffer&&U(t,l,r.framebuffer),q(t,l,r.state,u),r.profile&&u(r.profile)&&Z(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?u(r.drawVAO)?l(t.shared.vao,".setVAO(",r.drawVAO.append(t,l),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),W(t,s,r,n.attributes,c),W(t,l,r,n.attributes,u)),Y(t,s,r,n.uniforms,c,!1),Y(t,l,r,n.uniforms,u,!0),X(t,s,l,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,l),p=l.def(f,".id"),d=l.def(h,"[",p,"]");l(t.shared.gl,".useProgram(",f,".program);","if(!",d,"){",d,"=",h,"[",p,"]=",t.link(function(t){return $(K,0,r,t,2)}),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function tt(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!G(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(o.isDynamic(t[e[r]]))return!0;return!1}}(n)){var i=t.global,a=Object.keys(n),s=!1,l=!1,u=!1,c=t.global.def("{}");a.forEach(function(e){var r=n[e];if(o.isDynamic(r)){"function"==typeof r&&(r=n[e]=o.unbox(r));var a=Fr(r,null);s=s||a.thisDep,u=u||a.propDep,l=l||a.contextDep}else{switch(i(c,".",e,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(t.link(r))}i(";")}}),e.dynamic[r]=new o.DynamicVariable(4,{thisDep:s,contextDep:l,propDep:u,ref:c,append:function(t,e){a.forEach(function(r){var i=n[r];if(o.isDynamic(i)){var a=t.invoke(e,i);e(c,".",r,"=",a,";")}})}}),delete e.static[r]}}return{next:A,current:k,procs:function(){var t=B(),e=t.proc("poll"),r=t.proc("refresh"),a=t.block();e(a),r(a);var o,s=t.shared,l=s.gl,u=s.next,c=s.current;a(c,".dirty=false;"),U(t,e),U(t,r,null,!0),b&&(o=t.link(b)),n.oes_vertex_array_object&&r(t.link(n.oes_vertex_array_object),".bindVertexArrayOES(null);");var h=r.def(s.attributes),p=r.def(0),d=t.cond(p,".buffer");d.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",lr,",",p,".buffer.buffer);",l,".vertexAttribPointer(i,",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(l,".disableVertexAttribArray(i);",l,".vertexAttrib4f(i,",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;");var m=t.link(i.maxAttributes,{stable:!0});return r("for(var i=0;i<",m,";++i){",p,"=",h,"[i];",d,"}"),b&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",h,"[i].divisor);","}"),r(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(E).forEach(function(n){var i=E[n],o=a.def(u,".",n),s=t.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",c,".",n,"=",o,";"),r(s),e("if(",o,"!==",c,".",n,"){",s,"}")}),Object.keys(C).forEach(function(n){var i,o,s=C[n],h=k[n],p=t.block();if(p(l,".",s,"("),G(h)){var d=h.length;i=t.global.def(u,".",n),o=t.global.def(c,".",n),p(f(d,function(t){return i+"["+t+"]"}),");",f(d,function(t){return o+"["+t+"]="+i+"["+t+"];"}).join("")),e("if(",f(d,function(t){return i+"["+t+"]!=="+o+"["+t+"]"}).join("||"),"){",p,"}")}else i=a.def(u,".",n),o=a.def(c,".",n),p(i,");",c,".",n,"=",i,";"),e("if(",i,"!==",o,"){",p,"}");r(p)}),t.compile()}(),compile:function(e,n,i,a,o){var s=B();s.stats=s.link(o),Object.keys(n.static).forEach(function(t){tt(s,n,t)}),sr.forEach(function(t){tt(s,e,t)});var l=N(e,n,i,a);return l.shader.program&&(l.shader.program.attributes.sort(function(t,e){return t.name<e.name?-1:1}),l.shader.program.uniforms.sort(function(t,e){return t.name<e.name?-1:1})),function(t,e){var r=t.proc("draw",1);H(t,r),j(t,r,e.context),U(t,r,e.framebuffer),V(t,r,e),q(t,r,e.state),Z(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)J(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link(function(t){return $(J,0,e,t,1)}),"(",n,");",o,".call(this,a0);"))}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,a=i.current;if(j(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),zr(Object.keys(e.state)).forEach(function(r){var a=e.state[r],o=a.append(t,n);G(o)?o.forEach(function(e,i){z(e)?n.set(t.next[r],"["+i+"]",e):n.set(t.next[r],"["+i+"]",t.link(e,{stable:!0}))}):Dr(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)}),Z(t,n,e,!0,!0),[Ze,Xe,Ye,$e,We].forEach(function(r){var a=e.draw[r];if(a){var o=a.append(t,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,t.link(o),{stable:!0})}}),Object.keys(e.uniforms).forEach(function(a){var o=e.uniforms[a].append(t,n);Array.isArray(o)&&(o="["+o.map(function(e){return z(e)?e:t.link(e,{stable:!0})})+"]"),n.set(i.uniforms,"["+t.link(r.id(a),{stable:!0})+"]",o)}),Object.keys(e.attributes).forEach(function(r){var i=e.attributes[r].append(t,n),a=t.scopeAttrib(r);Object.keys(new x).forEach(function(t){n.set(a,"."+t,i[t])})}),e.scopeVAO){var o=e.scopeVAO.append(t,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",t.link(o,{stable:!0}))}function s(r){var a=e.shader[r];if(a){var o=a.append(t,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,t.link(o,{stable:!0}))}}s(He),s(Ge),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,l),function(t,e){var r=t.proc("batch",2);t.batchId="0",H(t,r);var n=!1,i=!0;Object.keys(e.context).forEach(function(t){n=n||e.context[t].propDep}),n||(j(t,r,e.context),i=!1);var a=e.framebuffer,o=!1;function s(t){return t.contextDep&&n||t.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||U(t,r,a)):U(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),V(t,r,e),q(t,r,e.state,function(t){return!s(t)}),(!e.profile||!s(e.profile))&&Z(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=o;var l=e.shader.progVar;if(l.contextDep&&n||l.propDep)Q(t,r,e,null);else{var u=l.append(t,r);if(r(t.shared.gl,".useProgram(",u,".program);"),e.shader.program)Q(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var c=t.global.def("{}"),h=r.def(u,".id"),f=r.def(c,"[",h,"]");r(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",c,"[",h,"]=",t.link(function(t){return $(Q,0,e,t,2)}),"(",u,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),t(s.compile(),{destroy:function(){l.shader.program.destroy()}})}}}var jr=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[];function s(t){o.push(t)}var l=[];function u(t,e,r){var n=o.pop()||new a;n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,l.push(n)}var c=[],h=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),u(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:u,update:function(){var t,r,a=i.length;if(0!==a){h.length=Math.max(h.length,a+1),c.length=Math.max(c.length,a+1),c[0]=0,h[0]=0;var o=0;for(t=0,r=0;r<i.length;++r){var u=i[r];e.ext_disjoint_timer_query.getQueryObjectEXT(u,34919)?(o+=e.ext_disjoint_timer_query.getQueryObjectEXT(u,34918),n(u)):i[t++]=u,c[r+1]=o,h[r+1]=t}for(i.length=t,t=0,r=0;r<l.length;++r){var f=l[r],p=f.startQueryIndex,d=f.endQueryIndex;f.sum+=c[d]-c[p];var m=h[p],g=h[d];g===m?(f.stats.gpuTime+=f.sum/1e6,s(f)):(f.startQueryIndex=m,f.endQueryIndex=g,l[t++]=f)}l.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){r.push.apply(r,i);for(var t=0;t<r.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(r[t]);i.length=0,r.length=0},restore:function(){i.length=0,r.length=0}}},Ur="webglcontextlost",Vr="webglcontextrestored";function qr(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}return function(e){var r=h(e);if(!r)return null;var n=r.gl,i=n.getContextAttributes();n.isContextLost();var a=function(t,e){var r={};function n(e){var n,i=e.toLowerCase();try{n=r[i]=t.getExtension(i)}catch(t){}return!!n}for(var i=0;i<e.extensions.length;++i){var a=e.extensions[i];if(!n(a))return e.onDestroy(),e.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach(function(t){if(r[t]&&!n(t))throw new Error("(regl): error restoring extension "+t)})}}}(n,r);if(!a)return null;var u=function(){var t={"":0},e=[""];return{id:function(r){var n=t[r];return n||(n=t[r]=e.length,e.push(r),n)},str:function(t){return e[t]}}}(),c={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},f=r.cachedCode||{},p=a.extensions,d=jr(0,p),T=l(),k=n.drawingBufferWidth,A=n.drawingBufferHeight,M={tick:0,time:0,viewportWidth:k,viewportHeight:A,framebufferWidth:k,framebufferHeight:A,drawingBufferWidth:k,drawingBufferHeight:A,pixelRatio:r.pixelRatio},V={elements:null,primitive:4,count:-1,offset:0,instances:-1},q=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063));var a=!!e.oes_texture_float;if(a){var o=t.createTexture();t.bindTexture(g,o),t.texImage2D(g,0,y,1,1,0,y,v,null);var s=t.createFramebuffer();if(t.bindFramebuffer(x,s),t.framebufferTexture2D(x,36064,g,o,0),t.bindTexture(g,null),36053!==t.checkFramebufferStatus(x))a=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var l=m.allocType(v,4);t.readPixels(0,0,1,1,y,v,l),t.getError()?a=!1:(t.deleteFramebuffer(s),t.deleteTexture(o),a=1===l[0]),m.freeType(l)}}var u=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var c=t.createTexture(),h=m.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,c),t.texImage2D(34069,0,y,3,3,0,y,5121,h),m.freeType(h),t.bindTexture(34067,null),t.deleteTexture(c),u=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:a,npotTextureCube:u}}(n,p),H=function(t,e,r,n){var i=0,a={};function o(e){this.id=i++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=L,this.persistentData=null,r.profile&&(this.stats={size:0})}o.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},o.prototype.destroy=function(){c(this)};var s=[];function l(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function u(t,e,r,n,i,a){var o,s;if(t.usage=r,Array.isArray(e)){if(t.dtype=n||P,e.length>0)if(Array.isArray(e[0])){o=I(e);for(var u=1,c=1;c<o.length;++c)u*=o[c];t.dimension=u,l(t,s=C(e,o,t.dtype),r),a?t.persistentData=s:m.freeType(s)}else if("number"==typeof e[0]){t.dimension=i;var h=m.allocType(t.dtype,e.length);D(h,e),l(t,h,r),a?t.persistentData=h:m.freeType(h)}else _(e[0])&&(t.dimension=e[0].length,t.dtype=n||O(e[0])||P,l(t,s=C(e,[e.length,e[0].length],t.dtype),r),a?t.persistentData=s:m.freeType(s))}else if(_(e))t.dtype=n||O(e),t.dimension=i,l(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(b(e)){o=e.shape;var f=e.stride,p=e.offset,d=0,g=0,y=0,v=0;1===o.length?(d=o[0],g=1,y=f[0],v=0):2===o.length&&(d=o[0],g=o[1],y=f[0],v=f[1]),t.dtype=n||O(e.data)||P,t.dimension=g;var x=m.allocType(t.dtype,d*g);R(x,e.data,d,g,y,v,p),l(t,x,r),a?t.persistentData=x:m.freeType(x)}else e instanceof ArrayBuffer&&(t.dtype=L,t.dimension=i,l(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e))))}function c(r){e.bufferCount--,n(r);var i=r.buffer;t.deleteBuffer(i),r.buffer=null,delete a[r.id]}return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach(function(e){t+=a[e].stats.size}),t}),{create:function(n,i,s,l){e.bufferCount++;var h=new o(i);function f(e){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(e)||_(e)||b(e)||e instanceof ArrayBuffer?i=e:"number"==typeof e?a=0|e:e&&("data"in e&&(i=e.data),"usage"in e&&(n=E[e.usage]),"type"in e&&(o=S[e.type]),"dimension"in e&&(s=0|e.dimension),"length"in e&&(a=0|e.length)),h.bind(),i?u(h,i,n,o,s,l):(a&&t.bufferData(h.type,a,n),h.dtype=o||L,h.usage=n,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*z[h.dtype]),f}function p(e,r){t.bufferSubData(h.type,r,e)}return a[h.id]=h,s||f(n),f._reglType="buffer",f._buffer=h,f.subdata=function(t,e){var r,n=0|(e||0);if(h.bind(),_(t)||t instanceof ArrayBuffer)p(t,n);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var i=m.allocType(h.dtype,t.length);D(i,t),p(i,n),m.freeType(i)}else if(Array.isArray(t[0])||_(t[0])){r=I(t);var a=C(t,r,h.dtype);p(a,n),m.freeType(a)}}else if(b(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,c=0;1===r.length?(s=r[0],l=1,u=o[0],c=0):2===r.length&&(s=r[0],l=r[1],u=o[0],c=o[1]);var d=Array.isArray(t.data)?h.dtype:O(t.data),g=m.allocType(d,s*l);R(g,t.data,s,l,u,c,t.offset),p(g,n),m.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){c(h)},f},createStream:function(t,e){var r=s.pop();return r||(r=new o(t)),r.bind(),u(r,e,35040,0,1,!1),r},destroyStream:function(t){s.push(t)},clear:function(){w(a).forEach(c),s.forEach(c)},getBuffer:function(t){return t&&t._buffer instanceof o?t._buffer:null},restore:function(){w(a).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})},_initBuffer:u}}(n,c,r,function(t){return Z.destroyBuffer(t)}),G=function(t,e,r,n){var i={},a=0,o={uint8:B,uint16:N};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}e.oes_element_index_uint&&(o.uint32=j),s.prototype.bind=function(){this.buffer.bind()};var l=[];function u(n,i,a,o,s,l,u){var c;if(n.buffer.bind(),i){var h=u;!u&&(!_(i)||b(i)&&!_(i.data))&&(h=e.oes_element_index_uint?j:N),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=c||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(c=u,!u){switch(n.buffer.dtype){case B:case 5120:c=B;break;case N:case 5122:c=N;break;case j:case 5124:c=j}n.buffer.dtype=c}n.type=c;var f=s;f<0&&(f=n.buffer.byteLength,c===N?f>>=1:c===j&&(f>>=2)),n.vertCount=f;var p=o;if(o<0){p=4;var d=n.buffer.dimension;1===d&&(p=0),2===d&&(p=1),3===d&&(p=4)}n.primType=p}function c(t){n.elementsCount--,delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,e){var i=r.create(null,U,!0),a=new s(i._buffer);function l(t){if(t)if("number"==typeof t)i(t),a.primType=4,a.vertCount=0|t,a.type=B;else{var e=null,r=35044,n=-1,s=-1,c=0,h=0;Array.isArray(t)||_(t)||b(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=E[t.usage]),"primitive"in t&&(n=F[t.primitive]),"count"in t&&(s=0|t.count),"type"in t&&(h=o[t.type]),"length"in t?c=0|t.length:(c=s,h===N||5122===h?c*=2:(h===j||5124===h)&&(c*=4))),u(a,e,r,n,s,c,h)}else i(),a.primType=4,a.vertCount=0,a.type=B;return l}return n.elementsCount++,l(t),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return i.subdata(t,e),l},l.destroy=function(){c(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),u(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){w(i).forEach(c)}}}(n,p,H,c),Z=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),u=0;u<s;++u)l[u]=new Qt;var c=0,h={},f={Record:Qt,scope:{},state:l,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&w(h).forEach(function(t){t.refresh()})}:function(){},createVAO:function(t){var e=new m;function r(t){var n;if(Array.isArray(t))n=t,e.elements&&e.ownsElements&&e.elements.destroy(),e.elements=null,e.ownsElements=!1,e.offset=0,e.count=0,e.instances=-1,e.primitive=4;else{if(t.elements){var o=t.elements;e.ownsElements?"function"==typeof o&&"elements"===o._reglType?(e.elements.destroy(),e.ownsElements=!1):(e.elements(o),e.ownsElements=!1):a.getElements(t.elements)?(e.elements=t.elements,e.ownsElements=!1):(e.elements=a.create(t.elements),e.ownsElements=!0)}else e.elements=null,e.ownsElements=!1;n=t.attributes,e.offset=0,e.count=-1,e.instances=-1,e.primitive=4,e.elements&&(e.count=e.elements._elements.vertCount,e.primitive=e.elements._elements.primType),"offset"in t&&(e.offset=0|t.offset),"count"in t&&(e.count=0|t.count),"instances"in t&&(e.instances=0|t.instances),"primitive"in t&&(e.primitive=F[t.primitive])}var s={},l=e.attributes;l.length=n.length;for(var u=0;u<n.length;++u){var c,h=n[u],f=l[u]=new Qt,p=h.data||h;Array.isArray(p)||_(p)||b(p)?(e.buffers[u]&&(c=e.buffers[u],_(p)&&c._buffer.byteLength>=p.byteLength?c.subdata(p):(c.destroy(),e.buffers[u]=null)),e.buffers[u]||(c=e.buffers[u]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,s[u]=1):i.getBuffer(h)?(f.buffer=i.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(h.buffer)?(f.buffer=i.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,f.type="type"in h?S[h.type]:f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1):"x"in h&&(f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2)}for(var d=0;d<e.buffers.length;++d)!s[d]&&e.buffers[d]&&(e.buffers[d].destroy(),e.buffers[d]=null);return e.refresh(),r}return n.vaoCount+=1,r.destroy=function(){for(var t=0;t<e.buffers.length;++t)e.buffers[t]&&e.buffers[t].destroy();e.buffers.length=0,e.ownsElements&&(e.elements.destroy(),e.elements=null,e.ownsElements=!1),e.destroy()},r._vao=e,r._reglType="vao",r(t)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(e){for(var r=0;r<l.length;++r){var n=l[r];n.buffer===e&&(t.disableVertexAttribArray(r),n.buffer=null)}},setVAO:p()?function(t){if(t!==f.currentVAO){var e=p();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),f.currentVAO=t}}:function(e){if(e!==f.currentVAO){if(e)e.bindAttrs();else{for(var r=d(),n=0;n<l.length;++n){var i=l[n];i.buffer?(t.enableVertexAttribArray(n),i.buffer.bind(),t.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offfset),r&&i.divisor&&r.vertexAttribDivisorANGLE(n,i.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}o.elements?t.bindBuffer(Kt,o.elements.buffer.buffer):t.bindBuffer(Kt,null)}f.currentVAO=e}},clear:p()?function(){w(h).forEach(function(t){t.destroy()})}:function(){}};function p(){return e.oes_vertex_array_object}function d(){return e.angle_instanced_arrays}function m(){this.id=++c,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var t=p();this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}return m.prototype.bindAttrs=function(){for(var e=d(),r=this.attributes,n=0;n<r.length;++n){var i=r[n];i.buffer?(t.enableVertexAttribArray(n),t.bindBuffer(34962,i.buffer.buffer),t.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offset),e&&i.divisor&&e.vertexAttribDivisorANGLE(n,i.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}for(var o=r.length;o<s;++o)t.disableVertexAttribArray(o);var l=a.getElements(this.elements);l?t.bindBuffer(Kt,l.buffer.buffer):t.bindBuffer(Kt,null)},m.prototype.refresh=function(){var t=p();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=null,t.bindVertexArrayOES(null))},m.prototype.destroy=function(){if(this.vao){var t=p();this===f.currentVAO&&(f.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),h[this.id]&&(delete h[this.id],n.vaoCount-=1)},f}(n,p,q,c,H,G,V),W=function(e,r,n,i){var a={},o={};function s(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function l(t,e){for(var r=0;r<t.length;++r)if(t[r].id===e.id)return void(t[r].location=e.location);t.push(e)}function u(t,n,i){var s=35632===t?a:o,l=s[n];if(!l){var u=r.str(n);l=e.createShader(t),e.shaderSource(l,u),e.compileShader(l),s[n]=l}return l}var c={},h=[],f=0;function p(t,e){this.id=f++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function d(t,n,a){var o,c,h=u(35632,t.fragId),f=u(35633,t.vertId),p=t.program=e.createProgram();if(e.attachShader(p,h),e.attachShader(p,f),a)for(o=0;o<a.length;++o){var d=a[o];e.bindAttribLocation(p,d[0],d[1])}e.linkProgram(p);var m=e.getProgramParameter(p,35718);i.profile&&(t.stats.uniformsCount=m);var g=t.uniforms;for(o=0;o<m;++o)if(c=e.getActiveUniform(p,o))if(c.size>1)for(var y=0;y<c.size;++y){var v=c.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),e.getUniformLocation(p,v),c))}else l(g,new s(c.name,r.id(c.name),e.getUniformLocation(p,c.name),c));var x=e.getProgramParameter(p,35721);i.profile&&(t.stats.attributesCount=x);var _=t.attributes;for(o=0;o<x;++o)(c=e.getActiveAttrib(p,o))&&l(_,new s(c.name,r.id(c.name),e.getAttribLocation(p,c.name),c))}return i.profile&&(n.getMaxUniformsCount=function(){var t=0;return h.forEach(function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var t=e.deleteShader.bind(e);w(a).forEach(t),a={},w(o).forEach(t),o={},h.forEach(function(t){e.deleteProgram(t.program)}),h.length=0,c={},n.shaderCount=0},program:function(r,i,s,l){var u=c[i];u||(u=c[i]={});var f=u[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(u[r]=m),h.push(m),t(m,{destroy:function(){if(m.refCount--,m.refCount<=0){e.deleteProgram(m.program);var t=h.indexOf(m);h.splice(t,1),n.shaderCount--}u[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete c[m.fragId][m.vertId]),Object.keys(c[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete c[m.fragId])}})},restore:function(){a={},o={};for(var t=0;t<h.length;++t)d(h[t],0,h[t].attributes.map(function(t){return[t.location,t.name]}))},shader:u,frag:-1,vert:-1}}(n,u,c,r),Y=Vt(n,p,q,function(){J.procs.poll()},M,c,r),X=function(t,e,r,n,i){var a={rgba4:Ht,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(a.srgba=35907),e.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),e.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach(function(t){var e=a[t];o[e]=t});var s=0,l={};function u(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=Ht,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function c(e){var r=e.renderbuffer;t.bindRenderbuffer(qt,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete l[e.id],n.renderbufferCount--}return u.prototype.decRef=function(){--this.refCount<=0&&c(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(l).forEach(function(e){t+=l[e].stats.size}),t}),{create:function(e,r){var s=new u(t.createRenderbuffer());function c(e,r){var n=0,l=0,u=Ht;if("object"==typeof e&&e){var h=e;if("shape"in h){var f=h.shape;n=0|f[0],l=0|f[1]}else"radius"in h&&(n=l=0|h.radius),"width"in h&&(n=0|h.width),"height"in h&&(l=0|h.height);"format"in h&&(u=a[h.format])}else"number"==typeof e?(n=0|e,l="number"==typeof r?0|r:n):e||(n=l=1);if(n!==s.width||l!==s.height||u!==s.format)return c.width=s.width=n,c.height=s.height=l,s.format=u,t.bindRenderbuffer(qt,s.renderbuffer),t.renderbufferStorage(qt,u,n,l),i.profile&&(s.stats.size=Zt(s.format,s.width,s.height)),c.format=o[s.format],c}return l[s.id]=s,n.renderbufferCount++,c(e,r),c.resize=function(e,r){var n=0|e,a=0|r||n;return n===s.width&&a===s.height||(c.width=s.width=n,c.height=s.height=a,t.bindRenderbuffer(qt,s.renderbuffer),t.renderbufferStorage(qt,s.format,n,a),i.profile&&(s.stats.size=Zt(s.format,s.width,s.height))),c},c._reglType="renderbuffer",c._renderbuffer=s,i.profile&&(c.stats=s.stats),c.destroy=function(){s.decRef()},c},clear:function(){w(l).forEach(c)},restore:function(){w(l).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(qt,e.renderbuffer),t.renderbufferStorage(qt,e.format,e.width,e.height)}),t.bindRenderbuffer(qt,null)}}}(n,p,0,c,r),$=function(e,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],u=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&u.push("srgba"),r.ext_color_buffer_half_float&&u.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&u.push("rgba32f");var c=["uint8"];function h(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function f(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function p(t,e,r){if(t)if(t.texture){var n=t.texture._texture;Math.max(1,n.width),Math.max(1,n.height),n.refCount+=1}else t.renderbuffer._renderbuffer.refCount+=1}function d(t,r){r&&(r.texture?e.framebufferTexture2D(Wt,t,r.target,r.texture._texture.texture,0):e.framebufferRenderbuffer(Wt,t,Yt,r.renderbuffer._renderbuffer.renderbuffer))}function m(t){var e=Xt,r=null,n=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target));var a=i._reglType;return"texture2d"===a||"textureCube"===a?r=i:"renderbuffer"===a&&(n=i,e=Yt),new h(e,r,n)}function g(t,e,r,n,o){if(r){var s=i.create2D({width:t,height:e,format:n,type:o});return s._texture.refCount=0,new h(Xt,s,null)}var l=a.create({width:t,height:e,format:n});return l._renderbuffer.refCount=0,new h(Yt,null,l)}function y(t){return t&&(t.texture||t.renderbuffer)}function v(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}r.oes_texture_half_float&&c.push("half float","float16"),r.oes_texture_float&&c.push("float","float32");var x=0,_={};function b(){this.id=x++,_[this.id]=this,this.framebuffer=e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function T(t){t.colorAttachments.forEach(f),f(t.depthAttachment),f(t.stencilAttachment),f(t.depthStencilAttachment)}function k(t){var r=t.framebuffer;e.deleteFramebuffer(r),t.framebuffer=null,o.framebufferCount--,delete _[t.id]}function A(t){var r;e.bindFramebuffer(Wt,t.framebuffer);var i=t.colorAttachments;for(r=0;r<i.length;++r)d(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)e.framebufferTexture2D(Wt,36064+r,Xt,null,0);e.framebufferTexture2D(Wt,33306,Xt,null,0),e.framebufferTexture2D(Wt,36096,Xt,null,0),e.framebufferTexture2D(Wt,36128,Xt,null,0),d(36096,t.depthAttachment),d(36128,t.stencilAttachment),d(33306,t.depthStencilAttachment),e.checkFramebufferStatus(Wt),e.isContextLost(),e.bindFramebuffer(Wt,s.next?s.next.framebuffer:null),s.cur=s.next,e.getError()}function M(e,r){var n=new b;function i(t,e){var r,a=0,o=0,s=!0,c=!0,h=null,f=!0,d="rgba",v="uint8",x=1,_=null,b=null,w=null,k=!1;if("number"==typeof t)a=0|t,o=0|e||a;else if(t){var M=t;if("shape"in M){var S=M.shape;a=S[0],o=S[1]}else"radius"in M&&(a=o=M.radius),"width"in M&&(a=M.width),"height"in M&&(o=M.height);("color"in M||"colors"in M)&&(h=M.color||M.colors,Array.isArray(h)),h||("colorCount"in M&&(x=0|M.colorCount),"colorTexture"in M&&(f=!!M.colorTexture,d="rgba4"),"colorType"in M&&(v=M.colorType,f||("half float"===v||"float16"===v?d="rgba16f":("float"===v||"float32"===v)&&(d="rgba32f"))),"colorFormat"in M&&(d=M.colorFormat,l.indexOf(d)>=0?f=!0:u.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(k=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,c=!1)),"stencil"in M&&("boolean"==typeof M.stencil?c=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=c=M.depthStencil:(w=M.depthStencil,s=!1,c=!1))}else a=o=1;var E=null,C=null,I=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r<x;++r)E[r]=g(a,o,f,d,v);for(a=a||E[0].width,o=o||E[0].height,_?C=m(_):s&&!c&&(C=g(a,o,k,"depth","uint32")),b?I=m(b):c&&!s&&(I=g(a,o,!1,"stencil","uint8")),w?L=m(w):!_&&!b&&c&&s&&(L=g(a,o,k,"depth stencil","depth stencil")),r=0;r<E.length;++r)p(E[r]),E[r]&&E[r].texture&&($t[E[r].texture._texture.format],Jt[E[r].texture._texture.type]);return p(C),p(I),p(L),T(n),n.width=a,n.height=o,n.colorAttachments=E,n.depthAttachment=C,n.stencilAttachment=I,n.depthStencilAttachment=L,i.color=E.map(y),i.depth=y(C),i.stencil=y(I),i.depthStencil=y(L),i.width=n.width,i.height=n.height,A(n),i}return o.framebufferCount++,i(e,r),t(i,{resize:function(t,e){var r=Math.max(0|t,1),a=Math.max(0|e||r,1);if(r===n.width&&a===n.height)return i;for(var o=n.colorAttachments,s=0;s<o.length;++s)v(o[s],r,a);return v(n.depthAttachment,r,a),v(n.stencilAttachment,r,a),v(n.depthStencilAttachment,r,a),n.width=i.width=r,n.height=i.height=a,A(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){k(n),T(n)},use:function(t){s.setFBO({framebuffer:i},t)}})}return t(s,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof b)return e}return null},create:M,createCube:function(e){var r=Array(6);function n(e){var a,o,s={color:null},l=0,u=null,c="rgba",h="uint8",f=1;if("number"==typeof e)l=0|e;else if(e){var p=e;"shape"in p?l=p.shape[0]:("radius"in p&&(l=0|p.radius),"width"in p?l=0|p.width:"height"in p&&(l=0|p.height)),("color"in p||"colors"in p)&&(u=p.color||p.colors,Array.isArray(u)),u||("colorCount"in p&&(f=0|p.colorCount),"colorType"in p&&(h=p.colorType),"colorFormat"in p&&(c=p.colorFormat)),"depth"in p&&(s.depth=p.depth),"stencil"in p&&(s.stencil=p.stencil),"depthStencil"in p&&(s.depthStencil=p.depthStencil)}else l=1;if(u)if(Array.isArray(u))for(o=[],a=0;a<u.length;++a)o[a]=u[a];else o=[u];else{o=Array(f);var d={radius:l,format:c,type:h};for(a=0;a<f;++a)o[a]=i.createCube(d)}for(s.color=Array(o.length),a=0;a<o.length;++a){var m=o[a];l=l||m.width,s.color[a]={target:34069,data:o[a]}}for(a=0;a<6;++a){for(var g=0;g<o.length;++g)s.color[g].target=34069+a;a>0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=M(s)}return t(n,{width:l,height:l,color:o})}return n(e),t(n,{faces:r,resize:function(t){var e,i=0|t;if(i===n.width)return n;var a=n.color;for(e=0;e<a.length;++e)a[e].resize(i);for(e=0;e<6;++e)r[e].resize(i);return n.width=n.height=i,n},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){w(_).forEach(k)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,w(_).forEach(function(t){t.framebuffer=e.createFramebuffer(),A(t)})}})}(n,p,q,Y,X,c),J=Nr(n,u,p,q,H,G,0,$,{},Z,W,V,M,d,f,r),K=te(n,$,J.procs.poll,M),Q=J.next,tt=n.canvas,et=[],rt=[],nt=[],it=[r.onDestroy],at=null;function ot(){if(0===et.length)return d&&d.update(),void(at=null);at=s.next(ot),gt();for(var t=et.length-1;t>=0;--t){var e=et[t];e&&e(M,null,0)}n.flush(),d&&d.update()}function st(){!at&&et.length>0&&(at=s.next(ot))}function lt(){at&&(s.cancel(ot),at=null)}function ut(t){t.preventDefault(),lt(),rt.forEach(function(t){t()})}function ct(t){n.getError(),a.restore(),W.restore(),H.restore(),Y.restore(),X.restore(),$.restore(),Z.restore(),d&&d.restore(),J.procs.refresh(),st(),nt.forEach(function(t){t()})}function ht(e){function r(t,e){var r={},n={};return Object.keys(t).forEach(function(i){var a=t[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(e&&Array.isArray(a))for(var s=0;s<a.length;++s)if(o.isDynamic(a[s]))return void(n[i]=o.unbox(a,i));r[i]=a}}),{dynamic:n,static:r}}var n=r(e.context||{},!0),i=r(e.uniforms||{},!0),a=r(e.attributes||{},!1),s=r(function(e){var r=t({},e);function n(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),n("blend"),n("depth"),n("cull"),n("stencil"),n("polygonOffset"),n("scissor"),n("sample"),"vao"in e&&(r.vao=e.vao),r}(e),!1),l={gpuTime:0,cpuTime:0,count:0},u=J.compile(s,a,i,n,l),c=u.draw,h=u.batch,f=u.scope,p=[];return t(function(t,e){var r;if("function"==typeof t)return f.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(r=0;r<t;++r)f.call(this,null,e,r);else{if(!Array.isArray(t))return f.call(this,t,e,0);for(r=0;r<t.length;++r)f.call(this,t[r],e,r)}else if("number"==typeof t){if(t>0)return h.call(this,function(t){for(;p.length<t;)p.push(null);return p}(0|t),0|t)}else{if(!Array.isArray(t))return c.call(this,t);if(t.length)return h.call(this,t,t.length)}},{stats:l,destroy:function(){u.destroy()}})}tt&&(tt.addEventListener(Ur,ut,!1),tt.addEventListener(Vr,ct,!1));var ft=$.setFBO=ht({framebuffer:o.define.call(null,1,"framebuffer")});function pt(t,e){var r=0;J.procs.poll();var i=e.color;i&&(n.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),r|=16384),"depth"in e&&(n.clearDepth(+e.depth),r|=256),"stencil"in e&&(n.clearStencil(0|e.stencil),r|=1024),n.clear(r)}function dt(t){return et.push(t),st(),{cancel:function(){var e=qr(et,t);et[e]=function t(){var e=qr(et,t);et[e]=et[et.length-1],et.length-=1,et.length<=0&&lt()}}}}function mt(){var t=Q.viewport,e=Q.scissor_box;t[0]=t[1]=e[0]=e[1]=0,M.viewportWidth=M.framebufferWidth=M.drawingBufferWidth=t[2]=e[2]=n.drawingBufferWidth,M.viewportHeight=M.framebufferHeight=M.drawingBufferHeight=t[3]=e[3]=n.drawingBufferHeight}function gt(){M.tick+=1,M.time=vt(),mt(),J.procs.poll()}function yt(){Y.refresh(),mt(),J.procs.refresh(),d&&d.update()}function vt(){return(l()-T)/1e3}yt();var xt=t(ht,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var r=0;r<6;++r)ft(t({framebuffer:e.framebuffer.faces[r]},e),pt);else ft(e,pt);else pt(0,e)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:ht({}),buffer:function(t){return H.create(t,34962,!1,!1)},elements:function(t){return G.create(t,!1)},texture:Y.create2D,cube:Y.createCube,renderbuffer:X.create,framebuffer:$.create,framebufferCube:$.createCube,vao:Z.createVAO,attributes:i,frame:dt,on:function(t,e){var r;switch(t){case"frame":return dt(e);case"lost":r=rt;break;case"restore":r=nt;break;case"destroy":r=it}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e)return r[t]=r[r.length-1],void r.pop()}}},limits:q,hasExtension:function(t){return q.extensions.indexOf(t.toLowerCase())>=0},read:K,destroy:function(){et.length=0,lt(),tt&&(tt.removeEventListener(Ur,ut),tt.removeEventListener(Vr,ct)),W.clear(),$.clear(),X.clear(),Z.clear(),Y.clear(),G.clear(),H.clear(),d&&d.clear(),it.forEach(function(t){t()})},_gl:n,_refresh:yt,poll:function(){gt(),d&&d.update()},now:vt,stats:c,getCachedCode:function(){return f},preloadCachedCode:function(t){Object.entries(t).forEach(function(t){f[t[0]]=t[1]})}});return r.onDone(null,xt),xt}},"object"==typeof t&&void 0!==e?e.exports=n():r.createREGL=n()}),Ax=f((t,e)=>{var r=hm(),n=kx();e.exports=function(t,e,i){var a=t._fullLayout,o=!0;return a._glcanvas.each(function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:i||{}})}catch(t){o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:r.key})},!1)}}),o||r({container:a._glcontainer.node()}),o}}),Mx=f((t,e)=>{var r=Cy(),n=Jv(),i=Kv(),a=Tx(),o=oe(),s=zr().selectMode,l=Ax(),u=Ze(),c=ui(),h=_y().styleTextSelection,f={};function p(t,e,r,n){var i=t._size,a=t.width*n,o=t.height*n,s=i.l*n,l=i.b*n,u=i.r*n,c=i.t*n,h=i.w*n,f=i.h*n;return[s+e.domain[0]*h,l+r.domain[0]*f,a-u-(1-e.domain[1])*h,o-c-(1-r.domain[1])*f]}(e.exports=function(t,e,d){if(d.length){var m,g,y=t._fullLayout,v=e._scene,x=e.xaxis,_=e.yaxis;if(v){if(!l(t,["ANGLE_instanced_arrays","OES_element_index_uint"],f))return void v.init();var b=v.count,w=y._glcanvas.data()[0].regl;if(c(t,e,d),v.dirty){if((v.line2d||v.error2d)&&!(v.scatter2d||v.fill2d||v.glText)&&w.clear({color:!0,depth:!0}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(b),m=0;m<b;m++)v.glText[m]=new a(w);if(v.glText){if(b>v.glText.length){var T=b-v.glText.length;for(m=0;m<T;m++)v.glText.push(new a(w))}else if(b<v.glText.length){var k=v.glText.length-b;v.glText.splice(b,k).forEach(function(t){t.destroy()})}for(m=0;m<b;m++)v.glText[m].update(v.textOptions[m])}if(v.line2d&&(v.line2d.update(v.lineOptions),v.lineOptions=v.lineOptions.map(function(t){if(t&&t.positions){for(var e=t.positions,r=0;r<e.length&&(isNaN(e[r])||isNaN(e[r+1]));)r+=2;for(var n=e.length-2;n>r&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t}),v.line2d.update(v.lineOptions)),v.error2d){var A=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(A)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map(function(t,e){var r=d[e];if(t&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[e],u=[];o._ownfill&&u.push(e),o._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var c,h,f=[],p=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(c=0;c<p.length&&isNaN(p[c+1]);)c+=2;for(h=p.length-2;h>c&&isNaN(p[h+1]);)h-=2;0!==p[c+1]&&(f=[p[c],0]),f=f.concat(p.slice(c,h+2)),0!==p[h+1]&&(f=f.concat([p[h],0]))}else if("tozerox"===o.fill){for(c=0;c<p.length&&isNaN(p[c]);)c+=2;for(h=p.length-2;h>c&&isNaN(p[h]);)h-=2;0!==p[c]&&(f=[0,p[c+1]]),f=f.concat(p.slice(c,h+2)),0!==p[h]&&(f=f.concat([0,p[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(f=[],n=0,t.splitNull=!0,i=0;i<p.length;i+=2)(isNaN(p[i])||isNaN(p[i+1]))&&((f=f.concat(p.slice(n,i))).push(p[n],p[n+1]),f.push(null,null),n=i+2);f=f.concat(p.slice(n)),n&&f.push(p[n],p[n+1])}else{var m=o._nexttrace;if(m){var g=v.lineOptions[e+1];if(g){var y=g.positions;if("tonexty"===o.fill){for(f=p.slice(),e=Math.floor(y.length/2);e--;){var x=y[2*e],_=y[2*e+1];isNaN(x)||isNaN(_)||f.push(x,_)}t.fill=m.fillcolor}}}}if(o._prevtrace&&"tonext"===o._prevtrace.fill){var b=v.lineOptions[e-1].positions,w=f.length/2,T=[n=w];for(i=0;i<b.length;i+=2)(isNaN(b[i])||isNaN(b[i+1]))&&(T.push(i/2+w+1),n=i+2);f=f.concat(b),t.hole=T}return t.fillmode=o.fill,t.opacity=o.opacity,t.positions=f,t}}),v.fill2d.update(v.fillOptions))}var M=y.dragmode,S=s(M),E=y.clickmode.indexOf("select")>-1;for(m=0;m<b;m++){var C=d[m][0],I=C.trace,L=C.t,P=L.index,z=I._length,O=L.x,D=L.y;if(I.selectedpoints||S||E){if(S||(S=!0),I.selectedpoints){var R=v.selectBatch[P]=o.selIndices2selPoints(I),F={};for(g=0;g<R.length;g++)F[R[g]]=1;var B=[];for(g=0;g<z;g++)F[g]||B.push(g);v.unselectBatch[P]=B}var N=L.xpx=new Array(z),j=L.ypx=new Array(z);for(g=0;g<z;g++)N[g]=x.c2p(O[g]),j[g]=_.c2p(D[g])}else L.xpx=L.ypx=null}if(S){if(v.select2d||(v.select2d=r(y._glcanvas.data()[1].regl)),v.scatter2d){var U=new Array(b);for(m=0;m<b;m++)U[m]=v.selectBatch[m].length||v.unselectBatch[m].length?v.markerUnselectedOptions[m]:{};v.scatter2d.update(U)}v.select2d&&(v.select2d.update(v.markerOptions),v.select2d.update(v.markerSelectedOptions)),v.glText&&d.forEach(function(t){var e=((t||[])[0]||{}).trace||{};u.hasText(e)&&h(t)})}else v.scatter2d&&v.scatter2d.update(v.markerOptions);var V={viewport:p(y,x,_,t._context.plotGlPixelRatio),range:[(x._rl||x.range)[0],(_._rl||_.range)[0],(x._rl||x.range)[1],(_._rl||_.range)[1]]},q=o.repeat(V,v.count);v.fill2d&&v.fill2d.update(q),v.line2d&&v.line2d.update(q),v.error2d&&v.error2d.update(q.concat(q)),v.scatter2d&&v.scatter2d.update(q),v.select2d&&v.select2d.update(q),v.glText&&v.glText.forEach(function(t){t.update(V)})}}}).reglPrecompiled=f}),Sx=f((t,e)=>{var r=wy();r.plot=Mx(),e.exports=r}),Ex=f((t,e)=>{e.exports=Sx()}),Cx=f((t,e)=>{var r=bn(),n=Ie(),i=Se().axisHoverFormat,a=Ot().hovertemplateAttrs,o=Yg(),s=ge().idRegex,l=me().templatedArray,u=D().extendFlat,c=r.marker,h=c.line,f=u(n("marker.line",{editTypeOverride:"calc"}),{width:u({},h.width,{editType:"calc"}),editType:"calc"}),p=u(n("marker"),{symbol:c.symbol,angle:c.angle,size:u({},c.size,{editType:"markerSize"}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:f,editType:"calc"});function d(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}p.color.editType=p.cmin.editType=p.cmax.editType="style",e.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:u({},o.text,{}),hovertext:u({},o.hovertext,{}),hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),marker:p,xaxes:d("x"),yaxes:d("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}}),Ix=f((t,e)=>{e.exports=function(t,e,r,n){var i,a;for(n||(n=1/0),i=0;i<e.length;i++)(a=e[i]).visible&&(n=Math.min(n,a[r].length));for(n===1/0&&(n=0),t._length=n,i=0;i<e.length;i++)(a=e[i]).visible&&(a._length=n);return n}}),Lx=f((t,e)=>{var r=oe(),n=Fe(),i=Cx(),a=Ze(),o=Gn(),s=Ix(),l=Xg().isOpenSymbol;function u(t,e){function n(n,a){return r.coerce(t,e,i.dimensions,n,a)}n("label");var a=n("values");a&&a.length?n("visible"):e.visible=!1,n("axis.type"),n("axis.matches")}e.exports=function(t,e,c,h){function f(n,a){return r.coerce(t,e,i,n,a)}var p=n(t,e,{name:"dimensions",handleItemDefaults:u}),d=f("diagonal.visible"),m=f("showupperhalf"),g=f("showlowerhalf");if(s(e,p,"values")&&(d||m||g)){f("text"),f("hovertext"),f("hovertemplate"),f("xhoverformat"),f("yhoverformat"),o(t,e,c,h,f,{noAngleRef:!0,noStandOff:!0});var y=l(e.marker.symbol),v=a.isBubble(e);f("marker.line.width",y||v?1:0),function(t,e,r,n){var i,a,o=e.dimensions,s=o.length,l=e.showupperhalf,u=e.showlowerhalf,c=e.diagonal.visible,h=new Array(s),f=new Array(s);for(i=0;i<s;i++){var p=i?i+1:"";h[i]="x"+p,f[i]="y"+p}var d=n("xaxes",h),m=n("yaxes",f),g=e._diag=new Array(s);e._xaxes={},e._yaxes={};var y=[],v=[];function x(t,n,i,a){if(t){var o=t.charAt(0),s=r._splomAxes[o];if(e["_"+o+"axes"][t]=1,a.push(t),!(t in s)){var l=s[t]={};i&&(l.label=i.label||"",i.visible&&i.axis&&(i.axis.type&&(l.type=i.axis.type),i.axis.matches&&(l.matches=n)))}}}var _=!c&&!u,b=!c&&!l;for(e._axesDim={},i=0;i<s;i++){var w=o[i],T=0===i,k=i===s-1,A=T&&_||k&&b?void 0:d[i],M=T&&b||k&&_?void 0:m[i];x(A,M,w,y),x(M,A,w,v),g[i]=[A,M],e._axesDim[A]=i,e._axesDim[M]=i}for(i=0;i<y.length;i++)for(a=0;a<v.length;a++){var S=y[i]+v[a];(i>a&&l||i<a&&u||i===a&&(c||!u||!l))&&(r._splomSubplots[S]=1)}(!u||!c&&l&&u)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,e,h,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}),Px=f((t,e)=>{var r=oe();e.exports=function(t,e){var n=t._fullLayout,i=e.uid,a=n._splomScenes;a||(a=n._splomScenes={});var o={dirty:!0,selectBatch:[],unselectBatch:[]},s=a[e.uid];return s||((s=a[i]=r.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||r.extendFlat(s,o),s}}),zx=f((t,e)=>{var r=oe(),n=ye(),i=ii().calcMarkerSize,a=ii().calcAxisExpansion,o=ei(),s=yy().markerSelection,l=yy().markerStyle,u=Px(),c=k().BADNUM,h=Wg().TOO_MANY_POINTS;e.exports=function(t,e){var f,p,d,m,g,y,v=e.dimensions,x=e._length,_={},b=_.cdata=[],w=_.data=[],T=e._visibleDims=[];function k(t,n){for(var i=t.makeCalcdata({v:n.values,vcalendar:e.calendar},"v"),a=0;a<i.length;a++)i[a]=i[a]===c?NaN:i[a];b.push(i),w.push("log"===t.type?r.simpleMap(i,t.c2l):i)}for(f=0;f<v.length;f++)if((d=v[f]).visible){if(m=n.getFromId(t,e._diag[f][0]),g=n.getFromId(t,e._diag[f][1]),m&&g&&m.type!==g.type){r.log("Skipping splom dimension "+f+" with conflicting axis types");continue}m?(k(m,d),g&&"category"===g.type&&(g._categories=m._categories.slice())):k(g,d),T.push(f)}for(o(t,e),r.extendFlat(_,l(t,e)),y=b.length*x>h?_.sizeAvg||Math.max(_.size,3):i(e,x),p=0;p<T.length;p++)d=v[f=T[p]],m=n.getFromId(t,e._diag[f][0])||{},g=n.getFromId(t,e._diag[f][1])||{},a(t,e,m,g,b[p],b[p],y);var A=u(t,e);return A.matrix||(A.matrix=!0),A.matrixOptions=_,A.selectedOptions=s(t,e,e.selected),A.unselectedOptions=s(t,e,e.unselected),[{x:!1,y:!1,t:{},trace:e}]}}),Ox=f((t,e)=>{(function(){var t,r,n,i,a,o;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-a)/1e6},r=process.hrtime,i=(t=function(){var t;return 1e9*(t=r())[0]+t[1]})(),o=1e9*process.uptime(),a=i-o):Date.now?(e.exports=function(){return Date.now()-n},n=Date.now()):(e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(t)}),Dx=f((t,e)=>{var r,n,i,a,o,s=Ox(),l=window,u=["moz","webkit"],c="AnimationFrame",h=l["request"+c],f=l["cancel"+c]||l["cancelRequest"+c];for(r=0;!h&&r<u.length;r++)h=l[u[r]+"Request"+c],f=l[u[r]+"Cancel"+c]||l[u[r]+"CancelRequest"+c];(!h||!f)&&(n=0,i=0,a=[],o=1e3/60,h=function(t){if(0===a.length){var e=s(),r=Math.max(0,o-(e-n));n=r+e,setTimeout(function(){var t=a.slice(0);a.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(n)}catch(t){setTimeout(function(){throw t},0)}},Math.round(r))}return a.push({handle:++i,callback:t,cancelled:!1}),i},f=function(t){for(var e=0;e<a.length;e++)a[e].handle===t&&(a[e].cancelled=!0)}),e.exports=function(t){return h.call(l,t)},e.exports.cancel=function(){f.apply(l,arguments)},e.exports.polyfill=function(t){t||(t=l),t.requestAnimationFrame=h,t.cancelAnimationFrame=f}}),Rx=f((t,e)=>{e.exports=function(t,e){var r="number"==typeof t,n="number"==typeof e;r&&!n?(e=t,t=0):!r&&!n&&(t=0,e=0);var i=(e|=0)-(t|=0);if(i<0)throw new Error("array length must be positive");for(var a=new Array(i),o=0,s=t;o<i;o++,s++)a[o]=s;return a}}),Fx=f((t,e)=>{var r=Cy(),n=Qg(),i=ey(),a=Dx(),o=Rx(),s=ty(),l=ny();function u(t,e){if(!(this instanceof u))return new u(t);this.traces=[],this.passes={},this.regl=t,this.scatter=r(t),this.canvas=this.scatter.canvas}function c(t,e,r){return(null!=t.id?t.id:t)<<16|(255&e)<<8|255&r}function h(t,e,r){let n,i,a,o,s=t[e],l=t[r];return s.length>2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x,s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y,l.height),[a,n,o,i]}function f(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];{let e=s(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}}e.exports=u,u.prototype.render=function(...t){return t.length&&this.update(...t),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,a(()=>{this.dirty=!1})),this)},u.prototype.update=function(...t){if(!t.length)return;for(let e=0;e<t.length;e++)this.updateItem(e,t[e]);this.traces=this.traces.filter(Boolean);let e=[],r=0;for(let t=0;t<this.traces.length;t++){let n=this.traces[t],i=this.traces[t].passes;for(let t=0;t<i.length;t++)e.push(this.passes[i[t]]);n.passOffset=r,r+=n.passes.length}return this.scatter.update(...e),this},u.prototype.updateItem=function(t,e){let{regl:r}=this;if(null===e)return this.traces[t]=null,this;if(!e)return this;let a,o=n(e,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),u=this.traces[t]||(this.traces[t]={id:t,buffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:s([r._gl.drawingBufferWidth,r._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(null!=o.color&&(u.color=o.color),null!=o.size&&(u.size=o.size),null!=o.marker&&(u.marker=o.marker),null!=o.borderColor&&(u.borderColor=o.borderColor),null!=o.borderSize&&(u.borderSize=o.borderSize),null!=o.opacity&&(u.opacity=o.opacity),o.viewport&&(u.viewport=s(o.viewport)),null!=o.diagonal&&(u.diagonal=o.diagonal),null!=o.upper&&(u.upper=o.upper),null!=o.lower&&(u.lower=o.lower),o.data){u.buffer(l(o.data)),u.columns=o.data.length,u.count=o.data[0].length,u.bounds=[];for(let t=0;t<u.columns;t++)u.bounds[t]=i(o.data[t],1)}o.range&&(u.range=o.range,a=u.range&&"number"!=typeof u.range[0]),o.domain&&(u.domain=o.domain);let p=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===u.columns&&"number"==typeof o.padding[o.padding.length-1]?(u.padding=o.padding.map(f),p=!0):u.padding=f(o.padding));let d=u.columns,m=u.count,g=u.viewport.width,y=u.viewport.height,v=u.viewport.x,x=u.viewport.y,_=g/d,b=y/d;u.passes=[];for(let t=0;t<d;t++)for(let e=0;e<d;e++){if(!u.diagonal&&e===t||!u.upper&&t>e||!u.lower&&t<e)continue;let r=c(u.id,t,e),n=this.passes[r]||(this.passes[r]={});if(o.data&&(o.transpose?n.positions={x:{buffer:u.buffer,offset:e,count:m,stride:d},y:{buffer:u.buffer,offset:t,count:m,stride:d}}:n.positions={x:{buffer:u.buffer,offset:e*m,count:m},y:{buffer:u.buffer,offset:t*m,count:m}},n.bounds=h(u.bounds,t,e)),o.domain||o.viewport||o.data){let r=p?h(u.padding,t,e):u.padding;if(u.domain){let[i,a,o,s]=h(u.domain,t,e);n.viewport=[v+i*g+r[0],x+a*y+r[1],v+o*g-r[2],x+s*y-r[3]]}else n.viewport=[v+e*_+_*r[0],x+t*b+b*r[1],v+(e+1)*_-_*r[2],x+(t+1)*b-b*r[3]]}o.color&&(n.color=u.color),o.size&&(n.size=u.size),o.marker&&(n.marker=u.marker),o.borderSize&&(n.borderSize=u.borderSize),o.borderColor&&(n.borderColor=u.borderColor),o.opacity&&(n.opacity=u.opacity),o.range&&(n.range=a?h(u.range,t,e):u.range||n.bounds),u.passes.push(r)}return this},u.prototype.draw=function(...t){if(t.length){let e=[];for(let r=0;r<t.length;r++)if("number"==typeof t[r]){let{passes:n,passOffset:i}=this.traces[t[r]];e.push(...o(i,i+n.length))}else if(t[r].length){let n=t[r],{passes:i,passOffset:a}=this.traces[r];i=i.map((t,r)=>{e[a+r]=n})}this.scatter.draw(...e)}else this.scatter.draw();return this},u.prototype.destroy=function(){return this.traces.forEach(t=>{t.buffer&&t.buffer.destroy&&t.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this}}),Bx=f((t,e)=>{var r=Fx(),n=oe(),i=ye(),a=zr().selectMode;function o(t,e){var o,s,l,u,c,h=t._fullLayout,f=h._size,p=e.trace,d=e.t,m=h._splomScenes[p.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=p.showupperhalf,g.upper=p.showlowerhalf,g.diagonal=p.diagonal.visible;var _=p._visibleDims,b=y.length,w=m.viewOpts={};for(w.ranges=new Array(b),w.domains=new Array(b),c=0;c<_.length;c++){l=_[c];var T=w.ranges[c]=new Array(4),k=w.domains[c]=new Array(4);(o=i.getFromId(t,p._diag[l][0]))&&(T[0]=o._rl[0],T[2]=o._rl[1],k[0]=o.domain[0],k[2]=o.domain[1]),(s=i.getFromId(t,p._diag[l][1]))&&(T[1]=s._rl[0],T[3]=s._rl[1],k[1]=s.domain[0],k[3]=s.domain[1])}var A=t._context.plotGlPixelRatio,M=f.l*A,S=f.b*A,E=f.w*A,C=f.h*A;w.viewport=[M,S,E+M,C+S],!0===m.matrix&&(m.matrix=r(v));var I=h.clickmode.indexOf("select")>-1,L=!0;if(a(x)||p.selectedpoints||I){var P=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var z=p.selectedpoints,O={};for(l=0;l<z.length;l++)O[z[l]]=!0;var D=[];for(l=0;l<P;l++)O[l]||D.push(l);m.unselectBatch=D}var R=d.xpx=new Array(b),F=d.ypx=new Array(b);for(c=0;c<_.length;c++){if(l=_[c],o=i.getFromId(t,p._diag[l][0]))for(R[c]=new Array(P),u=0;u<P;u++)R[c][u]=o.c2p(y[c][u]);if(s=i.getFromId(t,p._diag[l][1]))for(F[c]=new Array(P),u=0;u<P;u++)F[c][u]=s.c2p(y[c][u])}if(m.selectBatch.length||m.unselectBatch.length){var B=n.extendFlat({},g,m.unselectedOptions,w),N=n.extendFlat({},g,m.selectedOptions,w);m.matrix.update(B,N),L=!1}}else d.xpx=d.ypx=null;if(L){var j=n.extendFlat({},g,w);m.matrix.update(j,null)}}}e.exports=function(t,e,r){if(r.length)for(var n=0;n<r.length;n++)o(t,r[n][0])}}),Nx=f(t=>{t.getDimIndex=function(t,e){for(var r=e._id,n={x:0,y:1}[r.charAt(0)],i=t._visibleDims,a=0;a<i.length;a++){var o=i[a];if(t._diag[o][n]===r)return a}return!1}}),jx=f((t,e)=>{var r=Nx(),n=Zg().calcHover,i=rr().getFromId,a=D().extendFlat;function o(t,e,i,a){var o=t.cd[0].trace,s=t.scene.matrixOptions.cdata,l=t.xa,u=t.ya,c=l.c2p(e),h=u.c2p(i),f=t.distance,p=r.getDimIndex(o,l),d=r.getDimIndex(o,u);if(!1===p||!1===d)return[t];for(var m,g,y=s[p],v=s[d],x=f,_=0;_<y.length;_++)if(!a||_===t.index){var b=y[_],w=v[_],T=l.c2p(b)-c,k=u.c2p(w)-h,A=Math.sqrt(T*T+k*k);(a||A<x)&&(x=g=A,m=_)}return t.index=m,t.distance=x,t.dxy=g,void 0===m?[t]:[n(t,y,v,o)]}e.exports={hoverPoints:function(t,e,r,n,s){s||(s={});var l="x"===(n||"").charAt(0),u="y"===(n||"").charAt(0),c=o(t,e,r);if((l||u)&&"axis"===s.hoversubplots&&c[0])for(var h=(l?t.xa:t.ya)._subplotsWith,f=s.gd,p=a({},t),d=0;d<h.length;d++){var m=h[d];if(m!==t.xa._id+t.ya._id){u?p.xa=i(f,m,"x"):p.ya=i(f,m,"y");var g=o(p,e,r,l||u);c=c.concat(g)}}return c}}}),Ux=f((t,e)=>{var r=oe(),n=r.pushUnique,i=Ze(),a=Nx();e.exports=function(t,e){var o=t.cd,s=o[0].trace,l=o[0].t,u=t.scene,c=u.matrixOptions.cdata,h=t.xaxis,f=t.yaxis,p=[];if(!u)return p;var d=!i.hasMarkers(s)&&!i.hasText(s);if(!0!==s.visible||d)return p;var m=a.getDimIndex(s,h),g=a.getDimIndex(s,f);if(!1===m||!1===g)return p;var y=l.xpx[m],v=l.ypx[g],x=c[m],_=c[g],b=(t.scene.selectBatch||[]).slice(),w=[];if(!1!==e&&!e.degenerate)for(var T=0;T<x.length;T++)e.contains([y[T],v[T]],null,T,t)?(p.push({pointNumber:T,x:x[T],y:_[T]}),n(b,T)):-1!==b.indexOf(T)?n(b,T):w.push(T);var k=u.matrixOptions;return b.length||w.length?!u.selectBatch.length&&!u.unselectBatch.length&&u.matrix.update(u.unselectedOptions,r.extendFlat({},k,u.selectedOptions,u.viewOpts)):u.matrix.update(k,null),u.selectBatch=b,u.unselectBatch=w,p}}),Vx=f((t,e)=>{var r=oe(),n=ei(),i=yy().markerStyle;e.exports=function(t,e){var a=e.trace,o=t._fullLayout._splomScenes[a.uid];if(o){n(t,a),r.extendFlat(o.matrixOptions,i(t,a));var s=r.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}}),qx=f((t,e)=>{var r=Ut(),n=Ta();e.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:Cx(),supplyDefaults:Lx(),colorbar:hi(),calc:zx(),plot:Bx(),hoverPoints:jx().hoverPoints,selectPoints:Ux(),editStyle:Vx(),meta:{}},r.register(n)}),Hx=f((t,e)=>{var r=Jv(),n=Ut(),i=Ax(),a=_e().getModuleCalcData,o=Ai(),s=ye().getFromId,l=rr().shouldShowZeroLine,u="splom",c={};function h(t,e,r){for(var n=r.matrixOptions.data.length,i=e._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;o<i.length;o++){var l=i[o],u=a[o]=new Array(4),c=s(t,e._diag[l][0]);c&&(u[0]=c.r2l(c.range[0]),u[2]=c.r2l(c.range[1]));var h=s(t,e._diag[l][1]);h&&(u[1]=h.r2l(h.range[0]),u[3]=h.r2l(h.range[1]))}r.selectBatch.length||r.unselectBatch.length?r.matrix.update({ranges:a},{ranges:a}):r.matrix.update({ranges:a})}function f(t){var e=t._fullLayout,n=e._glcanvas.data()[0].regl,i=e._splomGrid;i||(i=e._splomGrid=r(n)),i.update(function(t){var e,r=t._context.plotGlPixelRatio,n=t._fullLayout,i=n._size,a=[0,0,n.width*r,n.height*r],o={};function s(t,e,n,i,s,l){n*=r,i*=r,s*=r,l*=r;var u=e[t+"color"],c=e[t+"width"],h=String(u+c);h in o?o[h].data.push(NaN,NaN,n,i,s,l):o[h]={data:[n,i,s,l],join:"rect",thickness:c*r,color:u,viewport:a,range:a,overlay:!1}}for(e in n._splomSubplots){var u,c,h=n._plots[e],f=h.xaxis,p=h.yaxis,d=f._gridVals,m=p._gridVals,g=f._offset,y=f._length,v=p._length,x=i.b+p.domain[0]*i.h,_=-p._m,b=-_*p.r2l(p.range[0],p.calendar);if(f.showgrid)for(e=0;e<d.length;e++)u=g+f.l2p(d[e].x),s("grid",f,u,x,u,x+v);if(p.showgrid)for(e=0;e<m.length;e++)s("grid",p,g,c=x+b+_*m[e].x,g+y,c);l(t,f,p)&&(u=g+f.l2p(0),s("zeroline",f,u,x,u,x+v)),l(t,p,f)&&s("zeroline",p,g,c=x+b+0,g+y,c)}var w=[];for(e in o)w.push(o[e]);return w}(t))}e.exports={name:u,attr:o.attr,attrRegex:o.attrRegex,layoutAttributes:o.layoutAttributes,supplyLayoutDefaults:o.supplyLayoutDefaults,drawFramework:o.drawFramework,plot:function(t){var e=t._fullLayout,r=n.getModule(u),o=a(t.calcdata,r)[0];i(t,["ANGLE_instanced_arrays","OES_element_index_uint"],c)&&(e._hasOnlyLargeSploms&&f(t),r.plot(t,{},o))},drag:function(t){var e=t.calcdata,r=t._fullLayout;r._hasOnlyLargeSploms&&f(t);for(var n=0;n<e.length;n++){var i=e[n][0].trace,a=r._splomScenes[i.uid];"splom"===i.type&&a&&a.matrix&&h(t,i,a)}},updateGrid:f,clean:function(t,e,r,n){var i,a={};if(n._splomScenes){for(i=0;i<t.length;i++){var s=t[i];"splom"===s.type&&(a[s.uid]=1)}for(i=0;i<r.length;i++){var l=r[i];if(!a[l.uid]){var u=n._splomScenes[l.uid];u&&u.destroy&&u.destroy(),n._splomScenes[l.uid]=null,delete n._splomScenes[l.uid]}}}0===Object.keys(n._splomScenes||{}).length&&delete n._splomScenes,n._splomGrid&&!e._hasOnlyLargeSploms&&n._hasOnlyLargeSploms&&(n._splomGrid.destroy(),n._splomGrid=null,delete n._splomGrid),o.clean(t,e,r,n)},updateFx:o.updateFx,toSVG:o.toSVG,reglPrecompiled:c}}),Gx=f((t,e)=>{var r=qx();r.basePlotModule=Hx(),e.exports=r}),Zx=f((t,e)=>{e.exports=Gx()}),Wx=f((t,e)=>{var r=Ie(),n=Ee(),i=R(),a=wa().attributes,o=D().extendFlat,s=me().templatedArray;e.exports={domain:a({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({autoShadowDflt:!0,editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:s("dimension",{label:{valType:"string",editType:"plot"},tickvals:o({},n.tickvals,{editType:"plot"}),ticktext:o({},n.ticktext,{editType:"plot"}),tickformat:o({},n.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:o({editType:"calc"},r("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),Yx=f((t,e)=>{e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}),Xx=f((t,e)=>{var r=qt();function n(t){return[t]}e.exports={keyFun:function(t){return t.key},repeat:n,descend:r,wrap:n,unwrap:function(t){return t[0]}}}),$x=f((t,e)=>{var r=Yx(),n=v(),i=Xx().keyFun,a=Xx().repeat,o=oe().sorterAsc,s=oe().strTranslate,l=r.bar.snapRatio;function u(t,e){return t*(1-l)+e*l}var c=r.bar.snapClose;function h(t,e){return t*(1-c)+e*c}function f(t,e,r,n){if(function(t,e){for(var r=0;r<e.length;r++)if(t>=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*f<i*o;f+=i){var p=f+i,d=e[p];if(i*r<i*h(l,d))return u(l,c);if(i*r<i*d||p===o)return u(d,l);c=l,l=d}}function p(t){t.attr("x",-r.bar.captureWidth/2).attr("width",r.bar.captureWidth)}function d(t){t.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(t){if(!t.brush.filterSpecified)return"0,"+t.height;for(var e,r,n,i=g(t.brush.filter.getConsolidated(),t.height),a=[0],o=i.length?i[0][0]:null,s=0;s<i.length;s++)r=(e=i[s])[1]-e[0],a.push(o),a.push(r),(n=s+1)<i.length&&(o=i[n][0]-e[1]);return a.push(t.height),a}function g(t,e){return t.map(function(t){return t.map(function(t){return Math.max(0,t*e)}).sort(o)})}function y(){n.select(document.body).style("cursor",null)}function x(t){t.attr("stroke-dasharray",m)}function _(t,e){var i=n.select(t).selectAll(".highlight, .highlight-shadow");x(e?i.transition().duration(r.bar.snapDuration).each("end",e):i)}function b(t,e){var n,i=t.brush,a=NaN,o={};if(i.filterSpecified){var s=t.height,l=i.filter.getConsolidated(),u=g(l,s),c=NaN,h=NaN,f=NaN;for(n=0;n<=u.length;n++){var p=u[n];if(p&&p[0]<=e&&e<=p[1]){c=n;break}if(h=n?n-1:NaN,p&&p[0]>e){f=n;break}}if(a=c,isNaN(a)&&(a=isNaN(h)||isNaN(f)?isNaN(h)?f:h:e-u[h][1]<u[f][0]-e?h:f),!isNaN(a)){var d=u[a],m=function(t,e){var n=r.bar.handleHeight;if(!(e>t[1]+n||e<t[0]-n))return e>=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var y=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(n=0;n<y.length;n++){var x=[.25*y[Math.max(n-1,0)]+.75*y[n],.25*y[Math.min(n+1,y.length-1)]+.75*y[n]];if(v>=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(i)].sort(o),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),_(t.parentNode)}function T(t,e){var i=b(e,e.height-n.mouse(t)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",function(t){n.event.preventDefault(),t.parent.inBrushDrag||T(this,t)}).on("mouseleave",function(t){t.parent.inBrushDrag||y()}).call(n.behavior.drag().on("dragstart",function(t){!function(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.unitToPaddedPx.invert(i),o=e.brush,s=b(e,i),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=i-c[0]-r.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter(function(t){return t[0]!==l[0]&&t[1]!==l[1]})),u.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)}).on("drag",function(t){w(this,t)}).on("dragend",function(t){!function(t,e){var r=e.brush,i=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),_(t.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]<l[0]&&l.reverse(),a.newExtent=[f(0,l,a.newExtent[0],a.stayingIntervals),f(1,l,a.newExtent[1],a.stayingIntervals)];var u=a.newExtent[1]>a.newExtent[0];a.extent=a.stayingIntervals.concat(u?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),u?_(t.parentNode,s):(s(),_(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,t)}))}function A(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){return function(e){var r=e.brush,n=function(t){return t.svgBrush.extent.map(function(t){return t.slice()})}(r),i=n.slice();r.filter.set(i),t()}}function E(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var s=function(){var t,e,r=[];return{set:function(n){1===(r=n.map(function(t){return t.slice().sort(o)}).sort(A)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=E(r),e=r.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return s.set(r),{filter:s,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:S(i),brushEndCallback:a}}},ensureAxisBrush:function(t,e,n){var o=t.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(t,e,n){var i=n._context.staticPlot,o=t.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(k).attr("height",function(t){return t.height-r.verticalPadding});var l=t.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",e).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",function(t){return t.height}).call(x);var u=t.selectAll(".highlight").data(a);u.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),u.attr("y1",function(t){return t.height}).call(x)}(o,e,n)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map(function(t){return t.sort(o)}),t=e.multiselect?E(t.sort(A)):[t[0]]):t=[t.sort(o)],e.tickvals){var r=e.tickvals.slice().sort(o);if(!(t=t.map(function(t){var e=[f(0,r,t[0],[]),f(1,r,t[1],[])];if(e[1]>e[0])return e}).filter(function(t){return t})).length)return}return t.length>1?t:t[0]}}}),Jx=f((t,e)=>{var r=oe(),n=Me().hasColorscale,i=Ue(),a=wa().defaults,o=Fe(),s=rr(),l=Wx(),u=$x(),c=Yx().maxDimensionCount,h=Ix();function f(t,e,n,i){function a(n,i){return r.coerce(t,e,l.dimensions,n,i)}var o=a("values"),c=a("visible");if(o&&o.length||(c=e.visible=!1),c){a("label"),a("tickvals"),a("ticktext"),a("tickformat");var h=a("range");e._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(e._ax,i.layout),a("multiselect");var f=a("constraintrange");f&&(e.constraintrange=u.cleanRanges(f,e))}}e.exports=function(t,e,s,u){function p(n,i){return r.coerce(t,e,l,n,i)}var d=t.dimensions;Array.isArray(d)&&d.length>c&&(r.log("parcoords traces support up to "+c+" dimensions at the moment"),d.splice(c));var m=o(t,e,{name:"dimensions",layout:u,handleItemDefaults:f}),g=function(t,e,a,o,s){var l=s("line.color",a);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,s,u,p);a(e,u,p),(!Array.isArray(m)||!m.length)&&(e.visible=!1),h(e,m,"values",g);var y=r.extendFlat({},u.font,{size:Math.round(u.font.size/1.2)});r.coerceFont(p,"labelfont",y),r.coerceFont(p,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(p,"rangefont",y),p("labelangle"),p("labelside"),p("unselected.line.color"),p("unselected.line.opacity")}}),Kx=f((t,e)=>{var r=oe().isArrayOrTypedArray,n=Ge(),i=Xx().wrap;e.exports=function(t,e){var a,o;return n.hasColorscale(e,"line")&&r(e.line.color)?(a=e.line.color,o=n.extractOpts(e.line).colorscale,n.calc(t,e,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=.5;return e}(e._length),o=[[0,e.line.color],[1,e.line.color]]),i({lineColor:a,cscale:o})}});function Qx(t){var e,r,n,i,a=[],o=1;if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if(t=String(t).toLowerCase(),t_.default[t])a=t_.default[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if("#"===t[0]){var s=t.slice(1),l=s.length;o=1,l<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var u=n[1],c="cmyk"===(i=u.replace(/a$/,""))?4:"gray"===i?1:3;a=n[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=a.shift()),o=(a=a.map(function(t,e){if("%"===t[t.length-1])return t=parseFloat(t)/100,3===e?t:"rgb"===i?255*t:"h"===i[0]||"l"===i[0]&&!e?100*t:"lab"===i?125*t:"lch"===i?e<2?150*t:360*t:"o"!==i[0]||e?"oklab"===i?.4*t:"oklch"===i?e<2?.4*t:360*t:t:t;if("h"===i[e]||2===e&&"h"===i[i.length-1]){if(void 0!==r_[t])return r_[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return 360*parseFloat(t);if(t.endsWith("grad"))return 360*parseFloat(t)/400;if(t.endsWith("rad"))return 180*parseFloat(t)/Math.PI}return"none"===t?0:parseFloat(t)})).length>c?a.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(a=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),i=(null==(r=null==(e=t.match(/([a-z])/gi))?void 0:e.join(""))?void 0:r.toLowerCase())||"rgb");return{space:i,values:a,alpha:o}}var t_,e_,r_,n_,i_,a_=h(()=>{var r,n;r=Yd(),n=null!=r?t(s(r)):{},t_=d(e(n,"default",{value:r,enumerable:!0}),r),e_=Qx,r_={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),o_=h(()=>{n_={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),s_=h(()=>{o_(),i_={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];u<3;)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u++]=255*a;return i}},n_.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}),l_={};function u_(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,r=e_(t);if(!r.space)return[];let n="h"===r.space[0]?i_.min:n_.min,i="h"===r.space[0]?i_.max:n_.max;return(e=Array(3))[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),e[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),e[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),"h"===r.space[0]&&(e=i_.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}p(l_,{default:()=>u_});var c_=h(()=>{a_(),o_(),s_()}),h_=f(t=>{var e=oe().isTypedArray;t.convertTypedArray=function(t){return e(t)?Array.prototype.slice.call(t):t},t.isOrdinal=function(t){return!!t.tickvals},t.isVisible=function(t){return t.visible||!("visible"in t)}}),f_=f((t,e)=>{var r=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=Yx().maxDimensionCount,a=oe(),o=1e-6,s=2048,l=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function f(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),!r.clearOnly&&(a.count=2*u,a.offset=2*l*n,e(a),l*n+u<i&&(r.currentRafs[o]=window.requestAnimationFrame(function(){s(l+1)})),r.drawCompleted=!1)}(0)}function p(t){return Math.max(o,Math.min(1-o,t))}function d(t,e){for(var r=new Array(256),n=0;n<256;n++)r[n]=t(n/255).concat(e);return r}function m(t,e){return(t>>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),i=0,a=0;a<e;a++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var l=4*t+s,u=r[64*a+l];63===l&&0===o&&(u*=-1),n[i++]=u}return n}function y(t){var e="0"+t;return e.substr(e.length-2)}function v(t){return t<i?"p"+y(t+1)+"_"+y(t+4):"colors"}function x(t,e,r,n,i,o,s,l,u,c,h,f,p,d){for(var m=[[],[]],g=0;g<64;g++)m[0][g]=g===i?1:0,m[1][g]=g===o?1:0;s*=d,l*=d,u*=d,c*=d;var y=t.lines.canvasOverdrag*d,v=t.domain,x=t.canvasWidth*d,_=t.canvasHeight*d,b=t.pad.l*d,w=t.pad.b*d,T=t.layoutHeight*d,k=t.layoutWidth*d,A=t.deselectedLines.color,M=t.deselectedLines.opacity;return a.extendFlat({key:h,resolution:[x,_],viewBoxPos:[s+y,l],viewBoxSize:[u,c],i0:i,i1:o,dim0A:m[0].slice(0,16),dim0B:m[0].slice(16,32),dim0C:m[0].slice(32,48),dim0D:m[0].slice(48,64),dim1A:m[1].slice(0,16),dim1B:m[1].slice(16,32),dim1C:m[1].slice(32,48),dim1D:m[1].slice(48,64),drwLayer:f,contextColor:[A[0]/255,A[1]/255,A[2]/255,"auto"!==M?A[3]*M:Math.max(1/255,Math.pow(1/t.lines.color.length,1/3))],scissorX:(n===e?0:s+y)+(b-y)+k*v.x[0],scissorWidth:(n===r?x-s+y:u+.5)+(n===e?s+y:0),scissorY:l+w+T*v.y[0],scissorHeight:c,viewportX:b-y+k*v.x[0],viewportY:w+T*v.y[0],viewportWidth:x,viewportHeight:_},p)}function _(t){var e=2047,r=Math.max(0,Math.floor(t[0]*e),0),n=Math.min(e,Math.ceil(t[1]*e),e);return[Math.min(r,n),Math.max(r,n)]}e.exports=function(t,e){var o,l,y,b,w,T=e.context,k=e.pick,A=e.regl,M=A._gl,S=M.getParameter(M.ALIASED_LINE_WIDTH_RANGE),E=Math.max(S[0],Math.min(S[1],e.viewModel.plotGlPixelRatio)),C={currentRafs:{},drawCompleted:!0,clearOnly:!1},I=function(t){for(var e={},r=0;r<=i;r+=4)e[v(r)]=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return e}(A),L=A.texture(c),P=[];O(e);var z=A({profile:!1,blend:{enable:T,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!T,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:A.prop("scissorX"),y:A.prop("scissorY"),width:A.prop("scissorWidth"),height:A.prop("scissorHeight")}},viewport:{x:A.prop("viewportX"),y:A.prop("viewportY"),width:A.prop("viewportWidth"),height:A.prop("viewportHeight")},dither:!1,vert:r,frag:n,primitive:"lines",lineWidth:E,attributes:I,uniforms:{resolution:A.prop("resolution"),viewBoxPos:A.prop("viewBoxPos"),viewBoxSize:A.prop("viewBoxSize"),dim0A:A.prop("dim0A"),dim1A:A.prop("dim1A"),dim0B:A.prop("dim0B"),dim1B:A.prop("dim1B"),dim0C:A.prop("dim0C"),dim1C:A.prop("dim1C"),dim0D:A.prop("dim0D"),dim1D:A.prop("dim1D"),loA:A.prop("loA"),hiA:A.prop("hiA"),loB:A.prop("loB"),hiB:A.prop("hiB"),loC:A.prop("loC"),hiC:A.prop("hiC"),loD:A.prop("loD"),hiD:A.prop("hiD"),palette:L,contextColor:A.prop("contextColor"),maskTexture:A.prop("maskTexture"),drwLayer:A.prop("drwLayer"),maskHeight:A.prop("maskHeight")},offset:A.prop("offset"),count:A.prop("count")});function O(t){o=t.model,l=t.viewModel,y=l.dimensions.slice(),b=y[0]?y[0].values.length:0;var e=o.lines,r=k?e.color.map(function(t,r){return r/e.color.length}):e.color,n=function(t,e,r){for(var n=new Array(t*(i+4)),a=0,o=0;o<t;o++){for(var s=0;s<i;s++)n[a++]=s<e.length?e[s].paddedUnitValues[o]:.5;n[a++]=m(o,2),n[a++]=m(o,1),n[a++]=m(o,0),n[a++]=p(r[o])}return n}(b,y,r);(function(t,e,r){for(var n=0;n<=i;n+=4)t[v(n)](g(n/4,e,r))})(I,b,n),!T&&!k&&(L=A.texture(a.extendFlat({data:d(o.unitToColor,255)},c)))}return{render:function(t,e,r){var n,i,a,l=t.length,u=1/0,c=-1/0;for(n=0;n<l;n++)t[n].dim0.canvasX<u&&(u=t[n].dim0.canvasX,i=n),t[n].dim1.canvasX>c&&(c=t[n].dim1.canvasX,a=n);0===l&&h(A,0,0,o.canvasWidth,o.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&n<y.length?y[n].brush.filter.getBounds():[-1/0,1/0];i[0][n]=a[0],i[1][n]=a[1]}var o=8*s,l=new Array(o);for(e=0;e<o;e++)l[e]=255;if(!t)for(e=0;e<y.length;e++){var u=e%8,c=(e-u)/8,h=Math.pow(2,u),f=y[e].brush.filter.get();if(!(f.length<2)){var p=_(f[0])[1];for(r=1;r<f.length;r++){var d=_(f[r]);for(n=p+1;n<d[0];n++)l[8*n+c]&=~h;p=Math.max(p,d[1])}}}var m={shape:[8,s],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:l};return w?w(m):w=A.texture(m),{maskTexture:w,maskHeight:s,loA:i[0].slice(0,16),loB:i[0].slice(16,32),loC:i[0].slice(32,48),loD:i[0].slice(48,64),hiA:i[1].slice(0,16),hiB:i[1].slice(16,32),hiC:i[1].slice(32,48),hiD:i[1].slice(48,64)}}(T);for(n=0;n<l;n++){var d=t[n],m=d.dim0.crossfilterDimensionIndex,g=d.dim1.crossfilterDimensionIndex,v=d.canvasX,M=d.canvasY,S=v+d.panelSizeX,E=d.plotGlPixelRatio;if(e||!P[m]||P[m][0]!==v||P[m][1]!==S){P[m]=[v,S];var I=x(o,i,a,n,m,g,v,M,d.panelSizeX,d.panelSizeY,d.dim0.crossfilterDimensionIndex,T?0:k?2:1,p,E);C.clearOnly=r;var L=e?o.lines.blockLineCount:b;f(A,z,C,L,b,I)}}},readPixel:function(t,e){return A.read({x:t,y:e,width:1,height:1,data:u}),u},readPixels:function(t,e,r,n){var i=new Uint8Array(4*r*n);return A.read({x:t,y:e,width:r,height:n,data:i}),i},destroy:function(){for(var e in t.style["pointer-events"]="none",L.destroy(),w&&w.destroy(),I)I[e].destroy()},update:O}}}),p_=f((t,e)=>{var r=v(),n=oe(),i=n.isArrayOrTypedArray,a=n.numberFormat,o=(c_(),m(l_)).default,s=rr(),l=n.strRotate,u=n.strTranslate,c=Ae(),h=Je(),f=Ge(),p=Xx(),d=p.keyFun,g=p.repeat,y=p.unwrap,x=h_(),_=Yx(),b=$x(),w=f_();function T(t,e,r){return n.aggNums(t,null,e,r)}function k(t,e){return M(T(Math.min,t,e),T(Math.max,t,e))}function A(t){var e=t.range;return e?M(e[0],e[1]):k(t.values,t._length)}function M(t,e){return(isNaN(t)||!isFinite(t))&&(t=0),(isNaN(e)||!isFinite(e))&&(e=0),t===e&&(0===t?(t-=1,e+=1):(t*=.9,e*=1.1)),[t,e]}function S(t,e,n,i,o){var s=A(n);return i?r.scale.ordinal().domain(i.map(function(t,e){return e?function(r,n){var i=e[n];return null==i?t(r):i}:t}(a(n.tickformat),o))).range(i.map(function(r){var n=(r-s[0])/(s[1]-s[0]);return t-e+n*(2*e-t)})):r.scale.linear().domain(s).range([t-e,e])}function E(t){if(t.tickvals){var e=A(t);return r.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}}function C(t){var e=t.map(function(t){return t[0]}),n=t.map(function(t){var e=o(t[1]);return r.rgb("rgb("+e[0]+","+e[1]+","+e[2]+")")}),i="rgb".split("").map(function(t){return r.scale.linear().clamp(!0).domain(e).range(n.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return i.map(function(e){return e(t)})}}function I(t){return t.dimensions.some(function(t){return t.brush.filterSpecified})}function L(t,e,i){var a=y(e),s=a.trace,l=x.convertTypedArray(a.lineColor),u=s.line,c={color:o(s.unselected.line.color),opacity:s.unselected.line.opacity},h=f.extractOpts(u),p=h.reversescale?f.flipScale(a.cscale):a.cscale,d=s.domain,m=s.dimensions,g=t.width,v=s.labelangle,b=s.labelside,w=s.labelfont,T=s.tickfont,k=s.rangefont,M=n.extendDeepNoArrays({},u,{color:l.map(r.scale.linear().domain(A({values:l,range:[h.min,h.max],_length:s._length}))),blockLineCount:_.blockLineCount,canvasOverdrag:_.overdrag*_.canvasPixelRatio}),S=Math.floor(g*(d.x[1]-d.x[0])),E=Math.floor(t.height*(d.y[1]-d.y[0])),I=t.margin||{l:80,r:80,t:100,b:80},L=S,P=E;return{key:i,colCount:m.filter(x.isVisible).length,dimensions:m,tickDistance:_.tickDistance,unitToColor:C(p),lines:M,deselectedLines:c,labelAngle:v,labelSide:b,labelFont:w,tickFont:T,rangeFont:k,layoutWidth:g,layoutHeight:t.height,domain:d,translateX:d.x[0]*g,translateY:t.height-d.y[1]*t.height,pad:I,canvasWidth:L*_.canvasPixelRatio+2*M.canvasOverdrag,canvasHeight:P*_.canvasPixelRatio,width:L,height:P,canvasPixelRatio:_.canvasPixelRatio}}function P(t,e,o){var s=o.width,l=o.height,u=o.dimensions,c=o.canvasPixelRatio,h=function(t){return s*t/Math.max(1,o.colCount-1)},f=_.verticalPadding/l,p=function(t,e){return r.scale.linear().range([e,t-e])}(l,_.verticalPadding),d={key:o.key,xScale:h,model:o,inBrushDrag:!1},m={};return d.dimensions=u.filter(x.isVisible).map(function(s,u){var g=function(t,e){return r.scale.linear().domain(A(t)).range([e,1-e])}(s,f),y=m[s.label];m[s.label]=(y||0)+1;var v=s.label+(y?"__"+y:""),w=s.constraintrange,T=w&&w.length;T&&!i(w[0])&&(w=[w]);var k=T?w.map(function(t){return t.map(g)}):[[-1/0,1/0]],M=s.values;M.length>s._length&&(M=M.slice(0,s._length));var C,L=s.tickvals;function P(t,e){return{val:t,text:C[e]}}function z(t,e){return t.val-e.val}if(i(L)&&L.length){n.isTypedArray(L)&&(L=Array.from(L)),C=s.ticktext,i(C)&&C.length?C.length>L.length?C=C.slice(0,L.length):L.length>C.length&&(L=L.slice(0,C.length)):C=L.map(a(s.tickformat));for(var O=1;O<L.length;O++)if(L[O]<L[O-1]){for(var D=L.map(P).sort(z),R=0;R<L.length;R++)L[R]=D[R].val,C[R]=D[R].text;break}}else L=void 0;return M=x.convertTypedArray(M),{key:v,label:s.label,tickFormat:s.tickformat,tickvals:L,ticktext:C,ordinal:x.isOrdinal(s),multiselect:s.multiselect,xIndex:u,crossfilterDimensionIndex:u,visibleIndex:s._index,height:l,values:M,paddedUnitValues:M.map(g),unitTickvals:L&&L.map(g),xScale:h,x:h(u),canvasX:h(u)*c,unitToPaddedPx:p,domainScale:S(l,_.verticalPadding,s,L,C),ordinalScale:E(s),parent:d,model:o,brush:b.makeBrush(t,T,k,function(){t.linePickActive(!1)},function(){var e=d;e.focusLayer&&e.focusLayer.render(e.panels,!0);var r=I(e);!t.contextShown()&&r?(e.contextLayer&&e.contextLayer.render(e.panels,!0),t.contextShown(!0)):t.contextShown()&&!r&&(e.contextLayer&&e.contextLayer.render(e.panels,!0,!0),t.contextShown(!1))},function(r){if(d.focusLayer.render(d.panels,!0),d.pickLayer&&d.pickLayer.render(d.panels,!0),t.linePickActive(!0),e&&e.filterChanged){var i=g.invert,a=r.map(function(t){return t.map(i).sort(n.sorterAsc)}).sort(function(t,e){return t[0]-e[0]});e.filterChanged(d.key,s._index,a)}})}}),d}function z(t){t.classed(_.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function O(t,e){var r="top"===e?1:-1,n=t*Math.PI/180;return{dir:r,dx:Math.sin(n),dy:Math.cos(n),degrees:t}}function D(t,e,r){for(var n=e.panels||(e.panels=[]),i=t.data(),a=0;a<i.length-1;a++){var o=n[a]||(n[a]={}),s=i[a],l=i[a+1];o.dim0=s,o.dim1=l,o.canvasX=s.canvasX,o.panelSizeX=l.canvasX-s.canvasX,o.panelSizeY=e.model.canvasHeight,o.y=0,o.canvasY=0,o.plotGlPixelRatio=r}}function R(t,e){return s.tickText(t._ax,e,!1).text}function F(t,e){if(t.ordinal)return"";var r=t.domainScale.domain(),n=r[e?r.length-1:0];return R(t.model.dimensions[t.visibleIndex],n)}e.exports=function(t,e,i,a){var o=t._context.staticPlot,f=t._fullLayout,p=f._toppaper,m=f._glcontainer,v=t._context.plotGlPixelRatio,T=t._fullLayout.paper_bgcolor;!function(t){for(var e=0;e<t.length;e++)for(var r=0;r<t[e].length;r++)for(var n=t[e][r].trace,i=n.dimensions,a=0;a<i.length;a++){var o=i[a].values,l=i[a]._ax;l&&(l.range?l.range=M(l.range[0],l.range[1]):l.range=k(o,n._length),l.dtick||(l.dtick=.01*(Math.abs(l.range[1]-l.range[0])||1)),l.tickformat=i[a].tickformat,s.calcTicks(l),l.cleanRange())}}(e);var A=function(){var t=!0,e=!1;return{linePickActive:function(e){return arguments.length?t=!!e:t},contextShown:function(t){return arguments.length?e=!!t:e}}}(),S=e.filter(function(t){return y(t).trace.visible}).map(L.bind(0,i)).map(P.bind(0,A,a));m.each(function(t,e){return n.extendFlat(t,S[e])});var E=m.selectAll(".gl-canvas").each(function(t){t.viewModel=S[0],t.viewModel.plotGlPixelRatio=v,t.viewModel.paperColor=T,t.model=t.viewModel?t.viewModel.model:null}),C=null;E.filter(function(t){return t.pick}).style("pointer-events",o?"none":"auto").on("mousemove",function(t){if(A.linePickActive()&&t.lineLayer&&a&&a.hover){var e=r.event,n=this.width,i=this.height,o=r.mouse(this),s=o[0],l=o[1];if(s<0||l<0||s>=n||l>=i)return;var u=t.lineLayer.readPixel(s,i-1-l),c=0!==u[3],h=c?u[2]+256*(u[1]+256*u[0]):null,f={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==C&&(c?a.hover(f):a.unhover&&a.unhover(f),C=h)}}),E.style("opacity",function(t){return t.pick?0:1}),p.style("background","rgba(255, 255, 255, 0)");var B=p.selectAll("."+_.cn.parcoords).data(S,d);B.exit().remove(),B.enter().append("g").classed(_.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),B.attr("transform",function(t){return u(t.model.translateX,t.model.translateY)});var N=B.selectAll("."+_.cn.parcoordsControlView).data(g,d);N.enter().append("g").classed(_.cn.parcoordsControlView,!0),N.attr("transform",function(t){return u(t.model.pad.l,t.model.pad.t)});var j=N.selectAll("."+_.cn.yAxis).data(function(t){return t.dimensions},d);j.enter().append("g").classed(_.cn.yAxis,!0),N.each(function(t){D(j,t,v)}),E.each(function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=w(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}}),j.attr("transform",function(t){return u(t.xScale(t.xIndex),0)}),j.call(r.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;A.linePickActive(!1),t.x=Math.max(-_.overdrag,Math.min(t.model.width+_.overdrag,r.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,j.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),D(j,e,v),j.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return u(t.xScale(t.xIndex),0)}),r.select(this).attr("transform",u(t.x,0)),j.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!I(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)}).on("dragend",function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,D(j,e,v),r.select(this).attr("transform",function(t){return u(t.x,0)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!I(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),j.exit().remove();var U=j.selectAll("."+_.cn.axisOverlays).data(g,d);U.enter().append("g").classed(_.cn.axisOverlays,!0),U.selectAll("."+_.cn.axis).remove();var V=U.selectAll("."+_.cn.axis).data(g,d);V.enter().append("g").classed(_.cn.axis,!0),V.each(function(t){var e=t.model.height/t.model.tickDistance,n=t.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat(function(e){return x.isOrdinal(t)?e:R(t.model.dimensions[t.visibleIndex],e)}).scale(n)),h.font(V.selectAll("text"),t.model.tickFont)}),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("cursor","default");var q=U.selectAll("."+_.cn.axisHeading).data(g,d);q.enter().append("g").classed(_.cn.axisHeading,!0);var H=q.selectAll("."+_.cn.axisTitle).data(g,d);H.enter().append("text").classed(_.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text(function(t){return t.label}).each(function(e){var n=r.select(this);h.font(n,e.model.labelFont),c.convertToTspans(n,t)}).attr("transform",function(t){var e=O(t.model.labelAngle,t.model.labelSide),r=_.axisTitleOffset;return(e.dir>0?"":u(0,2*r+t.model.height))+l(e.degrees)+u(-r*e.dx,-r*e.dy)}).attr("text-anchor",function(t){var e=O(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"});var G=U.selectAll("."+_.cn.axisExtent).data(g,d);G.enter().append("g").classed(_.cn.axisExtent,!0);var Z=G.selectAll("."+_.cn.axisExtentTop).data(g,d);Z.enter().append("g").classed(_.cn.axisExtentTop,!0),Z.attr("transform",u(0,-_.axisExtentOffset));var W=Z.selectAll("."+_.cn.axisExtentTopText).data(g,d);W.enter().append("text").classed(_.cn.axisExtentTopText,!0).call(z),W.text(function(t){return F(t,!0)}).each(function(t){h.font(r.select(this),t.model.rangeFont)});var Y=G.selectAll("."+_.cn.axisExtentBottom).data(g,d);Y.enter().append("g").classed(_.cn.axisExtentBottom,!0),Y.attr("transform",function(t){return u(0,t.model.height+_.axisExtentOffset)});var X=Y.selectAll("."+_.cn.axisExtentBottomText).data(g,d);X.enter().append("text").classed(_.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),X.text(function(t){return F(t,!1)}).each(function(t){h.font(r.select(this),t.model.rangeFont)}),b.ensureAxisBrush(U,T,t)}}),d_=f((t,e)=>{var r=p_(),n=Ax(),i=h_().isVisible,a={};function o(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var s=t._fullLayout;if(n(t,[],a)){var l={},u={},c={},h={},f=s._size;e.forEach(function(e,r){var n=e[0].trace;c[r]=n.index;var i=h[r]=n.index;l[r]=t.data[i].dimensions,u[r]=t.data[i].dimensions.slice()}),r(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=n.map(function(t){return t.slice()}),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[t._fullData[c[e]]._fullInput.uid];if(void 0===l[o]){var f=i.constraintrange;l[o]=f||null}var p=t._fullData[c[e]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,p.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete p.constraintrange,a=null);var d={};d[o]=a,t.emit("plotly_restyle",[d,[h[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,u[e].filter(i));l[e].sort(n),u[e].filter(function(t){return!i(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle",[{dimensions:[l[e]]},[h[e]]])}})}}).reglPrecompiled=a}),m_=f(t=>{var e=v(),r=_e().getModuleCalcData,n=d_(),i=Te();t.name="parcoords",t.plot=function(t){var e=r(t.calcdata,"parcoords")[0];e.length&&n(t,e)},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(".svg-container");n.filter(function(t,e){return e===n.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this,e=t.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})}),window.setTimeout(function(){e.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),g_=f((t,e)=>{e.exports={attributes:Wx(),supplyDefaults:Jx(),calc:Kx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:m_(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),y_=f((t,e)=>{var r=g_();r.plot=d_(),e.exports=r}),v_=f((t,e)=>{e.exports=y_()}),x_=f((t,e)=>{var r=D().extendFlat,n=j(),i=R(),a=Ie(),o=Ot().hovertemplateAttrs,s=wa().attributes,l=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});e.exports={domain:s({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}),__=f((t,e)=>{var r=oe(),n=Me().hasColorscale,i=Ue(),a=wa().defaults,o=Fe(),s=x_(),l=Ix(),u=S().isTypedArraySpec;function c(t,e){function n(n,i){return r.coerce(t,e,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=e.visible=!1),a){n("label"),n("displayindex",e._index);var o,l=t.categoryarray,c=r.isArrayOrTypedArray(l)&&l.length>0||u(l);c&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete t.categoryarray,delete t.ticktext),!c&&"array"===h&&(e.categoryorder="trace")}}e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,s,n,i)}var p=o(t,e,{name:"dimensions",handleItemDefaults:c}),d=function(t,e,a,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,u,h,f);a(e,h,f),(!Array.isArray(p)||!p.length)&&(e.visible=!1),l(e,p,"values",d),f("hoveron"),f("hovertemplate"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var m=h.font;r.coerceFont(f,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(f,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}),b_=f((t,e)=>{var r=Xx().wrap,n=Me().hasColorscale,i=He(),a=re(),o=Je(),s=oe(),l=T();function u(t,e,r,n){return{dimensionInd:t,categoryInd:e,categoryValue:r,displayInd:e,categoryLabel:n,valueInds:[],count:0,dragY:null}}function c(t,e,r){t.valueInds.push(e),t.count+=r}function h(t,e,r){return{categoryInds:t,color:e,rawColor:r,valueInds:[],count:0}}function f(t,e,r){t.valueInds.push(e),t.count+=r}e.exports=function(t,e){var p=s.filterVisible(e.dimensions);if(0===p.length)return[];var d,m,g,y=p.map(function(t){var e;if("trace"===t.categoryorder)e=null;else if("array"===t.categoryorder)e=t.categoryarray;else{e=a(t.values);for(var r=!0,n=0;n<e.length;n++)if(!l(e[n])){r=!1;break}e.sort(r?s.sorterAsc:void 0),"category descending"===t.categoryorder&&(e=e.reverse())}return function(t,e){e=null==e?[]:e.map(function(t){return t});var r={},n={},i=[];e.forEach(function(t,e){r[t]=0,n[t]=e});for(var a=0;a<t.length;a++){var o,s=t[a];void 0===r[s]?(r[s]=1,o=e.push(s)-1,n[s]=o):(r[s]++,o=n[s]),i.push(o)}var l=e.map(function(t){return r[t]});return{uniqueValues:e,uniqueCounts:l,inds:i}}(t.values,e)});d=s.isArrayOrTypedArray(e.counts)?e.counts:[e.counts],function(t){var e,r=t.map(function(t){return t.displayindex});if(function(t){for(var e=new Array(t.length),r=0;r<t.length;r++){if(t[r]<0||t[r]>=t.length||void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(r))for(e=0;e<t.length;e++)t[e]._displayindex=t[e].displayindex;else for(e=0;e<t.length;e++)t[e]._displayindex=e}(p),p.forEach(function(t,e){!function(t,e){t._categoryarray=e.uniqueValues,null===t.ticktext||void 0===t.ticktext?t._ticktext=[]:t._ticktext=t.ticktext.slice();for(var r=t._ticktext.length;r<e.uniqueValues.length;r++)t._ticktext.push(e.uniqueValues[r])}(t,y[e])});var v,x=e.line;function _(t){var e,r;return s.isArrayOrTypedArray(x.color)?r=e=x.color[t%x.color.length]:e=x.color,{color:v(e),rawColor:r}}x?(n(e,"line")&&i(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),v=o.tryColorscale(x)):v=s.identity;var b,w,T=p[0].values.length,k={},A=y.map(function(t){return t.inds});for(g=0,b=0;b<T;b++){var M=[];for(w=0;w<A.length;w++)M.push(A[w][b]);m=d[b%d.length],g+=m;var S=_(b),E=M+"-"+S.rawColor;void 0===k[E]&&(k[E]=h(M,S.color,S.rawColor)),f(k[E],b,m)}var C=p.map(function(t,e){return function(t,e,r,n,i){return{dimensionInd:t,containerInd:e,displayInd:r,dimensionLabel:n,count:i,categories:[],dragX:null}}(e,t._index,t._displayindex,t.label,g)});for(b=0;b<T;b++)for(m=d[b%d.length],w=0;w<C.length;w++){var I=C[w].containerInd,L=y[w].inds[b],P=C[w].categories;if(void 0===P[L]){var z=e.dimensions[I]._categoryarray[L],O=e.dimensions[I]._ticktext[L];P[L]=u(w,L,z,O)}c(P[L],b,m)}return r(function(t,e,r){var n=t.map(function(t){return t.categories.length}).reduce(function(t,e){return Math.max(t,e)});return{dimensions:t,paths:e,trace:void 0,maxCats:n,count:r}}(C,k,g))}}),w_=f((t,e)=>{var r=v(),n=(td(),m(Qp)).interpolateNumber,i=Pn(),a=Pr(),o=oe(),s=o.strTranslate,l=Je(),u=O(),c=Ae();function h(t,e,n,i){var a=e._context.staticPlot,u=t.map(N.bind(0,e,n)),h=i.selectAll("g.parcatslayer").data([null]);h.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var m=h.selectAll("g.trace.parcats").data(u,f),v=m.enter().append("g").attr("class","trace parcats");m.attr("transform",function(t){return s(t.x,t.y)}),v.append("g").attr("class","paths");var x=m.select("g.paths").selectAll("path.path").data(function(t){return t.paths},f);x.attr("fill",function(t){return t.model.color});var _=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(t){return t.model.color}).attr("fill-opacity",0);w(_),x.attr("d",function(t){return t.svgD}),_.empty()||x.sort(d),x.exit().remove(),x.on("mouseover",g).on("mouseout",y).on("click",b),v.append("g").attr("class","dimensions");var T=m.select("g.dimensions").selectAll("g.dimension").data(function(t){return t.dimensions},f);T.enter().append("g").attr("class","dimension"),T.attr("transform",function(t){return s(t.x,0)}),T.exit().remove();var M=T.selectAll("g.category").data(function(t){return t.categories},f),S=M.enter().append("g").attr("class","category");M.attr("transform",function(t){return s(0,t.y)}),S.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",function(t){return t.width}).attr("height",function(t){return t.height}),k(S);var E=M.selectAll("rect.bandrect").data(function(t){return t.bands},f);E.each(function(){o.raiseToTop(this)}),E.attr("fill",function(t){return t.color});var C=E.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(t){return t.color}).attr("fill-opacity",0);E.attr("fill",function(t){return t.color}).attr("width",function(t){return t.width}).attr("height",function(t){return t.height}).attr("y",function(t){return t.y}).attr("cursor",function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"}),A(C),E.exit().remove(),S.append("text").attr("class","catlabel").attr("pointer-events","none"),M.select("text.catlabel").attr("text-anchor",function(t){return p(t)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(t){return p(t)?t.width+5:-5}).attr("y",function(t){return t.height/2}).text(function(t){return t.model.categoryLabel}).each(function(t){l.font(r.select(this),t.parcatsViewModel.categorylabelfont),c.convertToTspans(r.select(this),e)}),S.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"}).attr("x",function(t){return t.width/2}).attr("y",-5).text(function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null}).each(function(t){l.font(r.select(this),t.parcatsViewModel.labelfont)}),M.selectAll("rect.bandrect").on("mouseover",I).on("mouseout",L),M.exit().remove(),T.call(r.behavior.drag().origin(function(t){return{x:t.x,y:0}}).on("dragstart",P).on("drag",z).on("dragend",D)),m.each(function(t){t.traceSelection=r.select(this),t.pathSelection=r.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=r.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),m.exit().remove()}function f(t){return t.key}function p(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function d(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor<e.model.rawColor?-1:0}function g(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){o.raiseToTop(this),T(r.select(this));var e=x(t),n=_(t);if(t.parcatsViewModel.graphDiv.emit("plotly_hover",{points:e,event:r.event,constraints:n}),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")){var i,s,l,c=r.mouse(this)[0],h=t.parcatsViewModel.graphDiv,f=t.parcatsViewModel.trace,p=h._fullLayout,d=p._paperdiv.node().getBoundingClientRect(),m=t.parcatsViewModel.graphDiv.getBoundingClientRect();for(l=0;l<t.leftXs.length-1;l++)if(t.leftXs[l]+t.dimWidths[l]-2<=c&&c<=t.leftXs[l+1]+2){var g=t.parcatsViewModel.dimensions[l],y=t.parcatsViewModel.dimensions[l+1];i=(g.x+g.width+y.x)/2,s=(t.topYs[l]+t.topYs[l+1]+t.height)/2;break}var v=t.parcatsViewModel.x+i,b=t.parcatsViewModel.y+s,w=u.mostReadable(t.model.color,["black","white"]),k=t.model.count,A=k/t.parcatsViewModel.model.count,M={countLabel:k,probabilityLabel:A.toFixed(3)},S=[];-1!==t.parcatsViewModel.hoverinfoItems.indexOf("count")&&S.push(["Count:",M.countLabel].join(" ")),-1!==t.parcatsViewModel.hoverinfoItems.indexOf("probability")&&S.push(["P:",M.probabilityLabel].join(" "));var E=S.join("<br>"),C=r.mouse(h)[0];a.loneHover({trace:f,x:v-d.left+m.left,y:b-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:C<v?"right":"left",hovertemplate:(f.line||{}).hovertemplate,hovertemplateLabels:M,eventData:[{data:f._input,fullData:f,count:k,probability:A}]},{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:h})}}}function y(t){if(!t.parcatsViewModel.dragDimension&&(w(r.select(this)),a.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(d),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var e=x(t),n=_(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:r.event,constraints:n})}}function x(t){for(var e=[],r=R(t.parcatsViewModel),n=0;n<t.model.valueInds.length;n++){var i=t.model.valueInds[n];e.push({curveNumber:r,pointNumber:i})}return e}function _(t){for(var e={},r=t.parcatsViewModel.model.dimensions,n=0;n<r.length;n++){var i=r[n],a=i.categories[t.model.categoryInds[n]];e[i.containerInd]=a.categoryValue}return void 0!==t.model.rawColor&&(e.color=t.model.rawColor),e}function b(t){if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){var e=x(t),n=_(t);t.parcatsViewModel.graphDiv.emit("plotly_click",{points:e,event:r.event,constraints:n})}}function w(t){t.attr("fill",function(t){return t.model.color}).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function T(t){t.attr("fill-opacity",.8).attr("stroke",function(t){return u.mostReadable(t.model.color,["black","white"])}).attr("stroke-width",.3)}function k(t){t.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function A(t){t.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function M(t){var e=t.parcatsViewModel.pathSelection,r=t.categoryViewModel.model.dimensionInd,n=t.categoryViewModel.model.categoryInd;return e.filter(function(e){return e.model.categoryInds[r]===n&&e.model.color===t.color})}function S(t,e,n){var i=r.select(t).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=r.select(t.parentNode).selectAll("rect.bandrect"),l=[];s.each(function(t){M(t).each(function(t){Array.prototype.push.apply(l,x(t))})});var u={};u[a.dimensionInd]=a.categoryValue,o.emit(e,{points:l,event:n,constraints:u})}function E(t,e,n){var i=r.select(t).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=M(i),l=[];s.each(function(t){Array.prototype.push.apply(l,x(t))});var u={};u[a.dimensionInd]=a.categoryValue,void 0!==i.rawColor&&(u.color=i.rawColor),o.emit(e,{points:l,event:n,constraints:u})}function C(t,e,n){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.select(n.parentNode).select("rect.catrect"),u=l.node().getBoundingClientRect(),c=l.datum(),h=c.parcatsViewModel,f=h.model.dimensions[c.model.dimensionInd],p=h.trace,d=u.top+u.height/2;h.dimensions.length>1&&f.displayInd===h.dimensions.length-1?(i=u.left,a="left"):(i=u.left+u.width,a="right");var m=c.model.count,g=c.model.categoryLabel,y=m/c.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==c.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==c.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var _=x.join("<br>");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:_,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:v,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:y}]}}function I(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var e,n=t.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron,c=this;"color"===l?(function(t){var e=r.select(t).datum(),n=M(e);T(n),n.each(function(){o.raiseToTop(this)}),r.select(t.parentNode).selectAll("rect.bandrect").filter(function(t){return t.color===e.color}).each(function(){o.raiseToTop(this),function(t){t.attr("stroke","black").attr("stroke-width",1.5)}(r.select(this))})}(c),E(c,"plotly_hover",r.event)):(function(t){r.select(t.parentNode).selectAll("rect.bandrect").each(function(t){var e=M(t);T(e),e.each(function(){o.raiseToTop(this)})}),function(t){t.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(r.select(t.parentNode))}(c),S(c,"plotly_hover",r.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?e=C(n,s,c):"color"===l?e=function(t,e,n){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=n.getBoundingClientRect(),c=r.select(n).datum(),h=c.categoryViewModel,f=h.parcatsViewModel,p=f.model.dimensions[h.model.dimensionInd],d=f.trace,m=l.y+l.height/2;f.dimensions.length>1&&p.displayInd===f.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=c.parcatsViewModel.model.count,v=0;c.categoryViewModel.bands.forEach(function(t){t.color===c.color&&(v+=t.count)});var x=h.model.count,_=0;f.pathSelection.each(function(t){t.model.color===c.color&&(_+=t.model.count)});var b=v/y,w=v/_,T=v/x,k={countLabel:v,categoryLabel:g,probabilityLabel:b.toFixed(3)},A=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&A.push(["Count:",k.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(A.push("P(color ∩ "+g+"): "+k.probabilityLabel),A.push("P("+g+" | color): "+w.toFixed(3)),A.push("P(color | "+g+"): "+T.toFixed(3)));var M=A.join("<br>"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:b,categorycount:x,colorcount:_,bandcolorcount:v}]}}(n,s,c):"dimension"===l&&(e=function(t,e,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){i.push(C(t,e,this))}),i}(n,s,c)),e&&a.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function L(t){var e=t.parcatsViewModel;e.dragDimension||(w(e.pathSelection),k(e.dimensionSelection.selectAll("g.category")),A(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(d),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?E(this,"plotly_unhover",r.event):S(this,"plotly_unhover",r.event))}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each(function(e){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map(function(t){return t.displayInd}),e.model.dragY=e.y,o.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each(function(e){e.y<i&&i<=e.y+e.height&&(t.potentialClickBand=this)}))}),t.parcatsViewModel.dragDimension=t,a.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function z(t){if("fixed"!==t.parcatsViewModel.arrangement&&(t.dragHasMoved=!0,null!==t.dragDimensionDisplayInd)){var e=t.dragDimensionDisplayInd,n=e-1,i=e+1,a=t.parcatsViewModel.dimensions[e];if(null!==t.dragCategoryDisplayInd){var o=a.categories[t.dragCategoryDisplayInd];o.model.dragY+=r.event.dy;var s=o.model.dragY,l=o.model.displayInd,u=a.categories,c=u[l-1],h=u[l+1];void 0!==c&&s<c.y+c.height/2&&(o.model.displayInd=c.model.displayInd,c.model.displayInd=l),void 0!==h&&s+o.height>h.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var f=t.parcatsViewModel.dimensions[n],p=t.parcatsViewModel.dimensions[i];void 0!==f&&a.model.dragX<f.x+f.width&&(a.model.displayInd=f.model.displayInd,f.model.displayInd=e),void 0!==p&&a.model.dragX+a.width>p.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}V(t.parcatsViewModel),U(t.parcatsViewModel),B(t.parcatsViewModel),F(t.parcatsViewModel)}}function D(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var e={},n=R(t.parcatsViewModel),a=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),o=t.initialDragDimensionDisplayInds.some(function(t,e){return t!==a[e]});o&&a.forEach(function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r});var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map(function(t){return t.displayInd});if(s=t.initialDragCategoryDisplayInds.some(function(t,e){return t!==l[e]})){var u=t.model.categories.slice().sort(function(t,e){return t.displayInd-e.displayInd}),c=u.map(function(t){return t.categoryValue}),h=u.map(function(t){return t.categoryLabel});e["dimensions["+t.model.containerInd+"].categoryarray"]=[c],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?E(t.potentialClickBand,"plotly_click",r.event.sourceEvent):S(t.potentialClickBand,"plotly_click",r.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,V(t.parcatsViewModel),U(t.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each(function(){B(t.parcatsViewModel,!0),F(t.parcatsViewModel,!0)}).each("end",function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[n])})}}function R(t){for(var e,r=t.graphDiv._fullData,n=0;n<r.length;n++)if(t.key===r[n].uid){e=n;break}return e}function F(t,e){var r;void 0===e&&(e=!1),t.pathSelection.data(function(t){return t.paths},f),(r=t.pathSelection,e?r.transition():r).attr("d",function(t){return t.svgD})}function B(t,e){function n(t){return e?t.transition():t}void 0===e&&(e=!1),t.dimensionSelection.data(function(t){return t.dimensions},f);var i=t.dimensionSelection.selectAll("g.category").data(function(t){return t.categories},f);n(t.dimensionSelection).attr("transform",function(t){return s(t.x,0)}),n(i).attr("transform",function(t){return s(0,t.y)}),i.select(".dimlabel").text(function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null}),i.select(".catlabel").attr("text-anchor",function(t){return p(t)?"start":"end"}).attr("x",function(t){return p(t)?t.width+5:-5}).each(function(t){var e,n;p(t)?(e=t.width+5,n="start"):(e=-5,n="end"),r.select(this).selectAll("tspan").attr("x",e).attr("text-anchor",n)});var a=i.selectAll("rect.bandrect").data(function(t){return t.bands},f),l=a.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",function(t){return t.color}).attr("fill-opacity",0);a.attr("fill",function(t){return t.color}).attr("width",function(t){return t.width}).attr("height",function(t){return t.height}).attr("y",function(t){return t.y}),A(l),a.each(function(){o.raiseToTop(this)}),a.exit().remove()}function N(t,e,r){var n,i=r[0],a=e.margin||{l:80,r:80,t:100,b:80},o=i.trace,s=o.domain,l=e.width,u=e.height,c=Math.floor(l*(s.x[1]-s.x[0])),h=Math.floor(u*(s.y[1]-s.y[0])),f=s.x[0]*l+a.l,p=e.height-s.y[1]*e.height+a.t,d=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var m={trace:o,key:o.uid,model:i,x:f,y:p,width:c,height:h,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:d,dragDimension:null,margin:a,paths:[],dimensions:[],graphDiv:t,traceSelection:null,pathSelection:null,dimensionSelection:null};return i.dimensions&&(V(m),U(m)),m}function j(t,e,r,i,a){var o,s,l=[],u=[];for(s=0;s<r.length-1;s++)o=n(r[s]+t[s],t[s+1]),l.push(o(a)),u.push(o(1-a));var c="M "+t[0]+","+e[0];for(c+="l"+r[0]+",0 ",s=1;s<r.length;s++)c+="C"+l[s-1]+","+e[s-1]+" "+u[s-1]+","+e[s]+" "+t[s]+","+e[s],c+="l"+r[s]+",0 ";for(c+="l0,"+i+" ",c+="l -"+r[r.length-1]+",0 ",s=r.length-2;s>=0;s--)c+="C"+u[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),c+="l-"+r[s]+",0 ";return c+="Z"}function U(t){var e=t.dimensions,r=t.model,n=e.map(function(t){return t.categories.map(function(t){return t.y})}),i=t.model.dimensions.map(function(t){return t.categories.map(function(t){return t.displayInd})}),a=t.model.dimensions.map(function(t){return t.displayInd}),o=t.dimensions.map(function(t){return t.model.dimensionInd}),s=e.map(function(t){return t.x}),l=e.map(function(t){return t.width}),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function h(t){var e=t.categoryInds.map(function(t,e){return i[e][t]});return o.map(function(t){return e[t]})}u.sort(function(e,r){var n=h(e),i=h(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),n<i?-1:n>i?1:0});for(var f=new Array(u.length),p=e[0].model.count,d=e[0].categories.map(function(t){return t.height}).reduce(function(t,e){return t+e}),m=0;m<u.length;m++){var g,y,v=u[m];g=p>0?d*(v.count/p):0;for(var x=new Array(n.length),_=0;_<v.categoryInds.length;_++){var b=v.categoryInds[_],w=i[_][b],T=a[_];x[T]=n[T][w],n[T][w]+=g;var k=t.dimensions[T].categories[w],A=k.bands.length,M=k.bands[A-1];if(void 0===M||v.rawColor!==M.rawColor){var S=void 0===M?0:M.y+M.height;k.bands.push({key:S,color:v.color,rawColor:v.rawColor,height:g,width:k.width,count:v.count,y:S,categoryViewModel:k,parcatsViewModel:t})}else{var E=k.bands[A-1];E.height+=g,E.count+=v.count}}y="hspline"===t.pathShape?j(s,x,l,g,.5):j(s,x,l,g,0),f[m]={key:v.valueInds[0],model:v,height:g,leftXs:s,topYs:x,dimWidths:l,svgD:y,parcatsViewModel:t}}t.paths=f}function V(t){var e=t.model.dimensions.map(function(t){return{displayInd:t.displayInd,dimensionInd:t.dimensionInd}});e.sort(function(t,e){return t.displayInd-e.displayInd});var r=[];for(var n in e){var i=e[n].dimensionInd,a=t.model.dimensions[i];r.push(q(t,a))}t.dimensions=r}function q(t,e){var r,n=t.model.dimensions.length,i=e.displayInd;r=40+(n>1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,u,c=[],h=t.model.maxCats,f=e.categories.length,p=e.count,d=t.height-8*(h-1),m=8*(h-f)/2,g=e.categories.map(function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}});for(g.sort(function(t,e){return t.displayInd-e.displayInd}),u=0;u<f;u++)l=g[u].categoryInd,o=e.categories[l],a=p>0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,c.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:c,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}}),T_=f((t,e)=>{var r=w_();e.exports=function(t,e,n,i){var a=t._fullLayout,o=a._paper,s=a._size;r(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}),k_=f(t=>{var e=_e().getModuleCalcData,r=T_(),n="parcats";t.name=n,t.plot=function(t,i,a,o){var s=e(t.calcdata,n);if(s.length){var l=s[0];r(t,l,a,o)}},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcats"),a=e._has&&e._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}),A_=f((t,e)=>{e.exports={attributes:x_(),supplyDefaults:__(),calc:b_(),plot:T_(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:k_(),categories:["noOpacity"],meta:{}}}),M_=f((t,e)=>{e.exports=A_()}),S_=f((t,e)=>{var r=Gt(),n="1.13.4",i='© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',a=['© <a target="_blank" href="https://carto.com/">Carto</a>',i].join(" "),o=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://www.openstreetmap.org/copyright">ODbL</a>'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=r(s);e.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+n+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}}),E_=f((t,e)=>{var r=oe(),n=q().defaultLine,i=wa().attributes,a=R(),o=bn().textposition,s=Lt().overrideAll,l=me().templatedArray,u=S_(),c=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:u.styleValuesMapbox.concat(u.styleValuesNonMapbox),dflt:u.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:c,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}),C_=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=og(),o=bn(),s=E_(),l=j(),u=Ie(),c=D().extendFlat,h=Lt().overrideAll,f=E_(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:c({},f.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:c({},d.opacity,{dflt:1})},mode:c({},o.mode,{dflt:"markers"}),text:c({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:c({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},u("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}),I_=f((t,e)=>{var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}),L_=f((t,e)=>{var r=oe(),n=Ze(),i=Gn(),a=Zn(),o=Yn(),s=Xn(),l=C_(),u=I_().isSupportedFont;e.exports=function(t,e,c,h){function f(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,f);if(d){if(f("text"),f("texttemplate"),f("hovertext"),f("hovertemplate"),f("mode"),f("below"),n.hasMarkers(e)){i(t,e,c,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,c,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||c),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:u(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==e.fill&&s(t,e,c,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}),P_=f((t,e)=>{var r=rr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}),z_=f((t,e)=>{var r=oe();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}}),O_=f((t,e)=>{var r=T(),n=oe(),i=k().BADNUM,a=pg(),o=Ge(),s=Je(),l=We(),u=Ze(),c=I_().isSupportedFont,h=z_(),f=Ye().appendArrayPointValue,p=Ae().NEWLINES,d=Ae().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i<t.length;i++)r.push(e[i-1],t[i])}else r=t;return r}function _(t){var e=t.textfont,r=e.family,n=e.style,i=e.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),c(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,c=e[0].trace,b=!0===c.visible&&0!==c._length,w="none"!==c.fill,T=u.hasLines(c),k=u.hasMarkers(c),A=u.hasText(c),M=k&&"circle"===c.marker.symbol,S=k&&"circle"!==c.marker.symbol,E=c.cluster&&c.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":c.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":c.line.width,"line-color":c.line.color,"line-opacity":c.opacity})),M){var O=function(t){var e,i,a,u,c=t[0].trace,h=c.marker,f=c.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return c.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(c,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(c)),m&&(u=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,_=[];for(e=0;e<t.length;e++){var b=t[e],w=b.lonlat;if(!v(w)){var T={};i&&(T.mcc=b.mcc=i(b.mc)),a&&(T.mrc=b.mrc=a(b.ms)),u&&(T.mo=u(b.mo)),f&&(T.selected=b.selected||0),_.push({type:"Feature",id:e+1,geometry:{type:"Point",coordinates:w},properties:T})}}if(f)for(x=s.makeSelectedPointStyleFns(c),e=0;e<_.length;e++){var k=_[e].properties;x.selectedOpacityFn&&(k.mo=g(x.selectedOpacityFn(k))),x.selectedColorFn&&(k.mcc=x.selectedColorFn(k)),x.selectedSizeFn&&(k.mrc=x.selectedSizeFn(k))}return{geojson:{type:"FeatureCollection",features:_},mcc:p||x&&x.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:d||x&&x.selectedSizeFn?{type:"identity",property:"mrc"}:y(h.size),mo:m||x&&x.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(e);L.geojson=O.geojson,L.layout.visibility="visible",E&&(L.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(c.cluster.color,c.cluster.step),"circle-radius":x(c.cluster.size,c.cluster.step),"circle-opacity":x(c.cluster.opacity,c.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":_(c),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":O.mcc,"circle-radius":O.mrc,"circle-opacity":O.mo})}if(M&&E&&(L.filter=["!",["has","point_count"]]),(S||A)&&(P.geojson=function(t,e){for(var r=e._fullLayout,i=t[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,c="auto"!==s?g(s,!0):y,h=u.hasText(i)?g(i.text):y,m=[],x=0;x<t.length;x++){var _=t[x];if(!v(_.lonlat)){var b,w=i.texttemplate;if(w){var T=Array.isArray(w)?w[x]||"":w,k=i._module.formatLabels(_,i,r),A={};f(A,i,_.i);var M=i._meta||{};b=n.texttemplateString(T,k,r._d3locale,A,_,M)}else b=h(x);b&&(b=b.replace(p,"").replace(d,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:_.lonlat},properties:{symbol:l(x),angle:c(x),text:b}})}}return{type:"FeatureCollection",features:m}}(e,t),n.extendFlat(P.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),S&&(n.extendFlat(P.layout,{"icon-size":c.marker.size/10}),"angle"in c.marker&&"auto"!==c.marker.angle&&n.extendFlat(P.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),P.layout["icon-allow-overlap"]=c.marker.allowoverlap,n.extendFlat(P.paint,{"icon-opacity":c.opacity*c.marker.opacity,"icon-color":c.marker.color})),A)){var D=(c.marker||{}).size,R=h(c.textposition,D);n.extendFlat(P.layout,{"text-size":c.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":_(c)}),n.extendFlat(P.paint,{"text-color":c.textfont.color,"text-opacity":c.opacity})}return z}}),D_=f((t,e)=>{var r=oe(),n=O_(),i=S_().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol",cluster:i+e+"-cluster",clusterCount:i+e+"-cluster-count"},this.below=null}var s=o.prototype;s.addSource=function(t,e,n){var i={type:"geojson",data:e.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[t]);a?a.setData(e.geojson):this.subplot.map.addSource(this.sourceIds[t],i)},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter);for(var i,a=this.layerIds[t],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(t){var e=t[0].trace,r=this.subplot,i=r.map,o=n(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),u=!!this.clusterEnabled,c=this;function h(t){u?function(t){for(var e=a.cluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(c.layerIds[n])}t||i.removeSource(c.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(c.layerIds[n]),t||i.removeSource(c.sourceIds[n])}}(t)}function f(t){l?function(t){t||c.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];c.addLayer(i,l,s)}}(t):function(t){for(var e=a.nonCluster,r=0;r<e.length;r++){var n=e[r],i=o[n];t||c.addSource(n,i),c.addLayer(n,i,s)}}(t)}var p=this.isHidden,d=!0!==e.visible;d?p||h():p?d||f():u!==l?(h(),f()):(this.below!==s&&(h(!0),f(!0)),function(){for(var t=l?a.cluster:a.nonCluster,e=0;e<t.length;e++){var n=t[e],i=o[n];i&&(r.setOptions(c.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&c.setSourceData(n,i),r.setOptions(c.layerIds[n],"setPaintProperty",i.paint)))}}()),this.clusterEnabled=l,this.isHidden=d,this.below=s,t[0].trace._glTrace=this},s.dispose=function(){for(var t=this.subplot.map,e=this.clusterEnabled?a.cluster:a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,u=l.cluster&&l.cluster.enabled,c=!0!==l.visible,h=new o(t,l.uid,u,c),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(u)for(h.addSource("circle",f.circle,l.cluster),r=0;r<a.cluster.length;r++)s=f[i=a.cluster[r]],h.addLayer(i,s,p);else for(r=0;r<a.nonCluster.length;r++)s=f[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,p);return e[0].trace._glTrace=h,h}}),R_=f((t,e)=>{var r=Pr(),n=oe(),i=di(),a=n.fillText,o=k().BADNUM,s=S_().traceLayerPrefix;function l(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];return i||o&&s?u.push("("+c(l[1])+", "+c(l[0])+")"):o?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1])),(i||-1!==n.indexOf("text"))&&a(e,t,u),u.join("<br>")}function c(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var u=t.cd,c=u[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+c.uid+"-circle",g=c.cluster&&c.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map(function(t){return t.id})}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(u,function(t){var e=t.lonlat;if(e[0]===o||g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),u=s.y-f.c2p([r,a]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)},t),!1!==t.index){var _=u[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[c.subplot]={_subplot:p};var S=c._module.formatLabels(_,c,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(c,_),t.extraText=l(c,_,u[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:l}}),F_=f((t,e)=>{e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}),B_=f((t,e)=>{var r=oe(),n=Ze(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,u=[],c=o[0].trace;if(!n.hasMarkers(c))return[];if(!1===e)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],f=h.lonlat;if(f[0]!==i){var p=[r.modHalf(f[0],360),f[1]],d=[s.c2p(p),l.c2p(p)];e.contains(d,null,a,t)?(u.push({pointNumber:a,lon:f[0],lat:f[1]}),h.selected=1):h.selected=0}}return u}}),N_=f((t,e)=>{var r,n;r=t,n=function(){var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),r=i(o),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else e=i;else t=i}return n(0,function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r="1.13.4",n=i;function i(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},l=Math.pow(2,53)-1;function u(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}}var c=u(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function f(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}var d=1;function m(){return d++}function g(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function x(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function b(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function w(t){return Array.isArray(t)?t.map(w):"object"==typeof t&&t?_(t,w):t}var T={};function k(t){T[t]||("undefined"!=typeof console&&console.warn(t),T[t]=!0)}function A(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function M(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)a=t[r],e+=((o=t[i]).x-a.x)*(a.y+o.y);return e}function S(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function E(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""}),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var C=null;function I(t){if(null==C){var e=t.navigator?t.navigator.userAgent:null;C=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return C}function L(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,z,O,D,R=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,B=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,N={now:R,frame:function(t){var e=F(t);return{cancel:function(){return B(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},j={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){V||!D||(q?H(t):O=t)}},V=!1,q=!1;function H(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,D),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}s.document&&((D=s.document.createElement("img")).onload=function(){O&&H(O),O=null,q=!0},D.onerror=function(){V=!0,O=null},D.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",Z=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function W(t){return 0===t.indexOf("mapbox:")}Z.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},Z.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Z.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},Z.prototype.normalizeStyleURL=function(t,e){if(!W(t))return t;var r=J(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeGlyphsURL=function(t,e){if(!W(t))return t;var r=J(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSourceURL=function(t,e){if(!W(t))return t;var r=J(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSpriteURL=function(t,e,r,n){var i=J(t);return W(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,K(i))},Z.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!W(t))return t;var r=J(t),n=N.devicePixelRatio>=2||512===e?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||j.ACCESS_TOKEN;return j.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},Z.prototype.canonicalizeTileURL=function(t,e){var r=J(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return e&&(i=i.filter(function(t){return!t.match(/^access_token=/)})),i.length&&(n+="?"+i.join("&")),n},Z.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&W(e),n=[],i=0,a=t.tiles||[];i<a.length;i+=1){var o=a[i];X(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o)}return n},Z.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=J(j.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){var i=t.params.indexOf("secure");i>=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!j.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||j.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter(function(t){return-1===t.indexOf("access_token")}),t.params.push("access_token="+e),K(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return Y.test(t)}var $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function J(t){var e=t.match($);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var Q="mapbox.eventData";function tt(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{var r=JSON.parse(function(t){return decodeURIComponent(s.atob(t).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e[1]));return r}catch(t){return null}}var et=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};et.prototype.getStorageKey=function(t){var e,r=tt(j.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(+("0x"+e))}))):n=j.ACCESS_TOKEN||"",t?Q+"."+t+":"+n:Q+":"+n},et.prototype.fetchEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=s.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){k("Unable to read from LocalStorage")}},et.prototype.saveEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){k("Unable to write to LocalStorage")}},et.prototype.processRequests=function(t){},et.prototype.postEvent=function(t,e,n,i){var a=this;if(j.EVENTS_URL){var o=J(j.EVENTS_URL);o.params.push("access_token="+(i||j.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:G,userId:this.anonId},l=e?p(s,e):s,u={url:K(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Mt(u,function(t){a.pendingRequest=null,n(t),a.saveEventData(),a.processRequests(i)})}},et.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var rt,nt,it=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(j.EVENTS_URL&&n||j.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return W(t)||X(t)}))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},function(t){t||n&&(e.success[n]=!0)},t))}},e}(et),at=function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){j.EVENTS_URL&&j.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return W(t)||X(t)})&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var r=tt(j.ACCESS_TOKEN),n=r?r.u:j.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)},t)}},e}(et),ot=new at,st=ot.postTurnstileEvent.bind(ot),lt=new it,ut=lt.postMapLoadEvent.bind(lt),ct="mapbox-tiles",ht=500,ft=50;function pt(){s.caches&&!rt&&(rt=s.caches.open(ct))}function dt(t,e,r){if(pt(),rt){var n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach(function(t,e){return n.headers.set(e,t)});var i=E(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===nt)try{new Response(new ReadableStream),nt=!0}catch(t){nt=!1}nt?e(t.body):t.blob().then(e)}(e,function(e){var r=new s.Response(e,n);pt(),rt&&rt.then(function(e){return e.put(mt(t.url),r)}).catch(function(t){return k(t.message)})}))}}function mt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function gt(t,e){if(pt(),!rt)return e(null);var r=mt(t.url);rt.then(function(t){t.match(r).then(function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)}).catch(e)}).catch(e)}var yt,vt=1/0;function xt(){return null==yt&&(yt=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),yt}var _t={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(_t);var bt=function(t){function e(e,r,n){401===r&&X(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),wt=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function Tt(t,e){var r=new s.AbortController,n=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:wt(),signal:r.signal}),i=!1,a=!1,o=function(t){return t.indexOf("sku=")>0&&X(t)}(n.url);"json"===t.type&&n.headers.set("Accept","application/json");var l=function(r,i,l){if(!a){if(r&&"SecurityError"!==r.message&&k(r),i&&l)return u(i);var c=Date.now();s.fetch(n).then(function(r){if(r.ok){var n=o?r.clone():null;return u(r,n,c)}return e(new bt(r.statusText,r.status,t.url))}).catch(function(t){20!==t.code&&e(new Error(t.message))})}},u=function(r,o,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then(function(t){a||(o&&s&&dt(n,o,s),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))}).catch(function(t){a||e(new Error(t.message))})};return o?gt(n,l):l(null,null),{cancel:function(){a=!0,i||r.abort()}}}var kt=function(t,e){if(!function(t){return/^file:/.test(t)||/^file:/.test(wt())&&!/^\w+:/.test(t)}(t.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Tt(t,e);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}return function(t,e){var r=new s.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new bt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},At=function(t,e){return kt(p(t,{type:"arrayBuffer"}),e)},Mt=function(t,e){return kt(p(t,{method:"POST"}),e)};function St(t){var e=s.document.createElement("a");return e.href=t,e.protocol===s.document.location.protocol&&e.host===s.document.location.host}var Et,Ct,It="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Et=[],Ct=0;var Lt=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Ct>=j.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Et.push(r),r}Ct++;var n=!1,i=function(){if(!n)for(n=!0,Ct--;Et.length&&Ct<j.MAX_PARALLEL_IMAGE_REQUESTS;){var t=Et.shift(),e=t.requestParameters,r=t.callback;t.cancelled||(t.cancel=Lt(e,r).cancel)}},a=At(t,function(t,r,n,a){i(),t?e(t):r&&(xt()?function(t,e){var r=new s.Blob([new Uint8Array(t)],{type:"image/png"});s.createImageBitmap(r).then(function(t){e(null,t)}).catch(function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(r,e):function(t,e,r,n){var i=new s.Image,a=s.URL;i.onload=function(){e(null,i),a.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame(function(){i.src=It})},i.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new s.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?a.createObjectURL(o):It}(r,e,n,a))});return{cancel:function(){a.cancel(),i()}}};function Pt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function zt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var Ot=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},Dt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ot),Rt=function(){};Rt.prototype.on=function(t,e){return this._listeners=this._listeners||{},Pt(t,e,this._listeners),this},Rt.prototype.off=function(t,e){return zt(t,e,this._listeners),zt(t,e,this._oneTimeListeners),this},Rt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Pt(t,e,this._oneTimeListeners),this},Rt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Ot(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];zt(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(p(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Dt&&console.error(t.error);return this},Rt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Rt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Ft={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Bt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Nt(t){var e=t.key,r=t.value;return r?[new Bt(e,r,"constants have been deprecated as of v8")]:[]}function jt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}function Ut(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Vt(t){if(Array.isArray(t))return t.map(Vt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Vt(t[r]);return e}return Ut(t)}var qt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Ht=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],a=i[0],o=i[1];this.bindings[a]=o}};Ht.prototype.concat=function(t){return new Ht(this,t)},Ht.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Ht.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Gt={kind:"null"},Zt={kind:"number"},Wt={kind:"string"},Yt={kind:"boolean"},Xt={kind:"color"},$t={kind:"object"},Jt={kind:"value"},Kt={kind:"collator"},Qt={kind:"formatted"},te={kind:"resolvedImage"};function ee(t,e){return{kind:"array",itemType:t,N:e}}function re(t){if("array"===t.kind){var e=re(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ne=[Gt,Zt,Wt,Yt,Xt,Qt,$t,ee(Jt),te];function ie(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ie(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=ne;r<n.length;r+=1)if(!ie(n[r],e))return null}return"Expected "+re(t)+" but found "+re(e)+" instead."}function ae(t,e){return e.some(function(e){return e.kind===t.kind})}function oe(t,e){return e.some(function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t})}var se=e(function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),h=i.substr(l+1,u-(l+1)).split(","),f=1;switch(c){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),g=m<=.5?m*(d+1):m+d-m*d,y=2*m-g;return[n(255*s(y,g,p+1/3)),n(255*s(y,g,p)),n(255*s(y,g,p-1/3)),f];default:return null}}return null}}catch(t){}}).parseCSSColor,le=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};le.parse=function(t){if(t){if(t instanceof le)return t;if("string"==typeof t){var e=se(t);if(e)return new le(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},le.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},le.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},le.black=new le(0,0,0,1),le.white=new le(1,1,1,1),le.transparent=new le(0,0,0,0),le.red=new le(1,0,0,1);var ue=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ue.prototype.compare=function(t,e){return this.collator.compare(t,e)},ue.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ce=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},he=function(t){this.sections=t};he.fromString=function(t){return new he([new ce(t,null,null,null,null)])},he.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some(function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length})},he.factory=function(t){return t instanceof he?t:he.fromString(t)},he.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map(function(t){return t.text}).join("")},he.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var fe=function(t){this.name=t.name,this.available=t.available};function pe(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function de(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof le)return!0;if(t instanceof ue)return!0;if(t instanceof he)return!0;if(t instanceof fe)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!de(r[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!de(t[n]))return!1;return!0}return!1}function me(t){if(null===t)return Gt;if("string"==typeof t)return Wt;if("boolean"==typeof t)return Yt;if("number"==typeof t)return Zt;if(t instanceof le)return Xt;if(t instanceof ue)return Kt;if(t instanceof he)return Qt;if(t instanceof fe)return te;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=me(i[n]);if(e){if(e===a)continue;e=Jt;break}e=a}return ee(e||Jt,r)}return $t}function ge(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof le||t instanceof he||t instanceof fe?t.toString():JSON.stringify(t)}fe.prototype.toString=function(){return this.name},fe.fromString=function(t){return t?new fe({name:t,available:!1}):null},fe.prototype.serialize=function(){return["image",this.name]};var ye=function(t,e){this.type=t,this.value=e};ye.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!de(t[1]))return e.error("invalid value");var r=t[1],n=me(r),i=e.expectedType;return"array"===n.kind&&0===n.N&&i&&"array"===i.kind&&("number"!=typeof i.N||0===i.N)&&(n=i),new ye(n,r)},ye.prototype.evaluate=function(){return this.value},ye.prototype.eachChild=function(){},ye.prototype.outputDefined=function(){return!0},ye.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof le?["rgba"].concat(this.value.toArray()):this.value instanceof he?this.value.serialize():this.value};var ve=function(t){this.name="ExpressionEvaluationError",this.message=t};ve.prototype.toJSON=function(){return this.message};var xe={string:Wt,number:Zt,boolean:Yt,object:$t},_e=function(t,e){this.type=t,this.args=e};_e.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in xe)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=xe[s],n++}else a=Jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=ee(a,o)}else r=xe[i];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,Jt);if(!u)return null;l.push(u)}return new _e(r,l)},_e.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!ie(this.type,me(r)))return r;if(e===this.args.length-1)throw new ve("Expected value to be of type "+re(this.type)+", but found "+re(me(r))+" instead.")}return null},_e.prototype.eachChild=function(t){this.args.forEach(t)},_e.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},_e.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map(function(t){return t.serialize()}))};var be=function(t){this.type=Qt,this.sections=t};be.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Zt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,ee(Wt))))return null;var u=null;if(o["text-color"]&&!(u=e.parse(o["text-color"],1,Xt)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var h=e.parse(t[a],1,Jt);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new be(n)},be.prototype.evaluate=function(t){return new he(this.sections.map(function(e){var r=e.content.evaluate(t);return me(r)===te?new ce("",r,null,null,null):new ce(ge(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))},be.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},be.prototype.outputDefined=function(){return!1},be.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var we=function(t){this.type=te,this.input=t};we.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Wt);return r?new we(r):e.error("No image name provided.")},we.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=fe.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},we.prototype.eachChild=function(t){t(this.input)},we.prototype.outputDefined=function(){return!1},we.prototype.serialize=function(){return["image",this.input.serialize()]};var Te={"to-boolean":Yt,"to-color":Xt,"to-number":Zt,"to-string":Wt},ke=function(t,e){this.type=t,this.args=e};ke.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=Te[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,Jt);if(!o)return null;i.push(o)}return new ke(n,i)},ke.prototype.evaluate=function(t){if("boolean"===this.type.kind)return!!this.args[0].evaluate(t);if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof le)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":pe(e[0],e[1],e[2],e[3])))return new le(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ve(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(t)))return 0;var u=Number(o);if(!isNaN(u))return u}throw new ve("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?he.fromString(ge(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?fe.fromString(ge(this.args[0].evaluate(t))):ge(this.args[0].evaluate(t))},ke.prototype.eachChild=function(t){this.args.forEach(t)},ke.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},ke.prototype.serialize=function(){if("formatted"===this.type.kind)return new be([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new we(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ae=["Unknown","Point","LineString","Polygon"],Me=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Ae[this.feature.type]:this.feature.type:null},Me.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Me.prototype.canonicalID=function(){return this.canonical},Me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=le.parse(t)),e};var Se=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};Se.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Se.prototype.eachChild=function(t){this.args.forEach(t)},Se.prototype.outputDefined=function(){return!1},Se.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},Se.parse=function(t,e){var r,n=t[0],i=Se.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),l=null,u=0,c=s;u<c.length;u+=1){var h=c[u],f=h[0],p=h[1];l=new Ke(e.registry,e.path,null,e.scope);for(var d=[],m=!1,g=1;g<t.length;g++){var y=t[g],v=Array.isArray(f)?f[g-1]:f.type,x=l.parse(y,1+d.length,v);if(!x){m=!0;break}d.push(x)}if(!m){if(Array.isArray(f)&&f.length!==d.length){l.error("Expected "+f.length+" arguments, but found "+d.length+" instead.");continue}for(var _=0;_<d.length;_++){var b=Array.isArray(f)?f[_]:f.type,w=d[_];l.concat(_+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new Se(n,a,p,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var T=(s.length?s:o).map(function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(re).join(", ")+")":"("+re(e.type)+"...)"}).join(" | "),k=[],A=1;A<t.length;A++){var M=e.parse(t[A],1+k.length);if(!M)return null;k.push(re(M.type))}e.error("Expected arguments of type "+T+", but found ("+k.join(", ")+") instead.")}return null},Se.register=function(t,e){for(var r in Se.definitions=e,e)t[r]=Se};var Ee=function(t,e,r){this.type=Kt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};Ee.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Yt);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Yt);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Wt))?null:new Ee(n,i,a)},Ee.prototype.evaluate=function(t){return new ue(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ee.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ee.prototype.outputDefined=function(){return!1},Ee.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Ce=8192;function Ie(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Le(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pe(t,e){var r=function(t){return(180+t)/360}(t[0]),n=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*Ce),Math.round(n*i*Ce)]}function ze(t,e,r){var n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function Oe(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function De(t,e){for(var r=!1,n=0,i=e.length;n<i;n++)for(var a=e[n],o=0,s=a.length;o<s-1;o++){if(ze(t,a[o],a[o+1]))return!1;Oe(t,a[o],a[o+1])&&(r=!r)}return r}function Re(t,e){for(var r=0;r<e.length;r++)if(De(t,e[r]))return!0;return!1}function Fe(t,e,r,n){var i=t[0]-r[0],a=t[1]-r[1],o=e[0]-r[0],s=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],c=i*u-l*a,h=o*u-l*s;return c>0&&h<0||c<0&&h>0}function Be(t,e,r,n){var i=[e[0]-t[0],e[1]-t[1]];return 0!==function(t,e){return t[0]*e[1]-t[1]*e[0]}([n[0]-r[0],n[1]-r[1]],i)&&!(!Fe(t,e,r,n)||!Fe(r,n,t,e))}function Ne(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(Be(t,e,a[o],a[o+1]))return!0;return!1}function je(t,e){for(var r=0;r<t.length;++r)if(!De(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Ne(t[n],t[n+1],e))return!1;return!0}function Ue(t,e){for(var r=0;r<e.length;r++)if(je(t,e[r]))return!0;return!1}function Ve(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var a=[],o=0;o<t[i].length;o++){var s=Pe(t[i][o],r);Ie(e,s),a.push(s)}n.push(a)}return n}function qe(t,e,r){for(var n=[],i=0;i<t.length;i++){var a=Ve(t[i],e,r);n.push(a)}return n}function He(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}Ie(e,t)}function Ge(t,e,r,n){for(var i=Math.pow(2,n.z)*Ce,a=[n.x*Ce,n.y*Ce],o=[],s=0,l=t;s<l.length;s+=1)for(var u=0,c=l[s];u<c.length;u+=1){var h=c[u],f=[h.x+a[0],h.y+a[1]];He(f,e,r,i),o.push(f)}return o}function Ze(t,e,r,n){for(var i=Math.pow(2,n.z)*Ce,a=[n.x*Ce,n.y*Ce],o=[],s=0,l=t;s<l.length;s+=1){for(var u=[],c=0,h=l[s];c<h.length;c+=1){var f=h[c],p=[f.x+a[0],f.y+a[1]];Ie(e,p),u.push(p)}o.push(u)}if(e[2]-e[0]<=i/2){!function(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}(e);for(var d=0,m=o;d<m.length;d+=1)for(var g=0,y=m[d];g<y.length;g+=1)He(y[g],e,r,i)}return o}var We=function(t,e){this.type=Yt,this.geojson=t,this.geometries=e};function Ye(t){if(t instanceof Se){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof We)return!1;var e=!0;return t.eachChild(function(t){e&&!Ye(t)&&(e=!1)}),e}function Xe(t){if(t instanceof Se&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!Xe(t)&&(e=!1)}),e}function $e(t,e){if(t instanceof Se&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild(function(t){r&&!$e(t,e)&&(r=!1)}),r}We.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(de(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new We(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new We(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new We(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},We.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Ve(e.coordinates,n,i),o=Ge(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!De(l[s],a))return!1}if("MultiPolygon"===e.type){var u=qe(e.coordinates,n,i),c=Ge(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var h=0,f=c;h<f.length;h+=1)if(!Re(f[h],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Ve(e.coordinates,n,i),o=Ze(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!je(l[s],a))return!1}if("MultiPolygon"===e.type){var u=qe(e.coordinates,n,i),c=Ze(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var h=0,f=c;h<f.length;h+=1)if(!Ue(f[h],u))return!1}return!0}(t,this.geometries)}return!1},We.prototype.eachChild=function(){},We.prototype.outputDefined=function(){return!0},We.prototype.serialize=function(){return["within",this.geojson]};var Je=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Je.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Je(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Je.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Je.prototype.eachChild=function(){},Je.prototype.outputDefined=function(){return!1},Je.prototype.serialize=function(){return["var",this.name]};var Ke=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Ht),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return"["+t+"]"}).join(""),this.scope=n,this.errors=i,this.expectedType=r};function Qe(t){if(t instanceof Je)return Qe(t.boundExpression);if(t instanceof Se&&"error"===t.name)return!1;if(t instanceof Ee)return!1;if(t instanceof We)return!1;var e=t instanceof ke||t instanceof _e,r=!0;return t.eachChild(function(t){r=e?r&&Qe(t):r&&t instanceof ye}),!!r&&Ye(t)&&$e(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function tr(t,e){for(var r,n,i=t.length-1,a=0,o=i,s=0;a<=o;)if(r=t[s=Math.floor((a+o)/2)],n=t[s+1],r<=e){if(s===i||e<n)return s;a=s+1}else{if(!(r>e))throw new ve("Input is not a number.");o=s-1}return 0}Ke.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ke.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new _e(e,[t]):"coerce"===r?new ke(e,[t]):t}if((null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t)&&(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof ye)&&"resolvedImage"!==a.type.kind&&Qe(a)){var l=new Me;try{a=new ye(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ke.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ke(this.registry,n,e||null,i,this.errors)},Ke.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new qt(n,t))},Ke.prototype.checkSubtype=function(t,e){var r=ie(t,e);return r&&this.error(r),r};var er=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};function rr(t,e,r){return t*(1-r)+e*r}er.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Zt);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],l=a,u=a+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new er(i,r,n)},er.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[tr(e,n)].evaluate(t)},er.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},er.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},er.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var nr=Object.freeze({__proto__:null,number:rr,color:function(t,e,r){return new le(rr(t.r,e.r,r),rr(t.g,e.g,r),rr(t.b,e.b,r),rr(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return rr(t,e[n],r)})}}),ir=.95047,ar=1.08883,or=4/29,sr=6/29,lr=3*sr*sr,ur=sr*sr*sr,cr=Math.PI/180,hr=180/Math.PI;function fr(t){return t>ur?Math.pow(t,1/3):t/lr+or}function pr(t){return t>sr?t*t*t:lr*(t-or)}function dr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function mr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function gr(t){var e=mr(t.r),r=mr(t.g),n=mr(t.b),i=fr((.4124564*e+.3575761*r+.1804375*n)/ir),a=fr((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-fr((.0193339*e+.119192*r+.9503041*n)/ar)),alpha:t.a}}function yr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*pr(e),r=ir*pr(r),n=ar*pr(n),new le(dr(3.2404542*r-1.5371385*e-.4985314*n),dr(-.969266*r+1.8760108*e+.041556*n),dr(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function vr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var xr={forward:gr,reverse:yr,interpolate:function(t,e,r){return{l:rr(t.l,e.l,r),a:rr(t.a,e.a,r),b:rr(t.b,e.b,r),alpha:rr(t.alpha,e.alpha,r)}}},_r={forward:function(t){var e=gr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*hr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*cr,r=t.c;return yr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:vr(t.h,e.h,r),c:rr(t.c,e.c,r),l:rr(t.l,e.l,r),alpha:rr(t.alpha,e.alpha,r)}}},br=Object.freeze({__proto__:null,lab:xr,hcl:_r}),wr=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function Tr(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}wr.interpolationFactor=function(t,e,r,i){var a=0;if("exponential"===t.name)a=Tr(e,t.base,r,i);else if("linear"===t.name)a=Tr(e,1,r,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new n(o[0],o[1],o[2],o[3]).solve(Tr(e,1,r,i))}return a},wr.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some(function(t){return"number"!=typeof t||t<0||t>1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Zt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Xt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c<a.length;c+=2){var h=a[c],f=a[c+1],p=c+3,d=c+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=e.parse(f,d,u);if(!m)return null;u=u||m.type,l.push([h,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new wr(u,r,n,i,l):e.error("Type "+re(u)+" is not interpolatable.")},wr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=tr(e,n),o=e[a],s=e[a+1],l=wr.interpolationFactor(this.interpolation,n,o,s),u=r[a].evaluate(t),c=r[a+1].evaluate(t);return"interpolate"===this.operator?nr[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?_r.reverse(_r.interpolate(_r.forward(u),_r.forward(c),l)):xr.reverse(xr.interpolate(xr.forward(u),xr.forward(c),l))},wr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},wr.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},wr.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var kr=function(t,e){this.type=t,this.args=e};kr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=o[a],l=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,i.push(l)}var u=n&&i.some(function(t){return ie(n,t.type)});return new kr(u?Jt:r,i)},kr.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(t))&&r instanceof fe&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},kr.prototype.eachChild=function(t){this.args.forEach(t)},kr.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},kr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ar=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ar.prototype.evaluate=function(t){return this.result.evaluate(t)},Ar.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},Ar.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a])}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new Ar(r,o):null},Ar.prototype.outputDefined=function(){return this.result.outputDefined()},Ar.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t.push(i,a.serialize())}return t.push(this.result.serialize()),t};var Mr=function(t,e,r){this.type=t,this.index=e,this.input=r};Mr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Zt),n=e.parse(t[2],2,ee(e.expectedType||Jt));if(!r||!n)return null;var i=n.type;return new Mr(i.itemType,r,n)},Mr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ve("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ve("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ve("Array index must be an integer, but found "+e+" instead.");return r[e]},Mr.prototype.eachChild=function(t){t(this.index),t(this.input)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Sr=function(t,e){this.type=Yt,this.needle=t,this.haystack=e};Sr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Jt),n=e.parse(t[2],2,Jt);return r&&n?ae(r.type,[Yt,Wt,Zt,Gt,Jt])?new Sr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+re(r.type)+" instead"):null},Sr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!oe(e,["boolean","string","number","null"]))throw new ve("Expected first argument to be of type boolean, string, number or null, but found "+re(me(e))+" instead.");if(!oe(r,["string","array"]))throw new ve("Expected second argument to be of type array or string, but found "+re(me(r))+" instead.");return r.indexOf(e)>=0},Sr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Sr.prototype.outputDefined=function(){return!0},Sr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Er=function(t,e,r){this.type=Zt,this.needle=t,this.haystack=e,this.fromIndex=r};Er.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Jt),n=e.parse(t[2],2,Jt);if(!r||!n)return null;if(!ae(r.type,[Yt,Wt,Zt,Gt,Jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+re(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Zt);return i?new Er(r,n,i):null}return new Er(r,n)},Er.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!oe(e,["boolean","string","number","null"]))throw new ve("Expected first argument to be of type boolean, string, number or null, but found "+re(me(e))+" instead.");if(!oe(r,["string","array"]))throw new ve("Expected second argument to be of type array or string, but found "+re(me(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Er.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Er.prototype.outputDefined=function(){return!1},Er.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Cr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Cr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);var u=e.concat(o);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var f=h[c];if("number"!=typeof f&&"string"!=typeof f)return u.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,me(f)))return null}else r=me(f);if(void 0!==i[String(f)])return u.error("Branch labels must be unique.");i[String(f)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,Jt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return!m||"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Cr(r,n,d,i,a,m)},Cr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(me(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Cr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Cr.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()},Cr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(h=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[h][1].push(o)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var c=u[l],h=c[0],f=c[1];1===f.length?e.push(s(f[0])):e.push(f.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var Ir=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};Ir.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,Yt);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Ir(r,n,s):null},Ir.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];if(i.evaluate(t))return a.evaluate(t)}return this.otherwise.evaluate(t)},Ir.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t(i),t(a)}t(this.otherwise)},Ir.prototype.outputDefined=function(){return this.branches.every(function(t){return t[0],t[1].outputDefined()})&&this.otherwise.outputDefined()},Ir.prototype.serialize=function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Lr=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function Pr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function zr(t,e,r,n){return 0===n.compare(e,r)}function Or(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Yt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,Jt);if(!a)return null;if(!Pr(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+re(a.type)+"'.");var o=e.parse(t[2],2,Jt);if(!o)return null;if(!Pr(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+re(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+re(a.type)+"' and '"+re(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new _e(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new _e(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Kt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=me(a),l=me(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ve('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=me(a),c=me(o);if("string"!==u.kind||"string"!==c.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e},i}()}Lr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Jt),n=e.parse(t[2],2,Zt);if(!r||!n)return null;if(!ae(r.type,[ee(Jt),Wt,Jt]))return e.error("Expected first argument to be of type array or string, but found "+re(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Zt);return i?new Lr(r.type,r,n,i):null}return new Lr(r.type,r,n)},Lr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!oe(e,["string","array"]))throw new ve("Expected first argument to be of type array or string, but found "+re(me(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Lr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Lr.prototype.outputDefined=function(){return!1},Lr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Dr=Or("==",function(t,e,r){return e===r},zr),Rr=Or("!=",function(t,e,r){return e!==r},function(t,e,r,n){return!zr(0,e,r,n)}),Fr=Or("<",function(t,e,r){return e<r},function(t,e,r,n){return n.compare(e,r)<0}),Br=Or(">",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),Nr=Or("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),jr=Or(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),Ur=function(t,e,r,n,i){this.type=Wt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Ur.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Zt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Wt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Wt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Zt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Zt))?null:new Ur(r,i,a,o,s)},Ur.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Ur.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Ur.prototype.outputDefined=function(){return!1},Ur.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Vr=function(t){this.type=Zt,this.input=t};Vr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+re(r.type)+" instead."):new Vr(r):null},Vr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ve("Expected value to be of type string or array, but found "+re(me(e))+" instead.")},Vr.prototype.eachChild=function(t){t(this.input)},Vr.prototype.outputDefined=function(){return!1},Vr.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t};var qr={"==":Dr,"!=":Rr,">":Br,"<":Fr,">=":jr,"<=":Nr,array:_e,at:Mr,boolean:_e,case:Ir,coalesce:kr,collator:Ee,format:be,image:we,in:Sr,"index-of":Er,interpolate:wr,"interpolate-hcl":wr,"interpolate-lab":wr,length:Vr,let:Ar,literal:ye,match:Cr,number:_e,"number-format":Ur,object:_e,slice:Lr,step:er,string:_e,"to-boolean":ke,"to-color":ke,"to-number":ke,"to-string":ke,var:Je,within:We};function Hr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=pe(r,n,i,o);if(s)throw new ve(s);return new le(r/255*o,n/255*o,i/255*o,o)}function Gr(t,e){return t in e}function Zr(t,e){var r=e[t];return void 0===r?null:r}function Wr(t){return{type:t}}function Yr(t){return{result:"success",value:t}}function Xr(t){return{result:"error",value:t}}function $r(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Jr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Kr(t){return!!t.expression&&t.expression.interpolated}function Qr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function tn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function en(t){return t}function rn(t,e){var r,n,i,a="color"===e.type,o=t.stops&&"object"==typeof t.stops[0][0],s=o||void 0!==t.property,l=o||!s,u=t.type||(Kr(e)?"exponential":"interval");if(a&&((t=jt({},t)).stops&&(t.stops=t.stops.map(function(t){return[t[0],le.parse(t[1])]})),t.default?t.default=le.parse(t.default):t.default=le.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!br[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===u)r=sn;else if("interval"===u)r=on;else if("categorical"===u){r=an,n=Object.create(null);for(var c=0,h=t.stops;c<h.length;c+=1){var f=h[c];n[f[0]]=f[1]}i=typeof t.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');r=ln}if(o){for(var p={},d=[],m=0;m<t.stops.length;m++){var g=t.stops[m],y=g[0].zoom;void 0===p[y]&&(p[y]={zoom:y,type:t.type,property:t.property,default:t.default,stops:[]},d.push(y)),p[y].stops.push([g[0].value,g[1]])}for(var v=[],x=0,_=d;x<_.length;x+=1){var b=_[x];v.push([p[b].zoom,rn(p[b],e)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:wr.interpolationFactor.bind(void 0,w),zoomStops:v.map(function(t){return t[0]}),evaluate:function(r,n){var i=r.zoom;return sn({stops:v,base:t.base},e,i).evaluate(i,n)}}}if(l){var T="exponential"===u?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:wr.interpolationFactor.bind(void 0,T),zoomStops:t.stops.map(function(t){return t[0]}),evaluate:function(a){var o=a.zoom;return r(t,e,o,n,i)}}}return{kind:"source",evaluate:function(a,o){var s=o&&o.properties?o.properties[t.property]:void 0;return void 0===s?nn(t.default,e.default):r(t,e,s,n,i)}}}function nn(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function an(t,e,r,n,i){return nn(typeof r===i?n[r]:void 0,t.default,e.default)}function on(t,e,r){if("number"!==Qr(r))return nn(t.default,e.default);var n=t.stops.length;if(1===n||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=tr(t.stops.map(function(t){return t[0]}),r);return t.stops[i][1]}function sn(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Qr(r))return nn(t.default,e.default);var i=t.stops.length;if(1===i||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=tr(t.stops.map(function(t){return t[0]}),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=nr[e.type]||en;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=br[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function ln(t,e,r){return"color"===e.type?r=le.parse(r):"formatted"===e.type?r=he.fromString(r.toString()):"resolvedImage"===e.type?r=fe.fromString(r.toString()):Qr(r)!==e.type&&("enum"!==e.type||!e.values[r])&&(r=void 0),nn(r,t.default,e.default)}Se.register(qr,{error:[{kind:"error"},[Wt],function(t,e){var r=e[0];throw new ve(r.evaluate(t))}],typeof:[Wt,[Jt],function(t,e){return re(me(e[0].evaluate(t)))}],"to-rgba":[ee(Zt,4),[Xt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Xt,[Zt,Zt,Zt],Hr],rgba:[Xt,[Zt,Zt,Zt,Zt],Hr],has:{type:Yt,overloads:[[[Wt],function(t,e){return Gr(e[0].evaluate(t),t.properties())}],[[Wt,$t],function(t,e){var r=e[0],n=e[1];return Gr(r.evaluate(t),n.evaluate(t))}]]},get:{type:Jt,overloads:[[[Wt],function(t,e){return Zr(e[0].evaluate(t),t.properties())}],[[Wt,$t],function(t,e){var r=e[0],n=e[1];return Zr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Jt,[Wt],function(t,e){return Zr(e[0].evaluate(t),t.featureState||{})}],properties:[$t,[],function(t){return t.properties()}],"geometry-type":[Wt,[],function(t){return t.geometryType()}],id:[Jt,[],function(t){return t.id()}],zoom:[Zt,[],function(t){return t.globals.zoom}],"heatmap-density":[Zt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Zt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Zt,Wr(Zt),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Zt,Wr(Zt),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Zt,overloads:[[[Zt,Zt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[Zt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Zt,[Zt,Zt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[Zt,[Zt,Zt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[Zt,[],function(){return Math.LN2}],pi:[Zt,[],function(){return Math.PI}],e:[Zt,[],function(){return Math.E}],"^":[Zt,[Zt,Zt],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[Zt,[Zt],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Zt,[Zt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Zt,[Zt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Zt,[Zt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Zt,[Zt],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Zt,[Zt],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Zt,[Zt],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Zt,[Zt],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Zt,[Zt],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Zt,[Zt],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Zt,Wr(Zt),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[Zt,Wr(Zt),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],abs:[Zt,[Zt],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Zt,[Zt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Zt,[Zt],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Zt,[Zt],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Yt,[Wt,Jt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Yt,[Jt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Yt,[Wt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Yt,[Wt,Jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[Yt,[Jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Yt,[Wt,Jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Yt,[Jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Yt,[Wt,Jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Yt,[Jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Yt,[Wt,Jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Yt,[Jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Yt,[Jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Yt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Yt,[ee(Wt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Yt,[ee(Jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Yt,[Wt,ee(Jt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Yt,[Wt,ee(Jt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Yt,overloads:[[[Yt,Yt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Wr(Yt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Yt,overloads:[[[Yt,Yt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[Wr(Yt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Yt,[Yt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Yt,[Wt],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[Wt,[Wt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Wt,[Wt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Wt,Wr(Jt),function(t,e){return e.map(function(e){return ge(e.evaluate(t))}).join("")}],"resolved-locale":[Wt,[Kt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var un=function(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new Me,this._defaultValue=e?"color"===(r=e).type&&tn(r.default)?new le(0,0,0,0):"color"===r.type?le.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function cn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in qr}function hn(t,e){var r=new Ke(qr,[],e?function(t){var e={color:Xt,string:Wt,number:Zt,enum:Wt,boolean:Yt,formatted:Qt,resolvedImage:te};return"array"===t.type?ee(e[t.value]||Jt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Yr(new un(n,e)):Xr(r.errors)}un.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},un.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ve("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var fn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Xe(e.expression)};fn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},fn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var pn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Xe(e.expression),this.interpolationType=n};function dn(t,e){if("error"===(t=hn(t,e)).result)return t;var r=t.value.expression,n=Ye(r);if(!n&&!$r(e))return Xr([new qt("","data expressions not supported")]);var i=$e(r,["zoom"]);if(!i&&!Jr(e))return Xr([new qt("","zoom expressions not supported")]);var a=gn(r);if(!a&&!i)return Xr([new qt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof qt)return Xr([a]);if(a instanceof wr&&!Kr(e))return Xr([new qt("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Yr(new fn(n?"constant":"source",t.value));var o=a instanceof wr?a.interpolation:void 0;return Yr(new pn(n?"camera":"composite",t.value,a.labels,o))}pn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},pn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},pn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?wr.interpolationFactor(this.interpolationType,t,e,r):0};var mn=function(t,e){this._parameters=t,this._specification=e,jt(this,rn(this._parameters,this._specification))};function gn(t){var e=null;if(t instanceof Ar)e=gn(t.result);else if(t instanceof kr)for(var r=0,n=t.args;r<n.length;r+=1){var i=n[r];if(e=gn(i))break}else(t instanceof er||t instanceof wr)&&t.input instanceof Se&&"zoom"===t.input.name&&(e=t);return e instanceof qt||t.eachChild(function(t){var r=gn(t);r instanceof qt?e=r:!e&&r?e=new qt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new qt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function yn(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],l=Qr(r);if("object"!==l)return[new Bt(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],h=n[c]||n["*"],f=void 0;if(i[c])f=i[c];else if(n[c])f=Hn;else if(i["*"])f=i["*"];else{if(!n["*"]){s.push(new Bt(e,r[u],'unknown property "'+u+'"'));continue}f=Hn}s=s.concat(f({key:(e&&e+".")+u,value:r[u],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:u},r))}for(var p in n)i[p]||n[p].required&&void 0===n[p].default&&void 0===r[p]&&s.push(new Bt(e,r,'missing required property "'+p+'"'));return s}function vn(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||Hn;if("array"!==Qr(e))return[new Bt(a,e,"array expected, "+Qr(e)+" found")];if(r.length&&e.length!==r.length)return[new Bt(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Bt(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===Qr(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(o({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:n,styleSpec:i,key:a+"["+u+"]"}));return l}function xn(t){var e=t.key,r=t.value,n=t.valueSpec,i=Qr(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new Bt(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Bt(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Bt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function _n(t){var e,r,n,i=t.valueSpec,a=Ut(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===Qr(t.value.stops)&&"array"===Qr(t.value.stops[0])&&"object"===Qr(t.value.stops[0][0]),c=yn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Bt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(vn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Qr(r)&&0===r.length&&e.push(new Bt(t.key,r,"array must have at least one stop")),e},default:function(t){return Hn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&c.push(new Bt(t.key,t.value,'missing required property "property"')),"identity"!==a&&!t.value.stops&&c.push(new Bt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Kr(t.valueSpec)&&c.push(new Bt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!$r(t.valueSpec)?c.push(new Bt(t.key,t.value,"property functions not supported")):s&&!Jr(t.valueSpec)&&c.push(new Bt(t.key,t.value,"zoom functions not supported"))),("categorical"===a||u)&&void 0===t.value.property&&c.push(new Bt(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],a=t.value,s=t.key;if("array"!==Qr(a))return[new Bt(s,a,"array expected, "+Qr(a)+" found")];if(2!==a.length)return[new Bt(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==Qr(a[0]))return[new Bt(s,a,"object expected, "+Qr(a[0])+" found")];if(void 0===a[0].zoom)return[new Bt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Bt(s,a,"object stop key must have value")];if(n&&n>Ut(a[0].zoom))return[new Bt(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ut(a[0].zoom)!==n&&(n=Ut(a[0].zoom),r=void 0,o={}),e=e.concat(yn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:xn,value:f}}))}else e=e.concat(f({key:s+"[0]",value:a[0],style:t.style,styleSpec:t.styleSpec},a));return cn(Vt(a[1]))?e.concat([new Bt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Hn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=Qr(t.value),l=Ut(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new Bt(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Bt(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return $r(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Bt(t.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new Bt(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new Bt(t.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new Bt(t.key,u,"integer expected, found "+l)]}}function bn(t){var e=("property"===t.expressionContext?dn:hn)(Vt(t.value),t.valueSpec);if("error"===e.result)return e.value.map(function(e){return new Bt(""+t.key+e.key,t.value,e.message)});var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new Bt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Xe(r))return[new Bt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Xe(r))return[new Bt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!$e(r,["zoom","feature-state"]))return[new Bt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Ye(r))return[new Bt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function wn(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ut(r))&&i.push(new Bt(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Ut(r))&&i.push(new Bt(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function Tn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!Tn(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}mn.deserialize=function(t){return new mn(t._parameters,t._specification)},mn.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var kn={type:"boolean",default:!1};function An(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};Tn(t)||(t=En(t));var e=hn(t,kn);if("error"===e.result)throw new Error(e.value.map(function(t){return t.key+": "+t.message}).join(", "));return{filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},needGeometry:Sn(t)}}function Mn(t,e){return t<e?-1:t>e?1:0}function Sn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(Sn(t[e]))return!0;return!1}function En(t){if(!t)return!0;var e=t[0];return t.length<=1?"any"!==e:"=="===e?Cn(t[1],t[2],"=="):"!="===e?Pn(Cn(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Cn(t[1],t[2],e):"any"===e?function(t){return["any"].concat(t.map(En))}(t.slice(1)):"all"===e?["all"].concat(t.slice(1).map(En)):"none"===e?["all"].concat(t.slice(1).map(En).map(Pn)):"in"===e?In(t[1],t.slice(2)):"!in"===e?Pn(In(t[1],t.slice(2))):"has"===e?Ln(t[1]):"!has"===e?Pn(Ln(t[1])):"within"!==e||t}function Cn(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function In(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(Mn)]]:["filter-in-small",t,["literal",e]]}}function Ln(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Pn(t){return["!",t]}function zn(t){return Tn(Vt(t.value))?bn(jt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):On(t)}function On(t){var e=t.value,r=t.key;if("array"!==Qr(e))return[new Bt(r,e,"array expected, "+Qr(e)+" found")];var n,i=t.styleSpec,a=[];if(e.length<1)return[new Bt(r,e,"filter array must have at least 1 element")];switch(a=a.concat(wn({key:r+"[0]",value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ut(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Ut(e[1])&&a.push(new Bt(r,e,'"$type" cannot be use with operator "'+e[0]+'"'));case"==":case"!=":3!==e.length&&a.push(new Bt(r,e,'filter array for operator "'+e[0]+'" must have 3 elements'));case"in":case"!in":e.length>=2&&"string"!==(n=Qr(e[1]))&&a.push(new Bt(r+"[1]",e[1],"string expected, "+n+" found"));for(var o=2;o<e.length;o++)n=Qr(e[o]),"$type"===Ut(e[1])?a=a.concat(wn({key:r+"["+o+"]",value:e[o],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new Bt(r+"["+o+"]",e[o],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var s=1;s<e.length;s++)a=a.concat(On({key:r+"["+s+"]",value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=Qr(e[1]),2!==e.length?a.push(new Bt(r,e,'filter array for "'+e[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new Bt(r+"[1]",e[1],"string expected, "+n+" found"));break;case"within":n=Qr(e[1]),2!==e.length?a.push(new Bt(r,e,'filter array for "'+e[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new Bt(r+"[1]",e[1],"object expected, "+n+" found"))}return a}function Dn(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Hn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var u,c=t.valueSpec||s[o];if(!c)return[new Bt(r,a,'unknown property "'+o+'"')];if("string"===Qr(a)&&$r(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new Bt(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&h.push(new Bt(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&tn(Vt(a))&&"identity"===Ut(a.type)&&h.push(new Bt(r,a,'"text-font" does not support identity functions'))),h.concat(Hn({key:t.key,value:a,valueSpec:c,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function Rn(t){return Dn(t,"paint")}function Fn(t){return Dn(t,"layout")}function Bn(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;!r.type&&!r.ref&&e.push(new Bt(n,r,'either "type" or "ref" is required'));var o,s=Ut(r.type),l=Ut(r.ref);if(r.id)for(var u=Ut(r.id),c=0;c<t.arrayIndex;c++){var h=i.layers[c];Ut(h.id)===u&&e.push(new Bt(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new Bt(n,r[t],'"'+t+'" is prohibited for ref layers'))}),i.layers.forEach(function(t){Ut(t.id)===l&&(o=t)}),o?o.ref?e.push(new Bt(n,r.ref,"ref cannot reference another ref layer")):s=Ut(o.type):e.push(new Bt(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var f=i.sources&&i.sources[r.source],p=f&&Ut(f.type);f?"vector"===p&&"raster"===s?e.push(new Bt(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===p&&"raster"!==s?e.push(new Bt(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==p||r["source-layer"]?"raster-dem"===p&&"hillshade"!==s?e.push(new Bt(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"===s&&r.paint&&r.paint["line-gradient"]&&("geojson"!==p||!f.lineMetrics)&&e.push(new Bt(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Bt(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Bt(n,r.source,'source "'+r.source+'" not found'))}else e.push(new Bt(n,r,'missing required property "source"'));return e=e.concat(yn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Hn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:zn,layout:function(t){return yn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Fn(jt({layerType:s},t))}}})},paint:function(t){return yn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Rn(jt({layerType:s},t))}}})}}}))}function Nn(t){var e=t.value,r=t.key,n=Qr(e);return"string"!==n?[new Bt(r,e,"string expected, "+n+" found")]:[]}var jn={promoteId:function(t){var e=t.key,r=t.value;if("string"===Qr(r))return Nn({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,Nn({key:e+"."+i,value:r[i]}));return n}};function Un(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new Bt(r,e,'"type" is required')];var a,o=Ut(e.type);switch(o){case"vector":case"raster":case"raster-dem":return a=yn({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:jn});case"geojson":if(a=yn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:jn}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],u=l[0],c=l[1],h="string"==typeof u?[u,["accumulated"],["get",s]]:u;a.push.apply(a,bn({key:r+"."+s+".map",value:c,expressionContext:"cluster-map"})),a.push.apply(a,bn({key:r+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return a;case"video":return yn({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return yn({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new Bt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return wn({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Vn(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=Qr(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new Bt("light",e,"object expected, "+o+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);a=l&&n[l[1]]&&n[l[1]].transition?a.concat(Hn({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?a.concat(Hn({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a.concat([new Bt(s,e[s],'unknown property "'+s+'"')])}return a}var qn={"*":function(){return[]},array:vn,boolean:function(t){var e=t.value,r=t.key,n=Qr(e);return"boolean"!==n?[new Bt(r,e,"boolean expected, "+n+" found")]:[]},number:xn,color:function(t){var e=t.key,r=t.value,n=Qr(r);return"string"!==n?[new Bt(e,r,"color expected, "+n+" found")]:null===se(r)?[new Bt(e,r,'color expected, "'+r+'" found')]:[]},constants:Nt,enum:wn,filter:zn,function:_n,layer:Bn,object:yn,source:Un,light:Vn,string:Nn,formatted:function(t){return 0===Nn(t).length?[]:bn(t)},resolvedImage:function(t){return 0===Nn(t).length?[]:bn(t)}};function Hn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&tn(Ut(e))?_n(t):r.expression&&cn(Vt(e))?bn(t):r.type&&qn[r.type]?qn[r.type](t):yn(jt({},t,{valueSpec:r.type?n[r.type]:r}))}function Gn(t){var e=t.value,r=t.key,n=Nn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Bt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Bt(r,e,'"glyphs" url must include a "{range}" token'))),n}function Zn(t,e){void 0===e&&(e=Ft);var r=[];return r=r.concat(Hn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Gn,"*":function(){return[]}}})),t.constants&&(r=r.concat(Nt({key:"constants",value:t.constants}))),Wn(r)}function Wn(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function Yn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Wn(t.apply(this,e))}}Zn.source=Yn(Un),Zn.light=Yn(Vn),Zn.layer=Yn(Bn),Zn.filter=Yn(zn),Zn.paintProperty=Yn(Rn),Zn.layoutProperty=Yn(Fn);var Xn=Zn,$n=Xn.light,Jn=Xn.paintProperty,Kn=Xn.layoutProperty;function Qn(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1){var a=i[n];t.fire(new Dt(new Error(a.message))),r=!0}return r}var ti=ri,ei=3;function ri(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var a=0;a<this.d*this.d;a++){var o=i[ei+a],s=i[ei+a+1];n.push(o===s?null:i.subarray(o,s))}var l=i[ei+n.length],u=i[ei+n.length+1];this.keys=i.subarray(l,u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}ri.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},ri.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ri.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},ri.prototype.query=function(t,e,r,n,i){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},ri.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=this.cells[i];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var f=l[h];if(void 0===o[f]){var p=4*f;(s?s(c[p+0],c[p+1],c[p+2],c[p+3]):t<=c[p+2]&&e<=c[p+3]&&r>=c[p+0]&&n>=c[p+1])?(o[f]=!0,a.push(u[f])):o[f]=!1}}},ri.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),f=l;f<=c;f++)for(var p=u;p<=h;p++){var d=this.d*p+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},ri.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ri.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ri.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=ei+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[ei+o]=a,i.set(s,a),a+=s.length}return i[ei+t.length]=a,i.set(this.keys,a),a+=this.keys.length,i[ei+t.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var ni=s.ImageData,ii=s.ImageBitmap,ai={};function oi(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ai[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var si in oi("Object",Object),ti.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},ti.deserialize=function(t){return new ti(t.buffer)},oi("Grid",ti),oi("Color",le),oi("Error",Error),oi("ResolvedImage",fe),oi("StylePropertyFunction",mn),oi("StyleExpression",un,{omit:["_evaluator"]}),oi("ZoomDependentExpression",pn),oi("ZoomConstantExpression",fn),oi("CompoundExpression",Se,{omit:["_evaluate"]}),qr)qr[si]._classRegistryKey||oi("Expression_"+si,qr[si]);function li(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function ui(t){return ii&&t instanceof ii}function ci(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(li(t)||ui(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof ni)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1){var o=a[i];n.push(ci(o,e))}return n}if("object"==typeof t){var s=t.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(ai[l].omit.indexOf(c)>=0)){var h=t[c];u[c]=ai[l].shallow.indexOf(c)>=0?h:ci(h,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof t)}function hi(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||li(t)||ui(t)||ArrayBuffer.isView(t)||t instanceof ni)return t;if(Array.isArray(t))return t.map(hi);if("object"==typeof t){var e=t.$name||"Object",r=ai[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=ai[e].shallow.indexOf(o)>=0?s:hi(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var fi=function(){this.first=!0};fi.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var pi={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function di(t){for(var e=0,r=t;e<r.length;e+=1)if(yi(r[e].charCodeAt(0)))return!0;return!1}function mi(t){return!(pi.Arabic(t)||pi["Arabic Supplement"](t)||pi["Arabic Extended-A"](t)||pi["Arabic Presentation Forms-A"](t)||pi["Arabic Presentation Forms-B"](t))}function gi(t){return!(t<11904||!(pi["Bopomofo Extended"](t)||pi.Bopomofo(t)||pi["CJK Compatibility Forms"](t)||pi["CJK Compatibility Ideographs"](t)||pi["CJK Compatibility"](t)||pi["CJK Radicals Supplement"](t)||pi["CJK Strokes"](t)||pi["CJK Symbols and Punctuation"](t)||pi["CJK Unified Ideographs Extension A"](t)||pi["CJK Unified Ideographs"](t)||pi["Enclosed CJK Letters and Months"](t)||pi["Halfwidth and Fullwidth Forms"](t)||pi.Hiragana(t)||pi["Ideographic Description Characters"](t)||pi["Kangxi Radicals"](t)||pi["Katakana Phonetic Extensions"](t)||pi.Katakana(t)||pi["Vertical Forms"](t)||pi["Yi Radicals"](t)||pi["Yi Syllables"](t)))}function yi(t){return 746===t||747===t||!(t<4352)&&!!(pi["Bopomofo Extended"](t)||pi.Bopomofo(t)||pi["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||pi["CJK Compatibility Ideographs"](t)||pi["CJK Compatibility"](t)||pi["CJK Radicals Supplement"](t)||pi["CJK Strokes"](t)||pi["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&12336!==t||pi["CJK Unified Ideographs Extension A"](t)||pi["CJK Unified Ideographs"](t)||pi["Enclosed CJK Letters and Months"](t)||pi["Hangul Compatibility Jamo"](t)||pi["Hangul Jamo Extended-A"](t)||pi["Hangul Jamo Extended-B"](t)||pi["Hangul Jamo"](t)||pi["Hangul Syllables"](t)||pi.Hiragana(t)||pi["Ideographic Description Characters"](t)||pi.Kanbun(t)||pi["Kangxi Radicals"](t)||pi["Katakana Phonetic Extensions"](t)||pi.Katakana(t)&&12540!==t||!(!pi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!pi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||pi["Unified Canadian Aboriginal Syllabics"](t)||pi["Unified Canadian Aboriginal Syllabics Extended"](t)||pi["Vertical Forms"](t)||pi["Yijing Hexagram Symbols"](t)||pi["Yi Syllables"](t)||pi["Yi Radicals"](t))}function vi(t){return!(yi(t)||function(t){return!!(pi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||pi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||pi["Letterlike Symbols"](t)||pi["Number Forms"](t)||pi["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||pi["Control Pictures"](t)&&9251!==t||pi["Optical Character Recognition"](t)||pi["Enclosed Alphanumerics"](t)||pi["Geometric Shapes"](t)||pi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||pi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||pi["CJK Symbols and Punctuation"](t)||pi.Katakana(t)||pi["Private Use Area"](t)||pi["CJK Compatibility Forms"](t)||pi["Small Form Variants"](t)||pi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function xi(t){return pi.Arabic(t)||pi["Arabic Supplement"](t)||pi["Arabic Extended-A"](t)||pi["Arabic Presentation Forms-A"](t)||pi["Arabic Presentation Forms-B"](t)}function _i(t){return t>=1424&&t<=2303||pi["Arabic Presentation Forms-A"](t)||pi["Arabic Presentation Forms-B"](t)}function bi(t,e){return!(!e&&_i(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||pi.Khmer(t))}function wi(t){for(var e=0,r=t;e<r.length;e+=1)if(_i(r[e].charCodeAt(0)))return!0;return!1}var Ti="deferred",ki="loading",Ai="loaded",Mi="error",Si=null,Ei="unavailable",Ci=null,Ii=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Ei=Mi),Si&&Si(t)};function Li(){Pi.fire(new Ot("pluginStateChange",{pluginStatus:Ei,pluginURL:Ci}))}var Pi=new Rt,zi=function(){return Ei},Oi=function(){if(Ei!==Ti||!Ci)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ei=ki,Li(),Ci&&At({url:Ci},function(t){t?Ii(t):(Ei=Ai,Li())})},Di={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ei===Ai||null!=Di.applyArabicShaping},isLoading:function(){return Ei===ki},setState:function(t){Ei=t.pluginStatus,Ci=t.pluginURL},isParsed:function(){return null!=Di.applyArabicShaping&&null!=Di.processBidirectionalText&&null!=Di.processStyledBidirectionalText},getPluginURL:function(){return Ci}},Ri=function(){!Di.isLoading()&&!Di.isLoaded()&&"deferred"===zi()&&Oi()},Fi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new fi,this.transition={})};Fi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!bi(n[r].charCodeAt(0),e))return!1;return!0}(t,Di.isLoaded())},Fi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Fi.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Bi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(tn(t))return new mn(t,e);if(cn(t)){var r=dn(t,e);if("error"===r.result)throw new Error(r.value.map(function(t){return t.key+": "+t.message}).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=le.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Bi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Bi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Ni=function(t){this.property=t,this.value=new Bi(t,void 0)};Ni.prototype.transitioned=function(t,e){return new Ui(this.property,this.value,e,p({},t.transition,this.transition),t.now)},Ni.prototype.untransitioned=function(){return new Ui(this.property,this.value,null,{},0)};var ji=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ji.prototype.getValue=function(t){return w(this._values[t].value.value)},ji.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ni(this._values[t].property)),this._values[t].value=new Bi(this._values[t].property,null===e?void 0:w(e))},ji.prototype.getTransition=function(t){return w(this._values[t].transition)},ji.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ni(this._values[t].property)),this._values[t].transition=w(e)||void 0},ji.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a)}return t},ji.prototype.transitioned=function(t,e){for(var r=new Vi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a])}return r},ji.prototype.untransitioned=function(){for(var t=new Vi(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var Ui=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};Ui.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var Vi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Vi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Gi(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r)}return n},Vi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var qi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};qi.prototype.getValue=function(t){return w(this._values[t].value)},qi.prototype.setValue=function(t,e){this._values[t]=new Bi(this._values[t].property,null===e?void 0:w(e))},qi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},qi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Gi(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r)}return n};var Hi=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Hi.prototype.isConstant=function(){return"constant"===this.value.kind},Hi.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Hi.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var Gi=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Gi.prototype.get=function(t){return this._values[t]};var Zi=function(t){this.specification=t};Zi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Zi.prototype.interpolate=function(t,e,r){var n=nr[this.specification.type];return n?n(t,e,r):t};var Wi=function(t,e){this.specification=t,this.overrides=e};Wi.prototype.possiblyEvaluate=function(t,e,r,n){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Hi(this,{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)},e):new Hi(this,t.expression,e)},Wi.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Hi(this,{kind:"constant",value:void 0},t.parameters);var n=nr[this.specification.type];return n?new Hi(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},Wi.prototype.evaluate=function(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)};var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new Hi(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new Hi(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Hi(this,{kind:"constant",value:s},e)}return new Hi(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,a){if("source"===t.kind){var o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Wi),Xi=function(t){this.specification=t};Xi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Fi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Fi(Math.floor(e.zoom),e)),t.expression.evaluate(new Fi(Math.floor(e.zoom+1),e)),e)}},Xi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Xi.prototype.interpolate=function(t){return t};var $i=function(t){this.specification=t};$i.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},$i.prototype.interpolate=function(){return!1};var Ji=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Bi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Ni(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};oi("DataDrivenProperty",Wi),oi("DataConstantProperty",Zi),oi("CrossFadedDataDrivenProperty",Yi),oi("CrossFadedProperty",Xi),oi("ColorRampProperty",$i);var Ki="-transition",Qi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new qi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ji(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Gi(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(Kn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return x(t,Ki)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Jn,n,t,e,r))return!1}if(x(t,Ki))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom||this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),b(t,function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Qn(this,t.call(Xn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Ft,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Hi&&$r(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Rt),ta={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ea=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ra=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function na(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map(function(t){var i=function(t){return ta[t].BYTES_PER_ELEMENT}(t.type),a=r=ia(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}}),size:ia(r,Math.max(n,e)),alignment:e}}function ia(t,e){return Math.ceil(t/e)*e}ra.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},ra.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},ra.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ra.prototype.clear=function(){this.length=0},ra.prototype.resize=function(t){this.reserve(t),this.length=t},ra.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},ra.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(ra);aa.prototype.bytesPerElement=4,oi("StructArrayLayout2i4",aa);var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(ra);oa.prototype.bytesPerElement=8,oi("StructArrayLayout4i8",oa);var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(ra);sa.prototype.bytesPerElement=12,oi("StructArrayLayout2i4i12",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(ra);la.prototype.bytesPerElement=8,oi("StructArrayLayout2i4ub8",la);var ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(ra);ua.prototype.bytesPerElement=8,oi("StructArrayLayout2f8",ua);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l,u)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t},e}(ra);ca.prototype.bytesPerElement=20,oi("StructArrayLayout10ui20",ca);var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,u,c,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,h,f){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=h,this.int16[p+11]=f,t},e}(ra);ha.prototype.bytesPerElement=24,oi("StructArrayLayout4i4ui4i24",ha);var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(ra);fa.prototype.bytesPerElement=12,oi("StructArrayLayout3f12",fa);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(ra);pa.prototype.bytesPerElement=4,oi("StructArrayLayout1ul4",pa);var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[h+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t},e}(ra);da.prototype.bytesPerElement=20,oi("StructArrayLayout6i1ul2ui20",da);var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(ra);ma.prototype.bytesPerElement=12,oi("StructArrayLayout2i2i2i12",ma);var ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(ra);ga.prototype.bytesPerElement=16,oi("StructArrayLayout2f1f2i16",ga);var ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(ra);ya.prototype.bytesPerElement=12,oi("StructArrayLayout2ub2f12",ya);var va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(ra);va.prototype.bytesPerElement=6,oi("StructArrayLayout3ui6",va);var xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y){var v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t},e}(ra);xa.prototype.bytesPerElement=48,oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",xa);var _a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){var C=34*t,I=17*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.float32[I+15]=S,this.float32[I+16]=E,t},e}(ra);_a.prototype.bytesPerElement=68,oi("StructArrayLayout8i15ui1ul4f68",_a);var ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(ra);ba.prototype.bytesPerElement=4,oi("StructArrayLayout1f4",ba);var wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(ra);wa.prototype.bytesPerElement=6,oi("StructArrayLayout3i6",wa);var Ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(ra);Ta.prototype.bytesPerElement=8,oi("StructArrayLayout1ul2ui8",Ta);var ka=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(ra);ka.prototype.bytesPerElement=4,oi("StructArrayLayout2ui4",ka);var Aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(ra);Aa.prototype.bytesPerElement=2,oi("StructArrayLayout1ui2",Aa);var Ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(ra);Ma.prototype.bytesPerElement=16,oi("StructArrayLayout4f16",Ma);var Sa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(ea);Sa.prototype.size=20;var Ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Sa(this,t)},e}(da);oi("CollisionBoxArray",Ea);var Ca=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(ea);Ca.prototype.size=48;var Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ca(this,t)},e}(xa);oi("PlacedSymbolArray",Ia);var La=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(ea);La.prototype.size=68;var Pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new La(this,t)},e}(_a);oi("SymbolInstanceArray",Pa);var za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ba);oi("GlyphOffsetArray",za);var Oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(wa);oi("SymbolLineVertexArray",Oa);var Da=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(ea);Da.prototype.size=8;var Ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Da(this,t)},e}(Ta);oi("FeatureIndexArray",Ra);var Fa=na([{name:"a_pos",components:2,type:"Int16"}],4).members,Ba=function(t){void 0===t&&(t=[]),this.segments=t};function Na(t,e){return 256*(t=h(Math.floor(t),0,255))+(e=h(Math.floor(e),0,255))}Ba.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Ba.MAX_VERTEX_ARRAY_LENGTH&&k("Max vertices per segment is "+Ba.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ba.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Ba.prototype.get=function(){return this.segments},Ba.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},Ba.simpleSegment=function(t,e,r,n){return new Ba([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Ba.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,oi("SegmentVector",Ba);var ja=na([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Ua=e(function(t){t.exports=function(t,e){var r,n,i,a,o,s,l,u;for(r=3&t.length,n=t.length-r,i=e,o=3432918353,s=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+(((a>>>16)+58964&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}}),Va=e(function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}}),qa=Ua,Ha=Ua,Ga=Va;qa.murmur3=Ha,qa.murmur2=Ga;var Za=function(){this.ids=[],this.positions=[],this.indexed=!1};Za.prototype.add=function(t,e,r,n){this.ids.push(Ya(t)),this.positions.push(e,r,n)},Za.prototype.getPositions=function(t){for(var e=Ya(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Za.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Xa(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},Za.deserialize=function(t){var e=new Za;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var Wa=Math.pow(2,53)-1;function Ya(t){var e=+t;return!isNaN(e)&&e<=Wa?e:qa(String(t))}function Xa(t,e,r,n){for(;r<n;){for(var i=t[r+n>>1],a=r-1,o=n+1;;){do{a++}while(t[a]<i);do{o--}while(t[o]>i);if(a>=o)break;$a(t,a,o),$a(e,3*a,3*o),$a(e,3*a+1,3*o+1),$a(e,3*a+2,3*o+2)}o-r<n-o?(Xa(t,e,r,o),r=o+1):(Xa(t,e,o+1,n),n=o)}}function $a(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}oi("FeaturePositionMap",Za);var Ja=function(t,e){this.gl=t.gl,this.location=e},Ka=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Ja),Qa=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Ja),to=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){(t[0]!==this.current[0]||t[1]!==this.current[1])&&(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Ja),eo=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2])&&(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Ja),ro=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Ja),no=function(t){function e(e,r){t.call(this,e,r),this.current=le.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Ja),io=new Float32Array(16),ao=function(t){function e(e,r){t.call(this,e,r),this.current=io}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Ja);function oo(t){return[Na(255*t.r,255*t.g),Na(255*t.b,255*t.a)]}var so=function(t,e,r){this.value=t,this.uniformNames=e.map(function(t){return"u_"+t}),this.type=r};so.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},so.prototype.getBinding=function(t,e,r){return"color"===this.type?new no(t,e):new Qa(t,e)};var lo=function(t,e){this.uniformNames=e.map(function(t){return"u_"+t}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};lo.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},lo.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)},lo.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new ro(t,e):new Qa(t,e)};var uo=function(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}}),this.paintVertexArray=new n};uo.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new Fi(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)},uo.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)},uo.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=oo(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else{for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},uo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},uo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var co=function(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map(function(t){return"u_"+t+"_t"}),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}}),this.paintVertexArray=new a};co.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.expression.evaluate(new Fi(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new Fi(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)},co.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)},co.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=oo(r),a=oo(n),o=t;o<e;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},co.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},co.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},co.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=h(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)},co.prototype.getBinding=function(t,e,r){return new Qa(t,e)};var ho=function(t,e,r,n,i,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};ho.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r)},ho.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)},ho.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=r.min,a=r.mid,o=r.max,s=n[i],l=n[a],u=n[o];if(s&&l&&u)for(var c=t;c<e;c++)this.zoomInPaintVertexArray.emplace(c,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(c,l.tl[0],l.tl[1],l.br[0],l.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],l.pixelRatio,u.pixelRatio)}},ho.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,ja.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,ja.members,this.expression.isStateDependent))},ho.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var fo=function(t,e,r){this.binders={},this._buffers=[];var n=[];for(var i in t.paint._values)if(r(i)){var a=t.paint.get(i);if(a instanceof Hi&&$r(a.property.specification)){var o=mo(i,t.type),s=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,c=a.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[i]=h?new lo(s.value,o):new so(s.value,o,l),n.push("/u_"+i);else if("source"===s.kind||h){var f=go(i,l,"source");this.binders[i]=h?new ho(s,l,u,e,f,t.id):new uo(s,o,l,f),n.push("/a_"+i)}else{var p=go(i,l,"composite");this.binders[i]=new co(s,o,l,u,e,p),n.push("/z_"+i)}}}this.cacheKey=n.sort().join("")};fo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof uo||e instanceof co?e.maxValue:0},fo.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof uo||o instanceof co||o instanceof ho)&&o.populatePaintArray(t,e,r,n,i)}},fo.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof lo&&n.setConstantPatternPositions(t,e)}},fo.prototype.updatePaintArrays=function(t,e,r,n,i){var a=!1;for(var o in t)for(var s=0,l=e.getPositions(o);s<l.length;s+=1){var u=l[s],c=r.feature(u.index);for(var h in this.binders){var f=this.binders[h];if((f instanceof uo||f instanceof co||f instanceof ho)&&!0===f.expression.isStateDependent){var p=n.paint.get(h);f.expression=p.value,f.updatePaintArray(u.start,u.end,c,t[o],i),a=!0}}}return a},fo.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof so||r instanceof lo)&&t.push.apply(t,r.uniformNames.map(function(t){return"#define HAS_UNIFORM_"+t}))}return t},fo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof uo||r instanceof co)for(var n=0;n<r.paintVertexAttributes.length;n++)t.push(r.paintVertexAttributes[n].name);else if(r instanceof ho)for(var i=0;i<ja.members.length;i++)t.push(ja.members[i].name)}return t},fo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof so||r instanceof lo||r instanceof co)for(var n=0,i=r.uniformNames;n<i.length;n+=1){var a=i[n];t.push(a)}}return t},fo.prototype.getPaintVertexBuffers=function(){return this._buffers},fo.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof so||i instanceof lo||i instanceof co)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var l=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:l})}}}return r},fo.prototype.setUniforms=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.name,l=o.property,u=o.binding;this.binders[l].setUniform(u,n,r.get(l),s)}},fo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof ho){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof uo||r instanceof co)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},fo.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof uo||r instanceof co||r instanceof ho)&&r.upload(t)}this.updatePaintBuffers()},fo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof uo||e instanceof co||e instanceof ho)&&e.destroy()}};var po=function(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var n=0,i=t;n<i.length;n+=1){var a=i[n];this.programConfigurations[a.id]=new fo(a,e,r)}this.needsUpload=!1,this._featureMap=new Za,this._bufferOffset=0};function mo(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function go(t,e,r){var n={color:{source:ua,composite:Ma},number:{source:ba,composite:ua}},i=function(t){return{"line-pattern":{source:ca,composite:ca},"fill-pattern":{source:ca,composite:ca},"fill-extrusion-pattern":{source:ca,composite:ca}}[t]}(t);return i&&i[r]||n[e][r]}po.prototype.populatePaintArrays=function(t,e,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},po.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n)||this.needsUpload}},po.prototype.get=function(t){return this.programConfigurations[t]},po.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},po.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},oi("ConstantBinder",so),oi("CrossFadedConstantBinder",lo),oi("SourceExpressionBinder",uo),oi("CrossFadedCompositeBinder",ho),oi("CompositeExpressionBinder",co),oi("ProgramConfiguration",fo,{omit:["_buffers"]}),oi("ProgramConfigurationSet",po);var yo=8192,vo=Math.pow(2,14)-1,xo=-vo-1;function _o(t){for(var e=yo/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a],s=Math.round(o.x*e),l=Math.round(o.y*e);o.x=h(s,xo,vo),o.y=h(l,xo,vo),(s<o.x||s>o.x+1||l<o.y||l>o.y+1)&&k("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function bo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?_o(t):[]}}function wo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var To=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new aa,this.indexArray=new va,this.segments=new Ba,this.programConfigurations=new po(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function ko(t,e){for(var r=0;r<t.length;r++)if(zo(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(zo(t,e[n]))return!0;return!!Eo(t,e)}function Ao(t,e,r){return!(!zo(t,e)&&!Io(e,t,r))}function Mo(t,e){if(1===t.length)return Po(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(zo(t,n[i]))return!0;for(var a=0;a<t.length;a++)if(Po(e,t[a]))return!0;for(var o=0;o<e.length;o++)if(Eo(t,e[o]))return!0;return!1}function So(t,e,r){if(t.length>1){if(Eo(t,e))return!0;for(var n=0;n<e.length;n++)if(Io(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(Io(t[i],e,r))return!0;return!1}function Eo(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(Co(n,i,e[a],e[a+1]))return!0;return!1}function Co(t,e,r,n){return A(t,r,n)!==A(e,r,n)&&A(t,e,r)!==A(t,e,n)}function Io(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(Lo(t,e[i-1],e[i])<n)return!0;return!1}function Lo(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Po(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,l=(r=t[o]).length-1;s<r.length;l=s++)n=r[s],i=r[l],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function zo(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Oo(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var a=A(t,e,r[0]);return a!==A(t,e,r[1])||a!==A(t,e,r[2])||a!==A(t,e,r[3])}function Do(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ro(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Fo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<t.length;l++){var u=t[l];s.push(u.sub(o))}return s}To.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=t;o<s.length;o+=1){var l=s[o],u=l.feature,c=l.id,h=l.index,f=l.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d=bo(u,p);if(this.layers[0]._featureFilter.filter(new Fi(this.zoom),d,r)){var m=a?a.evaluate(d,{},r):void 0,g={id:c,properties:u.properties,type:u.type,sourceLayerIndex:f,index:h,geometry:p?d.geometry:_o(u),patterns:{},sortKey:m};i.push(g)}}a&&i.sort(function(t,e){return t.sortKey-e.sortKey});for(var y=0,v=i;y<v.length;y+=1){var x=v[y],_=x,b=_.geometry,w=_.index,T=_.sourceLayerIndex,k=t[w].feature;this.addFeature(x,b,w,r),e.featureIndex.insert(k,b,w,T,this.index)}},To.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},To.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},To.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},To.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fa),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},To.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},To.prototype.addFeature=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var l=s[o],u=l.x,c=l.y;if(!(u<0||u>=yo||c<0||c>=yo)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=h.vertexLength;wo(this.layoutVertexArray,u,c,-1,-1),wo(this.layoutVertexArray,u,c,1,-1),wo(this.layoutVertexArray,u,c,1,1),wo(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},oi("CircleBucket",To,{omit:["layers"]});var Bo=new Ji({"circle-sort-key":new Wi(Ft.layout_circle["circle-sort-key"])}),No={paint:new Ji({"circle-radius":new Wi(Ft.paint_circle["circle-radius"]),"circle-color":new Wi(Ft.paint_circle["circle-color"]),"circle-blur":new Wi(Ft.paint_circle["circle-blur"]),"circle-opacity":new Wi(Ft.paint_circle["circle-opacity"]),"circle-translate":new Zi(Ft.paint_circle["circle-translate"]),"circle-translate-anchor":new Zi(Ft.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Zi(Ft.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Zi(Ft.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Wi(Ft.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Wi(Ft.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Wi(Ft.paint_circle["circle-stroke-opacity"])}),layout:Bo},jo="undefined"!=typeof Float32Array?Float32Array:Array;function Uo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Vo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*h+w*m,t[1]=x*i+_*l+b*f+w*g,t[2]=x*a+_*u+b*p+w*y,t[3]=x*o+_*c+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],t[4]=x*n+_*s+b*h+w*m,t[5]=x*i+_*l+b*f+w*g,t[6]=x*a+_*u+b*p+w*y,t[7]=x*o+_*c+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],t[8]=x*n+_*s+b*h+w*m,t[9]=x*i+_*l+b*f+w*g,t[10]=x*a+_*u+b*p+w*y,t[11]=x*o+_*c+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],t[12]=x*n+_*s+b*h+w*m,t[13]=x*i+_*l+b*f+w*g,t[14]=x*a+_*u+b*p+w*y,t[15]=x*o+_*c+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var qo=Vo,Ho=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};function Go(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}(function(){var t=new jo(3);jo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0)})(),function(){var t=new jo(4);jo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Zo=function(t){var e=t[0],r=t[1];return e*e+r*r};!function(){var t=new jo(2);jo!=Float32Array&&(t[0]=0,t[1]=0)}();var Wo=function(t){function e(e){t.call(this,e,No)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new To(t)},e.prototype.queryRadius=function(t){var e=t;return Do("circle-radius",this,e)+Do("circle-stroke-width",this,e)+Ro(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=Fo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e){return t.map(function(t){return Yo(t,e)})}(l,s),f=c?u*o:u,p=0,d=n;p<d.length;p+=1)for(var m=0,g=d[p];m<g.length;m+=1){var y=g[m],v=c?y:Yo(y,s),x=f,_=Go([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=_[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=a.cameraToCenterDistance/_[3]),Ao(h,v,x))return!0}return!1},e}(Qi);function Yo(t,e){var r=Go([],[t.x,t.y,0,1],e);return new a(r[0]/r[3],r[1]/r[3])}var Xo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(To);function $o(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function Jo(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=$o({},{width:n,height:i},r);Ko(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data}}function Ko(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l<i.height;l++)for(var u=((r.y+l)*t.width+r.x)*a,c=((n.y+l)*e.width+n.x)*a,h=0;h<i.width*a;h++)s[c+h]=o[u+h];return e}oi("HeatmapBucket",Xo,{omit:["layers"]});var Qo=function(t,e){$o(this,t,1,e)};Qo.prototype.resize=function(t){Jo(this,t,1)},Qo.prototype.clone=function(){return new Qo({width:this.width,height:this.height},new Uint8Array(this.data))},Qo.copy=function(t,e,r,n,i){Ko(t,e,r,n,i,1)};var ts=function(t,e){$o(this,t,4,e)};ts.prototype.resize=function(t){Jo(this,t,4)},ts.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},ts.prototype.clone=function(){return new ts({width:this.width,height:this.height},new Uint8Array(this.data))},ts.copy=function(t,e,r,n,i){Ko(t,e,r,n,i,4)},oi("AlphaImage",Qo),oi("RGBAImage",ts);var es={paint:new Ji({"heatmap-radius":new Wi(Ft.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Wi(Ft.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Zi(Ft.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $i(Ft.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Zi(Ft.paint_heatmap["heatmap-opacity"])})};function rs(t){var e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new ts({width:r,height:n}),a=function(r,n,a){e[t.evaluationKey]=a;var o=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(t.clips)for(var o=0,s=0;o<n;++o,s+=4*r)for(var l=0,u=0;l<r;l++,u+=4){var c=l/(r-1),h=t.clips[o];a(s,u,h.start*(1-c)+h.end*c)}else for(var f=0,p=0;f<r;f++,p+=4)a(0,p,f/(r-1));return i}var ns=function(t){function e(e){t.call(this,e,es),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Xo(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=rs({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Qi),is={paint:new Ji({"hillshade-illumination-direction":new Zi(Ft.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Zi(Ft.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Zi(Ft.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Zi(Ft.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Zi(Ft.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Zi(Ft.paint_hillshade["hillshade-accent-color"])})},as=function(t){function e(e){t.call(this,e,is)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Qi),os=na([{name:"a_pos",components:2,type:"Int16"}],4).members,ss=us,ls=us;function us(t,e,r){r=r||2;var n,i,a,o,s,l,u,c=e&&e.length,h=c?e[0]*r:t.length,f=cs(t,0,h,r,!0),p=[];if(!f||f.next===f.prev)return p;if(c&&(f=function(t,e,r,n){var i,a,o,s,l,u=[];for(i=0,a=e.length;i<a;i++)o=e[i]*n,s=i<a-1?e[i+1]*n:t.length,(l=cs(t,o,s,n,!1))===l.next&&(l.steiner=!0),u.push(bs(l));for(u.sort(ys),i=0;i<u.length;i++)vs(u[i],r),r=hs(r,r.next);return r}(t,e,f,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var d=r;d<h;d+=r)(s=t[d])<n&&(n=s),(l=t[d+1])<i&&(i=l),s>a&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return fs(f,p,r,n,i,u),p}function cs(t,e,r,n,i){var a,o;if(i===Os(t,e,r,n)>0)for(a=e;a<r;a+=n)o=Ls(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=Ls(a,t[a],t[a+1],o);return o&&As(o,o.next)&&(Ps(o),o=o.next),o}function hs(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!As(n,n.next)&&0!==ks(n.prev,n,n.next))n=n.next;else{if(Ps(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function fs(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=_s(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?ds(t,n,i,a):ps(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ps(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?fs(t=ms(hs(t),e,r),e,r,n,i,a,2):2===o&&gs(t,e,r,n,i,a):fs(hs(t),e,r,n,i,a,1);break}}}function ps(t){var e=t.prev,r=t,n=t.next;if(ks(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ws(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ks(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ds(t,e,r,n){var i=t.prev,a=t,o=t.next;if(ks(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=_s(s,l,e,r,n),f=_s(u,c,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&ws(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&ks(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&ws(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ks(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&ws(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&ks(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&ws(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ks(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function ms(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!As(i,a)&&Ms(i,n,n.next,a)&&Cs(i,a)&&Cs(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ps(n),Ps(n.next),n=t=a),n=n.next}while(n!==t);return hs(n)}function gs(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Ts(o,s)){var l=Is(o,s);return o=hs(o,o.next),l=hs(l,l.next),fs(o,e,r,n,i,a),void fs(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function ys(t,e){return t.x-e.x}function vs(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r;var l,u=r,c=r.x,h=r.y,f=1/0;n=r;do{i>=n.x&&n.x>=c&&i!==n.x&&ws(a<h?i:o,a,c,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),Cs(n,t)&&(l<f||l===f&&(n.x>r.x||n.x===r.x&&xs(r,n)))&&(r=n,f=l)),n=n.next}while(n!==u);return r}(t,e),e){var r=Is(e,t);hs(e,e.next),hs(r,r.next)}}function xs(t,e){return ks(t.prev,t,e.prev)<0&&ks(e.next,t,t.next)<0}function _s(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function bs(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function ws(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Ts(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Ms(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Cs(t,e)&&Cs(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ks(t.prev,t,e.prev)||ks(t,e.prev,e))||As(t,e)&&ks(t.prev,t,t.next)>0&&ks(e.prev,e,e.next)>0)}function ks(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function As(t,e){return t.x===e.x&&t.y===e.y}function Ms(t,e,r,n){var i=Es(ks(t,e,r)),a=Es(ks(t,e,n)),o=Es(ks(r,n,t)),s=Es(ks(r,n,e));return!!(i!==a&&o!==s||0===i&&Ss(t,r,e)||0===a&&Ss(t,n,e)||0===o&&Ss(r,t,n)||0===s&&Ss(r,e,n))}function Ss(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Es(t){return t>0?1:t<0?-1:0}function Cs(t,e){return ks(t.prev,t,t.next)<0?ks(t,e,t.next)>=0&&ks(t,t.prev,e)>=0:ks(t,e,t.prev)<0||ks(t,t.next,e)<0}function Is(t,e){var r=new zs(t.i,t.x,t.y),n=new zs(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ls(t,e,r,n){var i=new zs(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ps(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function zs(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Os(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Ds(t,e,r,n,i){Rs(t,e,r,n||t.length-1,i||Bs)}function Rs(t,e,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Rs(t,e,Math.max(r,Math.floor(e-o*l/a+u)),Math.min(n,Math.floor(e+(a-o)*l/a+u)),i)}var c=t[e],h=r,f=n;for(Fs(t,r,e),i(t[n],c)>0&&Fs(t,r,n);h<f;){for(Fs(t,h,f),h++,f--;i(t[h],c)<0;)h++;for(;i(t[f],c)>0;)f--}0===i(t[r],c)?Fs(t,r,f):Fs(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function Fs(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Bs(t,e){return t<e?-1:t>e?1:0}function Ns(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o<r;o++){var s=M(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]))}if(n&&a.push(n),e>1)for(var l=0;l<a.length;l++)a[l].length<=e||(Ds(a[l],e,1,a[l].length-1,js),a[l]=a[l].slice(0,e));return a}function js(t,e){return e.area-t.area}function Us(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var l=s.constantOr(null);l&&(i=!0,n[l.to]=!0,n[l.from]=!0)}return i}function Vs(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:n-1},r,{},i.availableImages),h=u.evaluate({zoom:n},r,{},i.availableImages),f=u.evaluate({zoom:n+1},r,{},i.availableImages);c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,f=f&&f.name?f.name:f,a[c]=!0,a[h]=!0,a[f]=!0,r.patterns[l.id]={min:c,mid:h,max:f}}}return r}us.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(Os(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;o-=Math.abs(Os(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},us.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r},ss.default=ls;var qs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new aa,this.indexArray=new va,this.indexArray2=new ka,this.programConfigurations=new po(t.layers,t.zoom),this.segments=new Ba,this.segments2=new Ba,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};qs.prototype.populate=function(t,e,r){this.hasPattern=Us("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,u=s.id,c=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=bo(l,f);if(this.layers[0]._featureFilter.filter(new Fi(this.zoom),p,r)){var d=n?n.evaluate(p,{},r,e.availableImages):void 0,m={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:f?p.geometry:_o(l),patterns:{},sortKey:d};i.push(m)}}n&&i.sort(function(t,e){return t.sortKey-e.sortKey});for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,_=x.geometry,b=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var T=Vs("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(T)}else this.addFeature(v,_,b,r,{});var k=t[b].feature;e.featureIndex.insert(k,_,b,w,this.index)}},qs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},qs.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r)}},qs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},qs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,os),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},qs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},qs.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Ns(e,500);a<o.length;a+=1){for(var s=o[a],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),f=h.vertexLength,p=[],d=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&d.push(p.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),x=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(x+y.length-1,x),p.push(y[0].x),p.push(y[0].y);for(var _=1;_<y.length;_++)this.layoutVertexArray.emplaceBack(y[_].x,y[_].y),this.indexArray2.emplaceBack(x+_-1,x+_),p.push(y[_].x),p.push(y[_].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var b=ss(p,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(f+b[w],f+b[w+1],f+b[w+2]);h.vertexLength+=l,h.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},oi("FillBucket",qs,{omit:["layers","patternFeatures"]});var Hs=new Ji({"fill-sort-key":new Wi(Ft.layout_fill["fill-sort-key"])}),Gs={paint:new Ji({"fill-antialias":new Zi(Ft.paint_fill["fill-antialias"]),"fill-opacity":new Wi(Ft.paint_fill["fill-opacity"]),"fill-color":new Wi(Ft.paint_fill["fill-color"]),"fill-outline-color":new Wi(Ft.paint_fill["fill-outline-color"]),"fill-translate":new Zi(Ft.paint_fill["fill-translate"]),"fill-translate-anchor":new Zi(Ft.paint_fill["fill-translate-anchor"]),"fill-pattern":new Yi(Ft.paint_fill["fill-pattern"])}),layout:Hs},Zs=function(t){function e(e){t.call(this,e,Gs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new qs(t)},e.prototype.queryRadius=function(){return Ro(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return Mo(Fo(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return!0},e}(Qi),Ws=na([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Ys=Xs;function Xs(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields($s,this,e)}function $s(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Js(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}Xs.types=["Unknown","Point","LineString","Polygon"],Xs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,s=0,l=[];t.pos<r;){if(i<=0){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Xs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},Xs.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=Xs.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/a;t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=Js(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)c(l[n][i])}1===l.length?l=l[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Ks=Qs;function Qs(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(tl,this,e),this.length=this._features.length}function tl(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}Qs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ys(this._pbf,e,this.extent,this._keys,this._values)};var el=function(t,e){this.layers=t.readFields(rl,{},e)};function rl(t,e,r){if(3===t){var n=new Ks(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var nl={VectorTile:el,VectorTileFeature:Ys,VectorTileLayer:Ks},il=nl.VectorTileFeature.types,al=Math.pow(2,13);function ol(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*al)+o,i*al*2,a*al*2,Math.round(s))}var sl=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new sa,this.indexArray=new va,this.programConfigurations=new po(t.layers,t.zoom),this.segments=new Ba,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function ll(t,e){return t.x===e.x&&(t.x<0||t.x>yo)||t.y===e.y&&(t.y<0||t.y>yo)}function ul(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>yo})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>yo})}sl.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Us("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,l=a.index,u=a.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,h=bo(o,c);if(this.layers[0]._featureFilter.filter(new Fi(this.zoom),h,r)){var f={id:s,sourceLayerIndex:u,index:l,geometry:c?h.geometry:_o(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Vs("fill-extrusion",this.layers,f,this.zoom,e)):this.addFeature(f,f.geometry,l,r,{}),e.featureIndex.insert(o,f.geometry,l,u,this.index,!0)}}},sl.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n],o=a.geometry;this.addFeature(a,o,a.index,e,r)}},sl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},sl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},sl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},sl.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ws),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},sl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},sl.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Ns(e,500);a<o.length;a+=1){for(var s=o[a],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),f=0,p=s;f<p.length;f+=1){var d=p[f];if(0!==d.length&&!ul(d))for(var m=0,g=0;g<d.length;g++){var y=d[g];if(g>=1){var v=d[g-1];if(!ll(y,v)){h.vertexLength+4>Ba.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),_=v.dist(y);m+_>32768&&(m=0),ol(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),ol(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=_,ol(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),ol(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Ba.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===il[t.type]){for(var w=[],T=[],k=h.vertexLength,A=0,M=s;A<M.length;A+=1){var S=M[A];if(0!==S.length){S!==s[0]&&T.push(w.length/2);for(var E=0;E<S.length;E++){var C=S[E];ol(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),w.push(C.x),w.push(C.y)}}}for(var I=ss(w,T),L=0;L<I.length;L+=3)this.indexArray.emplaceBack(k+I[L],k+I[L+2],k+I[L+1]);h.primitiveLength+=I.length/3,h.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},oi("FillExtrusionBucket",sl,{omit:["layers","features"]});var cl={paint:new Ji({"fill-extrusion-opacity":new Zi(Ft["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Wi(Ft["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Zi(Ft["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Zi(Ft["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Yi(Ft["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Wi(Ft["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Wi(Ft["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Zi(Ft["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},hl=function(t){function e(e){t.call(this,e,cl)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new sl(t)},e.prototype.queryRadius=function(){return Ro(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s,l){var u=Fo(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),f=function(t,e,r,n){for(var i=[],o=0,s=t;o<s.length;o+=1){var l=s[o],u=[l.x,l.y,n,1];Go(u,u,e),i.push(new a(u[0]/u[3],u[1]/u[3]))}return i}(u,l,0,0),p=function(t,e,r,n){for(var i=[],o=[],s=n[8]*e,l=n[9]*e,u=n[10]*e,c=n[11]*e,h=n[8]*r,f=n[9]*r,p=n[10]*r,d=n[11]*r,m=0,g=t;m<g.length;m+=1){for(var y=[],v=[],x=0,_=g[m];x<_.length;x+=1){var b=_[x],w=b.x,T=b.y,k=n[0]*w+n[4]*T+n[12],A=n[1]*w+n[5]*T+n[13],M=n[2]*w+n[6]*T+n[14],S=n[3]*w+n[7]*T+n[15],E=M+u,C=S+c,I=k+h,L=A+f,P=M+p,z=S+d,O=new a((k+s)/C,(A+l)/C);O.z=E/C,y.push(O);var D=new a(I/z,L/z);D.z=P/z,v.push(D)}i.push(y),o.push(v)}return[i,o]}(n,h,c,l);return function(t,e,r){var n=1/0;Mo(r,e)&&(n=pl(r,e[0]));for(var i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<a.length-1;s++){var l=a[s],u=a[s+1],c=o[s],h=[l,u,o[s+1],c,l];ko(r,h)&&(n=Math.min(n,pl(r,h)))}return n!==1/0&&n}(p[0],p[1],f)},e}(Qi);function fl(t,e){return t.x*e.x+t.y*e.y}function pl(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var a=e[n],o=t[0],s=r.sub(i),l=a.sub(i),u=o.sub(i),c=fl(s,s),h=fl(s,l),f=fl(l,l),p=fl(u,s),d=fl(u,l),m=c*f-h*h,g=(f*p-h*d)/m,y=(c*d-h*p)/m,v=1-g-y,x=i.z*v+r.z*g+a.z*y;if(isFinite(x))return x}return 1/0}for(var _=1/0,b=0,w=e;b<w.length;b+=1){var T=w[b];_=Math.min(_,T.z)}return _}var dl=na([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,ml=na([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,gl=nl.VectorTileFeature.types,yl=Math.cos(Math.PI/180*37.5),vl=Math.pow(2,14)/.5,xl=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(t){e.gradients[t.id]={}}),this.layoutVertexArray=new la,this.layoutVertexArray2=new ua,this.indexArray=new va,this.programConfigurations=new po(t.layers,t.zoom),this.segments=new Ba,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};xl.prototype.populate=function(t,e,r){this.hasPattern=Us("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,u=s.id,c=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=bo(l,f);if(this.layers[0]._featureFilter.filter(new Fi(this.zoom),p,r)){var d=n?n.evaluate(p,{},r):void 0,m={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:f?p.geometry:_o(l),patterns:{},sortKey:d};i.push(m)}}n&&i.sort(function(t,e){return t.sortKey-e.sortKey});for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,_=x.geometry,b=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var T=Vs("line",this.layers,v,this.zoom,e);this.patternFeatures.push(T)}else this.addFeature(v,_,b,r,{});var k=t[b].feature;e.featureIndex.insert(k,_,b,w,this.index)}},xl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},xl.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r)}},xl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xl.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,ml)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,dl),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},xl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xl.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},xl.prototype.addFeature=function(t,e,r,n,i){var a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,h=e;c<h.length;c+=1){var f=h[c];this.addLine(f,t,o,s,l,u)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},xl.prototype.addLine=function(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var o=0;o<t.length-1;o++)this.totalDistance+=t[o].dist(t[o+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===gl[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u<l-1&&t[u].equals(t[u+1]);)u++;if(!(l<(s?3:2))){"bevel"===r&&(i=1.05);var c,h=this.overscaling<=16?15*yo/(512*this.overscaling):0,f=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),p=void 0,d=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(c=t[l-2],g=t[u].sub(c)._unit()._perp());for(var y=u;y<l;y++)if(!(d=y===l-1?s?t[u+1]:void 0:t[y+1])||!t[y].equals(d)){g&&(m=g),c&&(p=c),c=t[y],g=d?d.sub(c)._unit()._perp():m;var v=(m=m||g).add(g);(0!==v.x||0!==v.y)&&v._unit();var x=m.x*g.x+m.y*g.y,_=v.x*g.x+v.y*g.y,b=0!==_?1/_:1/0,w=2*Math.sqrt(2-2*_),T=_<yl&&p&&d,k=m.x*g.y-m.y*g.x>0;if(T&&y>u){var A=c.dist(p);if(A>2*h){var M=c.sub(c.sub(p)._mult(h/A)._round());this.updateDistance(p,M),this.addCurrentVertex(M,m,0,0,f),p=M}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(b<a?E="miter":b<=2&&(E="fakeround")),"miter"===E&&b>i&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b<i&&(E="miter")),p&&this.updateDistance(p,c),"miter"===E)v._mult(b),this.addCurrentVertex(c,v,0,0,f);else if("flipbevel"===E){if(b>100)v=g.mult(-1);else{var C=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(C*(k?-1:1))}this.addCurrentVertex(c,v,0,0,f),this.addCurrentVertex(c,v.mult(-1),0,0,f)}else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(b*b-1),L=k?I:0,P=k?0:I;if(p&&this.addCurrentVertex(c,m,L,P,f),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),O=1;O<z;O++){var D=O/z;if(.5!==D){var R=D-.5;D+=D*R*(D-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*R*R+(.848013+x*(.215638*x-1.06021)))}var F=g.sub(m)._mult(D)._add(m)._unit()._mult(k?-1:1);this.addHalfVertex(c,F.x,F.y,!1,k,0,f)}d&&this.addCurrentVertex(c,g,-L,-P,f)}else if("butt"===E)this.addCurrentVertex(c,v,0,0,f);else if("square"===E){var B=p?1:-1;this.addCurrentVertex(c,v,B,B,f)}else"round"===E&&(p&&(this.addCurrentVertex(c,m,0,0,f),this.addCurrentVertex(c,m,1,1,f,!0)),d&&(this.addCurrentVertex(c,g,-1,-1,f,!0),this.addCurrentVertex(c,g,0,0,f)));if(T&&y<l-1){var N=c.dist(d);if(N>2*h){var j=c.add(d.sub(c)._mult(h/N)._round());this.updateDistance(c,j),this.addCurrentVertex(j,g,0,0,f),c=j}}}}},xl.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,u=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,u,a,!0,-n,i),this.distance>vl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},xl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,u=.5*(this.lineClips?this.scaledDistance*(vl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&u)<<2,u>>6),this.lineClips){var c=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(c,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},xl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},xl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},oi("LineBucket",xl,{omit:["layers","patternFeatures"]});var _l=new Ji({"line-cap":new Zi(Ft.layout_line["line-cap"]),"line-join":new Wi(Ft.layout_line["line-join"]),"line-miter-limit":new Zi(Ft.layout_line["line-miter-limit"]),"line-round-limit":new Zi(Ft.layout_line["line-round-limit"]),"line-sort-key":new Wi(Ft.layout_line["line-sort-key"])}),bl={paint:new Ji({"line-opacity":new Wi(Ft.paint_line["line-opacity"]),"line-color":new Wi(Ft.paint_line["line-color"]),"line-translate":new Zi(Ft.paint_line["line-translate"]),"line-translate-anchor":new Zi(Ft.paint_line["line-translate-anchor"]),"line-width":new Wi(Ft.paint_line["line-width"]),"line-gap-width":new Wi(Ft.paint_line["line-gap-width"]),"line-offset":new Wi(Ft.paint_line["line-offset"]),"line-blur":new Wi(Ft.paint_line["line-blur"]),"line-dasharray":new Xi(Ft.paint_line["line-dasharray"]),"line-pattern":new Yi(Ft.paint_line["line-pattern"]),"line-gradient":new $i(Ft.paint_line["line-gradient"])}),layout:_l},wl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Fi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Wi),Tl=new wl(bl.paint.properties["line-width"].specification);Tl.useIntegerZoom=!0;var kl=function(t){function e(e){t.call(this,e,bl),this.gradientVersion=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){if("line-gradient"===t){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression.expression instanceof er,this.gradientVersion=(this.gradientVersion+1)%l}},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Tl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new xl(t)},e.prototype.queryRadius=function(t){var e=t,r=Al(Do("line-width",this,e),Do("line-gap-width",this,e)),n=Do("line-offset",this,e);return r/2+Math.abs(n)+Ro(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=Fo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*Al(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i<t.length;i++){for(var o=t[i],s=[],l=0;l<o.length;l++){var u=o[l-1],c=o[l],h=o[l+1],f=0===l?n:c.sub(u)._unit()._perp(),p=l===o.length-1?n:h.sub(c)._unit()._perp(),d=f._add(p)._unit(),m=d.x*p.x+d.y*p.y;d._mult(1/m),s.push(d._mult(e)._add(c))}r.push(s)}return r}(n,c*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var a=0;a<i.length;a++)if(zo(t,i[a]))return!0;if(So(t,i,r))return!0}return!1}(l,n,u)},e.prototype.isTileClipped=function(){return!0},e}(Qi);function Al(t,e){return e>0?e+2*t:t}var Ml=na([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Sl=na([{name:"a_projected_pos",components:3,type:"Float32"}],4);na([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var El=na([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);na([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var Cl=na([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Il=na([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ll(t,e,r){return t.sections.forEach(function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Di.applyArabicShaping&&(t=Di.applyArabicShaping(t)),t}(t.text,e,r)}),t}na([{name:"triangle",components:3,type:"Uint16"}]),na([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),na([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),na([{type:"Float32",name:"offsetX"}]),na([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Pl={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},zl=24,Ol=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},Dl=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*m},Rl=Fl;function Fl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Fl.Varint=0,Fl.Fixed64=1,Fl.Bytes=2,Fl.Fixed32=5;var Bl=4294967296,Nl=1/Bl,jl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ul(t){return t.type===Fl.Bytes?t.readVarint()+t.pos:t.pos+1}function Vl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function ql(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Hl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Gl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Zl(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Wl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Yl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Xl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function $l(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Jl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Kl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ql(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function tu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function eu(t,e,r){1===t&&r.readMessage(ru,e)}function ru(t,e,r){if(3===t){var n=r.readMessage(nu,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:i,bitmap:new Qo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function nu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function iu(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w)}t.sort(function(t,e){return e.h-t.h});for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var h=c[u],f=o.length-1;f>=0;f--){var p=o[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=o.pop();f<o.length&&(o[f]=d)}else h.h===p.h?(p.x+=h.w,p.w-=h.w):h.w===p.w?(p.y+=h.h,p.h-=h.h):(o.push({x:p.x+h.w,y:p.y,w:p.w-h.w,h:h.h}),p.y+=h.h,p.h-=h.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}Fl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Kl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=tu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Kl(this.buf,this.pos)+Kl(this.buf,this.pos+4)*Bl;return this.pos+=8,t},readSFixed64:function(){var t=Kl(this.buf,this.pos)+tu(this.buf,this.pos+4)*Bl;return this.pos+=8,t},readFloat:function(){var t=Ol(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ol(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128||(e|=(127&(r=n[this.pos++]))<<7,r<128)||(e|=(127&(r=n[this.pos++]))<<14,r<128)||(e|=(127&(r=n[this.pos++]))<<21,r<128)?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128||(i=a[r.pos++],n|=(127&i)<<3,i<128)||(i=a[r.pos++],n|=(127&i)<<10,i<128)||(i=a[r.pos++],n|=(127&i)<<17,i<128)||(i=a[r.pos++],n|=(127&i)<<24,i<128)||(i=a[r.pos++],n|=(1&i)<<31,i<128))return function(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[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!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&jl?function(t,e,r){return jl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=t[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(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!==Fl.Bytes)return t.push(this.readVarint(e));var r=Ul(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Fl.Bytes)return t.push(this.readSVarint());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Fl.Bytes)return t.push(this.readBoolean());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Fl.Bytes)return t.push(this.readFloat());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Fl.Bytes)return t.push(this.readDouble());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Fl.Bytes)return t.push(this.readFixed32());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Fl.Bytes)return t.push(this.readSFixed32());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Fl.Bytes)return t.push(this.readFixed64());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Fl.Bytes)return t.push(this.readSFixed64());var e=Ul(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Fl.Varint)for(;this.buf[this.pos++]>127;);else if(e===Fl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Fl.Fixed32)this.pos+=4;else{if(e!==Fl.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 r=new Uint8Array(e);r.set(this.buf),this.buf=r,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),Ql(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ql(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ql(this.buf,-1&t,this.pos),Ql(this.buf,Math.floor(t*Nl),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ql(this.buf,-1&t,this.pos),Ql(this.buf,Math.floor(t*Nl),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((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)))))}(n,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(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Vl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Dl(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Dl(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 r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Vl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Fl.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Wl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Zl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Yl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Xl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,$l,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Jl,e)},writeBytesField:function(t,e){this.writeTag(t,Fl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Fl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Fl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Fl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Fl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Fl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Fl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Fl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Fl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Fl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var au=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},ou={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};ou.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},ou.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ou.tlbr.get=function(){return this.tl.concat(this.br)},ou.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(au.prototype,ou);var su=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=iu(i),o=a.w,s=a.h,l=new ts({width:o||1,height:s||1});for(var u in t){var c=t[u],h=r[u].paddedRect;ts.copy(c.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},c.data)}for(var f in e){var p=e[f],d=n[f].paddedRect,m=d.x+1,g=d.y+1,y=p.data.width,v=p.data.height;ts.copy(p.data,l,{x:0,y:0},{x:m,y:g},p.data),ts.copy(p.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),ts.copy(p.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),ts.copy(p.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),ts.copy(p.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};su.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new au(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},su.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},su.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],a=n[1];r.update(e.data,void 0,{x:i,y:a})}},oi("ImagePosition",au),oi("ImageAtlas",su);var lu={horizontal:1,vertical:2,horizontalOnly:3},uu=-17,cu=function(){this.scale=1,this.fontStack="",this.imageName=null};cu.forText=function(t,e){var r=new cu;return r.scale=t||1,r.fontStack=e,r},cu.forImage=function(t){var e=new cu;return e.imageName=t,e};var hu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function fu(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m){var g=hu.fromFeature(t,i);h===lu.vertical&&g.verticalizePunctuation();var y,v=Di.processBidirectionalText,x=Di.processStyledBidirectionalText;if(v&&1===g.sections.length){y=[];for(var _=0,b=v(g.toString(),_u(g,u,a,e,n,p,d));_<b.length;_+=1){var w=b[_],T=new hu;T.text=w,T.sections=g.sections;for(var k=0;k<w.length;k++)T.sectionIndex.push(0);y.push(T)}}else if(x){y=[];for(var A=0,M=x(g.text,g.sectionIndex,_u(g,u,a,e,n,p,d));A<M.length;A+=1){var S=M[A],E=new hu;E.text=S[0],E.sectionIndex=S[1],E.sections=g.sections,y.push(E)}}else y=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(g,_u(g,u,a,e,n,p,d));var C=[],I={positionedLines:C,text:g.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,a,o,s,l,u,c,h){for(var f=0,p=uu,d=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,x=i;v<x.length;v+=1){var _=x[v];_.trim();var b=_.getMaxScale(),w=(b-1)*zl,T={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=T;var k=T.positionedGlyphs,A=0;if(_.length()){for(var M=0;M<_.length();M++){var S=_.getSection(M),E=_.getSectionIndex(M),C=_.getCharCode(M),I=0,L=null,P=null,z=null,O=zl,D=!(l===lu.horizontal||!c&&!yi(C)||c&&(pu[C]||xi(C)));if(S.imageName){var R=n[S.imageName];if(!R)continue;z=S.imageName,t.iconsInText=t.iconsInText||!0,P=R.paddedRect;var F=R.displaySize;S.scale=S.scale*zl/h,L={width:F[0],height:F[1],left:1,top:-3,advance:D?F[1]:F[0]},I=w+(zl-F[1]*S.scale),O=L.advance;var B=D?F[0]*S.scale-zl*b:F[1]*S.scale-zl*b;B>0&&B>A&&(A=B)}else{var N=r[S.fontStack],j=N&&N[C];if(j&&j.rect)P=j.rect,L=j.metrics;else{var U=e[S.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}I=(b-S.scale)*zl}D?(t.verticalizable=!0,k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=O*S.scale+u):(k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=L.advance*S.scale+u)}if(0!==k.length){var q=f-u;d=Math.max(q,d),wu(k,0,k.length-1,g,A)}f=0;var H=a*b+A;T.lineOffset=Math.max(A,w),p+=H,m=Math.max(H,m),++y}else p+=a,++y}var G=p-uu,Z=bu(o),W=Z.horizontalAlign,Y=Z.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var u=(e-r)*i,c=0;c=a!==o?-s*n-uu:(-n*l+.5)*o;for(var h=0,f=t;h<f.length;h+=1)for(var p=f[h],d=0,m=p.positionedGlyphs;d<m.length;d+=1){var g=m[d];g.x+=u,g.y+=c}})(t.positionedLines,g,W,Y,d,m,a,G,i.length),t.top+=-Y*G,t.bottom=t.top+G,t.left+=-W*d,t.right=t.left+d}(I,e,r,n,y,o,s,l,h,u,f,m),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(C)&&I}hu.fromFeature=function(t,e){for(var r=new hu,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},hu.prototype.length=function(){return this.text.length},hu.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},hu.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},hu.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},hu.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;n&&vi(n)&&!Pl[t[r+1]]||i&&vi(i)&&!Pl[t[r-1]]||!Pl[t[r]]?e+=t[r]:e+=Pl[t[r]]}return e}(this.text)},hu.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&pu[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&pu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},hu.prototype.substring=function(t,e){var r=new hu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},hu.prototype.toString=function(){return this.text},hu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,r){return Math.max(e,t.sections[r].scale)},0)},hu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(cu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},hu.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(cu.forImage(e)),this.sectionIndex.push(this.sections.length-1)):k("Reached maximum number of images 6401")}else k("Can't add FormattedSection with an empty image.")},hu.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var pu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},du={};function mu(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*zl/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function gu(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function yu(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),(40===t||65288===t)&&(n+=50),(41===e||65289===e)&&(n+=50),n}function vu(t,e,r,n,i,a){for(var o=null,s=gu(e,r,i,a),l=0,u=n;l<u.length;l+=1){var c=u[l],h=gu(e-c.x,r,i,a)+c.badness;h<=s&&(o=c,s=h)}return{index:t,x:e,priorBreak:o,badness:s}}function xu(t){return t?xu(t.priorBreak).concat(t.index):[]}function _u(t,e,r,n,i,a,o){if("point"!==a)return[];if(!t)return[];for(var s=[],l=function(t,e,r,n,i,a){for(var o=0,s=0;s<t.length();s++){var l=t.getSection(s);o+=mu(t.getCharCode(s),l,n,i,e,a)}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,o),u=t.text.indexOf("")>=0,c=0,h=0;h<t.length();h++){var f=t.getSection(h),p=t.getCharCode(h);if(pu[p]||(c+=mu(p,f,n,i,e,o)),h<t.length()-1){var d=gi(p);(du[p]||d||f.imageName)&&s.push(vu(h+1,c,l,s,yu(p,t.getCharCode(h+1),d&&u),!1))}}return xu(vu(t.length(),c,l,s,0,!0))}function bu(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function wu(t,e,r,n,i){if(n||i)for(var a=t[r],o=a.metrics.advance*a.scale,s=(t[r].x+o)*n,l=e;l<=r;l++)t[l].x-=s,t[l].y+=i}function Tu(t,e,r,n,i,a){var o,s=t.image;if(s.content){var l=s.content,u=s.pixelRatio||1;o=[l[0]/u,l[1]/u,s.displaySize[0]-l[2]/u,s.displaySize[1]-l[3]/u]}var c,h,f,p,d=e.left*a,m=e.right*a;"width"===r||"both"===r?(p=i[0]+d-n[3],h=i[0]+m+n[1]):h=(p=i[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var g=e.top*a,y=e.bottom*a;return"height"===r||"both"===r?(c=i[1]+g-n[0],f=i[1]+y+n[2]):f=(c=i[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:h,bottom:f,left:p,collisionPadding:o}}du[10]=!0,du[32]=!0,du[38]=!0,du[40]=!0,du[41]=!0,du[43]=!0,du[45]=!0,du[47]=!0,du[173]=!0,du[183]=!0,du[8203]=!0,du[8208]=!0,du[8211]=!0,du[8231]=!0;var ku=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(a);oi("Anchor",ku);var Au=128;function Mu(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Fi(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[a],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new Fi(s)),maxSize:r.evaluate(new Fi(l)),interpolationType:i}}function Su(t,e,r){var n=e.uSize,i=e.uSizeT,a=r.lowerSize,o=r.upperSize;return"source"===t.kind?a/Au:"composite"===t.kind?rr(a/Au,o/Au,i):n}function Eu(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,a=t.minZoom,o=t.maxZoom,s=i?h(wr.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=rr(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var Cu=Object.freeze({__proto__:null,getSizeData:Mu,evaluateSizeForFeature:Su,evaluateSizeForZoom:Eu,SIZE_PACK_FACTOR:Au});function Iu(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;s<r/2;){var c=t[o-1],h=t[o],f=t[o+1];if(!f)return!1;var p=c.angleTo(h)-h.angleTo(f);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),u+=p;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=h.dist(f)}return!0}function Lu(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Pu(t,e,r){return t?.6*e*r:0}function zu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Ou(t,e,r,n,i,a){for(var o=Pu(r,i,a),s=zu(r,n)*a,l=0,u=Lu(t)/2,c=0;c<t.length-1;c++){var h=t[c],f=t[c+1],p=h.dist(f);if(l+p>u){var d=(u-l)/p,m=rr(h.x,f.x,d),g=rr(h.y,f.y,d),y=new ku(m,g,f.angleTo(h),c);return y._round(),!o||Iu(t,y,s,o,e)?y:void 0}l+=p}}function Du(t,e,r,n,i,a,o,s,l){var u=Pu(n,a,o),c=zu(n,i),h=c*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),Ru(t,f?e/2*s%e:(c/2+2*a)*o*s%e,e,u,r,h,f,!1,l)}function Ru(t,e,r,n,i,a,o,s,l){for(var u=a/2,c=Lu(t),h=0,f=e-r,p=[],d=0;d<t.length-1;d++){for(var m=t[d],g=t[d+1],y=m.dist(g),v=g.angleTo(m);f+r<h+y;){var x=((f+=r)-h)/y,_=rr(m.x,g.x,x),b=rr(m.y,g.y,x);if(_>=0&&_<l&&b>=0&&b<l&&f-u>=0&&f+u<=c){var w=new ku(_,b,v,d);w._round(),(!n||Iu(t,w,a,n,i))&&p.push(w)}}h+=y}return!s&&!p.length&&!o&&(p=Ru(t,h/2,r,n,i,a,o,!0,l)),p}function Fu(t,e,r,n,i){for(var o=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,c=0;c<l.length-1;c++){var h=l[c],f=l[c+1];h.x<e&&f.x<e||(h.x<e?h=new a(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round():f.x<e&&(f=new a(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round()),!(h.y<r&&f.y<r)&&(h.y<r?h=new a(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round():f.y<r&&(f=new a(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round()),!(h.x>=n&&f.x>=n)&&(h.x>=n?h=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),!(h.y>=i&&f.y>=i)&&(h.y>=i?h=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round():f.y>=i&&(f=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round()),(!u||!h.equals(u[u.length-1]))&&(u=[h],o.push(u)),u.push(f)))))}return o}function Bu(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,u=o.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,f=o.stretchX||[[0,l]],p=o.stretchY||[[0,u]],d=function(t,e){return t+e[1]-e[0]},m=f.reduce(d,0),g=p.reduce(d,0),y=l-m,v=u-g,x=0,_=m,b=0,w=g,T=0,k=y,A=0,M=v;if(o.content&&n){var S=o.content;x=Nu(f,0,S[0]),b=Nu(p,0,S[1]),_=Nu(f,S[0],S[2]),w=Nu(p,S[1],S[3]),T=S[0]-x,A=S[1]-b,k=S[2]-S[0]-_,M=S[3]-S[1]-w}var E=function(n,i,l,u){var f=Uu(n.stretch-x,_,c,t.left),p=Vu(n.fixed-T,k,n.stretch,m),d=Uu(i.stretch-b,w,h,t.top),y=Vu(i.fixed-A,M,i.stretch,g),v=Uu(l.stretch-x,_,c,t.left),S=Vu(l.fixed-T,k,l.stretch,m),E=Uu(u.stretch-b,w,h,t.top),C=Vu(u.fixed-A,M,u.stretch,g),I=new a(f,d),L=new a(v,d),P=new a(v,E),z=new a(f,E),O=new a(p/s,y/s),D=new a(S/s,C/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),N=[B,-F,F,B];I._matMult(N),L._matMult(N),z._matMult(N),P._matMult(N)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=u.stretch+u.fixed;return{tl:I,tr:L,bl:z,br:P,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:D,minFontScaleX:k/s/c,minFontScaleY:M/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=ju(f,y,m),I=ju(p,v,g),L=0;L<C.length-1;L++)for(var P=C[L],z=C[L+1],O=0;O<I.length-1;O++){var D=I[O],R=I[O+1];i.push(E(P,D,z,R))}else i.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));return i}function Nu(t,e,r){for(var n=0,i=0,a=t;i<a.length;i+=1){var o=a[i];n+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]))}return n}function ju(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],u=n[n.length-1];n.push({fixed:s-u.stretch,stretch:u.stretch}),n.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}return n.push({fixed:e+1,stretch:r}),n}function Uu(t,e,r,n){return t/e*r+n}function Vu(t,e,r,n){return t-e*r/n}var qu=function(t,e,r,n,i,o,s,l,u,c){if(this.boxStartIndex=t.length,u){var h=o.top,f=o.bottom,p=o.collisionPadding;p&&(h-=p[1],f+=p[3]);var d=f-h;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),c){var _=new a(y,m),b=new a(v,m),w=new a(y,g),T=new a(v,g),k=c*Math.PI/180;_._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),y=Math.min(_.x,b.x,w.x,T.x),v=Math.max(_.x,b.x,w.x,T.x),m=Math.min(_.y,b.y,w.y,T.y),g=Math.max(_.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,y,m,v,g,r,n,i)}this.boxEndIndex=t.length},Hu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Gu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Gu(t,e){return t<e?-1:t>e?1:0}function Zu(t,e,r){void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var c=l[u];(!u||c.x<n)&&(n=c.x),(!u||c.y<i)&&(i=c.y),(!u||c.x>o)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var h=o-n,f=s-i,p=Math.min(h,f),d=p/2,m=new Hu([],Wu);if(0===p)return new a(n,i);for(var g=n;g<o;g+=p)for(var y=i;y<s;y+=p)m.push(new Yu(g+d,y+d,d,t));for(var v=function(t){for(var e=0,r=0,n=0,i=t[0],a=0,o=i.length,s=o-1;a<o;s=a++){var l=i[a],u=i[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=3*c}return new Yu(r/e,n/e,0,t)}(t),x=m.length;m.length;){var _=m.pop();(_.d>v.d||!v.d)&&(v=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,x)),!(_.max-v.d<=e)&&(d=_.h/2,m.push(new Yu(_.p.x-d,_.p.y-d,d,t)),m.push(new Yu(_.p.x+d,_.p.y-d,d,t)),m.push(new Yu(_.p.x-d,_.p.y+d,d,t)),m.push(new Yu(_.p.x+d,_.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function Wu(t,e){return e.max-t.max}function Yu(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e[i],o=0,s=a.length,l=s-1;o<s;l=o++){var u=a[o],c=a[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,Lo(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Hu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Hu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Hu.prototype.peek=function(){return this.data[0]},Hu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},Hu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&r(e[s],o)<0&&(a=s,o=e[s]),r(o,i)>=0)break;e[t]=o,t=a}e[t]=i};var Xu=Number.POSITIVE_INFINITY;function $u(t,e){return e[1]!==Xu?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Ju(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Ku=255,Qu=Ku*Au;function tc(t,e,r,n,i,o,s,l,u,c,h,f,p,d,m){var g=function(t,e,r,n,i,o,s,l){for(var u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[],h=0,f=e.positionedLines;h<f.length;h+=1)for(var p=f[h],d=0,m=p.positionedGlyphs;d<m.length;d+=1){var g=m[d];if(g.rect){var y=g.rect||{},v=4,x=!0,_=1,b=0,w=(i||l)&&g.vertical,T=g.metrics.advance*g.scale/2;if(l&&e.verticalizable){var k=(g.scale-1)*zl,A=(zl-g.metrics.width*g.scale)/2;b=p.lineOffset/2-(g.imageName?-A:k)}if(g.imageName){var M=s[g.imageName];x=M.sdf,v=1/(_=M.pixelRatio)}var S=i?[g.x+T,g.y]:[0,0],E=i?[0,0]:[g.x+T+r[0],g.y+r[1]-b],C=[0,0];w&&(C=E,E=[0,0]);var I=(g.metrics.left-v)*g.scale-T+E[0],L=(-g.metrics.top-v)*g.scale+E[1],P=I+y.w*g.scale/_,z=L+y.h*g.scale/_,O=new a(I,L),D=new a(P,L),R=new a(I,z),F=new a(P,z);if(w){var B=new a(-T,T-uu),N=-Math.PI/2,j=12-T,U=g.imageName?j:0,V=new a(22-j,-U),q=new(Function.prototype.bind.apply(a,[null].concat(C)));O._rotateAround(N,B)._add(V)._add(q),D._rotateAround(N,B)._add(V)._add(q),R._rotateAround(N,B)._add(V)._add(q),F._rotateAround(N,B)._add(V)._add(q)}if(u){var H=Math.sin(u),G=Math.cos(u),Z=[G,-H,H,G];O._matMult(Z),D._matMult(Z),R._matMult(Z),F._matMult(Z)}var W=new a(0,0),Y=new a(0,0);c.push({tl:O,tr:D,bl:R,br:F,tex:y,writingMode:e.writingMode,glyphOffset:S,sectionIndex:g.sectionIndex,isSDF:x,pixelOffsetTL:W,pixelOffsetBR:Y,minFontScaleX:0,minFontScaleY:0})}}return c}(0,r,l,i,o,s,n,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[Au*i.layout.get("text-size").evaluate(s,{})])[0]>Qu&&k(t.layerIds[0]+': Value for "text-size" is >= '+Ku+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[Au*d.compositeTextSizes[0].evaluate(s,{},m),Au*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>Qu||v[1]>Qu)&&k(t.layerIds[0]+': Value for "text-size" is >= '+Ku+'. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,o,s,c,e,u.lineStartIndex,u.lineLength,p,m);for(var x=0,_=h;x<_.length;x+=1)f[_[x]]=t.text.placedSymbolArray.length-1;return 4*g.length}function ec(t){for(var e in t)return t[e];return null}function rc(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return!0}else i[e]=[];return i[e].push(n),!1}var nc=nl.VectorTileFeature.types,ic=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ac(t,e,r,n,i,a,o,s,l,u,c,h,f){var p=s?Math.min(Qu,Math.round(s[0])):0,d=s?Math.min(Qu,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(p<<1)+(l?1:0),d,16*u,16*c,256*h,256*f)}function oc(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function sc(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(wi(r[e].text))return!0;return!1}var lc=function(t){this.layoutVertexArray=new ha,this.indexArray=new va,this.programConfigurations=t,this.segments=new Ba,this.dynamicLayoutVertexArray=new fa,this.opacityVertexArray=new pa,this.placedSymbolArray=new Ia};lc.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},lc.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ml.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Sl.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,ic,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))},lc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},oi("SymbolBuffers",lc);var uc=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Ba,this.collisionVertexArray=new ya};uc.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,El.members,!0)},uc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},oi("CollisionBuffers",uc);var cc=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Uo([]),this.placementViewportMatrix=Uo([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Mu(this.zoom,e["text-size"]),this.iconSizeData=Mu(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var a="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(function(t){return lu[t]})),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id}),this.sourceID=t.sourceID};cc.prototype.createArrays=function(){this.text=new lc(new po(this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new lc(new po(this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.glyphOffsetArray=new za,this.lineVertexArray=new Oa,this.symbolInstances=new Pa},cc.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){var o=Pl[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0)}},cc.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,a=i.get("text-font"),o=i.get("text-field"),s=i.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof he&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||u){for(var h=e.iconDependencies,f=e.glyphDependencies,p=e.availableImages,d=new Fi(this.zoom),m=0,g=t;m<g.length;m+=1){var y=g[m],v=y.feature,x=y.id,_=y.index,b=y.sourceLayerIndex,w=n._featureFilter.needGeometry,T=bo(v,w);if(n._featureFilter.filter(d,T,r)){w||(T.geometry=_o(v));var k=void 0;if(l){var A=n.getValueAndResolveTokens("text-field",T,r,p),M=he.factory(A);sc(M)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===zi()||this.hasRTLText&&Di.isParsed())&&(k=Ll(M,n,T))}var S=void 0;if(u){var E=n.getValueAndResolveTokens("icon-image",T,r,p);S=E instanceof fe?E:fe.fromString(E)}if(k||S){var C=this.sortFeaturesByKey?c.evaluate(T,{},r):void 0,I={id:x,text:k,icon:S,index:_,sourceLayerIndex:b,geometry:T.geometry,properties:v.properties,type:nc[v.type],sortKey:C};if(this.features.push(I),S&&(h[S.name]=!0),k){var L=a.evaluate(T,{},r).join(","),P="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(lu.vertical)>=0;for(var z=0,O=k.sections;z<O.length;z+=1){var D=O[z];if(D.image)h[D.image.name]=!0;else{var R=di(k.toString()),F=D.fontStack||L,B=f[F]=f[F]||{};this.calculateGlyphDependencies(D.text,B,P,this.allowVerticalPlacement,R)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var u=0;u<t.length;u++){var c=t[u],h=c.geometry,f=c.text?c.text.toString():null;if(f){var p=l(f,h),d=l(f,h,!0);if(p in r&&d in e&&r[p]!==e[d]){var m=s(p,d,h),g=o(p,d,n[m].geometry);delete e[p],delete r[d],r[l(f,n[g].geometry,!0)]=g,n[m].geometry=null}else p in r?o(p,d,h):d in e?s(p,d,h):(a(u),e[p]=i-1,r[d]=i-1)}else a(u)}return n.filter(function(t){return t.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(t,e){return t.sortKey-e.sortKey})}},cc.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},cc.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},cc.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},cc.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},cc.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},cc.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},cc.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=a[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},cc.prototype.addSymbols=function(t,e,r,n,i,a,o,s,l,u,c,h){for(var f=t.indexArray,p=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,p,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=d.vertexLength,y=this.allowVerticalPlacement&&o===lu.vertical?Math.PI/2:0,v=a.text&&a.text.sections,x=0;x<e.length;x++){var _=e[x],b=_.tl,w=_.tr,T=_.bl,k=_.br,A=_.tex,M=_.pixelOffsetTL,S=_.pixelOffsetBR,E=_.minFontScaleX,C=_.minFontScaleY,I=_.glyphOffset,L=_.isSDF,P=_.sectionIndex,z=d.vertexLength,O=I[1];ac(p,s.x,s.y,b.x,O+b.y,A.x,A.y,r,L,M.x,M.y,E,C),ac(p,s.x,s.y,w.x,O+w.y,A.x+A.w,A.y,r,L,S.x,M.y,E,C),ac(p,s.x,s.y,T.x,O+T.y,A.x,A.y+A.h,r,L,M.x,S.y,E,C),ac(p,s.x,s.y,k.x,O+k.y,A.x+A.w,A.y+A.h,r,L,S.x,S.y,E,C),oc(t.dynamicLayoutVertexArray,s,y),f.emplaceBack(z,z+1,z+2),f.emplaceBack(z+1,z+2,z+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),(x===e.length-1||P!==e[x+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(p.length,a,a.index,{},h,v&&v[P])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,u,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,c)},cc.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},cc.prototype.addCollisionDebugVertices=function(t,e,r,n,i,o,s){var l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),u=l.vertexLength,c=i.layoutVertexArray,h=i.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(c,h,o,f,p,new a(t,e)),this._addCollisionDebugVertex(c,h,o,f,p,new a(r,e)),this._addCollisionDebugVertex(c,h,o,f,p,new a(r,n)),this._addCollisionDebugVertex(c,h,o,f,p,new a(t,n)),l.vertexLength+=4;var d=i.indexArray;d.emplaceBack(u,u+1),d.emplaceBack(u+1,u+2),d.emplaceBack(u+2,u+3),d.emplaceBack(u+3,u),l.primitiveLength+=4},cc.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var a=this.collisionBoxArray.get(i),o=a.x1,s=a.y1,l=a.x2,u=a.y2;this.addCollisionDebugVertices(o,s,l,u,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}},cc.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new uc(ma,Cl.members,ka),this.iconCollisionBox=new uc(ma,Cl.members,ka);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},cc.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,l){for(var u={},c=e;c<r;c++){var h=t.get(c);u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}for(var f=n;f<i;f++){var p=t.get(f);u.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},u.verticalTextFeatureIndex=p.featureIndex;break}for(var d=a;d<o;d++){var m=t.get(d);u.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},u.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=t.get(g);u.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},u.verticalIconFeatureIndex=y.featureIndex;break}return u},cc.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},cc.prototype.hasTextData=function(){return this.text.segments.get().length>0},cc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},cc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},cc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},cc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},cc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},cc.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return a.sort(function(t,e){return n[t]-n[e]||i[e]-i[t]}),a},cc.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},cc.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},oi("SymbolBucket",cc,{omit:["layers","collisionBoxArray","features","compareText"]}),cc.MAX_GLYPHS=65535,cc.addDynamicAttributes=oc;var hc=new Ji({"symbol-placement":new Zi(Ft.layout_symbol["symbol-placement"]),"symbol-spacing":new Zi(Ft.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Zi(Ft.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Wi(Ft.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Zi(Ft.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Zi(Ft.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Zi(Ft.layout_symbol["icon-ignore-placement"]),"icon-optional":new Zi(Ft.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Zi(Ft.layout_symbol["icon-rotation-alignment"]),"icon-size":new Wi(Ft.layout_symbol["icon-size"]),"icon-text-fit":new Zi(Ft.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Zi(Ft.layout_symbol["icon-text-fit-padding"]),"icon-image":new Wi(Ft.layout_symbol["icon-image"]),"icon-rotate":new Wi(Ft.layout_symbol["icon-rotate"]),"icon-padding":new Zi(Ft.layout_symbol["icon-padding"]),"icon-keep-upright":new Zi(Ft.layout_symbol["icon-keep-upright"]),"icon-offset":new Wi(Ft.layout_symbol["icon-offset"]),"icon-anchor":new Wi(Ft.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Zi(Ft.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Zi(Ft.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Zi(Ft.layout_symbol["text-rotation-alignment"]),"text-field":new Wi(Ft.layout_symbol["text-field"]),"text-font":new Wi(Ft.layout_symbol["text-font"]),"text-size":new Wi(Ft.layout_symbol["text-size"]),"text-max-width":new Wi(Ft.layout_symbol["text-max-width"]),"text-line-height":new Zi(Ft.layout_symbol["text-line-height"]),"text-letter-spacing":new Wi(Ft.layout_symbol["text-letter-spacing"]),"text-justify":new Wi(Ft.layout_symbol["text-justify"]),"text-radial-offset":new Wi(Ft.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Zi(Ft.layout_symbol["text-variable-anchor"]),"text-anchor":new Wi(Ft.layout_symbol["text-anchor"]),"text-max-angle":new Zi(Ft.layout_symbol["text-max-angle"]),"text-writing-mode":new Zi(Ft.layout_symbol["text-writing-mode"]),"text-rotate":new Wi(Ft.layout_symbol["text-rotate"]),"text-padding":new Zi(Ft.layout_symbol["text-padding"]),"text-keep-upright":new Zi(Ft.layout_symbol["text-keep-upright"]),"text-transform":new Wi(Ft.layout_symbol["text-transform"]),"text-offset":new Wi(Ft.layout_symbol["text-offset"]),"text-allow-overlap":new Zi(Ft.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Zi(Ft.layout_symbol["text-ignore-placement"]),"text-optional":new Zi(Ft.layout_symbol["text-optional"])}),fc=new Ji({"icon-opacity":new Wi(Ft.paint_symbol["icon-opacity"]),"icon-color":new Wi(Ft.paint_symbol["icon-color"]),"icon-halo-color":new Wi(Ft.paint_symbol["icon-halo-color"]),"icon-halo-width":new Wi(Ft.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Wi(Ft.paint_symbol["icon-halo-blur"]),"icon-translate":new Zi(Ft.paint_symbol["icon-translate"]),"icon-translate-anchor":new Zi(Ft.paint_symbol["icon-translate-anchor"]),"text-opacity":new Wi(Ft.paint_symbol["text-opacity"]),"text-color":new Wi(Ft.paint_symbol["text-color"],{runtimeType:Xt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Wi(Ft.paint_symbol["text-halo-color"]),"text-halo-width":new Wi(Ft.paint_symbol["text-halo-width"]),"text-halo-blur":new Wi(Ft.paint_symbol["text-halo-blur"]),"text-translate":new Zi(Ft.paint_symbol["text-translate"]),"text-translate-anchor":new Zi(Ft.paint_symbol["text-translate-anchor"])}),pc={paint:fc,layout:hc},dc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Gt,this.defaultValue=t};dc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},dc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},dc.prototype.outputDefined=function(){return!1},dc.prototype.serialize=function(){return null},oi("FormatSectionOverride",dc,{omit:["defaultValue"]});var mc=function(t){function e(e){t.call(this,e,pc)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||cn(a.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?String(t[r]):""})}(e.properties,i)},e.prototype.createBucket=function(t){return new cc(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=pc.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i=this.paint.get(n),a=new dc(i),o=new un(a,i.property.specification),s=null;s="constant"===i.value.kind||"source"===i.value.kind?new fn("source",o):new pn("composite",o,i.value.zoomStops,i.value._interpolationType),this.paint._values[n]=new Hi(i.property,s,i.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=pc.paint.properties[e],i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1){var a=r[e];if(n.overrides&&n.overrides.hasOverride(a))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof he)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){if(!i)if(t instanceof ye&&me(t.value)===Qt){var e=t.value;a(e.sections)}else t instanceof be?a(t.sections):t.eachChild(o)},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return i},e}(Qi),gc={paint:new Ji({"background-color":new Zi(Ft.paint_background["background-color"]),"background-pattern":new Xi(Ft.paint_background["background-pattern"]),"background-opacity":new Zi(Ft.paint_background["background-opacity"])})},yc=function(t){function e(e){t.call(this,e,gc)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Qi),vc={paint:new Ji({"raster-opacity":new Zi(Ft.paint_raster["raster-opacity"]),"raster-hue-rotate":new Zi(Ft.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Zi(Ft.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Zi(Ft.paint_raster["raster-brightness-max"]),"raster-saturation":new Zi(Ft.paint_raster["raster-saturation"]),"raster-contrast":new Zi(Ft.paint_raster["raster-contrast"]),"raster-resampling":new Zi(Ft.paint_raster["raster-resampling"]),"raster-fade-duration":new Zi(Ft.paint_raster["raster-fade-duration"])})},xc=function(t){function e(e){t.call(this,e,vc)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Qi),_c=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Qi),bc={circle:Wo,heatmap:ns,hillshade:as,fill:Zs,"fill-extrusion":hl,line:kl,symbol:mc,background:yc,raster:xc},wc=s.HTMLImageElement,Tc=s.HTMLCanvasElement,kc=s.HTMLVideoElement,Ac=s.ImageData,Mc=s.ImageBitmap,Sc=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};Sc.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=!(this.size&&this.size[0]===n&&this.size[1]===i||r),o=this.context,s=o.gl;if(this.useMipmap=!(!e||!e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[n,i],t instanceof wc||t instanceof Tc||t instanceof kc||t instanceof Ac||Mc&&t instanceof Mc?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},u=l.x,c=l.y;t instanceof wc||t instanceof Tc||t instanceof kc||t instanceof Ac||Mc&&t instanceof Mc?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Sc.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r===n.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},Sc.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Sc.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Ec=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Ec.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){t._triggered=!1,t._callback()},0))},Ec.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Cc=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new Ec(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=S()?t:s};function Ic(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Cc.prototype.send=function(t,e,r,n,i){var a=this;void 0===i&&(i=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=I(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:ci(e,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId})}}},Cc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else S()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Cc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Cc.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(hi(e.error)):n(null,hi(e.data)))}else{var i=!1,a=I(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?ci(e):null,data:ci(n,a)},a)}:function(t){i=!0},s=null,l=hi(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Cc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Lc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Lc.prototype.setNorthEast=function(t){return this._ne=t instanceof zc?new zc(t.lng,t.lat):zc.convert(t),this},Lc.prototype.setSouthWest=function(t){return this._sw=t instanceof zc?new zc(t.lng,t.lat):zc.convert(t),this},Lc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof zc)e=t,r=t;else{if(!(t instanceof Lc)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Lc.convert(a))}var o=t;return this.extend(zc.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new zc(e.lng,e.lat),this._ne=new zc(r.lng,r.lat)),this},Lc.prototype.getCenter=function(){return new zc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Lc.prototype.getSouthWest=function(){return this._sw},Lc.prototype.getNorthEast=function(){return this._ne},Lc.prototype.getNorthWest=function(){return new zc(this.getWest(),this.getNorth())},Lc.prototype.getSouthEast=function(){return new zc(this.getEast(),this.getSouth())},Lc.prototype.getWest=function(){return this._sw.lng},Lc.prototype.getSouth=function(){return this._sw.lat},Lc.prototype.getEast=function(){return this._ne.lng},Lc.prototype.getNorth=function(){return this._ne.lat},Lc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Lc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Lc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Lc.prototype.contains=function(t){var e=zc.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Lc.convert=function(t){return!t||t instanceof Lc?t:new Lc(t)};var Pc=6371008.8,zc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+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")};zc.prototype.wrap=function(){return new zc(f(this.lng,-180,180),this.lat)},zc.prototype.toArray=function(){return[this.lng,this.lat]},zc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},zc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Pc*Math.acos(Math.min(i,1))},zc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Lc(new zc(this.lng-r,this.lat-e),new zc(this.lng+r,this.lat+e))},zc.convert=function(t){if(t instanceof zc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new zc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new zc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Oc=2*Math.PI*Pc;function Dc(t){return Oc*Math.cos(t*Math.PI/180)}function Rc(t){return(180+t)/360}function Fc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Bc(t,e){return t/Dc(e)}function Nc(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var jc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};jc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=zc.convert(t);return new jc(Rc(r.lng),Fc(r.lat),Bc(e,r.lat))},jc.prototype.toLngLat=function(){return new zc(function(t){return 360*t-180}(this.x),Nc(this.y))},jc.prototype.toAltitude=function(){return function(t,e){return t*Dc(Nc(e))}(this.z,this.y)},jc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Oc*function(t){return 1/Math.cos(t*Math.PI/180)}(Nc(this.y))};var Uc=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Hc(0,t,t,e,r)};Uc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Uc.prototype.url=function(t,e){var r=function(t,e,r){var n=Ic(256*t,256*(e=Math.pow(2,r)-e-1),r),i=Ic(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Uc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new a((t.x*e-this.x)*yo,(t.y*e-this.y)*yo)},Uc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Vc=function(t,e){this.wrap=t,this.canonical=e,this.key=Hc(t,e.z,e.z,e.x,e.y)},qc=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Uc(r,+n,+i),this.key=Hc(e,t,r,n,i)};function Hc(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);var a=1<<r;return(a*a*t+a*i+n).toString(36)+r.toString(36)+e.toString(36)}qc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},qc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new qc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},qc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Hc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Hc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},qc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},qc.prototype.children=function(t){if(this.overscaledZ>=t)return[new qc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new qc(e,this.wrap,e,r,n),new qc(e,this.wrap,e,r+1,n),new qc(e,this.wrap,e,r,n+1),new qc(e,this.wrap,e,r+1,n+1)]},qc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},qc.prototype.wrapped=function(){return new qc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},qc.prototype.unwrapTo=function(t){return new qc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},qc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},qc.prototype.toUnwrapped=function(){return new Vc(this.wrap,this.canonical)},qc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},qc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new jc(t.x-this.wrap,t.y))},oi("CanonicalTileID",Uc),oi("OverscaledTileID",qc,{omit:["posMatrix"]});var Gc=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return k('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Gc.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Gc.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Gc.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Gc.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Gc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Gc.prototype.getPixels=function(){return new ts({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Gc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,u=a;u<o;u++)for(var c=n;c<i;c++)this.data[this._idx(c,u)]=t.data[this._idx(c+s,u+l)]},oi("DEMData",Gc);var Zc=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Zc.prototype.encode=function(t){return this._stringToNumber[t]},Zc.prototype.decode=function(t){return this._numberToString[t]};var Wc=function(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i},Yc={geometry:{configurable:!0}};Yc.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Yc.geometry.set=function(t){this._geometry=t},Wc.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"===e||"_vectorTileFeature"===e||(t[e]=this[e]);return t},Object.defineProperties(Wc.prototype,Yc);var Xc=function(){this.state={},this.stateChanges={},this.deletedStates={}};Xc.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},p(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var a in this.deletedStates[t][n]={},this.state[t][n])r[a]||(this.deletedStates[t][n][a]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o]},Xc.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},Xc.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},i=this.stateChanges[t]||{},a=p({},n[r],i[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var o=this.deletedStates[t][e];if(null===o)return{};for(var s in o)delete a[s]}return a},Xc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Xc.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),p(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var u in this.deletedStates[o]){if(null===this.deletedStates[o][u])this.state[o][u]={};else for(var c=0,h=Object.keys(this.deletedStates[o][u]);c<h.length;c+=1){var f=h[c];delete this.state[o][u][f]}s[u]=this.state[o][u]}r[o]=r[o]||{},p(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in t)t[d].setFeatureState(r,e)};var $c=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ti(yo,16,0),this.grid3D=new ti(yo,16,0),this.featureIndexArray=new Ra,this.promoteId=e};function Jc(t,e,r,n,i){return _(t,function(t,a){var o=e instanceof Gi?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o})}function Kc(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function Qc(t,e){return e-t}$c.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],h=0;h<u.length;h++){var f=u[h];c[0]=Math.min(c[0],f.x),c[1]=Math.min(c[1],f.y),c[2]=Math.max(c[2],f.x),c[3]=Math.max(c[3],f.y)}c[0]<yo&&c[1]<yo&&c[2]>=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},$c.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new nl.VectorTile(new Rl(this.rawTileData)).layers,this.sourceLayerCoder=new Zc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},$c.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=yo/t.tileSize/t.scale,l=An(o.filter),u=t.queryGeometry,c=t.queryPadding*s,h=Kc(u),f=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),p=Kc(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c,function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o<s.length;o+=1){var l=s[o];if(e<=l.x&&r<=l.y&&n>=l.x&&i>=l.y)return!0}var u=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var c=0,h=u;c<h.length;c+=1)if(zo(t,h[c]))return!0;for(var f=0;f<t.length-1;f++)if(Oo(t[f],t[f+1],u))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,n+c,i+c)}),m=0,g=d;m<g.length;m+=1){var y=g[m];f.push(y)}f.sort(Qc);for(var v,x={},_=function(a){var c=f[a];if(c!==v){v=c;var h=i.featureIndexArray.get(c),p=null;i.loadMatchingFeature(x,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,o.layers,o.availableImages,e,r,n,function(e,r,n){return p||(p=_o(e)),r.queryIntersectsFeature(u,e,n,p,i.z,t.transform,s,t.pixelPosMatrix)})}},b=0;b<f.length;b++)_(b);return x},$c.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s,l,u,c){var h=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(a,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var m=bo(d,!0);if(!i.filter(new Fi(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new Fi(this.tileID.overscaledZ),d))return;for(var g=this.getId(d,f),y=0;y<h.length;y++){var v=h[y];if(!(a&&a.indexOf(v)<0)){var x=s[v];if(x){var _={};void 0!==g&&u&&(_=u.getState(x.sourceLayer||"_geojsonTileLayer",g));var b=p({},l[v]);b.paint=Jc(b.paint,x.paint,d,_,o),b.layout=Jc(b.layout,x.layout,d,_,o);var w=!c||c(d,x,_);if(w){var T=new Wc(d,this.z,this.x,this.y,g);T.layer=b;var k=t[v];void 0===k&&(k=t[v]=[]),k.push({featureIndex:n,feature:T,intersectionZ:w})}}}}}},$c.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a,o,s){var l={};this.loadVTLayers();for(var u=An(i),c=0,h=t;c<h.length;c+=1){var f=h[c];this.loadMatchingFeature(l,r,n,f,u,a,o,s,e)}return l},$c.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return!0;return!1},$c.prototype.getId=function(t,e){var r=t.id;if(this.promoteId){var n="string"==typeof this.promoteId?this.promoteId:this.promoteId[e];"boolean"==typeof(r=t.properties[n])&&(r=Number(r))}return r},oi("FeatureIndex",$c,{omit:["rawTileData","sourceLayerCoder"]});var th=function(t,e){this.tileID=t,this.uid=m(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};th.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<N.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},th.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},th.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a[i],n=t.layerIds.map(function(t){return e.getLayer(t)}).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map(function(t){return n.filter(function(e){return e.id===t})[0]}));for(var o=0,s=n;o<s.length;o+=1){var l=s[o];r[l.id]=t}}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof cc){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof cc&&o.hasRTLText){this.hasRTLText=!0,Ri();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Ea},th.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},th.prototype.getBucket=function(t){return this.buckets[t.id]},th.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Sc(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Sc(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},th.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},th.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}},th.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=e?e.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=An(e&&e.filter),s=this.tileID.canonical,l=s.z,u=s.x,c=s.y,h={z:l,x:u,y:c},f=0;f<a.length;f++){var p=a.feature(f);if(o.needGeometry){var d=bo(p,!0);if(!o.filter(new Fi(this.tileID.overscaledZ),d,this.tileID.canonical))continue}else if(!o.filter(new Fi(this.tileID.overscaledZ),p))continue;var m=r.getId(p,i),g=new Wc(p,l,u,c,m);g.tile=h,t.push(g)}}},th.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},th.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},th.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=E(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},th.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},th.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}}},th.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},th.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<N.now()},th.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},th.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=N.now()+t},th.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r},th.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=this.dependencies[i];if(a)for(var o=0,s=e;o<s.length;o+=1)if(a[s[o]])return!0}return!1};var eh=s.performance,rh=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},eh.mark(this._marks.start)};rh.prototype.finish=function(){eh.mark(this._marks.end);var t=eh.getEntriesByName(this._marks.measure);return 0===t.length&&(eh.measure(this._marks.measure,this._marks.start,this._marks.end),t=eh.getEntriesByName(this._marks.measure),eh.clearMarks(this._marks.start),eh.clearMarks(this._marks.end),eh.clearMeasures(this._marks.measure)),t},t.Actor=Cc,t.AlphaImage=Qo,t.CanonicalTileID=Uc,t.CollisionBoxArray=Ea,t.Color=le,t.DEMData=Gc,t.DataConstantProperty=Zi,t.DictionaryCoder=Zc,t.EXTENT=yo,t.ErrorEvent=Dt,t.EvaluationParameters=Fi,t.Event=Ot,t.Evented=Rt,t.FeatureIndex=$c,t.FillBucket=qs,t.FillExtrusionBucket=sl,t.ImageAtlas=su,t.ImagePosition=au,t.LineBucket=xl,t.LngLat=zc,t.LngLatBounds=Lc,t.MercatorCoordinate=jc,t.ONE_EM=zl,t.OverscaledTileID=qc,t.Point=a,t.Point$1=a,t.Properties=Ji,t.Protobuf=Rl,t.RGBAImage=ts,t.RequestManager=Z,t.RequestPerformance=rh,t.ResourceType=_t,t.SegmentVector=Ba,t.SourceFeatureState=Xc,t.StructArrayLayout1ui2=Aa,t.StructArrayLayout2f1f2i16=ga,t.StructArrayLayout2i4=aa,t.StructArrayLayout3ui6=va,t.StructArrayLayout4i8=oa,t.SymbolBucket=cc,t.Texture=Sc,t.Tile=th,t.Transitionable=ji,t.Uniform1f=Qa,t.Uniform1i=Ka,t.Uniform2f=to,t.Uniform3f=eo,t.Uniform4f=ro,t.UniformColor=no,t.UniformMatrix4f=ao,t.UnwrappedTileID=Vc,t.ValidationError=Bt,t.WritingMode=lu,t.ZoomHistory=fi,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=oc,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0===--n&&r(a,i)})})},t.bezier=u,t.bindAll=v,t.browser=N,t.cacheEntryPossiblyAdded=function(t){++vt>ft&&(t.getActor().send("enforceCacheSizeLimit",ht),vt=0)},t.clamp=h,t.clearTileCache=function(t){var e=s.caches.delete(ct);t&&e.catch(t).then(function(){return t()})},t.clipLine=Fu,t.clone=function(t){var e=new jo(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=w,t.clone$2=function(t){var e=new jo(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Il,t.config=j,t.create=function(){var t=new jo(16);return jo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new jo(9);return jo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new jo(4);return jo!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=hn,t.createLayout=na,t.createStyleLayer=function(t){return"custom"===t.type?new _c(t):new bc[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var i in e)if(!t(e[i],r[i]))return!1;return!0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=c,t.emitValidationErrors=Qn,t.endsWith=x,t.enforceCacheSizeLimit=function(t){pt(),rt&&rt.then(function(e){e.keys().then(function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])})})},t.evaluateSizeForFeature=Su,t.evaluateSizeForZoom=Eu,t.evaluateVariableOffset=$u,t.evented=Pi,t.extend=p,t.featureFilter=An,t.filterObject=b,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=bu,t.getAnchorJustification=Ju,t.getArrayBuffer=At,t.getImage=Lt,t.getJSON=function(t,e){return kt(p(t,{type:"json"}),e)},t.getRTLTextPluginStatus=zi,t.getReferrer=wt,t.getVideo=function(t,e){var r=s.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(var n=0;n<t.length;n++){var i=s.document.createElement("source");St(t[n])||(r.crossOrigin="Anonymous"),i.src=t[n],r.appendChild(i)}return{cancel:function(){}}},t.identity=Uo,t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,_=r*u-a*o,b=n*l-i*s,w=n*u-a*s,T=i*u-a*l,k=c*m-h*d,A=c*g-f*d,M=c*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(I=1/I,t[0]=(s*C-l*E+u*S)*I,t[1]=(i*E-n*C-a*S)*I,t[2]=(m*T-g*w+y*b)*I,t[3]=(f*w-h*T-p*b)*I,t[4]=(l*M-o*C-u*A)*I,t[5]=(r*C-i*M+a*A)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(c*T-f*_+p*x)*I,t[8]=(o*E-s*M+u*k)*I,t[9]=(n*M-r*E-a*k)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-c*w-p*v)*I,t[12]=(s*A-o*S-l*k)*I,t[13]=(r*S-n*A+i*k)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(c*b-h*x+f*v)*I,t):null},t.isChar=pi,t.isMapboxURL=W,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=kt,t.mapObject=_,t.mercatorXfromLng=Rc,t.mercatorYfromLat=Fc,t.mercatorZfromAltitude=Bc,t.mul=qo,t.multiply=Vo,t.mvt=nl,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=rr,t.offscreenCanvasSupported=xt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new Rl(t).readFields(eu,[])},t.pbf=Rl,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=yo/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,f=h.minZoom,p=h.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Fi(f),o),u["text-size"].possiblyEvaluate(new Fi(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,g=d.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Fi(m),o),u["icon-size"].possiblyEvaluate(new Fi(g),o)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new Fi(t.zoom+1),o),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new Fi(t.zoom+1),o),c.textMaxSize=u["text-size"].possiblyEvaluate(new Fi(18));for(var y=l.get("text-line-height")*zl,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),_=l.get("text-size"),b=function(){var a=T[w],s=l.get("text-font").evaluate(a,{},o).join(","),u=_.evaluate(a,{},o),h=c.layoutTextSize.evaluate(a,{},o),f=c.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,m=[0,0];if(d){var g=d.toString(),b=l.get("text-letter-spacing").evaluate(a,{},o)*zl,A=function(t){for(var e=0,r=t;e<r.length;e+=1)if(!mi(r[e].charCodeAt(0)))return!1;return!0}(g)?b:0,M=l.get("text-anchor").evaluate(a,{},o),S=l.get("text-variable-anchor");if(!S){var E=l.get("text-radial-offset").evaluate(a,{},o);m=E?$u(M,[E*zl,Xu]):l.get("text-offset").evaluate(a,{},o).map(function(t){return t*zl})}var C=v?"center":l.get("text-justify").evaluate(a,{},o),I=l.get("symbol-placement"),L="point"===I?l.get("text-max-width").evaluate(a,{},o)*zl:0,P=function(){t.allowVerticalPlacement&&di(g)&&(p.vertical=fu(d,e,r,i,s,L,y,M,"left",A,m,lu.vertical,!0,I,h,u))};if(!v&&S){for(var z="auto"===C?S.map(function(t){return Ju(t)}):[C],O=!1,D=0;D<z.length;D++){var R=z[D];if(!p.horizontal[R])if(O)p.horizontal[R]=p.horizontal[0];else{var F=fu(d,e,r,i,s,L,y,"center",R,A,m,lu.horizontal,!1,I,h,u);F&&(p.horizontal[R]=F,O=1===F.positionedLines.length)}}P()}else{"auto"===C&&(C=Ju(M));var B=fu(d,e,r,i,s,L,y,M,C,A,m,lu.horizontal,!1,I,h,u);B&&(p.horizontal[C]=B),P(),di(g)&&v&&x&&(p.vertical=fu(d,e,r,i,s,L,y,M,C,A,m,lu.vertical,!1,I,h,u))}}var N=void 0,j=!1;if(a.icon&&a.icon.name){var U=n[a.icon.name];U&&(N=function(t,e,r){var n=bu(r),i=n.horizontalAlign,a=n.verticalAlign,o=e[0],s=e[1],l=o-t.displaySize[0]*i,u=l+t.displaySize[0],c=s-t.displaySize[1]*a;return{image:t,top:c,bottom:c+t.displaySize[1],left:l,right:u}}(i[a.icon.name],l.get("icon-offset").evaluate(a,{},o),l.get("icon-anchor").evaluate(a,{},o)),j=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&k("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==t.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var V=ec(p.horizontal)||p.vertical;t.iconsInText=!!V&&V.iconsInText,(V||N)&&function(t,e,r,n,i,a,o,s,l,u,c){var h=a.textMaxSize.evaluate(e,{});void 0===h&&(h=o);var f,p=t.layers[0].layout,d=p.get("icon-offset").evaluate(e,{},c),m=ec(r.horizontal),g=24,y=o/g,v=t.tilePixelRatio*y,x=t.tilePixelRatio*h/g,_=t.tilePixelRatio*s,b=t.tilePixelRatio*p.get("symbol-spacing"),w=p.get("text-padding")*t.tilePixelRatio,T=p.get("icon-padding")*t.tilePixelRatio,A=p.get("text-max-angle")/180*Math.PI,M="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),S="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),E=p.get("symbol-placement"),C=b/2,I=p.get("icon-text-fit");n&&"none"!==I&&(t.allowVerticalPlacement&&r.vertical&&(f=Tu(n,r.vertical,I,p.get("icon-text-fit-padding"),d,y)),m&&(n=Tu(n,m,I,p.get("icon-text-fit-padding"),d,y)));var L=function(s,h){h.x<0||h.x>=yo||h.y<0||h.y>=yo||function(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,A){var M,S,E,C,I,L=t.addToLineVertexArray(e,r),P=0,z=0,O=0,D=0,R=-1,F=-1,B={},N=qa(""),j=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(M=s.layout.get("text-offset").evaluate(_,{},T).map(function(t){return t*zl}),j=M[0],U=M[1]):(j=s.layout.get("text-radial-offset").evaluate(_,{},T)*zl,U=Xu),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(_,{},T)+90,q=n.vertical;C=new qu(l,e,u,c,h,q,f,p,d,V),o&&(I=new qu(l,e,u,c,h,o,g,y,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),Z=Bu(i,H,w,G),W=o?Bu(o,H,w,G):void 0;E=new qu(l,e,u,c,h,i,g,y,!1,H),P=4*Z.length;var Y=t.iconSizeData,X=null;"source"===Y.kind?(X=[Au*s.layout.get("icon-size").evaluate(_,{})])[0]>Qu&&k(t.layerIds[0]+': Value for "icon-size" is >= '+Ku+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[Au*b.compositeIconSizes[0].evaluate(_,{},T),Au*b.compositeIconSizes[1].evaluate(_,{},T)])[0]>Qu||X[1]>Qu)&&k(t.layerIds[0]+': Value for "icon-size" is >= '+Ku+'. Reduce your "icon-size".'),t.addSymbols(t.icon,Z,X,x,v,_,!1,e,L.lineStartIndex,L.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1,W&&(z=4*W.length,t.addSymbols(t.icon,W,X,x,v,_,lu.vertical,e,L.lineStartIndex,L.lineLength,-1,T),F=t.icon.placedSymbolArray.length-1)}for(var $ in n.horizontal){var J=n.horizontal[$];if(!S){N=qa(J.text);var K=s.layout.get("text-rotate").evaluate(_,{},T);S=new qu(l,e,u,c,h,J,f,p,d,K)}var Q=1===J.positionedLines.length;if(O+=tc(t,e,J,a,s,d,_,m,L,n.vertical?lu.horizontal:lu.horizontalOnly,Q?Object.keys(n.horizontal):[$],B,R,b,T),Q)break}n.vertical&&(D+=tc(t,e,n.vertical,a,s,d,_,m,L,lu.vertical,["vertical"],B,F,b,T));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=C?C.boxStartIndex:t.collisionBoxArray.length,nt=C?C.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,lt=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ut(S,lt),lt=ut(C,lt),lt=ut(E,lt);var ct=(lt=ut(I,lt))>-1?1:0;ct&&(lt*=A/zl),t.glyphOffsetArray.length>=cc.MAX_GLYPHS&&k("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,tt,et,rt,nt,it,at,ot,st,u,O,D,P,z,ct,0,f,j,U,lt)}(t,h,s,r,n,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,M,l,_,T,S,d,e,a,u,c,o)};if("line"===E)for(var P=0,z=Fu(e.geometry,0,0,yo,yo);P<z.length;P+=1)for(var O=z[P],D=Du(O,b,A,r.vertical||m,n,g,x,t.overscaling,yo),R=0,F=D;R<F.length;R+=1){var B=F[R];(!m||!rc(t,m.text,C,B))&&L(O,B)}else if("line-center"===E)for(var N=0,j=e.geometry;N<j.length;N+=1){var U=j[N];if(U.length>1){var V=Ou(U,A,r.vertical||m,n,g,x);V&&L(U,V)}}else if("Polygon"===e.type)for(var q=0,H=Ns(e.geometry,0);q<H.length;q+=1){var G=H[q],Z=Zu(G,16);L(G[0],new ku(Z.x,Z.y,0))}else if("LineString"===e.type)for(var W=0,Y=e.geometry;W<Y.length;W+=1){var X=Y[W];L(X,new ku(X[0].x,X[0].y,0))}else if("Point"===e.type)for(var $=0,J=e.geometry;$<J.length;$+=1)for(var K=J[$],Q=0,tt=K;Q<tt.length;Q+=1){var et=tt[Q];L([et],new ku(et.x,et.y,0))}}(t,a,p,N,n,c,h,f,m,j,o)},w=0,T=t.features;w<T.length;w+=1)b();a&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r},t.plugin=Di,t.polygonIntersectsPolygon=ko,t.postMapLoadEvent=ut,t.postTurnstileEvent=st,t.potpack=iu,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=oi,t.registerForPluginStateChange=function(t){return t({pluginStatus:Ei,pluginURL:Ci}),Pi.on("pluginStateChange",t),t},t.renderColorRamp=rs,t.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){ht=t,ft=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),Ei===Ti||Ei===ki||Ei===Ai)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ci=N.resolveURL(t),Ei=Ti,Si=e,Li(),r||Oi()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.sqrLen=Zo,t.styleSpec=Ft,t.sub=Ho,t.symbolSize=Cu,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.transformMat4=Go,t.translate=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,p,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+f*y+e[13],t[14]=a*m+u*g+p*y+e[14],t[15]=o*m+c*g+d*y+e[15]),t},t.triggerPluginCompletionEvent=Ii,t.uniqueId=m,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=$n,t.validateStyle=Xn,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=nl,t.version=r,t.warnOnce=k,t.webpSupported=U,t.window=s,t.wrap=f}),n(0,function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",i=0,a=t;i<a.length;i+=1)n+=e(a[i])+",";return n+"]"}for(var o=Object.keys(t).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+e(t[o[l]])+",";return s+"}"}function r(r){for(var n="",i=0,a=t.refProperties;i<a.length;i+=1)n+="/"+e(r[a[i]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,a=0,o=e;a<o.length;a+=1){var s=o[a];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var u=0,c=n;u<c.length;u+=1){var h=c[u];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var f=function(t,e){for(var n={},i=0;i<t.length;i++){var a=e&&e[t[i].id]||r(t[i]);e&&(e[t[i].id]=a);var o=n[a];o||(o=n[a]=[]),o.push(t[i])}var s=[];for(var l in n)s.push(n[l]);return s}(t.values(this._layerConfigs),this.keyCache),p=0,d=f;p<d.length;p+=1){var m=d[p].map(function(t){return i._layers[t.id]}),g=m[0];if("none"!==g.visibility){var y=g.source||"",v=this.familiesBySource[y];v||(v=this.familiesBySource[y]={});var x=g.sourceLayer||"_geojsonTileLayer",_=v[x];_||(_=v[x]=[]),_.push(m)}}};var i=function(e){var r={},n=[];for(var i in e){var a=e[i],o=r[i]={};for(var s in a){var l=a[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(u),o[s]={rect:u,metrics:l.metrics}}}}var c=t.potpack(n),h=c.w,f=c.h,p=new t.AlphaImage({width:h||1,height:f||1});for(var d in e){var m=e[d];for(var g in m){var y=m[+g];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var v=r[d][g].rect;t.AlphaImage.copy(y.bitmap,p,{x:0,y:0},{x:v.x+1,y:v.y+1},y.bitmap)}}}this.image=p,this.positions=r};t.register("GlyphAtlas",i);var a=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function o(e,r,n){for(var i=new t.EvaluationParameters(r),a=0,o=e;a<o.length;a+=1)o[a].recalculate(i,n)}function s(e,r){var n=t.getArrayBuffer(e.request,function(e,n,i,a){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:i,expires:a})});return function(){n.cancel(),r()}}a.prototype.parse=function(e,r,n,a,s){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var u=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var h={},f={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},p=r.familiesBySource[this.source];for(var d in p){var m=e.layers[d];if(m){1===m.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+d+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var g=u.encode(d),y=[],v=0;v<m.length;v++){var x=m.feature(v),_=c.getId(x,d);y.push({feature:x,id:_,index:v,sourceLayerIndex:g})}for(var b=0,w=p[d];b<w.length;b+=1){var T=w[b],k=T[0];k.minzoom&&this.zoom<Math.floor(k.minzoom)||k.maxzoom&&this.zoom>=k.maxzoom||"none"===k.visibility||(o(T,this.zoom,n),(h[k.id]=k.createBucket({index:c.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:g,sourceID:this.source})).populate(y,f,this.tileID.canonical),c.bucketLayerIDs.push(T.map(function(t){return t.id})))}}}var A,M,S,E,C=t.mapObject(f.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},function(t,e){A||(A=t,M=e,P.call(l))}):M={};var I=Object.keys(f.iconDependencies);I.length?a.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},function(t,e){A||(A=t,S=e,P.call(l))}):S={};var L=Object.keys(f.patternDependencies);function P(){if(A)return s(A);if(M&&S&&E){var e=new i(M),r=new t.ImageAtlas(S,E);for(var a in h){var l=h[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,M,e.positions,S,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(f,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(h).filter(function(t){return!t.isEmpty()}),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?M:null,iconMap:this.returnDependencies?S:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},function(t,e){A||(A=t,E=e,P.call(l))}):E={},P.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);var c={};if(o){var h=o.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))}),n.loaded=n.loaded||{},n.loaded[i]=s})},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var u=t.window.ImageBitmap,c=function(){this.loaded={}};c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=u&&a instanceof u?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n<e.features.length;n++)t(e.features[n],r);else if("GeometryCollection"===i)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],r);else if("Feature"===i)t(e.geometry,r);else if("Polygon"===i)f(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)f(e.coordinates[n],r);return e};function f(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r<t.length;r++)p(t[r],!e)}}function p(t,e){for(var r=0,n=0,i=t.length,a=i-1;n<i;a=n++)r+=(t[n][0]-t[a][0])*(t[a][1]+t[n][1]);r>=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];e.push([new t.Point$1(i[0],i[1])])}return e}for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],u=0,c=s[o];u<c.length;u+=1){var h=c[u];l.push(new t.Point$1(h[0],h[1]))}a.push(l)}return a},m.prototype.toGeoJSON=function(t,e,r){return d.call(this,t,e,r)};var g=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};g.prototype.feature=function(t){return new m(this._features[t])};var y=t.vectorTile.VectorTileFeature,v=x;function x(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}x.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],i=[],a=0;a<n.length;a++)i.push(new t.Point$1(n[a][0],n[a][1]));this.geometry.push(i)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},_.prototype.toGeoJSON=y.prototype.toGeoJSON;var b=A,w=A,T=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new v(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return A({layers:r})},k=v;function A(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,M,t.layers[r])}(e,r),r.finish()}function M(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r,n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,S,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)e.writeMessage(4,P,a[r])}function S(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,E,t),e.writeVarintField(3,r.type),e.writeMessage(4,L,r)}function E(t,e){var r=t.feature,n=t.keys,i=t.values,a=t.keycache,o=t.valuecache;for(var s in r.properties){var l=a[s];void 0===l&&(n.push(s),l=n.length-1,a[s]=l),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var h=c+":"+u,f=o[h];void 0===f&&(i.push(u),f=i.length-1,o[h]=f),e.writeVarint(f)}}function C(t,e){return(e<<3)+(7&t)}function I(t){return t<<1^t>>31}function L(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],u=1;1===n&&(u=l.length),e.writeVarint(C(1,u));for(var c=3===n?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==n&&e.writeVarint(C(2,c-1));var f=l[h].x-i,p=l[h].y-a;e.writeVarint(I(f)),e.writeVarint(I(p)),i+=f,a+=p}3===n&&e.writeVarint(C(7,1))}}function P(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function z(t,e,r,n,i,a){if(!(i-n<=r)){var o=n+i>>1;O(t,e,o,n,i,a%2),z(t,e,r,n,o-1,a+1),z(t,e,r,o+1,i,a+1)}}function O(t,e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);O(t,e,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(i,Math.floor(r+(o-s)*u/o+c)),a)}var h=e[2*r+a],f=n,p=i;for(D(t,e,n,r),e[2*i+a]>h&&D(t,e,n,i);f<p;){for(D(t,e,f,p),f++,p--;e[2*f+a]<h;)f++;for(;e[2*p+a]>h;)p--}e[2*n+a]===h?D(t,e,n,p):D(t,e,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function D(t,e,r,n){R(t,r,n),R(e,2*r,2*n),R(e,2*r+1,2*n+1)}function R(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function F(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}b.fromVectorTileJs=w,b.fromGeojsonVt=T,b.GeoJSONWrapper=k;var B=function(t){return t[0]},N=function(t){return t[1]},j=function(t,e,r,n,i){void 0===e&&(e=B),void 0===r&&(r=N),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l<t.length;l++)o[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);z(o,s,n,0,o.length-1,0)};j.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,a,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),f=u.pop(),p=u.pop();if(f-p<=o)for(var d=p;d<=f;d++)s=e[2*d],l=e[2*d+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[d]);else{var m=Math.floor((p+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(p),u.push(m-1),u.push(g)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(g))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},j.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var u=o.pop(),c=o.pop(),h=o.pop();if(c-h<=a)for(var f=h;f<=c;f++)F(e[2*f],e[2*f+1],r,n)<=l&&s.push(t[f]);else{var p=Math.floor((h+c)/2),d=e[2*p],m=e[2*p+1];F(d,m,r,n)<=l&&s.push(t[p]);var g=(u+1)%2;(0===u?r-i<=d:n-i<=m)&&(o.push(h),o.push(p-1),o.push(g)),(0===u?r+i>=d:n+i>=m)&&(o.push(p+1),o.push(c),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},V=function(t){this.options=J(Object.create(U),t),this.trees=new Array(this.options.maxZoom+1)};function q(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function H(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:W(n),y:Y(i),zoom:1/0,index:e,parentId:-1}}function G(t){return{type:"Feature",id:t.id,properties:Z(t),geometry:{type:"Point",coordinates:[X(t.x),$(t.y)]}}}function Z(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return J(J({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function W(t){return t/360+.5}function Y(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function X(t){return 360*(t-.5)}function $(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function J(t,e){for(var r in e)t[r]=e[r];return t}function K(t){return t.x}function Q(t){return t.y}function tt(t,e,r,n){for(var i,a=n,o=r-e>>1,s=r-e,l=t[e],u=t[e+1],c=t[r],h=t[r+1],f=e+3;f<r;f+=3){var p=et(t[f],t[f+1],l,u,c,h);if(p>a)i=f,a=p;else if(p===a){var d=Math.abs(f-o);d<s&&(i=f,s=d)}}a>n&&(i-e>3&&tt(t,e,i,n),t[i+2]=a,r-i>3&&tt(t,i,r,n))}function et(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function rt(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)nt(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)nt(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)nt(t,e[n][i])}(i),i}function nt(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function it(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,a=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)at(i,s);else if("MultiPoint"===a)for(var u=0;u<i.length;u++)at(i[u],s);else if("LineString"===a)ot(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(u=0;u<i.length;u++)s=[],ot(i[u],s,o,!1),t.push(rt(l,"LineString",s,e.properties));return}st(i,s,o,!1)}else if("Polygon"===a)st(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(u=0;u<e.geometry.geometries.length;u++)it(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<i.length;u++){var c=[];st(i[u],c,o,!0),s.push(c)}}t.push(rt(l,a,s,e.properties))}}function at(t,e){e.push(lt(t[0])),e.push(ut(t[1])),e.push(0)}function ot(t,e,r,n){for(var i,a,o=0,s=0;s<t.length;s++){var l=lt(t[s][0]),u=ut(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=e.length-3;e[2]=1,tt(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function st(t,e,r,n){for(var i=0;i<t.length;i++){var a=[];ot(t[i],a,r,n),e.push(a)}}function lt(t){return t/360+.5}function ut(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function ct(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<n)return t;if(o<r||a>=n)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],h=c.geometry,f=c.type,p=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(p>=r&&d<n)l.push(c);else if(!(d<r||p>=n)){var m=[];if("Point"===f||"MultiPoint"===f)ht(h,m,r,n,i);else if("LineString"===f)ft(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)dt(h,m,r,n,i,!1);else if("Polygon"===f)dt(h,m,r,n,i,!0);else if("MultiPolygon"===f)for(var g=0;g<h.length;g++){var y=[];dt(h[g],y,r,n,i,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===f){for(g=0;g<m.length;g++)l.push(rt(c.id,f,m[g],c.tags));continue}("LineString"===f||"MultiLineString"===f)&&(1===m.length?(f="LineString",m=m[0]):f="MultiLineString"),("Point"===f||"MultiPoint"===f)&&(f=3===m.length?"Point":"MultiPoint"),l.push(rt(c.id,f,m,c.tags))}}}return l.length?l:null}function ht(t,e,r,n,i){for(var a=0;a<t.length;a+=3){var o=t[a+i];o>=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function ft(t,e,r,n,i,a,o){for(var s,l,u=pt(t),c=0===i?gt:yt,h=t.start,f=0;f<t.length-3;f+=3){var p=t[f],d=t[f+1],m=t[f+2],g=t[f+3],y=t[f+4],v=0===i?p:d,x=0===i?g:y,_=!1;o&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(d-y,2))),v<r?x>r&&(l=c(u,p,d,g,y,r),o&&(u.start=h+s*l)):v>n?x<n&&(l=c(u,p,d,g,y,n),o&&(u.start=h+s*l)):mt(u,p,d,m),x<r&&v>=r&&(l=c(u,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=c(u,p,d,g,y,n),_=!0),!a&&_&&(o&&(u.end=h+s*l),e.push(u),u=pt(t)),o&&(h+=s)}var b=t.length-3;p=t[b],d=t[b+1],m=t[b+2],(v=0===i?p:d)>=r&&v<=n&&mt(u,p,d,m),b=u.length-3,a&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&mt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function pt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function dt(t,e,r,n,i,a){for(var o=0;o<t.length;o++)ft(t[o],e,r,n,i,a,!1)}function mt(t,e,r,n){t.push(e),t.push(r),t.push(n)}function gt(t,e,r,n,i,a){var o=(a-e)/(n-e);return t.push(a),t.push(r+(i-r)*o),t.push(1),o}function yt(t,e,r,n,i,a){var o=(a-r)/(i-r);return t.push(e+(n-e)*o),t.push(a),t.push(1),o}function vt(t,e){for(var r=[],n=0;n<t.length;n++){var i,a=t[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=xt(a.geometry,e);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(xt(a.geometry[s],e))}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var l=[],u=0;u<a.geometry[s].length;u++)l.push(xt(a.geometry[s][u],e));i.push(l)}r.push(rt(a.id,o,i,a.tags))}return r}function xt(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function _t(t,e){if(t.transformed)return t;var r,n,i,a=1<<t.z,o=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(n=0;n<u.length;n+=2)l.geometry.push(bt(u[n],u[n+1],e,a,o,s));else for(n=0;n<u.length;n++){var h=[];for(i=0;i<u[n].length;i+=2)h.push(bt(u[n][i],u[n][i+1],e,a,o,s));l.geometry.push(h)}}return t.transformed=!0,t}function bt(t,e,r,n,i,a){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function wt(t,e,r,n,i){for(var a=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){o.numFeatures++,Tt(o,t[s],a,i);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,h=t[s].maxY;l<o.minX&&(o.minX=l),u<o.minY&&(o.minY=u),c>o.maxX&&(o.maxX=c),h>o.maxY&&(o.maxY=h)}return o}function Tt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)kt(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)kt(o,i[s],t,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<i.length;l++){var u=i[l];for(s=0;s<u.length;s++)kt(o,u[s],t,r,!0,0===s)}if(o.length){var c=e.tags||null;if("LineString"===a&&n.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var f={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:c};null!==e.id&&(f.id=e.id),t.features.push(f)}}function kt(t,e,r,n,i,a){var o=n*n;if(n>0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>o)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n<i;a=n,n+=2)r+=(t[n]-t[a])*(t[n+1]+t[a+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var o=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=s}}(s,a),t.push(s)}}function At(t,e){e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e);var r=e.debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)it(r,t.features[n],e,n);else"Feature"===t.type?it(r,t,e):it(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(t,e){var r=e.buffer/e.extent,n=t,i=ct(t,1,-1-r,r,0,-1,2,e),a=ct(t,1,1-r,2+r,0,-1,2,e);return(i||a)&&(n=ct(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=vt(i,1).concat(n)),a&&(n=n.concat(vt(a,-1)))),n}(n,e),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Mt(t,e,r){return 32*((1<<t)*r+e)+t}function St(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new g(n.features),a=b(i);(0!==a.byteOffset||a.byteLength!==a.buffer.byteLength)&&(a=new Uint8Array(a)),e(null,{vectorTile:i,rawData:a.buffer})}V.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,a=e.nodeSize;r&&console.time("total time");var o="prepare "+t.length+" points";r&&console.time(o),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push(H(t[l],l));this.trees[i+1]=new j(s,K,Q,a,Float32Array),r&&console.timeEnd(o);for(var u=i;u>=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new j(s,K,Q,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,h=l.range(W(r),Y(a),W(i),Y(n));c<h.length;c+=1){var f=h[c],p=l.points[f];u.push(p.numPoints?G(p):this.points[p.index])}return u},V.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var a=i.points[e];if(!a)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,u=i.within(a.x,a.y,o);l<u.length;l+=1){var c=u[l],h=i.points[c];h.parentId===t&&s.push(h.numPoints?G(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},V.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},V.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),a=this.options,o=a.extent,s=a.radius/o,l=(r-s)/i,u=(r+1+s)/i,c={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,u),n.points,e,r,i,c),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,u),n.points,i,r,i,c),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,u),n.points,-1,r,i,c),c.features.length?c:null},V.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},V.prototype._appendLeaves=function(t,e,r,n,i){for(var a=0,o=this.getChildren(e);a<o.length;a+=1){var s=o[a],l=s.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(t,l.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},V.prototype._addTileFeatures=function(t,e,r,n,i,a){for(var o=0,s=t;o<s.length;o+=1){var l=e[s[o]],u=l.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:u?Z(l):this.points[l.index].properties},h=void 0;u?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(c.id=h),a.features.push(c)}},V.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},V.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.radius,a=n.extent,o=n.reduce,s=n.minPoints,l=i/(a*Math.pow(2,e)),u=0;u<t.length;u++){var c=t[u];if(!(c.zoom<=e)){c.zoom=e;for(var h=this.trees[e+1],f=h.within(c.x,c.y,l),p=c.numPoints||1,d=p,m=0,g=f;m<g.length;m+=1){var y=g[m],v=h.points[y];v.zoom>e&&(d+=v.numPoints||1)}if(d>=s){for(var x=c.x*p,_=c.y*p,b=o&&p>1?this._map(c,!0):null,w=(u<<5)+(e+1)+this.points.length,T=0,k=f;T<k.length;T+=1){var A=k[T],M=h.points[A];if(!(M.zoom<=e)){M.zoom=e;var S=M.numPoints||1;x+=M.x*S,_+=M.y*S,M.parentId=w,o&&(b||(b=this._map(c,!0)),o(b,this._map(M)))}}c.parentId=w,r.push(q(x/d,_/d,w,d,b))}else if(r.push(c),d>1)for(var E=0,C=f;E<C.length;E+=1){var I=C[E],L=h.points[I];L.zoom<=e||(L.zoom=e,r.push(L))}}}return r},V.prototype._getOriginId=function(t){return t-this.points.length>>5},V.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},V.prototype._map=function(t,e){if(t.numPoints)return e?J({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?J({},n):n},At.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},At.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=Mt(e,r,n),f=this.tiles[h];if(!f&&(u>1&&console.time("creation"),f=this.tiles[h]=wt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<<i-e;if(r!==Math.floor(a/d)||n!==Math.floor(o/d))continue}else if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue;if(f.source=null,0!==t.length){u>1&&console.time("clipping");var m,g,y,v,x,_,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=g=y=v=null,x=ct(t,c,r-b,r+T,0,f.minX,f.maxX,l),_=ct(t,c,r+w,r+k,0,f.minX,f.maxX,l),t=null,x&&(m=ct(x,c,n-b,n+T,1,f.minY,f.maxY,l),g=ct(x,c,n+w,n+k,1,f.minY,f.maxY,l),x=null),_&&(y=ct(_,c,n-b,n+T,1,f.minY,f.maxY,l),v=ct(_,c,n+w,n+k,1,f.minY,f.maxY,l),_=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},At.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<<t,s=Mt(t,e=(e%o+o)%o,r);if(this.tiles[s])return _t(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[Mt(u,c,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,h),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?_t(this.tiles[s],i):null):null};var Et=function(e){function r(t,r,n,i){e.call(this,t,r,n,St),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=t.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map(function(t){return t.key+": "+t.message}).join(", "));var l=o.features.filter(function(t){return s.value.evaluate({zoom:0},t)});o={type:"FeatureCollection",features:l}}e._geoJSONIndex=n.cluster?new V(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u<c.length;u+=1){var h=c[u],f=n[h],p=f[0],d=f[1],m=t.createExpression(d),g=t.createExpression("string"==typeof p?[p,["accumulated"],["get",h]]:p);i[h]=m.value,a[h]=g.value}return r.map=function(t){s.properties=t;for(var e={},r=0,n=l;r<n.length;r+=1){var a=n[r];e[a]=i[a].evaluate(o,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,n=l;r<n.length;r+=1){var i=n[r];o.accumulated=t[i],t[i]=a[i].evaluate(o,s)}},r}(n)).load(o.features):function(t,e){return new At(t,e)}(o,n.geojsonVtOptions)}catch(t){return r(t)}e.loaded={};var u={};if(i){var c=i.finish();c&&(u.resourceTiming={},u.resourceTiming[n.source]=JSON.parse(JSON.stringify(c)))}r(null,u)})}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,i=t.uid;return n&&n[i]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},r}(l),Ct=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:Et},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return Ct.prototype.setReferrer=function(t,e){this.referrer=e},Ct.prototype.setImages=function(t,e,r){for(var n in this.availableImages[t]=e,this.workerSources[t]){var i=this.workerSources[t][n];for(var a in i)i[a].availableImages=e}r()},Ct.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Ct.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Ct.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Ct.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Ct.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Ct.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Ct.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Ct.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Ct.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Ct.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Ct.prototype.syncRTLPluginState=function(e,r,n){try{t.plugin.setState(r);var i=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=i){this.self.importScripts(i);var a=t.plugin.isParsed();n(a?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),a)}}catch(t){n(t.toString())}},Ct.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Ct.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},Ct.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t),this.getAvailableImages(t))}return this.workerSources[t][e][r]},Ct.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new c),this.demWorkerSources[t][e]},Ct.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Ct(self)),Ct}),n(0,function(t){var e=t.createCommonjsModule(function(t){function e(t){return!r(t)}function r(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?function(t){return void 0===n[t]&&(n[t]=function(t){var r=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t);if(!r)return!1;var n=r.createShader(r.VERTEX_SHADER);return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(t)),n[t]}(t&&t.failIfMajorPerformanceCaveat)?void 0:"insufficient WebGL support":"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support"}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var n={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),r={create:function(e,r,n){var i=t.window.document.createElement(e);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},n=t.window.document&&t.window.document.documentElement.style;function i(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var a,o=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(a=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=a)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u)}catch(t){l=!1}r.addEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.addEventListener(e,r,n):t.addEventListener(e,r,n.capture)},r.removeEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.removeEventListener(e,r,n):t.removeEventListener(e,r,n.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",c,!0)},0)},r.mousePos=function(e,r){var n=e.getBoundingClientRect();return new t.Point(r.clientX-n.left-e.clientLeft,r.clientY-n.top-e.clientTop)},r.touchPos=function(e,r){for(var n=e.getBoundingClientRect(),i=[],a=0;a<r.length;a++)i.push(new t.Point(r[a].clientX-n.left-e.clientLeft,r[a].clientY-n.top-e.clientTop));return i},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var n=r[e],i=n.ids,a=n.callback;this._notify(i,a)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},r.prototype._validate=function(e,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];if(a[0]<r||a[1]<a[0]||e<a[1])return!1;r=a[1]}return!0},r.prototype._validateContent=function(t,e){return!t||!(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1])},r.prototype.updateImage=function(t,e){var r=this.images[t];e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var n=0,i=t;n<i.length;n+=1){var a=i[n];this.images[a]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i];this.images[o]||this.fire(new t.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:!(!s.userImage||!s.userImage.render)}:t.warnOnce('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},a=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:a}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var n=t.potpack(e),i=n.w,a=n.h,o=this.atlasImage;for(var s in o.resize({width:i||1,height:a||1}),this.patterns){var l=this.patterns[s].bin,u=l.x+1,c=l.y+1,h=this.images[s].data,f=h.width,p=h.height;t.RGBAImage.copy(h,o,{x:0,y:0},{x:u,y:c},{width:f,height:p}),t.RGBAImage.copy(h,o,{x:0,y:p-1},{x:u,y:c-1},{width:f,height:1}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:u,y:c+p},{width:f,height:1}),t.RGBAImage.copy(h,o,{x:f-1,y:0},{x:u-1,y:c},{width:1,height:p}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:u+f,y:c},{width:1,height:p})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];h(i)&&this.updateImage(n,i)}}},r}(t.Evented),p=g,d=g,m=1e20;function g(t,e,r,n,i,a){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=a||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(t,e,r,n,i,a,o){for(var s=0;s<e;s++){for(var l=0;l<r;l++)n[l]=t[l*e+s];for(v(n,i,a,o,r),l=0;l<r;l++)t[l*e+s]=i[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(v(n,i,a,o,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(i[s])}}function v(t,e,r,n,i){r[0]=0,n[0]=-m,n[1]=+m;for(var a=1,o=0;a<i;a++){for(var s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);s<=n[o];)o--,s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);r[++o]=a,n[o]=s,n[o+1]=+m}for(a=0,o=0;a<i;a++){for(;n[o+1]<a;)o++;e[a]=(a-r[o])*(a-r[o])+t[r[o]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=e.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?m:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var a=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return r},p.default=d;var x=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};x.prototype.setURL=function(t){this.url=t},x.prototype.getGlyphs=function(e,r){var n=this,i=[];for(var a in e)for(var o=0,s=e[a];o<s.length;o+=1){var l=s[o];i.push({stack:a,id:l})}t.asyncAll(i,function(t,e){var r=t.stack,i=t.id,a=n.entries[r];a||(a=n.entries[r]={glyphs:{},requests:{},ranges:{}});var o=a.glyphs[i];if(void 0===o){if(o=n._tinySDF(a,r,i))return a.glyphs[i]=o,void e(null,{stack:r,id:i,glyph:o});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i<o.length;i+=1)(0,o[i])(t,e);delete a.requests[s]})),l.push(function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})})}}else e(null,{stack:r,id:i,glyph:o})},function(t,e){if(t)r(t);else if(e){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.stack,l=o.id,u=o.glyph;(n[s]||(n[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,n)}})},x.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},x.prototype._tinySDF=function(e,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var a=e.tinySDF;if(!a){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=e.tinySDF=new x.TinySDF(24,3,8,.25,i,o)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},x.loadGlyphRange=function(e,r,n,i,a){var o=256*r,s=o+255,l=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",o+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,function(e,r){if(e)a(e);else if(r){for(var n={},i=0,o=t.parseGlyphPBF(r);i<o.length;i+=1){var s=o[i];n[s.id]=s}a(null,n)}})},x.TinySDF=p;var _=function(){this.specification=t.styleSpec.light.position};_.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},_.prototype.interpolate=function(e,r,n){return{x:t.number(e.x,r.x,n),y:t.number(e.y,r.y,n),z:t.number(e.z,r.z,n)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new _,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w="-transition",T=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var n in e){var i=e[n];t.endsWith(n,w)?this._transitionable.setTransition(n.slice(0,-11),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),k=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};k.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},k.prototype.getDashRanges=function(t,e,r){var n=[],i=t.length%2==1?-t[t.length-1]*r:0,a=t[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){o=!o;var u=t[l];i=s*r,a=(s+=u)*r,n.push({left:i,right:a,isDash:o,zeroLength:0===u})}return n},k.prototype.addRoundDash=function(t,e,r){for(var n=e/2,i=-r;i<=r;i++)for(var a=this.nextRow+r+i,o=this.width*a,s=0,l=t[s],u=0;u<this.width;u++){u/l.right>1&&(l=t[++s]);var c=Math.abs(u-l.left),h=Math.abs(u-l.right),f=Math.min(c,h),p=void 0,d=i/r*(n+1);if(l.isDash){var m=n-Math.abs(d);p=Math.sqrt(f*f+m*m)}else p=n-Math.sqrt(f*f+d*d);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},k.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],u=0;u<this.width;u++){u/l.right>1&&(l=t[++s]);var c=Math.abs(u-l.left),h=Math.abs(u-l.right),f=Math.min(c,h),p=l.isDash?f:-f;this.data[o+u]=Math.max(0,Math.min(255,p+128))}},k.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<e.length;o++)a+=e[o];if(0!==a){var s=this.width/a,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,n):this.addRegularDash(l)}var u={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,u},k.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var A=function e(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),a=0;a<i.length;a++){var o=i[a],s=new e.Actor(o,n,this.id);s.name="Worker "+a,this.actors.push(s)}};function M(e,r,n){var i=function(i,a){if(i)return n(i);if(a){var o=t.pick(t.extend(a,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);a.vector_layers&&(o.vectorLayers=a.vector_layers,o.vectorLayerIds=o.vectorLayers.map(function(t){return t.id})),o.tiles=r.canonicalizeTileset(o,e.url),n(null,o)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame(function(){return i(null,e)})}A.prototype.broadcast=function(e,r,n){n=n||function(){},t.asyncAll(this.actors,function(t,n){t.send(e,r,n)},n)},A.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},A.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},A.Actor=t.Actor;var S=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};S.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},S.prototype.contains=function(e){var r=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),a=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=n&&e.x<a&&e.y>=i&&e.y<o};var E=function(e){function r(r,n,i,a){if(e.call(this),this.id=r,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(n,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=M(this._options,this.map._requestManager,function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new S(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},r.prototype.setTiles=function(t){var e=this;return this.setSourceProperty(function(){e._options.tiles=t}),this},r.prototype.setUrl=function(t){var e=this;return this.setSourceProperty(function(){e.url=t,e._options.url=t}),this},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function a(n,i){return delete e.request,e.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,a.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,a.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),C=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.dispatcher=i,this.setEventedParent(a),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=M(this._options,this.map._requestManager,function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new S(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var n=this,i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(a){n.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=n.map.painter.context,s=o.gl;e.texture=n.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new t.Texture(o,a,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),r(null)}})},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),I=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(t,n){t&&(e.state="errored",r(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(a){this.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=t.window.ImageBitmap&&a instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?a:t.browser.getImageData(a,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:o,encoding:this.encoding};(!e.actor||"expired"===e.state)&&(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(C),L=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(a),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var o=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:t.EXTENT,radius:(n.clusterRadius||50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(r){if(r)e.fire(new t.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}})},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}}),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))})},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))})},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())})},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,function(){e.texture=null}),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.x),a=Math.max(a,l.y)}var u=i-r,c=a-n,h=Math.max(u,c),f=Math.max(0,Math.floor(-Math.log(h)/Math.LN2)),p=Math.pow(2,f);return new t.CanonicalTileID(f,Math.floor((r+i)/2*p),Math.floor((n+a)/2*p))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map(function(t){return r.tileID.getTilePoint(t)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),O=function(e){function r(t,r,n,i){e.call(this,t,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1){var a=i[n];this.urls.push(this.map._requestManager.transformRequest(a,t.ResourceType.Source).url)}t.getVideo(this.urls,function(r,n){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",function(){e.map.triggerRepaint()}),e.map&&e.video.play(),e._finishLoading())})},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),D=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?(!Array.isArray(n.coordinates)||4!==n.coordinates.length||n.coordinates.some(function(t){return!Array.isArray(t)||2!==t.length||t.some(function(t){return"number"!=typeof t})}))&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"!=typeof n.canvas&&!(n.canvas instanceof t.window.HTMLCanvasElement)&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(z),R={vector:E,raster:C,"raster-dem":I,geojson:L,video:O,image:z,canvas:D};function F(e,r){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function B(t,e,r,n,i,a){var o=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n+=1){var a=e[i[n]];if(a&&a.source===r&&"fill-extrusion"===a.type)return!0}else for(var o in e){var s=e[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort(N);for(var u=[],c=0,h=l;c<h.length;c+=1){var f=h[c];u.push({wrappedTileID:f.tileID.wrapped().key,queryResults:f.tile.queryRenderedFeatures(e,r,t._state,f.queryGeometry,f.cameraQueryGeometry,f.scale,i,a,s,F(t.transform,f.tileID))})}var p=function(t){for(var e={},r={},n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.queryResults,s=a.wrappedTileID,l=r[s]=r[s]||{};for(var u in o)for(var c=o[u],h=l[u]=l[u]||{},f=e[u]=e[u]||[],p=0,d=c;p<d.length;p+=1){var m=d[p];h[m.featureIndex]||(h[m.featureIndex]=!0,f.push(m))}}return e}(u);for(var d in p)p[d].forEach(function(e){var r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n});return p}function N(t,e){var r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var j=function(t,e){this.max=t,this.onRemove=e,this.reset()};j.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var n=r[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},j.prototype.add=function(t,e,r){var n=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var a={value:e,timeout:void 0};if(void 0!==r&&(a.timeout=setTimeout(function(){n.remove(t,a)},r)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},j.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},j.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n<i.length;n+=1){var a=i[n];t(a.value)||e.push(a)}for(var o=0,s=e;o<s.length;o+=1){var l=s[o];this.remove(l.value.tileID,l)}};var U=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},U.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var V={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},q=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};q.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},q.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},q.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],i=e.attributes[n.name];void 0!==i&&t.enableVertexAttribArray(i)}},q.prototype.setVertexAttribPointers=function(t,e,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],a=e.attributes[i.name];void 0!==a&&t.vertexAttribPointer(a,i.components,t[V[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},q.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var H=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};H.prototype.get=function(){return this.current},H.prototype.set=function(t){},H.prototype.getDefault=function(){return this.default},H.prototype.setDefault=function(){this.set(this.default)};var G=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(H),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(H),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(H),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(H),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(H),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(H),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask&&!this.dirty||(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(H),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&!this.dirty||(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(H),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(H),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(H),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(H),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(H),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(H),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(H),at=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(H),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(H),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(H),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(H),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(H),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(H),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(H),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(H),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(H),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(H),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(H),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(H),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(H),vt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){!this.vao||t===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(H),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(H),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(H),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(H),wt=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e}(H),Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(wt),kt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(wt),At=function(t,e,r,n){this.context=t,this.width=e,this.height=r;var i=t.gl,a=this.framebuffer=i.createFramebuffer();this.colorAttachment=new Tt(t,a),n&&(this.depthAttachment=new kt(t,a))};At.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)};var Mt=function(t,e,r){this.func=t,this.mask=e,this.range=r};Mt.ReadOnly=!1,Mt.ReadWrite=!0,Mt.disabled=new Mt(519,Mt.ReadOnly,[0,1]);var St=7680,Et=function(t,e,r,n,i,a){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a};Et.disabled=new Et({func:519,mask:0},0,0,St,St,St);var Ct=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Ct.disabled=new Ct(Ct.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Ct.unblended=new Ct(Ct.Replace,t.Color.transparent,[!0,!0,!0,!0]),Ct.alphaBlended=new Ct([1,771],t.Color.transparent,[!0,!0,!0,!0]);var It=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};It.disabled=new It(!1,1029,2305),It.backCCW=new It(!0,1029,2305);var Lt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new G(this),this.clearDepth=new Z(this),this.clearStencil=new W(this),this.colorMask=new Y(this),this.depthMask=new X(this),this.stencilMask=new $(this),this.stencilFunc=new J(this),this.stencilOp=new K(this),this.stencilTest=new Q(this),this.depthRange=new tt(this),this.depthTest=new et(this),this.depthFunc=new rt(this),this.blend=new nt(this),this.blendFunc=new it(this),this.blendColor=new at(this),this.blendEquation=new ot(this),this.cullFace=new st(this),this.cullFaceSide=new lt(this),this.frontFace=new ut(this),this.program=new ct(this),this.activeTexture=new ht(this),this.viewport=new ft(this),this.bindFramebuffer=new pt(this),this.bindRenderbuffer=new dt(this),this.bindTexture=new mt(this),this.bindVertexBuffer=new gt(this),this.bindElementBuffer=new yt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new vt(this),this.pixelStoreUnpack=new xt(this),this.pixelStoreUnpackPremultiplyAlpha=new _t(this),this.pixelStoreUnpackFlipY=new bt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Lt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Lt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Lt.prototype.createIndexBuffer=function(t,e){return new U(this,t,e)},Lt.prototype.createVertexBuffer=function(t,e,r){return new q(this,t,e,r)},Lt.prototype.createRenderbuffer=function(t,e,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i},Lt.prototype.createFramebuffer=function(t,e,r){return new At(this,t,e,r)},Lt.prototype.clear=function(t){var e=t.color,r=t.depth,n=this.gl,i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Lt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Lt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Lt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Lt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Ct.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Lt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Pt=function(e){function r(r,n,i){var a=this;e.call(this),this.id=r,this.dispatcher=i,this.on("data",function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(a.reload(),a.transform&&a.update(a.transform))}),this.on("error",function(){a._sourceErrored=!0}),this._source=function(e,r,n,i){var a=new R[r.type](e,r,n,i);if(a.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+a.id);return t.bindAll(["load","abort","unload","serialize","prepare"],a),a}(r,n,i,this),this._tiles={},this._cache=new j(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,function(){})},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,function(){})},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return t.values(this._tiles).map(function(t){return t.tileID}).sort(zt).map(function(t){return t.key})},r.prototype.getRenderableIds=function(e){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(i,e)&&n.push(this._tiles[i]);return e?n.sort(function(e,n){var i=e.tileID,a=n.tileID,o=new t.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new t.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x}).map(function(t){return t.tileID.key}):n.map(function(t){return t.tileID}).sort(zt).map(function(t){return t.key})},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,n,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){var i=this.getTileByID(n);a(t,i),a(i,t)}}function a(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(t){return n._source.hasTile(t)}))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Ot(this._source.type)){for(var u={},c={},h=0,f=Object.keys(l);h<f.length;h+=1){var p=f[h],d=l[p],m=this._tiles[p];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(d,o);g&&(this._addTile(g.tileID),u[g.tileID.key]=g.tileID),c[p]=d}}for(var y in this._retainLoadedChildren(c,a,s,l),u)l[y]||(this._coveredTiles[y]=!0,l[y]=u[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var x=0,_=t.keysDifference(this._tiles,l);x<_.length;x+=1){var b=_[x],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):(!w.hasSymbolBuckets||w.symbolFadeFinished())&&this._removeTile(b)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var n={},i={},a=Math.max(e-r.maxOverzooming,this._source.minzoom),o=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var c=u[l],h=this._addTile(c);n[c.key]=c,!h.hasData()&&e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,o,n);for(var f=0,p=t;f<p.length;f+=1){var d=p[f],m=this._tiles[d.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),_=d.overscaledZ-1;_>=a;--_){var b=d.scaledTo(_);if(i[b.key]||(i[b.key]=!0,!(m=this.getTile(b))&&x&&(m=this._addTile(b)),m&&(n[b.key]=b,x=m.wasRequested(),m.hasData())))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a<o.length;a+=1){var s=o[a];this._loadedParentTiles[s]=r}}},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=!!r;return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),!(e.uses>0)&&(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map(function(t){return o.pointCoordinate(t)}),u=s.map(function(t){return o.pointCoordinate(t)}),c=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,m=0,g=u;m<g.length;m+=1){var y=g[m];h=Math.min(h,y.x),f=Math.min(f,y.y),p=Math.max(p,y.x),d=Math.max(d,y.y)}for(var v=function(e){var n=i._tiles[c[e]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*t.EXTENT/n.tileSize/m,y=[s.getTilePoint(new t.MercatorCoordinate(h,f)),s.getTilePoint(new t.MercatorCoordinate(p,d))];if(y[0].x-g<t.EXTENT&&y[0].y-g<t.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map(function(t){return s.getTilePoint(t)}),x=u.map(function(t){return s.getTilePoint(t)});a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x<c.length;x++)v(x);return a},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map(function(t){return e._tiles[t].tileID}),n=0,i=r;n<i.length;n+=1){var a=i[n];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ot(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter(function(r){return!r.hasDependency(t,e)})},r}(t.Evented);function zt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Ot(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(sa.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={}};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ft.workerCount;)this.workers.push(new Dt);return this.active[t]=!0,this.workers.slice()},Ft.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach(function(t){t.terminate()}),this.workers=null)},Ft.prototype.isPreloaded=function(){return!!this.active[Rt]},Ft.prototype.numActive=function(){return Object.keys(this.active).length};var Bt,Nt=Math.floor(t.browser.hardwareConcurrency/2);function jt(){return Bt||(Bt=new Ft),Bt}function Ut(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach(function(t){t in r&&(n[t]=r[t])}),n}function Vt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Ut(t[n],e[t[n].ref]));return t}Ft.workerCount=Math.max(Math.min(Nt,6),1);var qt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Ht(t,e,r){r.push({command:qt.addSource,args:[t,e[t]]})}function Gt(t,e,r){e.push({command:qt.removeSource,args:[t]}),r[t]=!0}function Zt(t,e,r,n){Gt(t,r,n),Ht(t,e,r)}function Wt(e,r,n){var i;for(i in e[n])if(e[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;return!0}function Yt(e,r,n,i,a,o){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}));for(s in r)!r.hasOwnProperty(s)||e.hasOwnProperty(s)||t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]})}function Xt(t){return t.id}function $t(t,e){return t[e.id]=e,t}function Jt(e,r){if(!e)return[{command:qt.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:qt.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:qt.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:qt.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:qt.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:qt.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:qt.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:qt.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:qt.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:qt.setLight,args:[r.light]});var i={},a=[];!function(e,r,n,i){var a;for(a in r=r||{},e=e||{})e.hasOwnProperty(a)&&(r.hasOwnProperty(a)||Gt(a,n,i));for(a in r)r.hasOwnProperty(a)&&(e.hasOwnProperty(a)?t.deepEqual(e[a],r[a])||("geojson"===e[a].type&&"geojson"===r[a].type&&Wt(e,r,a)?n.push({command:qt.setGeoJSONSourceData,args:[a,r[a].data]}):Zt(a,r,n,i)):Ht(a,r,n))}(e.sources,r.sources,a,i);var o=[];e.layers&&e.layers.forEach(function(t){i[t.source]?n.push({command:qt.removeLayer,args:[t.id]}):o.push(t)}),n=n.concat(a),function(e,r,n){r=r||[];var i,a,o,s,l,u,c,h=(e=e||[]).map(Xt),f=r.map(Xt),p=e.reduce($t,{}),d=r.reduce($t,{}),m=h.slice(),g=Object.create(null);for(i=0,a=0;i<h.length;i++)o=h[i],d.hasOwnProperty(o)?a++:(n.push({command:qt.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(i=0,a=0;i<f.length;i++)o=f[f.length-1-i],m[m.length-1-i]!==o&&(p.hasOwnProperty(o)?(n.push({command:qt.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,u=m[m.length-i],n.push({command:qt.addLayer,args:[d[o],u]}),m.splice(m.length-i,0,o),g[o]=!0);for(i=0;i<f.length;i++)if(s=p[o=f[i]],l=d[o],!g[o]&&!t.deepEqual(s,l)){if(!t.deepEqual(s.source,l.source)||!t.deepEqual(s["source-layer"],l["source-layer"])||!t.deepEqual(s.type,l.type)){n.push({command:qt.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],n.push({command:qt.addLayer,args:[l,u]});continue}for(c in Yt(s.layout,l.layout,n,o,null,qt.setLayoutProperty),Yt(s.paint,l.paint,n,o,null,qt.setPaintProperty),t.deepEqual(s.filter,l.filter)||n.push({command:qt.setFilter,args:[o,l.filter]}),(!t.deepEqual(s.minzoom,l.minzoom)||!t.deepEqual(s.maxzoom,l.maxzoom))&&n.push({command:qt.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&("layout"===c||"paint"===c||"filter"===c||"metadata"===c||"minzoom"===c||"maxzoom"===c||(0===c.indexOf("paint.")?Yt(s[c],l[c],n,o,c.slice(6),qt.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:qt.setLayerProperty,args:[o,c,l[c]]})));for(c in l)!l.hasOwnProperty(c)||s.hasOwnProperty(c)||"layout"===c||"paint"===c||"filter"===c||"metadata"===c||"minzoom"===c||"maxzoom"===c||(0===c.indexOf("paint.")?Yt(s[c],l[c],n,o,c.slice(6),qt.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:qt.setLayerProperty,args:[o,c,l[c]]}))}}(o,r.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:qt.setStyle,args:[r]}]}return n}var Kt=function(t,e){this.reset(t,e)};Kt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Kt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,n=this._distances[r],i=e*this.paddedLength+this.padding;n<i&&r<this._distances.length;)n=this._distances[++r];var a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Qt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a<this.xCellCount*this.yCellCount;a++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function te(e,r,n,i,a){var o=t.create();return r?(t.scale(o,o,[1/a,1/a,1]),n||t.rotateZ(o,o,i.angle)):t.multiply(o,i.labelPlaneMatrix,e),o}function ee(e,r,n,i,a){if(r){var o=t.clone(e);return t.scale(o,o,[a,a,1]),n||t.rotateZ(o,o,-i.angle),o}return i.glCoordMatrix}function re(e,r){var n=[e.x,e.y,0,1];pe(n,n,r);var i=n[3];return{point:new t.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function ne(t,e){return.5+t/e*.5}function ie(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ae(e,r,n,i,a,o,s,l){var u=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;y<d.length;y++){var v=d.get(y);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!g)fe(v.numGlyphs,f);else{g=!1;var x=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(x,x,r),ie(x,h)){var _=x[3],b=ne(n.transform.cameraToCenterDistance,_),w=t.evaluateSizeForFeature(u,c,v),T=s?w/b:w*b,k=new t.Point(v.anchorX,v.anchorY),A=re(k,a).point,M={},S=le(v,T,!1,l,r,a,o,e.glyphOffsetArray,p,f,A,k,M,m);g=S.useVertical,(S.notEnoughRoom||g||S.needsFlipping&&le(v,T,!0,l,r,a,o,e.glyphOffsetArray,p,f,A,k,M,m).notEnoughRoom)&&fe(v.numGlyphs,f)}else fe(v.numGlyphs,f)}}i?e.text.dynamicLayoutVertexBuffer.updateData(f):e.icon.dynamicLayoutVertexBuffer.updateData(f)}function oe(t,e,r,n,i,a,o,s,l,u,c){var h=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,p=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(h-1),g=ce(t*d,r,n,i,a,o,s.segment,f,p,l,u,c);if(!g)return null;var y=ce(t*m,r,n,i,a,o,s.segment,f,p,l,u,c);return y?{first:g,last:y}:null}function se(e,r,n,i){return e===t.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function le(e,r,n,i,a,o,s,l,u,c,h,f,p,d){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=oe(g,l,y,v,n,h,f,e,u,o,p);if(!w)return{notEnoughRoom:!0};var T=re(w.first.point,s).point,k=re(w.last.point,s).point;if(i&&!n){var A=se(e.writingMode,T,k,d);if(A)return A}m=[w.first];for(var M=e.glyphStartIndex+1;M<x-1;M++)m.push(ce(g*l.getoffsetX(M),y,v,n,h,f,e.segment,_,b,u,o,p));m.push(w.last)}else{if(i&&!n){var S=re(f,a).point,E=e.lineStartIndex+e.segment+1,C=new t.Point(u.getx(E),u.gety(E)),I=re(C,a),L=I.signedDistanceFromCamera>0?I.point:ue(f,C,S,1,a),P=se(e.writingMode,S,L,d);if(P)return P}var z=ce(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,p);if(!z)return{notEnoughRoom:!0};m=[z]}for(var O=0,D=m;O<D.length;O+=1){var R=D[O];t.addDynamicAttributes(c,R.point,R.angle)}return{}}function ue(t,e,r,n,i){var a=re(t.add(t.sub(e)._unit()),i).point,o=r.sub(a);return r.add(o._mult(n/o.mag()))}function ce(e,r,n,i,a,o,s,l,u,c,h,f){var p=i?e-r:e+r,d=p>0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,y=a,v=a,x=0,_=0,b=Math.abs(p),w=[];x+_<=b;){if((g+=d)<l||g>=u)return null;if(v=y,w.push(y),void 0===(y=f[g])){var T=new t.Point(c.getx(g),c.gety(g)),k=re(T,h);if(k.signedDistanceFromCamera>0)y=f[g]=k.point;else{var A=g-d;y=ue(0===x?o:new t.Point(c.getx(A),c.gety(A)),T,v,b-x+1,h)}}x+=_,_=v.dist(y)}var M=(b-x)/_,S=y.sub(v),E=S.mult(M)._add(v);E._add(S._unit()._perp()._mult(n*d));var C=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(E),{point:E,angle:C,path:w}}Qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Qt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Qt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Qt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Qt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],h=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:u-h,y1:c-h,x2:u+h,y2:c+h})}return a?o.filter(a):o}var f={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,r,n,this._queryCell,o,f,a),i?o.length>0:o},Qt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,u,c,i),n?u.length>0:u},Qt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Qt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Qt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Qt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,u=this.boxCells[i];if(null!==u)for(var c=this.bboxes,h=0,f=u;h<f.length;h+=1){var p=f[h];if(!l.box[p]){l.box[p]=!0;var d=4*p;if(t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var x=v[y];if(!l.circle[x]){l.circle[x]=!0;var _=3*x;if(this._circleAndRectCollide(g[_],g[_+1],g[_+2],t,e,r,n)&&(!s||s(this.circleKeys[x]))){if(o.hitTest)return a.push(!0),!0;var b=g[_],w=g[_+1],T=g[_+2];a.push({key:this.circleKeys[x],x1:b-T,y1:w-T,x2:b+T,y2:w+T})}}}},Qt.prototype._queryCellCircle=function(t,e,r,n,i,a,o,s){var l=o.circle,u=o.seenUids,c=this.boxCells[i];if(null!==c)for(var h=this.bboxes,f=0,p=c;f<p.length;f+=1){var d=p[f];if(!u.box[d]){u.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[d])))return a.push(!0),!0}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,v=0,x=g;v<x.length;v+=1){var _=x[v];if(!u.circle[_]){u.circle[_]=!0;var b=3*_;if(this._circlesCollide(y[b],y[b+1],y[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[_])))return a.push(!0),!0}}},Qt.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),f=l;f<=c;f++)for(var p=u;p<=h;p++){var d=this.xCellCount*p+f;if(i.call(this,t,e,r,n,d,a,o,s))return}},Qt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Qt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Qt.prototype._circlesCollide=function(t,e,r,n,i,a){var o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s},Qt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var h=l-s,f=c-u;return h*h+f*f<=r*r};var he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function fe(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(he,3*n)}}function pe(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}var de=100,me=function(t,e,r){void 0===e&&(e=new Qt(t.width+200,t.height+200,25)),void 0===r&&(r=new Qt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+de,this.screenBottomBoundary=t.height+de,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function ge(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}me.prototype.placeCollisionBox=function(t,e,r,n,i){var a=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),o=r*a.perspectiveRatio,s=t.x1*o+a.point.x,l=t.y1*o+a.point.y,u=t.x2*o+a.point.x,c=t.y2*o+a.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,i)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},me.prototype.placeCollisionCircles=function(e,r,n,i,a,o,s,l,u,c,h,f,p){var d=[],m=new t.Point(r.anchorX,r.anchorY),g=re(m,o),y=ne(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(c?a/y:a*y)/t.ONE_EM,x=re(m,s).point,_=oe(v,i,r.lineOffsetX*v,r.lineOffsetY*v,!1,x,m,r,n,s,{}),b=!1,w=!1,T=!0;if(_){for(var k=.5*f*y+p,A=new t.Point(-de,-de),M=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),S=new Kt,E=_.first,C=_.last,I=[],L=E.path.length-1;L>=1;L--)I.push(E.path[L]);for(var P=1;P<C.path.length;P++)I.push(C.path[P]);var z=2.5*k;if(l){var O=I.map(function(t){return re(t,l)});I=O.some(function(t){return t.signedDistanceFromCamera<=0})?[]:O.map(function(t){return t.point})}var D=[];if(I.length>0){for(var R=I[0].clone(),F=I[0].clone(),B=1;B<I.length;B++)R.x=Math.min(R.x,I[B].x),R.y=Math.min(R.y,I[B].y),F.x=Math.max(F.x,I[B].x),F.y=Math.max(F.y,I[B].y);D=R.x>=A.x&&F.x<=M.x&&R.y>=A.y&&F.y<=M.y?[I]:F.x<A.x||R.x>M.x||F.y<A.y||R.y>M.y?[]:t.clipLine([I],A.x,A.y,M.x,M.y)}for(var N=0,j=D;N<j.length;N+=1){var U=j[N];S.reset(U,.25*k);var V=0;V=S.length<=.5*k?1:Math.ceil(S.paddedLength/z)+1;for(var q=0;q<V;q++){var H=q/Math.max(V-1,1),G=S.lerp(H),Z=G.x+de,W=G.y+de;d.push(Z,W,k,0);var Y=Z-k,X=W-k,$=Z+k,J=W+k;if(T=T&&this.isOffscreen(Y,X,$,J),w=w||this.isInsideGrid(Y,X,$,J),!e&&this.grid.hitTestCircle(Z,W,k,h)&&(b=!0,!u))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!u&&b||!w?[]:d,offscreen:T,collisionDetected:b}},me.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,a=-1/0,o=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],c=new t.Point(u.x+de,u.y+de);n=Math.min(n,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y),r.push(c)}for(var h={},f={},p=0,d=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o));p<d.length;p+=1){var m=d[p],g=m.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var y=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,y)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===f[g.bucketInstanceId]&&(f[g.bucketInstanceId]=[]),f[g.bucketInstanceId].push(g.featureIndex))}}return f},me.prototype.insertCollisionBox=function(t,e,r,n,i){var a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};(e?this.ignoredGrid:this.grid).insert(a,t[0],t[1],t[2],t[3])},me.prototype.insertCollisionCircles=function(t,e,r,n,i){for(var a=e?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<t.length;s+=4)a.insertCircle(o,t[s],t[s+1],t[s+2])},me.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var i=[r,n,0,1];return pe(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+de,(-i[1]/i[3]+1)/2*this.transform.height+de),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},me.prototype.isOffscreen=function(t,e,r,n){return r<de||t>=this.screenRightBoundary||n<de||e>this.screenBottomBoundary},me.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary},me.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-de,-de,0]),e};var ye=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};ye.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var ve=function(t,e,r,n,i){this.text=new ye(t?t.text:null,e,r,i),this.icon=new ye(t?t.icon:null,e,n,i)};ve.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var xe=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},_e=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},be=function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},we=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function Te(e,r,n,i,a){var o=t.getAnchorAlignment(e),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,u=t.evaluateVariableOffset(e,i);return new t.Point(s+u[0]*a,l+u[1]*a)}function ke(e,r,n,i,a,o){var s=e.x1,l=e.x2,u=e.y1,c=e.y2,h=e.anchorPointX,f=e.anchorPointY,p=new t.Point(r,n);return i&&p._rotate(a?o:-o),{x1:s+p.x,y1:u+p.y,x2:l+p.x,y2:c+p.y,anchorPointX:h,anchorPointY:f}}we.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var Ae=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new me(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new we(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function Me(t,e,r,n,i){t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0)}Ae.prototype.getBucketParts=function(e,r,n,i){var a=n.getBucket(r),o=n.latestFeatureIndex;if(a&&o&&r.id===a.layerIds[0]){var s=n.collisionBoxArray,l=a.layers[0].layout,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),c=n.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),f="map"===l.get("text-pitch-alignment"),p="map"===l.get("text-rotation-alignment"),d=ge(n,1,this.transform.zoom),m=te(h,f,p,this.transform,d),g=null;if(f){var y=ee(h,f,p,this.transform,d);g=t.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[a.bucketInstanceId]=new be(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);var v={bucket:a,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:u,textPixelRatio:c,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(var x=0,_=a.sortKeyRanges;x<_.length;x+=1){var b=_[x],w=b.sortKey,T=b.symbolInstanceStart,k=b.symbolInstanceEnd;e.push({sortKey:w,symbolInstanceStart:T,symbolInstanceEnd:k,parameters:v})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}},Ae.prototype.attemptAnchorPlacement=function(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d){var m,g=[h.textOffset0,h.textOffset1],y=Te(t,r,n,g,i),v=this.collisionIndex.placeCollisionBox(ke(e,y.x,y.y,a,o,this.transform.angle),c,s,l,u.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(ke(d,y.x,y.y,a,o,this.transform.angle),c,s,l,u.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(f,t,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[h.crossTileID]=p),{shift:y,placedGlyphBoxes:v}):void 0},Ae.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,u=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,h=a.textPixelRatio,f=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(x||!o.hasIconData()||y),A=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var M=function(e,a){if(!r[e.crossTileID]){if(f)return void(i.placements[e.crossTileID]=new xe(!1,!1,!1));var p,T=!1,M=!1,S=!0,E=null,C={box:null,offscreen:null},I={box:null,offscreen:null},L=null,P=null,z=0,O=0,D=0;a.textFeatureIndex?z=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),a.verticalTextFeatureIndex&&(O=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i<s.length&&(s[i]===t.WritingMode.vertical?(C=n(),I=C):C=r(),!(C&&C.box&&C.box.length));i+=1);else C=r()};if(s.get("text-variable-anchor")){var N=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[e.crossTileID]){var j=i.prevPlacement.variableOffsets[e.crossTileID];N.indexOf(j.anchor)>0&&(N=N.filter(function(t){return t!==j.anchor})).unshift(j.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,c=w&&!x?r:null,f={box:[],offscreen:!1},p=v?2*N.length:N.length,d=0;d<p;++d){var g=N[d%N.length],y=d>=N.length,k=i.attemptAnchorPlacement(g,t,a,s,u,_,b,h,l,m,y,e,o,n,c);if(k&&(f=k.placedGlyphBoxes)&&f.box&&f.box.length){T=!0,E=k.shift;break}}return f};B(function(){return U(R,a.iconBox,t.WritingMode.horizontal)},function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}}),C&&(T=C.box,S=C.offscreen);var V=F(C&&C.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};B(function(){return H(R,t.WritingMode.horizontal)},function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}}),F(C&&C.box&&C.box.length)}}if(T=(p=C)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(o.textSizeData,d,G),W=s.get("text-padding"),Y=e.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,Z,l,u,c,n,b,m.predicate,Y,W),T=v||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(D=a.iconFeatureIndex),a.iconBox){var X=function(t){var e=w&&E?ke(t,E.x,E.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,h,l,m.predicate)};M=I&&I.box&&I.box.length&&a.verticalIconBox?(P=X(a.verticalIconBox)).box.length>0:(P=X(a.iconBox)).box.length>0,S=S&&P.offscreen}var $=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,J=y||0===e.numIconVertices;if($||J?J?$||(M=M&&T):T=M&&T:M=T=M&&T,T&&p&&p.box&&(I&&I.box&&O?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,m.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),M&&P&&i.collisionIndex.insertCollisionBox(P.box,s.get("icon-ignore-placement"),o.bucketInstanceId,D,m.ID),L&&(T&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var K=o.bucketInstanceId,Q=i.collisionCircleArrays[K];void 0===Q&&(Q=i.collisionCircleArrays[K]=new _e);for(var tt=0;tt<L.circles.length;tt+=4)Q.circles.push(L.circles[tt+0]),Q.circles.push(L.circles[tt+1]),Q.circles.push(L.circles[tt+2]),Q.circles.push(L.collisionDetected?1:0)}i.placements[e.crossTileID]=new xe(T||k,M||A,S||o.justReloaded),r[e.crossTileID]=!0}};if(T)for(var S=o.getSortedSymbolIndexes(this.transform.angle),E=S.length-1;E>=0;--E){var C=S[E];M(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var I=e.symbolInstanceStart;I<e.symbolInstanceEnd;I++)M(o.symbolInstances.get(I),o.collisionArrays[I]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){var L=this.collisionCircleArrays[o.bucketInstanceId];t.invert(L.invProjMatrix,l),L.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},Ae.prototype.markUsedJustification=function(e,r,n,i){var a,o={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex};a=i===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:o[t.getAnchorJustification(r)];for(var s=0,l=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<l.length;s+=1){var u=l[s];u>=0&&(e.text.placedSymbolArray.get(u).crossTileID=a>=0&&u!==a?0:n.crossTileID)}},Ae.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o<s.length;o+=1){var l=s[o];e.text.placedSymbolArray.get(l).placedOrientation=i}n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)},Ae.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=i[s];u?(this.opacities[s]=new ve(u,n,l.text,l.icon),r=r||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new ve(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in i){var h=i[c];if(!this.opacities[c]){var f=new ve(h,n,!1,!1);f.isHidden()||(this.opacities[c]=f,r=r||h.text.placed||h.icon.placed)}}for(var p in a)!this.variableOffsets[p]&&this.opacities[p]&&!this.opacities[p].isHidden()&&(this.variableOffsets[p]=a[p]);for(var d in o)!this.placedOrientations[d]&&this.opacities[d]&&!this.opacities[d].isHidden()&&(this.placedOrientations[d]=o[d]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},Ae.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.getBucket(t);o&&a.latestFeatureIndex&&t.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,a.collisionBoxArray)}},Ae.prototype.updateBucketOpacities=function(e,r,n){var i=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var a=e.layers[0].layout,o=new ve(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),u=a.get("text-variable-anchor"),c="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),f="none"!==a.get("icon-text-fit"),p=new ve(null,0,s&&(l||!e.hasIconData()||a.get("icon-optional")),l&&(s||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);for(var d=function(t,e,r){for(var n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(r)},m=function(n){var a=e.symbolInstances.get(n),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,m=a.crossTileID,g=r[m],y=i.opacities[m];g?y=o:y||(y=p,i.opacities[m]=y),r[m]=!0;var v=s>0||l>0,x=a.numIconVertices>0,_=i.placedOrientations[a.crossTileID],b=_===t.WritingMode.vertical,w=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(v){var T=Oe(y.text),k=b?De:T;d(e.text,s,k);var A=w?De:T;d(e.text,l,A);var M=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=M||b?1:0)}),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,_);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var C=Oe(y.icon),I=!(f&&a.verticalPlacedIconSymbolIndex&&b);if(a.placedIconSymbolIndex>=0){var L=I?C:De;d(e.icon,a.numIconVertices,L),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var P=I?De:C;d(e.icon,a.numVerticalIconVertices,P),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var z=e.collisionArrays[n];if(z){var O=new t.Point(0,0);if(z.textBox||z.verticalTextBox){var D=!0;if(u){var R=i.variableOffsets[m];R?(O=Te(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),c&&O._rotate(h?i.transform.angle:-i.transform.angle)):D=!1}z.textBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!D||b,O.x,O.y),z.verticalTextBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!D||w,O.x,O.y)}var F=!(w||!z.verticalIconBox);z.iconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,F,f?O.x:0,f?O.y:0),z.verticalIconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,f?O.x:0,f?O.y:0)}}},g=0;g<e.symbolInstances.length;g++)m(g);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=y.invProjMatrix,e.placementViewportMatrix=y.viewportMatrix,e.collisionCircleArray=y.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},Ae.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Ae.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},Ae.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Ae.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},Ae.prototype.setStale=function(){this.stale=!0};var Se=Math.pow(2,25),Ee=Math.pow(2,24),Ce=Math.pow(2,17),Ie=Math.pow(2,16),Le=Math.pow(2,9),Pe=Math.pow(2,8),ze=Math.pow(2,1);function Oe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Se+e*Ee+r*Ce+e*Ie+r*Le+e*Pe+r*ze+e}var De=0,Re=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Re.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex<t.length;){var o=t[this._currentTileIndex];if(e.getBucketParts(a,n,o,this._sortAcrossTiles),this._currentTileIndex++,i())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(function(t,e){return t.sortKey-e.sortKey}));this._currentPartIndex<a.length;){var s=a[this._currentPartIndex];if(e.placeLayerBucketPart(s,this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0}return!1};var Fe=function(t,e,r,n,i,a,o){this.placement=new Ae(t,i,a,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Fe.prototype.isDone=function(){return this._done},Fe.prototype.continuePlacement=function(e,r,n){for(var i=this,a=t.browser.now(),o=function(){var e=t.browser.now()-a;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Re(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Fe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Be=512/t.EXTENT/2,Ne=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<e.length;n++){var i=e.get(n),a=i.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};Ne.prototype.getScaledCoordinates=function(e,r){var n=r.canonical.z-this.tileID.canonical.z,i=Be/Math.pow(2,n);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},Ne.prototype.findMatches=function(t,e,r){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var a=t.get(i);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o)for(var s=this.getScaledCoordinates(a,e),l=0,u=o;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=n&&Math.abs(c.coord.y-s.y)<=n&&!r[c.crossTileID]){r[c.crossTileID]=!0,a.crossTileID=c.crossTileID;break}}}}};var je=function(){this.maxCrossTileID=0};je.prototype.generate=function(){return++this.maxCrossTileID};var Ue=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Ue.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var n=this.indexes[r],i={};for(var a in n){var o=n[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),i[o.tileID.key]=o}this.indexes[r]=i}this.lng=t},Ue.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>t.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var u=o[t.scaledTo(Number(a)).key];u&&u.findMatches(e.symbolInstances,t,i)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=r.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ne(t,e.symbolInstances,e.bucketInstanceId),!0},Ue.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var n=0,i=e.indexedSymbolInstances[r];n<i.length;n+=1){var a=i[n];delete this.usedCrossTileIDs[t][a.crossTileID]}},Ue.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e};var Ve=function(){this.layerIndexes={},this.crossTileIDs=new je,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Ve.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new Ue);var i=!1,a={};n.handleWrapJump(r);for(var o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.getBucket(t);!u||t.id!==u.layerIds[0]||(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,u,this.crossTileIDs)&&(i=!0),a[u.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i},Ve.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach(function(t){e[t]=!0}),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var qe=function(e,r){return t.emitValidationErrors(e,r&&r.filter(function(t){return"source.canvas"!==t.identifier}))},He=t.pick(qt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ge=t.pick(qt,["setCenter","setZoom","setBearing","setPitch"]),Ze=function(){var e={},r=t.styleSpec.$version;for(var n in t.styleSpec.$root){var i=t.styleSpec.$root[n];if(i.required){var a=null;null!=(a="version"===n?r:"array"===i.type?[]:{})&&(e[n]=a)}}return e}(),We=function(e){function r(n,i){var a=this;void 0===i&&(i={}),e.call(this),this.map=n,this.dispatcher=new A(jt(),this),this.imageManager=new f,this.imageManager.setEventedParent(this),this.glyphManager=new x(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new k(256,512),this.crossTileSymbolIndex=new Ve,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var o=this;this._rtlTextPluginCallback=r.registerForPluginStateChange(function(e){var r={pluginStatus:e.pluginStatus,pluginURL:e.pluginURL};o.dispatcher.broadcast("syncRTLPluginState",r,function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every(function(t){return t}))for(var n in o.sourceCaches)o.sourceCaches[n].reload()})}),this.on("data",function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=a.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in a._layers){var i=a._layers[n];i.source===r.id&&a._validateLayer(i)}}}})}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var a=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(a,function(e,r){n._request=null,e?n.fire(new t.ErrorEvent(e)):r&&n._load(r,i)})},r.prototype.loadJSON=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame(function(){n._request=null,n._load(e,!1!==r.validate)})},r.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ze,!1)},r.prototype._load=function(e,r){if(!r||!qe(this,t.validateStyle(e))){for(var n in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(n,e.sources[n],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=Vt(this.stylesheet.layers);this._order=i.map(function(t){return t.id}),this._layers={},this._serializedLayers={};for(var a=0,o=i;a<o.length;a+=1){var s=o[a];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new T(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._loadSprite=function(e){var r=this;this._spriteRequest=function(e,r,n){var i,a,o,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),function(t,e){l=null,o||(o=t,i=e,c())}),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),function(t,e){u=null,o||(o=t,a=e,c())});function c(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],u=l.width,c=l.height,h=l.x,f=l.y,p=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,v,{x:h,y:f},{x:0,y:0},{width:u,height:c}),r[s]={data:v,pixelRatio:d,sdf:p,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))})},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r],a=this._layers[i];"custom"!==a.type&&e.push(a.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var l={};for(var u in this.sourceCaches){var c=this.sourceCaches[u];l[u]=c.used,c.used=!1}for(var h=0,f=this._order;h<f.length;h+=1){var p=f[h],d=this._layers[p];d.recalculate(e,this._availableImages),!d.isHidden(e.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(var m in l){var g=this.sourceCaches[m];l[m]!==g.used&&g.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),qe(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Vt(e.layers);var n=Jt(this.serialize(),e).filter(function(t){return!(t.command in Ge)});if(0===n.length)return!1;var i=n.filter(function(t){return!(t.command in He)});if(i.length>0)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return n.forEach(function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)}),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Pt(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}}),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(qe(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;if(r&&-1===i)return void this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));this._order.splice(i,0,e),this._layerOrderChanged=!0}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r)){if(null==r)return i.filter=void 0,void this._updateLayer(i);this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i))}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._serializeLayers(this._order)},function(t){return void 0!==t})},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][o];if(u)for(var c=0,h=u;c<h.length;c+=1){var f=h[c];i.push(f)}}}}i.sort(function(t,e){return e.intersectionZ-t.intersectionZ});for(var p=[],d=this._order.length-1;d>=0;d--){var m=this._order[d];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id]<d)break;p.push(y),i.pop()}else for(var v=0,x=t;v<x.length;v+=1){var _=x[v][m];if(_)for(var b=0,w=_;b<w.length;b+=1){var T=w[b];p.push(T.feature)}}}return p},r.prototype.queryRenderedFeatures=function(e,r,n){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var a=0,o=r.layers;a<o.length;a+=1){var s=o[a],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[l.source]=!0}}var u=[];for(var c in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!i[c]||u.push(B(this.sourceCaches[c],this._layers,this._serializedLayers,e,r,n));return this.placement&&u.push(function(t,e,r,n,i,a,o){for(var s={},l=a.queryRenderedSymbols(n),u=[],c=0,h=Object.keys(l).map(Number);c<h.length;c+=1){var f=h[c];u.push(o[f])}u.sort(N);for(var p=function(){var r=m[d],n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(var a in n){var o=s[a]=s[a]||[],u=n[a];u.sort(function(t,e){var n=r.featureSortOrder;if(n){var i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex});for(var c=0,h=u;c<h.length;c+=1){var f=h[c];o.push(f)}}},d=0,m=u;d<m.length;d+=1)p();var g=function(e){s[e].forEach(function(n){var i=n.feature,a=t[e],o=r[a.source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o})};for(var y in s)g(y);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[e];return n?function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],i={},a=0;a<r.length;a++){var o=r[a],s=o.tileID.canonical.key;i[s]||(i[s]=!0,o.querySourceFeatures(n,e))}return n}(n,r):[]},r.prototype.addSourceType=function(t,e,n){return r.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var a in e)if(!t.deepEqual(e[a],n[a])){i=!0;break}if(i){var o={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(o)}},r.prototype._validate=function(e,r,n,i,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&qe(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:n,styleSpec:t.styleSpec},i)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,n,i,a){void 0===a&&(a=!1);for(var o=!1,s=!1,l={},u=0,c=this._order;u<c.length;u+=1){var h=c[u],f=this._layers[h];if("symbol"===f.type){if(!l[f.source]){var p=this.sourceCaches[f.source];l[f.source]=p.getRenderableIds(!0).map(function(t){return p.getTileByID(t)}).sort(function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)})}var d=this.crossTileSymbolIndex.addLayer(f,l[f.source],e.center.lng);o=o||d}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((a=a||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Fe(e,this._order,a,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var m=0,g=this._order;m<g.length;m+=1){var y=g[m],v=this._layers[y];"symbol"===v.type&&this.placement.updateLayerOpacities(v,l[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[e.source];n&&n.setDependencies(e.tileID.key,e.type,e.icons)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},r.prototype.getResource=function(e,r,n){return t.makeRequest(r,n)},r}(t.Evented);We.getSourceType=function(t){return R[t]},We.setSourceType=function(t,e){R[t]=e},We.registerForPluginStateChange=t.registerForPluginStateChange;var Ye=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Xe=br("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),$e=br("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Je=br("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Ke=br("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Qe=br("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),tr=br("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),er=br("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),rr=br("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),nr=br("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),ir=br("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),ar=br("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),or=br("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),sr=br("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),lr=br("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),ur=br("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),cr=br("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hr=br("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),fr=br("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),pr=br("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),dr=br("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),mr=br("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),gr=br("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),yr=br("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),vr=br("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),xr=br("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),_r=br("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function br(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"}),vertexSource:e=e.replace(r,function(t,e,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"}),staticAttributes:n,staticUniforms:o}}var wr=Object.freeze({__proto__:null,prelude:Xe,background:$e,backgroundPattern:Je,circle:Ke,clippingMask:Qe,heatmap:tr,heatmapTexture:er,collisionBox:rr,collisionCircle:nr,debug:ir,fill:ar,fillOutline:or,fillOutlinePattern:sr,fillPattern:lr,fillExtrusion:ur,fillExtrusionPattern:cr,hillshadePrepare:hr,hillshade:fr,line:pr,lineGradient:dr,linePattern:mr,lineSDF:gr,raster:yr,symbolIcon:vr,symbolSDF:xr,symbolTextAndIcon:_r}),Tr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function kr(t){for(var e=[],r=0;r<t.length;r++)if(null!==t[r]){var n=t[r].split(" ");e.push(n.pop())}return e}Tr.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(l=!0);var c=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||c?this.freshBind(e,r,n,i,a,o,s):(t.bindVertexArrayOES.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},Tr.prototype.freshBind=function(t,e,r,n,i,a,o){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=u.currentNumAttributes||0;for(var h=l;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var f=0,p=r;f<p.length;f+=1)p[f].enableAttributes(c,t);a&&a.enableAttributes(c,t),o&&o.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(var d=0,m=r;d<m.length;d+=1){var g=m[d];g.bind(),g.setVertexAttribPointers(c,t,i)}a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),u.currentNumAttributes=l},Tr.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Ar=function(t,e,r,n,i,a){var o=t.gl;this.program=o.createProgram();for(var s=kr(r.staticAttributes),l=n?n.getBinderAttributes():[],u=s.concat(l),c=r.staticUniforms?kr(r.staticUniforms):[],h=n?n.getBinderUniforms():[],f=[],p=0,d=c.concat(h);p<d.length;p+=1){var m=d[p];f.indexOf(m)<0&&f.push(m)}var g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;");var y=g.concat(Xe.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(Xe.vertexSource,r.vertexSource).join("\n"),x=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(x,y),o.compileShader(x),o.attachShader(this.program,x);var _=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(_,v),o.compileShader(_),o.attachShader(this.program,_),this.attributes={};var b={};this.numAttributes=u.length;for(var w=0;w<this.numAttributes;w++)u[w]&&(o.bindAttribLocation(this.program,w,u[w]),this.attributes[u[w]]=w);o.linkProgram(this.program),o.deleteShader(_),o.deleteShader(x);for(var T=0;T<f.length;T++){var k=f[T];if(k&&!b[k]){var A=o.getUniformLocation(this.program,k);A&&(b[k]=A)}}this.fixedUniforms=i(t,b),this.binderUniforms=n?n.getUniforms(t,b):[]}}};function Mr(t,e,r){var n=1/ge(r,1,e.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,e.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Ar.prototype.draw=function(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:f});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],_=0,b=c.get();_<b.length;_+=1){var w=b[_],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new Tr)).bind(t,this,l,p?p.getPaintVertexBuffers():[],u,w.vertexOffset,d,m),y.drawElements(e,w.primitiveLength*x,y.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Sr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Er=function(e,r,n,i,a,o,s){return t.extend(Sr(e,r,n,i),Mr(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Cr=function(t){return{u_matrix:t}},Ir=function(e,r,n,i){return t.extend(Cr(e),Mr(n,r,i))},Lr=function(t,e){return{u_matrix:t,u_world:e}},Pr=function(e,r,n,i,a){return t.extend(Ir(e,r,n,i),{u_world:a})},zr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=ge(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},Or=function(t,e,r){var n=ge(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Dr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Rr=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},Fr=function(t){return{u_matrix:t}},Br=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:ge(e,1,r),u_intensity:n}};function Nr(e,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.MercatorCoordinate(0,i/n).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var jr=function(e,r,n){var i=e.transform;return{u_matrix:Gr(e,r,n),u_ratio:1/ge(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Ur=function(e,r,n,i){return t.extend(jr(e,r,n),{u_image:0,u_image_height:i})},Vr=function(e,r,n,i){var a=e.transform,o=Hr(r,a);return{u_matrix:Gr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/ge(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},qr=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=Hr(r,o),u="round"===n.layout.get("line-cap"),c=s.getDash(i.from,u),h=s.getDash(i.to,u),f=c.width*a.fromScale,p=h.width*a.toScale;return t.extend(jr(e,r,n),{u_patternscale_a:[l/f,-c.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:h.y,u_mix:a.t})};function Hr(t,e){return 1/ge(t,1,e.tileZoom)}function Gr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Zr=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:Xr(i.paint.get("raster-saturation")),u_contrast_factor:Yr(i.paint.get("raster-contrast")),u_spin_weights:Wr(i.paint.get("raster-hue-rotate"))}};function Wr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}function Yr(t){return t>0?1/(1-t):1+t}function Xr(t){return t>0?1-1/(1.001-t):-t}var $r,Jr=function(t,e,r,n,i,a,o,s,l,u){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Kr=function(e,r,n,i,a,o,s,l,u,c,h){var f=a.transform;return t.extend(Jr(e,r,n,i,a,o,s,l,u,c),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:1})},Qr=function(e,r,n,i,a,o,s,l,u,c){return t.extend(Kr(e,r,n,i,a,o,s,l,!0,u),{u_texsize_icon:c,u_texture_icon:1})},tn=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},en=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,h=c*(n.tileID.canonical.x+n.tileID.wrap*u),f=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ge(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},rn={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function nn(e,r,n,i,a,o,s){for(var l=e.context,u=l.gl,c=e.useProgram("collisionBox"),h=[],f=0,p=0,d=0;d<i.length;d++){var m=i[d],g=r.getTile(m),y=g.getBucket(n);if(y){var v=m.posMatrix;(0!==a[0]||0!==a[1])&&(v=e.translatePosMatrix(m.posMatrix,g,a,o));var x=s?y.textCollisionBox:y.iconCollisionBox,_=y.collisionCircleArray;if(_.length>0){var b=t.create(),w=v;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:_,circleOffset:p,transform:w,invTransform:b}),p=f+=_.length/4}x&&c.draw(l,u.LINES,Mt.disabled,Et.disabled,e.colorModeForRenderPass(),It.disabled,Or(v,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*f),k._trim();for(var A=0,M=0,S=h;M<S.length;M+=1)for(var E=S[M],C=0;C<E.circleArray.length/4;C++){var I=4*C,L=E.circleArray[I+0],P=E.circleArray[I+1],z=E.circleArray[I+2],O=E.circleArray[I+3];k.emplace(A++,L,P,z,O,0),k.emplace(A++,L,P,z,O,1),k.emplace(A++,L,P,z,O,2),k.emplace(A++,L,P,z,O,3)}(!$r||$r.length<2*f)&&($r=function(e){var r=2*e,n=new t.StructArrayLayout3ui6;n.resize(r),n._trim();for(var i=0;i<r;i++){var a=6*i;n.uint16[a+0]=4*i+0,n.uint16[a+1]=4*i+1,n.uint16[a+2]=4*i+2,n.uint16[a+3]=4*i+2,n.uint16[a+4]=4*i+3,n.uint16[a+5]=4*i+0}return n}(f));for(var D=l.createIndexBuffer($r,!0),R=l.createVertexBuffer(k,t.collisionCircleLayout.members,!0),F=0,B=h;F<B.length;F+=1){var N=B[F],j=Dr(N.transform,N.invTransform,e.transform);T.draw(l,u.TRIANGLES,Mt.disabled,Et.disabled,e.colorModeForRenderPass(),It.disabled,j,n.id,R,D,t.SegmentVector.simpleSegment(0,2*N.circleOffset,N.circleArray.length,N.circleArray.length/2),null,e.transform.zoom,null,null,null)}R.destroy(),D.destroy()}}var an=t.identity(new Float32Array(16));function on(e,r,n,i,a,o){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,u=-(s.verticalAlign-.5)*n,c=t.evaluateVariableOffset(e,i);return new t.Point((l/a+c[0])*o,(u/a+c[1])*o)}function sn(e,r,n,i,a,o,s,l,u,c,h){var f=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,m={};p.clear();for(var g=0;g<f.length;g++){var y=f.get(g),v=e.allowVerticalPlacement&&!y.placedOrientation,x=y.hidden||!y.crossTileID||v?null:i[y.crossTileID];if(x){var _=new t.Point(y.anchorX,y.anchorY),b=re(_,n?l:s),w=ne(o.cameraToCenterDistance,b.signedDistanceFromCamera),T=a.evaluateSizeForFeature(e.textSizeData,c,y)*w/t.ONE_EM;n&&(T*=e.tilePixelRatio/u);for(var k=x.width,A=x.height,M=on(x.anchor,k,A,x.textOffset,x.textBoxScale,T),S=n?re(_.add(M),s).point:b.point.add(r?M.rotate(-o.angle):M),E=e.allowVerticalPlacement&&y.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,C=0;C<y.numGlyphs;C++)t.addDynamicAttributes(p,S,E);h&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:S,angle:E})}else fe(y.numGlyphs,p)}if(h){d.clear();for(var I=e.icon.placedSymbolArray,L=0;L<I.length;L++){var P=I.get(L);if(P.hidden)fe(P.numGlyphs,d);else{var z=m[L];if(z)for(var O=0;O<P.numGlyphs;O++)t.addDynamicAttributes(d,z.shiftedAnchor,z.angle);else fe(P.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function ln(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function un(e,r,n,i,a,o,s,l,u,c,h,f){for(var p=e.context,d=p.gl,m=e.transform,g="map"===l,y="map"===u,v=g&&"point"!==n.layout.get("symbol-placement"),x=g&&!y&&!v,_=void 0!==n.layout.get("symbol-sort-key").constantOr(1),b=!1,w=e.depthModeForSublayer(0,Mt.ReadOnly),T=n.layout.get("text-variable-anchor"),k=[],A=0,M=i;A<M.length;A+=1){var S=M[A],E=r.getTile(S),C=E.getBucket(n);if(C){var I=a?C.text:C.icon;if(I&&I.segments.get().length){var L=I.programConfigurations.get(n.id),P=a||C.sdfIcons,z=a?C.textSizeData:C.iconSizeData,O=y||0!==m.pitch,D=e.useProgram(ln(P,a,C),L),R=t.evaluateSizeForZoom(z,m.zoom),F=void 0,B=[0,0],N=void 0,j=void 0,U=null,V=void 0;if(a){if(N=E.glyphAtlasTexture,j=d.LINEAR,F=E.glyphAtlasTexture.size,C.iconsInText){B=E.imageAtlasTexture.size,U=E.imageAtlasTexture;var q="composite"===z.kind||"camera"===z.kind;V=O||e.options.rotating||e.options.zooming||q?d.LINEAR:d.NEAREST}}else{var H=1!==n.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear;N=E.imageAtlasTexture,j=P||e.options.rotating||e.options.zooming||H||O?d.LINEAR:d.NEAREST,F=E.imageAtlasTexture.size}var G=ge(E,1,e.transform.zoom),Z=te(S.posMatrix,y,g,e.transform,G),W=ee(S.posMatrix,y,g,e.transform,G),Y=T&&C.hasTextData(),X="none"!==n.layout.get("icon-text-fit")&&Y&&C.hasIconData();v&&ae(C,S.posMatrix,e,a,Z,W,y,c);var $=e.translatePosMatrix(S.posMatrix,E,o,s),J=v||a&&T||X?an:Z,K=e.translatePosMatrix(W,E,o,s,!0),Q=P&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),tt={program:D,buffers:I,uniformValues:P?C.iconsInText?Qr(z.kind,R,x,y,e,$,J,K,F,B):Kr(z.kind,R,x,y,e,$,J,K,a,F):Jr(z.kind,R,x,y,e,$,J,K,a,F),atlasTexture:N,atlasTextureIcon:U,atlasInterpolation:j,atlasInterpolationIcon:V,isSDF:P,hasHalo:Q};if(_&&C.canOverlap){b=!0;for(var et=0,rt=I.segments.get();et<rt.length;et+=1){var nt=rt[et];k.push({segments:new t.SegmentVector([nt]),sortKey:nt.sortKey,state:tt})}}else k.push({segments:I.segments,sortKey:0,state:tt})}}}b&&k.sort(function(t,e){return t.sortKey-e.sortKey});for(var it=0,at=k;it<at.length;it+=1){var ot=at[it],st=ot.state;if(p.activeTexture.set(d.TEXTURE0),st.atlasTexture.bind(st.atlasInterpolation,d.CLAMP_TO_EDGE),st.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),st.atlasTextureIcon&&st.atlasTextureIcon.bind(st.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),st.isSDF){var lt=st.uniformValues;st.hasHalo&&(lt.u_is_halo=1,cn(st.buffers,ot.segments,n,e,st.program,w,h,f,lt)),lt.u_is_halo=0}cn(st.buffers,ot.segments,n,e,st.program,w,h,f,st.uniformValues)}}function cn(t,e,r,n,i,a,o,s,l){var u=n.context,c=u.gl;i.draw(u,c.TRIANGLES,a,o,s,It.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function hn(t,e,r,n,i,a,o){var s,l,u,c,h,f=t.context.gl,p=r.paint.get("fill-pattern"),d=p&&p.constantOr(1),m=r.getCrossfadeParameters();o?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=f.LINES):(l=d?"fillPattern":"fill",s=f.TRIANGLES);for(var g=0,y=n;g<y.length;g+=1){var v=y[g],x=e.getTile(v);if(!d||x.patternsLoaded()){var _=x.getBucket(r);if(_){var b=_.programConfigurations.get(r.id),w=t.useProgram(l,b);d&&(t.context.activeTexture.set(f.TEXTURE0),x.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var T=p.constantOr(null);if(T&&x.imageAtlas){var k=x.imageAtlas,A=k.patternPositions[T.to.toString()],M=k.patternPositions[T.from.toString()];A&&M&&b.setConstantPatternPositions(A,M)}var S=t.translatePosMatrix(v.posMatrix,x,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){c=_.indexBuffer2,h=_.segments2;var E=[f.drawingBufferWidth,f.drawingBufferHeight];u="fillOutlinePattern"===l&&d?Pr(S,t,m,x,E):Lr(S,E)}else c=_.indexBuffer,h=_.segments,u=d?Ir(S,t,m,x):Cr(S);w.draw(t.context,s,i,t.stencilModeForClipping(v),a,It.disabled,u,r.id,_.layoutVertexBuffer,c,h,r.paint,t.transform.zoom,b)}}}}function fn(t,e,r,n,i,a,o){for(var s=t.context,l=s.gl,u=r.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),h=r.getCrossfadeParameters(),f=r.paint.get("fill-extrusion-opacity"),p=0,d=n;p<d.length;p+=1){var m=d[p],g=e.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),x=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",v);c&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var _=u.constantOr(null);if(_&&g.imageAtlas){var b=g.imageAtlas,w=b.patternPositions[_.to.toString()],T=b.patternPositions[_.from.toString()];w&&T&&v.setConstantPatternPositions(w,T)}var k=t.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),A=r.paint.get("fill-extrusion-vertical-gradient"),M=c?Er(k,t,A,f,m,h,g):Sr(k,t,A,f);x.draw(s,s.gl.TRIANGLES,i,a,o,It.backCCW,M,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,v)}}}function pn(t,e,r,n,i,a){var o=t.context,s=o.gl,l=e.fbo;if(l){var u=t.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var c=function(t,e,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:Nr(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}}(t,e,r);u.draw(o,s.TRIANGLES,n,i,a,It.disabled,c,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function dn(e,r,n,i,a,o){var s=e.context,l=s.gl,u=r.dem;if(u&&u.data){var c=u.dim,h=u.stride,f=u.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){var p=r.demTexture;p.update(f,{premultiply:!1}),p.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(s,f,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var d=r.fbo;if(!d){var m=new t.Texture(s,{width:c,height:c,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(d=r.fbo=s.createFramebuffer(c,c,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,It.disabled,function(e,r){var n=r.stride,i=t.create();return t.ortho(i,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(i,i,[0,-t.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}}(r.tileID,u),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function mn(e,r,n,i,a){var o=i.paint.get("raster-fade-duration");if(o>0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),h=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=f&&e.refreshedUponExpiration?1:t.clamp(f?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var gn=new t.Color(1,0,0,1),yn=new t.Color(0,1,0,1),vn=new t.Color(0,0,1,1),xn=new t.Color(1,0,1,1),_n=new t.Color(0,1,1,1);function bn(t){var e=t.transform.padding;wn(t,t.transform.height-(e.top||0),3,gn),wn(t,e.bottom||0,3,yn),Tn(t,e.left||0,3,vn),Tn(t,t.transform.width-(e.right||0),3,xn);var r=t.transform.centerPoint;!function(t,e,r,n){var i=20,a=2;kn(t,e-a/2,r-i/2,a,i,n),kn(t,e-i/2,r-a/2,i,a,n)}(t,r.x,t.transform.height-r.y,_n)}function wn(t,e,r,n){kn(t,0,e+r/2,t.transform.width,r,n)}function Tn(t,e,r,n){kn(t,e-r/2,0,r,t.transform.height,n)}function kn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function An(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,u=Et.disabled,c=e.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,u,c,It.disabled,Rr(o,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,p=f&&f.byteLength||0,d=Math.floor(p/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+d+"kb"),s.draw(i,a.TRIANGLES,l,u,Ct.alphaBlended,It.disabled,Rr(o,t.Color.transparent,g),h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var Mn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=Et.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,u="map"===a,c="map"===o,h=0,f=e;h<f.length;h+=1){var p=f[h],d=i.getTile(p),m=d.getBucket(n);if(m&&m.text&&m.text.segments.get().length){var g=m.textSizeData,y=t.evaluateSizeForZoom(g,l.zoom),v=ge(d,1,r.transform.zoom),x=te(p.posMatrix,c,u,r.transform,v),_="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(y){var b=Math.pow(2,l.zoom-d.tileID.overscaledZ);sn(m,u,c,s,t.symbolSize,l,x,p.posMatrix,b,y,_)}}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&un(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&un(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(nn(e,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),nn(e,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var u=e.context,c=u.gl,h=e.depthModeForSublayer(0,Mt.ReadOnly),f=Et.disabled,p=e.colorModeForRenderPass(),d=[],m=0;m<i.length;m++){var g=i[m],y=r.getTile(g),v=y.getBucket(n);if(v){var x=v.programConfigurations.get(n.id),_={programConfiguration:x,program:e.useProgram("circle",x),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:zr(e,g,y,n)};if(l)for(var b=0,w=v.segments.get();b<w.length;b+=1){var T=w[b];d.push({segments:new t.SegmentVector([T]),sortKey:T.sortKey,state:_})}else d.push({segments:v.segments,sortKey:0,state:_})}}l&&d.sort(function(t,e){return t.sortKey-e.sortKey});for(var k=0,A=d;k<A.length;k+=1){var M=A[k],S=M.state,E=S.programConfiguration,C=S.program,I=S.layoutVertexBuffer,L=S.indexBuffer,P=S.uniformValues,z=M.segments;C.draw(u,c.TRIANGLES,h,f,p,It.disabled,P,n.id,I,L,z,n.paint,e.transform.zoom,E)}}}},heatmap:function(e,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var a=e.context,o=a.gl,s=Et.disabled,l=new Ct([o.ONE,o.ONE],t.Color.transparent,[!0,!0,!0,!0]);(function(t,e,r){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,r,n){var i=t.gl,a=t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e.width/4,e.height/4,0,i.RGBA,a,null),n.colorAttachment.set(r)}(t,e,a,i)}})(a,e,n),a.clear({color:t.Color.transparent});for(var u=0;u<i.length;u++){var c=i[u];if(!r.hasRenderableParent(c)){var h=r.getTile(c),f=h.getBucket(n);if(f){var p=f.programConfigurations.get(n.id),d=e.useProgram("heatmap",p),m=e.transform.zoom;d.draw(a,o.TRIANGLES,Mt.disabled,s,l,It.disabled,Br(c.posMatrix,h,m,n.paint.get("heatmap-intensity")),n.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,n.paint,e.transform.zoom,p)}}}a.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var n=e.context,i=n.gl,a=r.heatmapFbo;if(a){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new t.Texture(n,r.colorRamp,i.RGBA)),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Mt.disabled,Et.disabled,e.colorModeForRenderPass(),It.disabled,function(e,r,n,i){var a=t.create();t.ortho(a,0,e.width,e.height,0,0,1);var o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}}(e,r,0,1),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,n))},line:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1))for(var s=e.depthModeForSublayer(0,Mt.ReadOnly),l=e.colorModeForRenderPass(),u=n.paint.get("line-dasharray"),c=n.paint.get("line-pattern"),h=c.constantOr(1),f=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),d=h?"linePattern":u?"lineSDF":f?"lineGradient":"line",m=e.context,g=m.gl,y=!0,v=0,x=i;v<x.length;v+=1){var _=x[v],b=r.getTile(_);if(!h||b.patternsLoaded()){var w=b.getBucket(n);if(w){var T=w.programConfigurations.get(n.id),k=e.context.program.get(),A=e.useProgram(d,T),M=y||A.program!==k,S=c.constantOr(null);if(S&&b.imageAtlas){var E=b.imageAtlas,C=E.patternPositions[S.to.toString()],I=E.patternPositions[S.from.toString()];C&&I&&T.setConstantPatternPositions(C,I)}var L=h?Vr(e,b,n,p):u?qr(e,b,n,u,p):f?Ur(e,b,n,w.lineClipsArray.length):jr(e,b,n);if(h)m.activeTexture.set(g.TEXTURE0),b.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),T.updatePaintBuffers(p);else if(u&&(M||e.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m);else if(f){var P=w.gradients[n.id],z=P.texture;if(n.gradientVersion!==P.version){var O=256;if(n.stepInterpolant){var D=r.getSource().maxzoom,R=_.canonical.z===D?Math.ceil(1<<e.transform.maxZoom-_.canonical.z):1,F=w.maxLineLength/t.EXTENT*1024*R;O=t.clamp(t.nextPowerOfTwo(F),256,m.maxTextureSize)}P.gradient=t.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:O,image:P.gradient||void 0,clips:w.lineClipsArray}),P.texture?P.texture.update(P.gradient):P.texture=new t.Texture(m,P.gradient,g.RGBA),P.version=n.gradientVersion,z=P.texture}m.activeTexture.set(g.TEXTURE0),z.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}A.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(_),l,It.disabled,L,n.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,n.paint,e.transform.zoom,T,w.layoutVertexBuffer2),y=!1}}}}},fill:function(e,r,n,i){var a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===u){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?Mt.ReadWrite:Mt.ReadOnly);hn(e,r,n,i,c,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var h=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Mt.ReadOnly);hn(e,r,n,i,h,s,!0)}}},"fill-extrusion":function(t,e,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var a=new Mt(t.context.gl.LEQUAL,Mt.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))fn(t,e,r,n,a,Et.disabled,Ct.disabled),fn(t,e,r,n,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var o=t.colorModeForRenderPass();fn(t,e,r,n,a,Et.disabled,o)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,a=t.depthModeForSublayer(0,Mt.ReadOnly),o=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n],l=s[0],u=0,c=s[1];u<c.length;u+=1){var h=c[u],f=e.getTile(h);f.needsHillshadePrepare&&"offscreen"===t.renderPass?dn(t,f,r,a,Et.disabled,o):"translucent"===t.renderPass&&pn(t,f,r,a,l[h.overscaledZ],o)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")&&n.length)for(var i=t.context,a=i.gl,o=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),u=o instanceof z?[{},n]:t.stencilConfigForOverlap(n),c=u[0],h=u[1],f=h[h.length-1].overscaledZ,p=!t.options.moving,d=0,m=h;d<m.length;d+=1){var g=m[d],y=t.depthModeForSublayer(g.overscaledZ-f,1===r.paint.get("raster-opacity")?Mt.ReadWrite:Mt.ReadOnly,a.LESS),v=e.getTile(g),x=t.transform.calculatePosMatrix(g.toUnwrapped(),p);v.registerFadeDuration(r.paint.get("raster-fade-duration"));var _=e.findLoadedParent(g,0),b=mn(v,_,e,r,t.transform),w=void 0,T=void 0,k="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),v.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),_?(_.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,_.tileID.overscaledZ-v.tileID.overscaledZ),T=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var A=Zr(x,T||[0,0],w||1,b,r);o instanceof z?s.draw(i,a.TRIANGLES,y,Et.disabled,l,It.disabled,A,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,y,c[g.overscaledZ],l,It.disabled,A,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=t.context,o=a.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!t.isPatternMissing(u)){var c=!u&&1===n.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var h=Et.disabled,f=t.depthModeForSublayer(0,"opaque"===c?Mt.ReadWrite:Mt.ReadOnly),p=t.colorModeForRenderPass(),d=t.useProgram(u?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});u&&(a.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var x=v[y],_=t.transform.calculatePosMatrix(x.toUnwrapped()),b=u?en(_,i,t,u,{tileID:x,tileSize:l},g):tn(_,i,n);d.draw(a,o.TRIANGLES,f,h,p,It.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)An(t,e,r[n])},custom:function(t,e,r){var n=t.context,i=r.implementation;if("offscreen"===t.renderPass){var a=i.prerender;a&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),a.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Et.disabled);var o="3d"===i.renderingMode?new Mt(t.context.gl.LEQUAL,Mt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Mt.ReadOnly);n.setDepthMode(o),i.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},Sn=function(t,e){this.context=new Lt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Pt.maxUnderzooming+Pt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ve,this.gpuTimers={}};Sn.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n<i.length;n+=1){var a=i[n];this.style._layers[a].resize()}},Sn.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,Ye.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Ye.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,P.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,Ye.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Et({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},Sn.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Mt.disabled,this.stencilClearMode,Ct.disabled,It.disabled,Fr(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Sn.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Ct.disabled),r.setDepthMode(Mt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a<o.length;a+=1){var s=o[a],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,Mt.disabled,new Et({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Ct.disabled,It.disabled,Fr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Sn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Et({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},Sn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Et({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Sn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort(function(t,e){return e.overscaledZ-t.overscaledZ}),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s<a;s++)o[s+i]=new Et({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=a,[o,n]}return[(e={},e[i]=Et.disabled,e),n]},Sn.prototype.colorModeForRenderPass=function(){var e=this.context.gl;if(this._showOverdrawInspector){var r=1/8;return new Ct([e.CONSTANT_COLOR,e.ONE],new t.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Ct.unblended:Ct.alphaBlended},Sn.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return Mt.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Mt(r||this.context.gl.LEQUAL,e,[n,n])},Sn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Sn.prototype.render=function(e,r){var n=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var i=this.style._order,a=this.style.sourceCaches;for(var o in a){var s=a[o];s.used&&s.prepare(this.context)}var l,u,c={},h={},f={};for(var p in a){var d=a[p];c[p]=d.getVisibleCoordinates(),h[p]=c[p].slice().reverse(),f[p]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++){var g=i[m];if(this.style._layers[g].is3D()){this.opaquePassCutoff=m;break}}this.renderPass="offscreen";for(var y=0,v=i;y<v.length;y+=1){var x=v[y],_=this.style._layers[x];if(_.hasOffscreenPass()&&!_.isHidden(this.transform.zoom)){var b=h[_.source];"custom"!==_.type&&!b.length||this.renderLayer(this,a[_.source],_,b)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],k=c[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var A=this.style._layers[i[this.currentLayer]],M=a[A.source],S=("symbol"===A.type?f:h)[A.source];this._renderTileClippingMasks(A,c[A.source]),this.renderLayer(this,M,A,S)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach(function(t){t.source&&!t.isHidden(n.transform.zoom)&&(t.source!==(u&&u.id)&&(u=n.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<u.getSource().maxzoom)&&(l=u))}),l&&Mn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&bn(this),this.context.setDefault()},Sn.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||"background"!==r.type&&"custom"!==r.type&&!n.length||(this.id=r.id,this.gpuTimingStart(r),Mn[r.type](t,e,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},Sn.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},Sn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},Sn.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},Sn.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var n=t[r],i=this.context.extTimerQuery,a=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),e[r]=a}return e},Sn.prototype.translatePosMatrix=function(e,r,n,i,a){if(!n[0]&&!n[1])return e;var o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var u=[a?n[0]:ge(r,n[0],this.transform.zoom),a?n[1]:ge(r,n[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,u),c},Sn.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},Sn.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},Sn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},Sn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Ar(this.context,t,wr[t],e,rn[t],this._showOverdrawInspector)),this.cache[r]},Sn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Sn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},Sn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},Sn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var En=function(t,e){this.points=t,this.planes=e};En.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(r){return t.transformMat4([],r,e)}).map(function(e){return t.scale$1([],e,1/e[3]/r*i)}),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)});return new En(a,o)};var Cn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Cn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a<r.length;a++)n[a]=r[a]?this.min[a]:this.center[a],i[a]=r[a]?this.center[a]:this.max[a];return i[2]=this.max[2],new Cn(n,i)},Cn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},Cn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},Cn.prototype.intersects=function(e){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,i=0;i<e.planes.length;i++){for(var a=e.planes[i],o=0,s=0;s<r.length;s++)o+=t.dot$1(a,r[s])>=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var f=e.points[h][l]-this.min[l];u=Math.min(u,f),c=Math.max(c,f)}if(c<0||u>this.max[l]-this.min[l])return 0}return 1};var In=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};In.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},In.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},In.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},In.prototype.clone=function(){return new In(this.top,this.bottom,this.left,this.right)},In.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Ln=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new In,this._posMatrixCache={},this._alignedPosMatrixCache={}},Pn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Ln.prototype.clone=function(){var t=new Ln(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Pn.minZoom.get=function(){return this._minZoom},Pn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Pn.maxZoom.get=function(){return this._maxZoom},Pn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Pn.minPitch.get=function(){return this._minPitch},Pn.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Pn.maxPitch.get=function(){return this._maxPitch},Pn.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Pn.renderWorldCopies.get=function(){return this._renderWorldCopies},Pn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Pn.worldSize.get=function(){return this.tileSize*this.scale},Pn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Pn.size.get=function(){return new t.Point(this.width,this.height)},Pn.bearing.get=function(){return-this.angle/Math.PI*180},Pn.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Pn.pitch.get=function(){return this._pitch/Math.PI*180},Pn.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Pn.fov.get=function(){return this._fov/Math.PI*180},Pn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Pn.zoom.get=function(){return this._zoom},Pn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Pn.center.get=function(){return this._center},Pn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Pn.padding.get=function(){return this._edgeInsets.toJSON()},Pn.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Pn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Ln.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Ln.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Ln.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Ln.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},Ln.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=En.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new Cn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],f=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(u(-d)),c.push(u(d));for(c.push(u(0));c.length>0;){var m=c.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var _=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(_),Math.abs(b)),T=3+(1<<f-m.zoom)-2;if(m.zoom===f||w>T&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===f?p:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var k=0;k<4;k++){var A=(g<<1)+k%2,M=(y<<1)+(k>>1);c.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:A,y:M,wrap:m.wrap,fullyVisible:v})}}return h.sort(function(t,e){return t.distanceSq-e.distanceSq}).map(function(t){return t.tileID})},Ln.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Pn.unmodified.get=function(){return this._unmodified},Ln.prototype.zoomScale=function(t){return Math.pow(2,t)},Ln.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Ln.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Ln.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Pn.point.get=function(){return this.project(this.center)},Ln.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Ln.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Ln.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Ln.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Ln.prototype.coordinateLocation=function(t){return t.toLngLat()},Ln.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,u=n[1]/a,c=r[2]/i,h=n[2]/a,f=c===h?0:(0-c)/(h-c);return new t.MercatorCoordinate(t.number(o,s,f)/this.worldSize,t.number(l,u,f)/this.worldSize)},Ln.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Ln.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Ln.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Ln.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Ln.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Ln.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Ln.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;a=t.mercatorYfromLat(h[1])*this.worldSize,e=(o=t.mercatorYfromLat(h[0])*this.worldSize)-a<u.y?u.y/(o-a):0}if(this.lngRange){var f=this.lngRange;s=t.mercatorXfromLng(f[0])*this.worldSize,r=(l=t.mercatorXfromLng(f[1])*this.worldSize)-s<u.x?u.x/(l-s):0}var p=this.point,d=Math.max(r||0,e||0);if(d)return this.center=this.unproject(new t.Point(r?(l+s)/2:p.x,e?(o+a)/2:p.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=p.y,g=u.y/2;m-g<a&&(i=a+g),m+g>o&&(i=o-g)}if(this.lngRange){var y=p.x,v=u.x/2;y-v<s&&(n=s+v),y+v>l&&(n=l-v)}(void 0!==n||void 0!==i)&&(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=c,this._constraining=!1}},Ln.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),c=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,c,u),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-s,-l,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),t.scale(h,h,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var f=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*f+m*p,y=l-Math.round(l)+d*p+m*f,v=new Float64Array(h);if(t.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Ln.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Ln.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Ln.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s<l.length;s+=1){var u=l[s];n=Math.min(n,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y)}return[new t.Point(n,i),new t.Point(a,i),new t.Point(a,o),new t.Point(n,o),new t.Point(n,i)]},Object.defineProperties(Ln.prototype,Pn);var zn=function(e){this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(t,e){var r=!1,n=null,i=function(){n=null,r&&(t(),n=setTimeout(i,e),r=!1)};return function(){return r=!0,n||i(),n}}(this._updateHashUnthrottled.bind(this),300)};zn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},zn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},zn.prototype.getHashString=function(e){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,i),o=Math.round(r.lng*a)/a,s=Math.round(r.lat*a)/a,l=this._map.getBearing(),u=this._map.getPitch(),c="";if(c+=e?"/"+o+"/"+s+"/"+n:n+"/"+s+"/"+o,(l||u)&&(c+="/"+Math.round(10*l)/10),u&&(c+="/"+Math.round(u)),this._hashName){var h=this._hashName,f=!1,p=t.window.location.hash.slice(1).split("&").map(function(t){var e=t.split("=")[0];return e===h?(f=!0,e+"="+c):t}).filter(function(t){return t});return f||p.push(h+"="+c),"#"+p.join("&")}return"#"+c},zn.prototype._getCurrentHash=function(){var e,r=this,n=t.window.location.hash.replace("#","");return this._hashName?(n.split("&").map(function(t){return t.split("=")}).forEach(function(t){t[0]===r._hashName&&(e=t)}),(e&&e[1]||"").split("/")):n.split("/")},zn.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some(function(t){return isNaN(t)})){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},zn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var On={linearity:.3,easing:t.bezier(0,0,.3,1)},Dn=t.extend({deceleration:2500,maxSpeed:1400},On),Rn=t.extend({deceleration:20,maxSpeed:1400},On),Fn=t.extend({deceleration:1e3,maxSpeed:360},On),Bn=t.extend({deceleration:1e3,maxSpeed:90},On),Nn=function(t){this._map=t,this.clear()};function jn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Un(e,r,n){var i=n.maxSpeed,a=n.linearity,o=n.deceleration,s=t.clamp(e*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}Nn.prototype.clear=function(){this._inertiaBuffer=[]},Nn.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Nn.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();e.length>0&&r-e[0].time>160;)e.shift()},Nn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n<i.length;n+=1){var a=i[n].settings;r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,a.panDelta&&r.pan._add(a.panDelta),a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround)}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=Un(r.pan.mag(),o,t.extend({},Dn,e||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,jn(s,l)}if(r.zoom){var u=Un(r.zoom,o,Rn);s.zoom=this._map.transform.zoom+u.amount,jn(s,u)}if(r.bearing){var c=Un(r.bearing,o,Fn);s.bearing=this._map.transform.bearing+t.clamp(c.amount,-179,179),jn(s,c)}if(r.pitch){var h=Un(r.pitch,o,Bn);s.pitch=this._map.transform.pitch+h.amount,jn(s,h)}if(s.zoom||s.bearing){var f=void 0===r.pinchAround?r.around:r.pinchAround;s.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var Vn=function(e){function n(n,i,a,o){void 0===o&&(o={});var s=r.mousePos(i.getCanvasContainer(),a),l=i.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:a},o)),this._defaultPrevented=!1,this.target=i}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),qn=function(e){function n(n,i,a){var o="touchend"===n?a.changedTouches:a.touches,s=r.touchPos(i.getCanvasContainer(),o),l=s.map(function(t){return i.unproject(t)}),u=s.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new t.Point(0,0)),c=i.unproject(u);e.call(this,n,{points:s,point:u,lngLats:l,lngLat:c,originalEvent:a}),this._defaultPrevented=!1}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),Hn=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),Gn=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Gn.prototype.reset=function(){delete this._mousedownPos},Gn.prototype.wheel=function(t){return this._firePreventable(new Hn(t.type,this._map,t))},Gn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new Vn(t.type,this._map,t))},Gn.prototype.mouseup=function(t){this._map.fire(new Vn(t.type,this._map,t))},Gn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Vn(t.type,this._map,t))},Gn.prototype.dblclick=function(t){return this._firePreventable(new Vn(t.type,this._map,t))},Gn.prototype.mouseover=function(t){this._map.fire(new Vn(t.type,this._map,t))},Gn.prototype.mouseout=function(t){this._map.fire(new Vn(t.type,this._map,t))},Gn.prototype.touchstart=function(t){return this._firePreventable(new qn(t.type,this._map,t))},Gn.prototype.touchmove=function(t){this._map.fire(new qn(t.type,this._map,t))},Gn.prototype.touchend=function(t){this._map.fire(new qn(t.type,this._map,t))},Gn.prototype.touchcancel=function(t){this._map.fire(new qn(t.type,this._map,t))},Gn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Gn.prototype.isEnabled=function(){return!0},Gn.prototype.isActive=function(){return!1},Gn.prototype.enable=function(){},Gn.prototype.disable=function(){};var Zn=function(t){this._map=t};Zn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Zn.prototype.mousemove=function(t){this._map.fire(new Vn(t.type,this._map,t))},Zn.prototype.mousedown=function(){this._delayContextMenu=!0},Zn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Vn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Zn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Vn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Zn.prototype.isEnabled=function(){return!0},Zn.prototype.isActive=function(){return!1},Zn.prototype.enable=function(){},Zn.prototype.disable=function(){};var Wn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Yn(t,e){for(var r={},n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}Wn.prototype.isEnabled=function(){return!!this._enabled},Wn.prototype.isActive=function(){return!!this._active},Wn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Wn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Wn.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Wn.prototype.mousemoveWindow=function(t,e){if(this._active){var n=e;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=n,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var a=Math.min(i.x,n.x),o=Math.max(i.x,n.x),s=Math.min(i.y,n.y),l=Math.max(i.y,n.y);r.setTransform(this._box,"translate("+a+"px,"+s+"px)"),this._box.style.width=o-a+"px",this._box.style.height=l-s+"px"}}},Wn.prototype.mouseupWindow=function(e,n){var i=this;if(this._active&&0===e.button){var a=this._startPos,o=n;if(this.reset(),r.suppressClick(),a.x!==o.x||a.y!==o.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(a,o,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Wn.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Wn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Wn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Xn=function(t){this.reset(),this.numTouches=t.numTouches};Xn.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Xn.prototype.touchstart=function(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n<i.length;n+=1){var a=i[n];r._add(a)}return r.div(e.length)}(r),this.touches=Yn(n,r)))},Xn.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var n=Yn(r,e);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>30)&&(this.aborted=!0)}}},Xn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var $n=function(t){this.singleTap=new Xn(t),this.numTaps=t.numTaps,this.reset()};$n.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},$n.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},$n.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},$n.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if((!i||!a)&&this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Jn=function(){this._zoomIn=new $n({numTouches:1,numTaps:2}),this._zoomOut=new $n({numTouches:2,numTaps:1}),this.reset()};Jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Jn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Jn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Jn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout(function(){return n.reset()},0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout(function(){return n.reset()},0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Jn.prototype.touchcancel=function(){this.reset()},Jn.prototype.enable=function(){this._enabled=!0},Jn.prototype.disable=function(){this._enabled=!1,this.reset()},Jn.prototype.isEnabled=function(){return this._enabled},Jn.prototype.isActive=function(){return this._active};var Kn={0:1,2:2},Qn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Qn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Qn.prototype._correctButton=function(t,e){return!1},Qn.prototype._move=function(t,e){return{}},Qn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Qn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r){if(t.preventDefault(),function(t,e){var r=Kn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))return void this.reset();if(this._moved||!(e.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(r,e)}},Qn.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},Qn.prototype.enable=function(){this._enabled=!0},Qn.prototype.disable=function(){this._enabled=!1,this.reset()},Qn.prototype.isEnabled=function(){return this._enabled},Qn.prototype.isActive=function(){return this._active};var ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.mousedown=function(e,r){t.prototype.mousedown.call(this,e,r),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Qn),ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=.8*(e.x-t.x);if(r)return this._active=!0,{bearingDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Qn),ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=-.5*(e.y-t.y);if(r)return this._active=!0,{pitchDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Qn),ni=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};ni.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},ni.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},ni.prototype.touchmove=function(t,e,r){if(this._active&&!(r.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,r)},ni.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},ni.prototype.touchcancel=function(){this.reset()},ni.prototype._calculateTransform=function(e,r,n){n.length>0&&(this._active=!0);var i=Yn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var u=i[l],c=this._touches[l];c&&(a._add(u),o._add(u.sub(c)),s++,i[l]=u)}if(this._touches=i,!(s<this._minTouches)&&o.mag()){var h=o.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:a.div(s),panDelta:h}}},ni.prototype.enable=function(){this._enabled=!0},ni.prototype.disable=function(){this._enabled=!1,this.reset()},ni.prototype.isEnabled=function(){return this._enabled},ni.prototype.isActive=function(){return this._active};var ii=function(){this.reset()};function ai(t,e,r){for(var n=0;n<t.length;n++)if(t[n].identifier===r)return e[n]}function oi(t,e){return Math.log(t/e)/Math.LN2}ii.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},ii.prototype._start=function(t){},ii.prototype._move=function(t,e,r){return{}},ii.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},ii.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var n=this._firstTwoTouches,i=n[0],a=n[1],o=ai(r,e,i),s=ai(r,e,a);if(o&&s){var l=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],l,t)}}},ii.prototype.touchend=function(t,e,n){if(this._firstTwoTouches){var i=this._firstTwoTouches,a=i[0],o=i[1],s=ai(n,e,a),l=ai(n,e,o);s&&l||(this._active&&r.suppressClick(),this.reset())}},ii.prototype.touchcancel=function(){this.reset()},ii.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},ii.prototype.disable=function(){this._enabled=!1,this.reset()},ii.prototype.isEnabled=function(){return this._enabled},ii.prototype.isActive=function(){return this._active};var si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(oi(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:oi(this._distance,r),pinchAround:e}},e}(ii);function li(t,e){return 180*t.angleWith(e)/Math.PI}var ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:li(this._vector,r),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,r=li(t,this._startVector);return Math.abs(r)<e},e}(ii);function ci(t){return Math.abs(t.y)>Math.abs(t.x)}var hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ci(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ci(t)&&ci(e)&&a}},e}(ii),fi={panStep:100,bearingStep:15,pitchStep:10},pi=function(){var t=fi;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function di(t){return t*(2-t)}pi.prototype.reset=function(){this._active=!1},pi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:di,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},pi.prototype.enable=function(){this._enabled=!0},pi.prototype.disable=function(){this._enabled=!1,this.reset()},pi.prototype.isEnabled=function(){return this._enabled},pi.prototype.isActive=function(){return this._active},pi.prototype.disableRotation=function(){this._rotationDisabled=!0},pi.prototype.enableRotation=function(){this._rotationDisabled=!1};var mi=4.000244140625,gi=1/450,yi=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=gi,t.bindAll(["_onTimeout"],this)};yi.prototype.setZoomRate=function(t){this._defaultZoomRate=t},yi.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},yi.prototype.isEnabled=function(){return!!this._enabled},yi.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},yi.prototype.isZooming=function(){return!!this._zooming},yi.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},yi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},yi.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%mi===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},yi.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},yi.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},yi.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>mi?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=u(h);o=t.number(l,s,f),h<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},yi.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},yi.prototype.reset=function(){this._active=!1};var vi=function(t,e){this._clickZoom=t,this._tapZoom=e};vi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},vi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},vi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},vi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var xi=function(){this.reset()};xi.prototype.reset=function(){this._active=!1},xi.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},xi.prototype.enable=function(){this._enabled=!0},xi.prototype.disable=function(){this._enabled=!1,this.reset()},xi.prototype.isEnabled=function(){return this._enabled},xi.prototype.isActive=function(){return this._active};var _i=function(){this._tap=new $n({numTouches:1,numTaps:1}),this.reset()};_i.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},_i.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},_i.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},_i.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},_i.prototype.touchcancel=function(){this.reset()},_i.prototype.enable=function(){this._enabled=!0},_i.prototype.disable=function(){this._enabled=!1,this.reset()},_i.prototype.isEnabled=function(){return this._enabled},_i.prototype.isActive=function(){return this._active};var bi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};bi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},bi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},bi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},bi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var wi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};wi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},wi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},wi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},wi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Ti=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};Ti.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Ti.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Ti.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Ti.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Ti.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Ti.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ki=function(t){return t.zoom||t.drag||t.pitch||t.rotate},Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function Mi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Si=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Nn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;a<o.length;a+=1){var s=o[a],l=s[0],u=s[1],c=s[2];r.addEventListener(l,u,l===t.window.document?this.handleWindowEvent:this.handleEvent,c)}};Si.prototype.destroy=function(){for(var e=0,n=this._listeners;e<n.length;e+=1){var i=n[e],a=i[0],o=i[1],s=i[2];r.removeEventListener(a,o,a===t.window.document?this.handleWindowEvent:this.handleEvent,s)}},Si.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Gn(e,t));var n=e.boxZoom=new Wn(e,t);this._add("boxZoom",n);var i=new Jn,a=new xi;e.doubleClickZoom=new vi(a,i),this._add("tapZoom",i),this._add("clickZoom",a);var o=new _i;this._add("tapDragZoom",o);var s=e.touchPitch=new hi;this._add("touchPitch",s);var l=new ei(t),u=new ri(t);e.dragRotate=new wi(t,l,u),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",u,["mouseRotate"]);var c=new ti(t),h=new ni(t);e.dragPan=new bi(r,c,h),this._add("mousePan",c),this._add("touchPan",h,["touchZoom","touchRotate"]);var f=new ui,p=new si;e.touchZoomRotate=new Ti(r,p,f,o),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]);var d=e.scrollZoom=new yi(e,this);this._add("scrollZoom",d,["mousePan"]);var m=e.keyboard=new pi;this._add("keyboard",m),this._add("blockableMapEvent",new Zn(e));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g+=1){var v=y[g];t.interactive&&t[v]&&e[v].enable(t[v])}},Si.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},Si.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,r=this._handlers;e<r.length;e+=1)r[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},Si.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},Si.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Si.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Si.prototype.isMoving=function(){return!!ki(this._eventsInProgress)||this.isZooming()},Si.prototype._blockedByActive=function(t,e,r){for(var n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1},Si.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},Si.prototype._getMapTouches=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r],a=i.target;this._el.contains(a)&&e.push(i)}return e},Si.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var n="renderFrame"===t.type?void 0:t,i={needsRenderFrame:!1},a={},o={},s=t.touches?this._getMapTouches(t.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,t),u=0,c=this._handlers;u<c.length;u+=1){var h=c[u],f=h.handlerName,p=h.handler,d=h.allowed;if(p.isEnabled()){var m=void 0;this._blockedByActive(o,d,f)?p.reset():p[e||t.type]&&(m=p[e||t.type](t,l,s),this.mergeHandlerResult(i,a,m,f,n),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||p.isActive())&&(o[f]=p)}}var g={};for(var y in this._previousActiveHandlers)o[y]||(g[y]=n);this._previousActiveHandlers=o,(Object.keys(g).length||Mi(i))&&(this._changes.push([i,a,g]),this._triggerRenderFrame()),(Object.keys(o).length||Mi(i))&&this._map._stop(!0),this._updatingCamera=!1;var v=i.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],v(this._map))}else this.stop(!0)},Si.prototype.mergeHandlerResult=function(e,r,n,i,a){if(n){t.extend(e,n);var o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}},Si.prototype._applyChanges=function(){for(var e={},r={},n={},i=0,a=this._changes;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],u=o[2];s.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(e.around=s.around),void 0!==s.pinchAround&&(e.pinchAround=s.pinchAround),s.noInertia&&(e.noInertia=s.noInertia),t.extend(r,l),t.extend(n,u)}this._updateMapTransform(e,r,n),this._changes=[]},Si.prototype._updateMapTransform=function(t,e,r){var n=this._map,i=n.transform;if(!Mi(t))return this._fireEvents(e,r,!0);var a=t.panDelta,o=t.zoomDelta,s=t.bearingDelta,l=t.pitchDelta,u=t.around,c=t.pinchAround;void 0!==c&&(u=c),n._stop(!0),u=u||n.transform.centerPoint;var h=i.pointLocation(a?u.sub(a):u);s&&(i.bearing+=s),l&&(i.pitch+=l),o&&(i.zoom+=o),i.setLocationAtPoint(h,u),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)},Si.prototype._fireEvents=function(e,r,n){var i=this,a=ki(this._eventsInProgress),o=ki(e),s={};for(var l in e){var u=e[l].originalEvent;this._eventsInProgress[l]||(s[l+"start"]=u),this._eventsInProgress[l]=e[l]}for(var c in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(c,s[c]);for(var h in o&&this._fireEvent("move",o.originalEvent),e){var f=e[h].originalEvent;this._fireEvent(h,f)}var p,d={};for(var m in this._eventsInProgress){var g=this._eventsInProgress[m],y=g.handlerName,v=g.originalEvent;this._handlersById[y].isActive()||(delete this._eventsInProgress[m],p=r[y]||v,d[m+"end"]=p)}for(var x in d)this._fireEvent(x,d[x]);var _=ki(this._eventsInProgress);if(n&&(a||o)&&!_){this._updatingCamera=!0;var b=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=function(t){return 0!==t&&-i._bearingSnap<t&&t<i._bearingSnap};b?(w(b.bearing||this._map.getBearing())&&(b.bearing=0),this._map.easeTo(b,{originalEvent:p})):(this._map.fire(new t.Event("moveend",{originalEvent:p})),w(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Si.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Si.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(e){delete t._frameId,t.handleEvent(new Ai("renderFrame",{timeStamp:e})),t._applyChanges()})},Si.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var Ei=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){e=t.LngLatBounds.convert(e);var n=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,r)},r.prototype._cameraForBoxAndBearing=function(e,r,n,i){var a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.extend({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}i.padding=t.extend(a,i.padding);var s=this.transform,l=s.padding,u=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(r)),h=u.rotate(-n*Math.PI/180),f=c.rotate(-n*Math.PI/180),p=new t.Point(Math.max(h.x,f.x),Math.max(h.y,f.y)),d=new t.Point(Math.min(h.x,f.x),Math.min(h.y,f.y)),m=p.sub(d),g=(s.width-(l.left+l.right+i.padding.left+i.padding.right))/m.x,y=(s.height-(l.top+l.bottom+i.padding.top+i.padding.bottom))/m.y;if(!(y<0||g<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(g,y)),i.maxZoom),x="number"==typeof i.offset.x?new t.Point(i.offset.x,i.offset.y):t.Point.convert(i.offset),_=(i.padding.left-i.padding.right)/2,b=(i.padding.top-i.padding.bottom)/2,w=new t.Point(_,b).rotate(n*Math.PI/180),T=x.add(w).mult(s.scale/s.zoomScale(v));return{center:s.unproject(u.add(c).div(2).sub(T)),zoom:v,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,i),i,a)},r.prototype._fitInternal=function(e,r,n){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),null!=e.padding&&!n.isPaddingEqual(e.padding)&&(n.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),a&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),u="zoom"in e?+e.zoom:a,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,h="pitch"in e?+e.pitch:s,f="padding"in e?e.padding:i.padding,p=t.Point.convert(e.offset),d=i.centerPoint.add(p),m=i.pointLocation(d),g=t.LngLat.convert(e.center||m);this._normalizeCenter(g);var y,v,x=i.project(m),_=i.project(g).sub(x),b=i.zoomScale(u-a);e.around&&(y=t.LngLat.convert(e.around),v=i.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||u!==a,this._rotating=this._rotating||o!==c,this._pitching=this._pitching||h!==s,this._padding=!i.isPaddingEqual(f),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,w),this._ease(function(e){if(n._zooming&&(i.zoom=t.number(a,u,e)),n._rotating&&(i.bearing=t.number(o,c,e)),n._pitching&&(i.pitch=t.number(s,h,e)),n._padding&&(i.interpolatePadding(l,f,e),d=i.centerPoint.add(p)),y)i.setLocationAtPoint(y,v);else{var m=i.zoomScale(i.zoom-a),g=u>a?Math.min(2,b):Math.max(.5,b),w=Math.pow(g,1-e),T=i.unproject(x.add(_.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)},function(t){n._afterEase(r,t)},e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,!r&&!n.moving&&this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,d=a.zoomScale(c-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var x=a.project(y),_=a.project(v).sub(x),b=e.curve,w=Math.max(a.width,a.height),T=w/d,k=_.mag();if("minZoom"in e){var A=t.clamp(Math.min(e.minZoom,o,c),a.minZoom,a.maxZoom),M=w/a.zoomScale(A-o);b=Math.sqrt(M/k*2)}var S=b*b;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var L=E(0),P=function(t){return I(L)/I(L+b*t)},z=function(t){return w*((I(L)*function(t){return C(t)/I(t)}(L+b*t)-C(L))/S)/k},O=(E(1)-L)/b;if(Math.abs(k)<1e-6||!isFinite(O)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var D=T<w?-1:1;O=Math.abs(Math.log(T/w))/b,z=function(){return 0},P=function(t){return Math.exp(D*b*t)}}if("duration"in e)e.duration=+e.duration;else{var R="screenSpeed"in e?+e.screenSpeed/b:+e.speed;e.duration=1e3*O/R}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=f!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease(function(e){var i=e*O,d=1/P(i);a.zoom=1===e?c:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,h,e)),n._pitching&&(a.pitch=t.number(l,f,e)),n._padding&&(a.interpolatePadding(u,p,e),g=a.centerPoint.add(m));var y=1===e?v:a.unproject(x.add(_.mult(z(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)},function(){return n._afterEase(r)},e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),Ci=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Ci.prototype.getDefaultPosition=function(){return"bottom-right"},Ci.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ci.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Ci.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},Ci.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ci.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce(function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<r.length-1?"&":"")),t},"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},Ci.prototype._updateData=function(t){t&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType||"style"===t.dataType)&&(this._updateAttributions(),this._updateEditLink())},Ci.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(function(t){return"string"!=typeof t?"":t})):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];if(i.used){var a=i.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t.sort(function(t,e){return t.length-e.length});var o=(t=t.filter(function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0})).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ci.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ii=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Ii.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ii.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ii.prototype.getDefaultPosition=function(){return"bottom-left"},Ii.prototype._updateLogo=function(t){(!t||"metadata"===t.sourceDataType)&&(this._container.style.display=this._logoRequired()?"block":"none")},Ii.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},Ii.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Li=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Li.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Li.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===t)return void(i.cancelled=!0)}},Li.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,n=e;r<n.length;r+=1){var i=n[r];if(!i.cancelled&&(i.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Li.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Pi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},zi=t.window.HTMLImageElement,Oi=t.window.HTMLElement,Di=t.window.ImageBitmap,Ri=60,Fi={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:Ri,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Bi=function(n){function i(e){var r=this;if(null!=(e=t.extend({},Fi,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>Ri)throw new Error("maxPitch must be less than or equal to 60");var i=new Ln(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Li,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Pi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Oi))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return r._update(!1)}),this.on("moveend",function(){return r._update(!1)}),this.on("zoom",function(){return r._update(!0)}),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Si(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new zn(a).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Ci({customAttribution:e.customAttribution})),this.addControl(new Ii,e.logoPosition),this.on("style.load",function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)}),this.on("data",function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))}),this.on("dataloading",function(e){r.fire(new t.Event(e.dataType+"dataloading",e))})}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(t){if((t=null==t?Ri:t)>Ri)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Vn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Vn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Vn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o<a.length;o++){var s=a[o];if(s.layer===e&&s.listener===r){for(var l in s.delegates)i.off(l,s.delegates[l]);return a.splice(o,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var n;if(void 0===r&&void 0!==e&&!(e instanceof t.Point)&&!Array.isArray(e)&&(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),a=t.Point.convert(e[1]);n=[i,new t.Point(a.x,i.y),a,new t.Point(i.x,a.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},i.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},i.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new We(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new We(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(e,r){var n=this;if("string"==typeof e){var i=this._requestManager.normalizeStyleURL(e),a=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(a,function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)})}else"object"==typeof e&&this._updateDiff(e,r)},i.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var a=n.sdf;void 0===a&&(a=!1);var o=n.stretchX,s=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),r instanceof zi||Di&&r instanceof Di){var u=t.browser.getImageData(r),c=u.width,h=u.height,f=u.data;this.style.addImage(e,{data:new t.RGBAImage({width:c,height:h},f),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var p=r.width,d=r.height,m=r.data,g=r;this.style.addImage(e,{data:new t.RGBAImage({width:p,height:d},new Uint8Array(m)),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:g}),g.onAdd&&g.onAdd(this,e)}},i.prototype.updateImage=function(e,r){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof zi||Di&&r instanceof Di?t.browser.getImageData(r):r,a=i.width,o=i.height,s=i.data;if(void 0===a||void 0===o)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==n.data.width||o!==n.data.height)return this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof zi||Di&&r instanceof Di);n.data.replace(s,l),this.style.updateImage(e,n)},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},i.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,r,n),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){a[t]=r.create("div","mapboxgl-ctrl-"+t,i)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(e,r){var n=t.browser.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new Sn(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(e){var r,n=this,i=0,a=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=a.createQueryEXT(),a.beginQueryEXT(a.TIME_ELAPSED_EXT,r),i=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(s,l);var u=new t.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=u.crossFadingFactor();(1!==c||c!==this._crossFadingFactor)&&(o=!0,this._crossFadingFactor=c),this.style.update(u)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-i;a.endQueryEXT(a.TIME_ELAPSED_EXT,r),setTimeout(function(){var e=a.getQueryObjectEXT(r,a.QUERY_RESULT_EXT)/1e6;a.deleteQueryEXT(r),n.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))},50)}if(this.listens("gpu-timing-layer")){var f=this.painter.collectGpuTimers();setTimeout(function(){var e=n.painter.queryGpuTimers(f);n.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))},50)}var p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),this._loaded&&!this._fullyLoaded&&!p&&(this._fullyLoaded=!0),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext&&n.loseContext(),Ni(this._canvasContainer),Ni(this._controlContainer),Ni(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(t){e._frame=null,e._render(t)}))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},a.showPadding.get=function(){return!!this._showPadding},a.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},a.version.get=function(){return t.version},Object.defineProperties(i.prototype,a),i}(Ei);function Ni(t){t.parentNode&&t.parentNode.removeChild(t)}var ji={showCompass:!0,showZoom:!0,visualizePitch:!1},Ui=function(e){var n=this;this.options=t.extend({},ji,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(t){return n._map.zoomIn({},{originalEvent:t})}),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(t){return n._map.zoomOut({},{originalEvent:t})}),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(t){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:t}):n._map.resetNorth({},{originalEvent:t})}),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ui.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},Ui.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Ui.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Vi(this._map,this._compass,this.options.visualizePitch)),this._container},Ui.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Ui.prototype._createButton=function(t,e){var n=r.create("button",t,this._container);return n.type="button",n.addEventListener("click",e),n},Ui.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Vi=function(e,n,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new ei({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,i&&(this.mousePitch=new ri({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(n,"mousedown",this.mousedown),r.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(n,"touchmove",this.touchmove),r.addEventListener(n,"touchend",this.touchend),r.addEventListener(n,"touchcancel",this.reset)};function qi(e,r,n){if(e=new t.LngLat(e.lng,e.lat),r){var i=new t.LngLat(e.lng-360,e.lat),a=new t.LngLat(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<o?e=i:n.locationPoint(a).distSqr(r)<o&&(e=a)}for(;Math.abs(e.lng-n.center.lng)>180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Vi.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Vi.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Vi.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Vi.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Vi.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Vi.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Vi.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Vi.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Vi.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Vi.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Vi.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Hi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Gi(t,e,r){var n=t.classList;for(var i in Hi)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var Zi,Wi=function(e){function n(n,i){if(e.call(this),(n instanceof t.window.HTMLElement||i)&&(n=t.extend({element:n},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var u=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];u<c.length;u+=1){var h=c[u],f=r.createNS("http://www.w3.org/2000/svg","ellipse");f.setAttributeNS(null,"opacity","0.04"),f.setAttributeNS(null,"cx","10.5"),f.setAttributeNS(null,"cy","5.80029008"),f.setAttributeNS(null,"rx",h.rx),f.setAttributeNS(null,"ry",h.ry),l.appendChild(f)}var p=r.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var d=r.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),p.appendChild(d);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=r.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(g);var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var _=r.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),v.appendChild(x),v.appendChild(_),s.appendChild(l),s.appendChild(p),s.appendChild(m),s.appendChild(y),s.appendChild(v),a.appendChild(s),a.setAttributeNS(null,"height",41*this._scale+"px"),a.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(a),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(t){t.preventDefault()}),this._element.addEventListener("mousedown",function(t){t.preventDefault()}),Gi(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=38.1,r=13.5,n=Math.sqrt(Math.pow(r,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(24.6+n)],"bottom-right":[-n,-1*(24.6+n)],left:[r,-24.6],right:[-r,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(t){var e=t.code,r=t.charCode||t.keyCode;("Space"===e||"Enter"===e||32===r||13===r)&&this.togglePopup()},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=qi(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),(!t||"moveend"===t.type)&&(this._pos=this._pos.round()),r.setTransform(this._element,Hi[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+e)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){if(!this._isDragging){var r=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Yi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Xi=0,$i=!1,Ji=function(e){function n(r){e.call(this),this.options=t.extend({},Yi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),function(e){void 0!==Zi?e(Zi):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then(function(t){Zi="denied"!==t.state,e(Zi)}):(Zi=!!t.window.navigator.geolocation,e(Zi))}(this._setupUI),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Xi=0,$i=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),(!this.options.trackUserLocation||"ACTIVE_LOCK"===this._watchState)&&this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&$i)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Wi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Wi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;!e.geolocateSource&&"ACTIVE_LOCK"===n._watchState&&!r&&(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))})},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Xi--,$i=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Xi>1?(e={maximumAge:6e5,timeout:0},$i=!0):(e=this.options.positionOptions,$i=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Ki={maxWidth:100,unit:"metric"},Qi=function(e){this.options=t.extend({},Ki,e),t.bindAll(["_onMove","setUnit"],this)};function ta(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?ea(e,n,l/5280,t._getUIString("ScaleControl.Miles")):ea(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?ea(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?ea(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):ea(e,n,s,t._getUIString("ScaleControl.Meters"))}function ea(t,e,r,n){var i=function(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r),a=i/r;t.style.width=e*a+"px",t.innerHTML=i+"&nbsp;"+n}Qi.prototype.getDefaultPosition=function(){return"bottom-left"},Qi.prototype._onMove=function(){ta(this._map,this._container,this.options)},Qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Qi.prototype.setUnit=function(t){this.options.unit=t,ta(this._map,this._container,this.options)};var ra=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};ra.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ra.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ra.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},ra.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ra.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},ra.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ra.prototype._isFullscreen=function(){return this._fullscreen},ra.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ra.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var na={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ia=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),aa=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(na),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(t){var e=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return e._container.classList.add(t)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=qi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=oa(this.options.offset);if(!a){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=i.y+o.bottom.y<u?["top"]:i.y>this._map.transform.height-u?["bottom"]:[],i.x<l/2?s.push("left"):i.x>this._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var c=i.add(o[a]).round();r.setTransform(this._container,Hi[a]+" translate("+c.x+"px,"+c.y+"px)"),Gi(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(ia);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function oa(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.Point(0,0),top:new t.Point(0,e),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-e),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(e,0),right:new t.Point(-e,0)}}if(e instanceof t.Point||Array.isArray(e)){var n=t.Point.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(e.center||[0,0]),top:t.Point.convert(e.top||[0,0]),"top-left":t.Point.convert(e["top-left"]||[0,0]),"top-right":t.Point.convert(e["top-right"]||[0,0]),bottom:t.Point.convert(e.bottom||[0,0]),"bottom-left":t.Point.convert(e["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(e["bottom-right"]||[0,0]),left:t.Point.convert(e.left||[0,0]),right:t.Point.convert(e.right||[0,0])}}return oa(new t.Point(0,0))}var sa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Bi,NavigationControl:Ui,GeolocateControl:Ji,AttributionControl:Ci,ScaleControl:Qi,FullscreenControl:ra,Popup:aa,Marker:Wi,Style:We,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){jt().acquire(Rt)},clearPrewarmedResources:function(){var t=Bt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Bt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return sa}),r},"object"==typeof t&&void 0!==e?e.exports=n():(r=r||self).mapboxgl=n()}),j_=f((t,e)=>{var r=oe(),n=Ae().sanitizeHTML,i=z_(),a=S_();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n<e.length;n++)if("string"!=typeof e[n]||0===e[n].length)return!1;return!0}return r.isPlainObject(e)||"string"==typeof e&&e.length>0}function u(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r<e.length;r++){var n=e[r].id;if("string"==typeof n&&0===n.indexOf(a.traceLayerPrefix)){t=n;break}}return t},s.updateLayer=function(t){var e=this.subplot,r=u(t),n=this.lookupBelow(),i=this.findFollowingMapboxLayerId(n);this.removeLayer(),l(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=t.type,this.below=n},s.updateStyle=function(t){if(l(t)){var e=u(t);this.subplot.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",e.paint)}},s.removeLayer=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},s.dispose=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer),t.getSource(this.idSource)&&t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new o(t,e);return n.update(r),n}}),U_=f((t,e)=>{var r=N_(),n=oe(),i=_g(),a=Ut(),o=rr(),s=cr(),l=Pr(),u=zr(),c=u.drawMode,h=u.selectMode,f=Mn().prepSelect,p=Mn().clearOutline,d=Mn().clearSelectionsCache,m=Mn().selectOnClick,g=S_(),y=j_();function v(t,e){this.id=e,this.gd=t;var r=t._fullLayout,n=t._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(t,e,r){var n,i=this,a=e[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash={},i.layerList=[]),n=i.map?new Promise(function(r,n){i.updateMap(t,e,r,n)}):new Promise(function(r,n){i.createMap(t,e,r,n)}),r.push(n)},x.createMap=function(t,e,n,a){var o=this,s=e[o.id],l=o.styleObj=b(s.style,e);o.accessToken=s.accesstoken;var u=s.bounds,c=u?[[u.west,u.south],[u.east,u.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:T(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:c,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new r.AttributionControl({compact:!0}));h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(t,e);var f=[];f.push(new Promise(function(t){h.once("load",t)})),f=f.concat(i.fetchTraceGeoData(t)),Promise.all(f).then(function(){o.fillBelowLookup(t,e),o.updateData(t),o.updateLayout(e),o.resolveOnRender(n)}).catch(a)},x.updateMap=function(t,e,r,n){var a=this,o=a.map,s=e[this.id];a.rejectOnError(n);var l=[],u=b(s.style,e);JSON.stringify(a.styleObj)!==JSON.stringify(u)&&(a.styleObj=u,o.setStyle(u.style),a.traceHash={},l.push(new Promise(function(t){o.once("styledata",t)}))),l=l.concat(i.fetchTraceGeoData(t)),Promise.all(l).then(function(){a.fillBelowLookup(t,e),a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)}).catch(n)},x.fillBelowLookup=function(t,e){var r,n,i=e[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<t.length;r++){var s=t[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var u=i[r];n="string"==typeof u.below?u.below:o?"traces":"",a["layout-"+r]=n}var c,h,f={};for(c in a)f[n=a[c]]?f[n].push(c):f[n]=[c];for(n in f){var p=f[n];if(p.length>1)for(r=0;r<p.length;r++)0===(c=p[r]).indexOf("trace-")?(h=c.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===c.indexOf("layout-")&&(h=c.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var _={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function b(t,e){var r={};if(n.isPlainObject(t))r.id=t.id,r.style=t;else if("string"==typeof t)if(r.id=t,-1!==g.styleValuesMapbox.indexOf(t))r.style=w(t);else if(g.stylesNonMapbox[t]){r.style=g.stylesNonMapbox[t];var i=r.style.sources["plotly-"+t],a=i?i.tiles:void 0;a&&a[0]&&"?api_key="===a[0].slice(-9)&&(a[0]+=e._mapboxAccessToken)}else r.style=t;else r.id=g.styleValueDflt,r.style=w(g.styleValueDflt);return r.transition={duration:0,delay:0},r}function w(t){return g.styleUrlPrefix+t+"-"+g.styleUrlSuffix}function T(t){return[t.lon,t.lat]}x.updateData=function(t){var e,r,n,i,a=this.traceHash,o=t.slice().sort(function(t,e){return _[t[0].trace.type]-_[e[0].trace.type]});for(n=0;n<o.length;n++){var s=o[n],l=!1;(e=a[(r=s[0].trace).uid])&&(e.type===r.type?(e.update(s),l=!0):e.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var u=Object.keys(a);t:for(n=0;n<u.length;n++){var c=u[n];for(i=0;i<t.length;i++)if(c===(r=t[i][0].trace).uid)continue t;(e=a[c]).dispose(),delete a[c]}},x.updateLayout=function(t){var e=this.map,r=t[this.id];!this.dragging&&!this.wheeling&&(e.setCenter(T(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch)),this.updateLayers(t),this.updateFramework(t),this.updateFx(t),this.map.resize(),this.gd._context._scrollZoom.mapbox?e.scrollZoom.enable():e.scrollZoom.disable()},x.resolveOnRender=function(t){var e=this.map;e.on("render",function r(){e.loaded()&&(e.off("render",r),setTimeout(t,10))})},x.rejectOnError=function(t){var e=this.map;function r(){t(new Error(g.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},x.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t),e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(e.mockAxis,t)},x.initFx=function(t,e){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(e._hoverlayer)}function s(){var t=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(t))}i.on("moveend",function(t){if(r.map){var e=n._fullLayout;if(t.originalEvent||r.wheeling){var i=e[r.id];a.call("_storeDirectGUIEdit",n.layout,e._preGUI,r.getViewEdits(i));var o=r.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}t.originalEvent&&"mouseup"===t.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),e._rehover&&e._rehover()}}),i.on("wheel",function(){r.wheeling=!0}),i.on("mousemove",function(t){var e=r.div.getBoundingClientRect(),a=[t.originalEvent.offsetX,t.originalEvent.offsetY];t.target.getBoundingClientRect=function(){return e},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,t,r.id)},l.hover(n,t,r.id),n._fullLayout._hoversubplot=r.id}),i.on("dragstart",function(){r.dragging=!0,o()}),i.on("zoomstart",o),i.on("mouseout",function(){n._fullLayout._hoversubplot=null}),i.on("drag",s),i.on("zoom",s),i.on("dblclick",function(){var t=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(t));var e=r.viewInitial;i.setCenter(T(e.center)),i.setZoom(e.zoom),i.setBearing(e.bearing),i.setPitch(e.pitch);var o=r.getView();t._input.center=t.center=o.center,t._input.zoom=t.zoom=o.zoom,t._input.bearing=t.bearing=o.bearing,t._input.pitch=t.pitch=o.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}),r.clearOutline=function(){d(r.dragOptions),p(r.dragOptions.gd)},r.onClickInPanFn=function(t){return function(e){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(u)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||c(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e<n.length;e++)n[e].dispose();for(n=this.layerList=[],e=0;e<r.length;e++)n.push(y(this,e,r[e]))}else for(e=0;e<r.length;e++)n[e].update(r[e])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(t,e,r){for(var n in r)this.map[e](t,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(t,e){var r=this.map;if("string"==typeof e){if(""===e)return void r.addLayer(t,e);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(e===i[a].id)return void r.addLayer(t,e);n.warn(["Trying to add layer with *below* value",e,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(t)},x.project=function(t){return this.map.project(new r.LngLat(t[0],t[1]))},x.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat},n=t.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),_derived:{coordinates:[t.unproject([0,0]).toArray(),t.unproject([i,0]).toArray(),t.unproject([i,a]).toArray(),t.unproject([0,a]).toArray()]}}},x.getViewEdits=function(t){for(var e=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[e+"."+a]=t[a]}return n},x.getViewEditsWithDerived=function(t){var e=this.id,r=this.getViewEdits(t);return r[e+"._derived"]=t._derived,r},e.exports=v}),V_=f((t,e)=>{var r=oe(),n=Vs(),i=Fe(),a=E_();function o(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var a=r("bounds.west"),o=r("bounds.east"),l=r("bounds.south"),u=r("bounds.north");(void 0===a||void 0===o||void 0===l||void 0===u)&&delete e.bounds,i(t,e,{name:"layers",handleItemDefaults:s}),e._input=t}function s(t,e){function n(n,i){return r.coerce(t,e,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=e.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}e.exports=function(t,e,r){n(t,e,r,{type:"mapbox",attributes:a,handleDefaults:o,partition:"y",accessToken:e._mapboxAccessToken})}}),q_=f(t=>{var e=N_(),r=oe(),n=r.strTranslate,i=r.strScale,a=_e().getSubplotCalcData,o=Te(),s=v(),l=Je(),u=Ae(),c=U_(),h="mapbox",f=t.constants=S_();t.name=h,t.attr="subplot",t.idRoot=h,t.idRegex=t.attrRegex=r.counterRegex(h);var p=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");t.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},t.layoutAttributes=E_(),t.supplyLayoutDefaults=V_();var d=!0;function m(t){return"string"==typeof t&&(-1!==f.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://")||0===t.indexOf("stamen"))}t.plot=function(t){d&&(d=!1,r.warn(p));var n=t._fullLayout,i=t.calcdata,o=n._subplots[h];if(e.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var s=function(t,e){var n=t._fullLayout,i=t._context;if(""===i.mapboxAccessToken)return"";for(var a=[],o=[],s=!1,l=!1,u=0;u<e.length;u++){var c=n[e[u]],h=c.accesstoken;m(c.style)&&(h?r.pushUnique(a,h):(m(c._input.style)&&(r.error("Uses Mapbox map style, but did not set an access token."),s=!0),l=!0)),h&&r.pushUnique(o,h)}if(l){var p=s?f.noAccessTokenErrorMsg:f.missingStyleErrorMsg;throw r.error(p),new Error(p)}return a.length?(a.length>1&&r.warn(f.multipleTokensErrorMsg),a[0]):(o.length&&r.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);e.accessToken=s;for(var l=0;l<o.length;l++){var u=o[l],g=a(i,h,u),y=n[u],v=y._subplot;v||(v=new c(t,u),n[u]._subplot=v),v.viewInitial||(v.viewInitial={center:r.extendFlat({},y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),v.plot(g,n,t._promises)}},t.clean=function(t,e,r,n){for(var i=n._subplots[h]||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},t.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots[h],a=e._size,c=0;c<r.length;c++){var p=e[r[c]],d=p.domain,m=p._subplot.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":m,x:a.l+a.w*d.x[0],y:a.t+a.h*(1-d.y[1]),width:a.w*(d.x[1]-d.x[0]),height:a.h*(d.y[1]-d.y[0]),preserveAspectRatio:"none"});var g=s.select(p._subplot.div);if(null!==g.select(".mapboxgl-ctrl-logo").node().offsetParent){var y=e._glimages.append("g");y.attr("transform",n(a.l+a.w*d.x[0]+10,a.t+a.h*(1-d.y[0])-31)),y.append("path").attr("d",f.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),y.append("path").attr("d",f.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),y.append("path").attr("d",f.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),y.append("polygon").attr("points",f.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var v=g.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),x=e._glimages.append("g"),_=x.append("text");_.text(v).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":v});var b=l.bBox(_.node()),w=a.w*(d.x[1]-d.x[0]);if(b.width>w/2){var T=v.split("|").join("<br>");_.text(T).attr("data-unformatted",T).call(u.convertToTspans,t),b=l.bBox(_.node())}_.attr("transform",n(-3,8-b.height)),x.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var k=1;b.width+6>w&&(k=w/(b.width+6));var A=[a.l+a.w*d.x[1],a.t+a.h*(1-d.y[0])];x.attr("transform",n(A[0],A[1])+i(k))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[h],n=0;n<r.length;n++)e[r[n]]._subplot.updateFx(e)}}),H_=f((t,e)=>{e.exports={attributes:C_(),supplyDefaults:L_(),colorbar:hi(),formatLabels:P_(),calc:ug(),plot:D_(),hoverPoints:R_().hoverPoints,eventData:F_(),selectPoints:B_(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:q_(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),G_=f((t,e)=>{e.exports=H_()}),Z_=f((t,e)=>{var r=Rg(),n=Ie(),i=Ot().hovertemplateAttrs,a=j(),o=D().extendFlat;e.exports=o({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:o({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:o({},r.marker.line.color,{editType:"plot"}),width:o({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:o({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:o({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:o({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),showlegend:o({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}),W_=f((t,e)=>{var r=oe(),n=Ue(),i=Z_();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("locations"),u=s("z"),c=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(u)&&u.length&&("string"==typeof c&&""!==c||r.isPlainObject(c))?(s("featureidkey"),e._length=Math.min(l.length,u.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(t,e,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}}),Y_=f((t,e)=>{var r=T(),n=oe(),i=Ge(),a=Je(),o=pg().makeBlank,s=_g();function l(t){var e,r=t[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<t.length;s++){var l=t[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}e={type:"identity",property:"mo2"}}else e=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":e}),n.extendFlat(i.line.paint,{"line-opacity":e}),i}e.exports={convert:function(t){var e=t[0].trace,a=!0===e.visible&&0!==e._length,u={layout:{visibility:"none"},paint:{}},c={layout:{visibility:"none"},paint:{}},h=e._opts={fill:u,line:c,geojson:o()};if(!a)return h;var f=s.extractTraceFeature(t);if(!f)return h;var p,d,m,g=i.makeColorScaleFuncFromTrace(e),y=e.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(p=function(t){var e=t.mo;return r(e)?+n.constrain(e,0,1):0}),n.isArrayOrTypedArray(v.color)&&(d=function(t){return t.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(t){return t.mlw});for(var x=0;x<t.length;x++){var _=t[x],b=_.fOut;if(b){var w=b.properties;w.fc=g(_.z),p&&(w.mo=p(_)),d&&(w.mlc=d(_)),m&&(w.mlw=m(_)),_.ct=w.ct,_._polygons=s.feature2polygons(b)}}var T=p?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(u.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":T}),n.extendFlat(c.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":T}),u.layout.visibility="visible",c.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:f},l(t),h},convertOnSelect:l}}),X_=f((t,e)=>{var r=Y_().convert,n=Y_().convertOnSelect,i=S_().traceLayerPrefix;function a(t,e){this.type="choroplethmapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",i+e+"-fill"],["line",i+e+"-line"]],this.below=null}var o=a.prototype;o.update=function(t){this._update(r(t)),t[0].trace._glTrace=this},o.updateOnSelect=function(t){this._update(n(t))},o._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=t[o];e.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&e.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},o._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}),$_=f((t,e)=>{e.exports={attributes:Z_(),supplyDefaults:W_(),colorbar:No(),calc:Bg(),plot:X_(),hoverPoints:Ug(),eventData:Vg(),selectPoints:qg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"==typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:q_(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}),J_=f((t,e)=>{e.exports=$_()}),K_=f((t,e)=>{var r=Ie(),n=Ot().hovertemplateAttrs,i=j(),a=C_(),o=D().extendFlat;e.exports=o({lon:a.lon,lat:a.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:a.text,hovertext:a.hovertext,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:n(),showlegend:o({},i.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}),Q_=f((t,e)=>{var r=oe(),n=Ue(),i=K_();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("lon")||[],u=s("lat")||[],c=Math.min(l.length,u.length);c?(e._length=c,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}}),tb=f((t,e)=>{var r=T(),n=oe().isArrayOrTypedArray,i=k().BADNUM,a=He(),o=oe()._;e.exports=function(t,e){for(var s=e._length,l=new Array(s),u=e.z,c=n(u)&&u.length,h=0;h<s;h++){var f=l[h]={},p=e.lon[h],d=e.lat[h];if(f.lonlat=r(p)&&r(d)?[+p,+d]:[i,i],c){var m=u[h];f.z=r(m)?m:i}}return a(t,e,{vals:c?u:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(t,"lat:")+" ",lon:o(t,"lon:")+" "}}),l}}),eb=f((t,e)=>{var r=T(),n=oe(),i=q(),a=Ge(),o=k().BADNUM,s=pg().makeBlank;e.exports=function(t){var e=t[0].trace,l=!0===e.visible&&0!==e._length,u=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return u;var c,h=[],f=e.z,p=e.radius,d=n.isArrayOrTypedArray(f)&&f.length,m=n.isArrayOrTypedArray(p);for(c=0;c<t.length;c++){var g=t[c],y=g.lonlat;if(y[0]!==o){var v={};if(d){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(p[c])&&p[c]>0?+p[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(c=1;c<b.length;c++)T.push(b[c][0],b[c][1]);var k=["interpolate",["linear"],["get","z"],_.min,0,_.max,1];return n.extendFlat(u.heatmap.paint,{"heatmap-weight":d?k:1/(_.max-_.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),u.geojson={type:"FeatureCollection",features:h},u.heatmap.layout.visibility="visible",u}}),rb=f((t,e)=>{var r=eb(),n=S_().traceLayerPrefix;function i(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",n+e+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(t){var e=this.subplot,n=this.layerList,i=r(t),a=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<n.length;o++){var s=n[o],l=s[0],u=s[1],c=i[l];e.setOptions(u,"setLayoutProperty",c.layout),"visible"===c.layout.visibility&&e.setOptions(u,"setPaintProperty",c.paint)}},a._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},a._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}),nb=f((t,e)=>{var r=rr(),n=R_().hoverPoints,i=R_().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var h=s.subplot.mockAxis;s.z=c.z,s.zLabel=r.tickText(h,h.c2l(c.z),"hover").text}return s.extraText=i(u,c,l[0].t.labels),[s]}}}),ib=f((t,e)=>{e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}),ab=f((t,e)=>{e.exports={attributes:K_(),supplyDefaults:Q_(),colorbar:No(),formatLabels:P_(),calc:tb(),plot:rb(),hoverPoints:nb(),eventData:ib(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"==typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymapbox",basePlotModule:q_(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}),ob=f((t,e)=>{e.exports=ab()}),sb=f((t,e)=>{e.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}),lb=f((t,e)=>{e.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}),ub=f((t,e)=>{var r=Gt(),n=sb(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:lb(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);e.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}),cb=f((t,e)=>{var r=oe(),n=q().defaultLine,i=wa().attributes,a=R(),o=bn().textposition,s=Lt().overrideAll,l=me().templatedArray,u=ub(),c=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:u.styleValuesMap,dflt:u.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:c,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}),hb=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=og(),o=bn(),s=cb(),l=j(),u=Ie(),c=D().extendFlat,h=Lt().overrideAll,f=cb(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:c({},f.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:c({},d.opacity,{dflt:1})},mode:c({},o.mode,{dflt:"markers"}),text:c({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:c({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},u("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}),fb=f((t,e)=>{var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}),pb=f((t,e)=>{var r=oe(),n=Ze(),i=Gn(),a=Zn(),o=Yn(),s=Xn(),l=hb(),u=fb().isSupportedFont;e.exports=function(t,e,c,h){function f(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,f);if(d){if(f("text"),f("texttemplate"),f("hovertext"),f("hovertemplate"),f("mode"),f("below"),n.hasMarkers(e)){i(t,e,c,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,c,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||c),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:u(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==e.fill&&s(t,e,c,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}),db=f((t,e)=>{var r=rr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}),mb=f((t,e)=>{var r=oe();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}}),gb=f((t,e)=>{var r=T(),n=oe(),i=k().BADNUM,a=pg(),o=Ge(),s=Je(),l=We(),u=Ze(),c=fb().isSupportedFont,h=mb(),f=Ye().appendArrayPointValue,p=Ae().NEWLINES,d=Ae().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i<t.length;i++)r.push(e[i-1],t[i])}else r=t;return r}function _(t){var e=t.textfont,r=e.family,n=e.style,i=e.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),c(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,c=e[0].trace,b=!0===c.visible&&0!==c._length,w="none"!==c.fill,T=u.hasLines(c),k=u.hasMarkers(c),A=u.hasText(c),M=k&&"circle"===c.marker.symbol,S=k&&"circle"!==c.marker.symbol,E=c.cluster&&c.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":c.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":c.line.width,"line-color":c.line.color,"line-opacity":c.opacity})),M){var O=function(t){var e,i,a,u,c=t[0].trace,h=c.marker,f=c.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return c.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(c,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(c)),m&&(u=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,_=[];for(e=0;e<t.length;e++){var b=t[e],w=b.lonlat;if(!v(w)){var T={};i&&(T.mcc=b.mcc=i(b.mc)),a&&(T.mrc=b.mrc=a(b.ms)),u&&(T.mo=u(b.mo)),f&&(T.selected=b.selected||0),_.push({type:"Feature",id:e+1,geometry:{type:"Point",coordinates:w},properties:T})}}if(f)for(x=s.makeSelectedPointStyleFns(c),e=0;e<_.length;e++){var k=_[e].properties;x.selectedOpacityFn&&(k.mo=g(x.selectedOpacityFn(k))),x.selectedColorFn&&(k.mcc=x.selectedColorFn(k)),x.selectedSizeFn&&(k.mrc=x.selectedSizeFn(k))}return{geojson:{type:"FeatureCollection",features:_},mcc:p||x&&x.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:d||x&&x.selectedSizeFn?{type:"identity",property:"mrc"}:y(h.size),mo:m||x&&x.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(e);L.geojson=O.geojson,L.layout.visibility="visible",E&&(L.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(c.cluster.color,c.cluster.step),"circle-radius":x(c.cluster.size,c.cluster.step),"circle-opacity":x(c.cluster.opacity,c.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":_(c),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":O.mcc,"circle-radius":O.mrc,"circle-opacity":O.mo})}if(M&&E&&(L.filter=["!",["has","point_count"]]),(S||A)&&(P.geojson=function(t,e){for(var r=e._fullLayout,i=t[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,c="auto"!==s?g(s,!0):y,h=u.hasText(i)?g(i.text):y,m=[],x=0;x<t.length;x++){var _=t[x];if(!v(_.lonlat)){var b,w=i.texttemplate;if(w){var T=Array.isArray(w)?w[x]||"":w,k=i._module.formatLabels(_,i,r),A={};f(A,i,_.i);var M=i._meta||{};b=n.texttemplateString(T,k,r._d3locale,A,_,M)}else b=h(x);b&&(b=b.replace(p,"").replace(d,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:_.lonlat},properties:{symbol:l(x),angle:c(x),text:b}})}}return{type:"FeatureCollection",features:m}}(e,t),n.extendFlat(P.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),S&&(n.extendFlat(P.layout,{"icon-size":c.marker.size/10}),"angle"in c.marker&&"auto"!==c.marker.angle&&n.extendFlat(P.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),P.layout["icon-allow-overlap"]=c.marker.allowoverlap,n.extendFlat(P.paint,{"icon-opacity":c.opacity*c.marker.opacity,"icon-color":c.marker.color})),A)){var D=(c.marker||{}).size,R=h(c.textposition,D);n.extendFlat(P.layout,{"text-size":c.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":_(c)}),n.extendFlat(P.paint,{"text-color":c.textfont.color,"text-opacity":c.opacity})}return z}}),yb=f((t,e)=>{var r=oe(),n=gb(),i=ub().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(t,e,r,n){this.type="scattermap",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol",cluster:i+e+"-cluster",clusterCount:i+e+"-cluster-count"},this.below=null}var s=o.prototype;s.addSource=function(t,e,n){var i={type:"geojson",data:e.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[t]);a?a.setData(e.geojson):this.subplot.map.addSource(this.sourceIds[t],i)},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter);for(var i,a=this.layerIds[t],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(t){var e=t[0].trace,r=this.subplot,i=r.map,o=n(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),u=!!this.clusterEnabled,c=this;function h(t){u?function(t){for(var e=a.cluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(c.layerIds[n])}t||i.removeSource(c.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(c.layerIds[n]),t||i.removeSource(c.sourceIds[n])}}(t)}function f(t){l?function(t){t||c.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];c.addLayer(i,l,s)}}(t):function(t){for(var e=a.nonCluster,r=0;r<e.length;r++){var n=e[r],i=o[n];t||c.addSource(n,i),c.addLayer(n,i,s)}}(t)}var p=this.isHidden,d=!0!==e.visible;d?p||h():p?d||f():u!==l?(h(),f()):(this.below!==s&&(h(!0),f(!0)),function(){for(var t=l?a.cluster:a.nonCluster,e=0;e<t.length;e++){var n=t[e],i=o[n];i&&(r.setOptions(c.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&c.setSourceData(n,i),r.setOptions(c.layerIds[n],"setPaintProperty",i.paint)))}}()),this.clusterEnabled=l,this.isHidden=d,this.below=s,t[0].trace._glTrace=this},s.dispose=function(){for(var t=this.subplot.map,e=this.clusterEnabled?a.cluster:a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,u=l.cluster&&l.cluster.enabled,c=!0!==l.visible,h=new o(t,l.uid,u,c),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(u)for(h.addSource("circle",f.circle,l.cluster),r=0;r<a.cluster.length;r++)s=f[i=a.cluster[r]],h.addLayer(i,s,p);else for(r=0;r<a.nonCluster.length;r++)s=f[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,p);return e[0].trace._glTrace=h,h}}),vb=f((t,e)=>{var r=Pr(),n=oe(),i=di(),a=n.fillText,o=k().BADNUM,s=ub().traceLayerPrefix;function l(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];return i||o&&s?u.push("("+c(l[1])+", "+c(l[0])+")"):o?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1])),(i||-1!==n.indexOf("text"))&&a(e,t,u),u.join("<br>")}function c(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var u=t.cd,c=u[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+c.uid+"-circle",g=c.cluster&&c.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map(function(t){return t.id})}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(u,function(t){var e=t.lonlat;if(e[0]===o||g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),u=s.y-f.c2p([r,a]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)},t),!1!==t.index){var _=u[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[c.subplot]={_subplot:p};var S=c._module.formatLabels(_,c,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(c,_),t.extraText=l(c,_,u[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:l}}),xb=f((t,e)=>{e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}),_b=f((t,e)=>{var r=oe(),n=Ze(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,u=[],c=o[0].trace;if(!n.hasMarkers(c))return[];if(!1===e)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],f=h.lonlat;if(f[0]!==i){var p=[r.modHalf(f[0],360),f[1]],d=[s.c2p(p),l.c2p(p)];e.contains(d,null,a,t)?(u.push({pointNumber:a,lon:f[0],lat:f[1]}),h.selected=1):h.selected=0}}return u}}),bb=f((t,e)=>{var n,a;n=t,a=function(){var t={},e={};function n(r,n,i){if(e[r]=i,"index"===r){var a="var sharedModule = {}; ("+e.shared+")(sharedModule); ("+e.worker+")(sharedModule);",o={};return e.shared(o),e.index(t,o),"undefined"!=typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),t}}return n("shared",0,function(t){function e(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,s)}l((n=n.apply(t,e||[])).next())})}function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"function"==typeof SuppressedError&&SuppressedError;var a=s;function s(t,e){this.x=t,this.y=e}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(t){return t instanceof s?t:Array.isArray(t)?new s(t[0],t[1]):t};var h=n(a),f=p;function p(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}p.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var d=n(f);let m,g;function y(){return null==m&&(m="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),m}function v(){if(null==g&&(g=!1,y())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let e=0;e<25;e++){let r=4*e;t.fillStyle=`rgb(${r},${r+1},${r+2})`,t.fillRect(e%5,Math.floor(e/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let t=0;t<100;t++)if(t%4!=3&&e[t]!==t){g=!0;break}}}return g||!1}function x(t,e,r,n){let i=new d(t,e,r,n);return t=>i.solve(t)}let _=x(.25,.1,.25,1);function b(t,e,r){return Math.min(r,Math.max(e,t))}function w(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function T(t,...e){for(let r of e)for(let e in r)t[e]=r[e];return t}let k=1;function A(t,e,r){let n={};for(let r in t)n[r]=e.call(this,t[r],r,t);return n}function M(t,e,r){let n={};for(let r in t)e.call(this,t[r],r,t)&&(n[r]=t[r]);return n}function S(t){return Array.isArray(t)?t.map(S):"object"==typeof t&&t?A(t,S):t}let E={};function C(t){E[t]||("undefined"!=typeof console&&console.warn(t),E[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function L(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let P=null;function z(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}let O="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function D(t,r,n,i,a){return e(this,void 0,void 0,function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");let e=new VideoFrame(t,{timestamp:0});try{let o=null==e?void 0:e.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);let s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield e.copyTo(l,function(t,e,r,n,i){let a=4*Math.max(-e,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,e),u=Math.max(0,r);return{rect:{x:l,y:u,width:Math.min(t.width,e+n)-l,height:Math.min(t.height,r+i)-u},layout:[{offset:o,stride:s}]}}(t,r,n,i,a)),s)for(let t=0;t<l.length;t+=4){let e=l[t];l[t]=l[t+2],l[t+2]=e}return l}finally{e.close()}})}let R,F,B="AbortError";function N(){return new Error(B)}let j={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function U(t){return j.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}let V="global-dispatcher";class q extends Error{constructor(t,e,r,n){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=n}}let H=()=>L(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,G=function(t,r){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let e=U(t.url);if(e)return e(t,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:V},r)}if(!(/^file:/.test(n=t.url)||/^file:/.test(H())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,r){return e(this,void 0,void 0,function*(){let e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:H(),signal:r.signal});"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");let n,i=yield fetch(e);if(!i.ok){let e=yield i.blob();throw new q(i.status,i.statusText,t.url,e)}n="arrayBuffer"===t.type||"image"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text();let a=yield n;if(r.signal.aborted)throw N();return{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires")}})}(t,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:V},r)}var n,i,a;return i=t,a=r,new Promise((t,e)=>{var r;let n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(let t in i.headers)n.setRequestHeader(t,i.headers[t]);"json"===i.type&&(n.responseType="text",!(null===(r=i.headers)||void 0===r)&&r.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{e(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===i.type)try{r=JSON.parse(n.response)}catch(t){return void e(t)}t({data:r,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{let t=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});e(new q(n.status,n.statusText,i.url,t))}},a.signal.addEventListener("abort",()=>{n.abort(),e(N())}),n.send(i.body)})};function Z(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;let e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function W(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Y(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}class X{constructor(t,e={}){T(this,e),this.type=t}}class $ extends X{constructor(t,e={}){super("error",T({error:t},e))}}class J{on(t,e){return this._listeners=this._listeners||{},W(t,e,this._listeners),this}off(t,e){return Y(t,e,this._listeners),Y(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},W(t,e,this._oneTimeListeners),this):new Promise(e=>this.once(t,e))}fire(t,e){"string"==typeof t&&(t=new X(t,e||{}));let r=t.type;if(this.listens(r)){t.target=this;let e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let r of e)r.call(this,t);let n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let e of n)Y(r,e,this._oneTimeListeners),e.call(this,t);let i=this._eventedParent;i&&(T(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(t))}else t instanceof $&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var K={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let Q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function tt(t,e){let r={};for(let e in t)"ref"!==e&&(r[e]=t[e]);return Q.forEach(t=>{t in e&&(r[t]=e[t])}),r}function et(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!et(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!et(t[r],e[r]))return!1;return!0}return t===e}function rt(t,e){t.push(e)}function nt(t,e,r){rt(r,{command:"addSource",args:[t,e[t]]})}function it(t,e,r){rt(e,{command:"removeSource",args:[t]}),r[t]=!0}function at(t,e,r,n){it(t,r,n),nt(t,e,r)}function ot(t,e,r){let n;for(n in t[r])if(Object.prototype.hasOwnProperty.call(t[r],n)&&"data"!==n&&!et(t[r][n],e[r][n]))return!1;for(n in e[r])if(Object.prototype.hasOwnProperty.call(e[r],n)&&"data"!==n&&!et(t[r][n],e[r][n]))return!1;return!0}function st(t,e,r,n,i,a){t=t||{},e=e||{};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(et(t[o],e[o])||r.push({command:a,args:[n,o,e[o],i]}));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&!Object.prototype.hasOwnProperty.call(t,o)&&(et(t[o],e[o])||r.push({command:a,args:[n,o,e[o],i]}))}function lt(t){return t.id}function ut(t,e){return t[e.id]=e,t}class ct{constructor(t,e,r,n){this.message=(t?`${t}: `:"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)}}function ht(t,...e){for(let r of e)for(let e in r)t[e]=r[e];return t}class ft extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class pt{constructor(t,e=[]){this.parent=t,this.bindings={};for(let[t,r]of e)this.bindings[t]=r}concat(t){return new pt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}let dt={kind:"null"},mt={kind:"number"},gt={kind:"string"},yt={kind:"boolean"},vt={kind:"color"},xt={kind:"object"},_t={kind:"value"},bt={kind:"collator"},wt={kind:"formatted"},Tt={kind:"padding"},kt={kind:"resolvedImage"},At={kind:"variableAnchorOffsetCollection"};function Mt(t,e){return{kind:"array",itemType:t,N:e}}function St(t){if("array"===t.kind){let e=St(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}let Et=[dt,mt,gt,yt,vt,wt,xt,Mt(_t),Tt,kt,At];function Ct(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ct(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(let t of Et)if(!Ct(t,e))return null}return`Expected ${St(t)} but found ${St(e)} instead.`}function It(t,e){return e.some(e=>e.kind===t.kind)}function Lt(t,e){return e.some(e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t)}function Pt(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}let zt=.96422,Ot=.82521,Dt=4/29,Rt=6/29,Ft=3*Rt*Rt,Bt=Rt*Rt*Rt,Nt=Math.PI/180,jt=180/Math.PI;function Ut(t){return(t%=360)<0&&(t+=360),t}function Vt([t,e,r,n]){let i,a,o=Ht((.2225045*(t=qt(t))+.7168786*(e=qt(e))+.0606169*(r=qt(r)))/1);t===e&&e===r?i=a=o:(i=Ht((.4360747*t+.3850649*e+.1430804*r)/zt),a=Ht((.0139322*t+.0971045*e+.7141733*r)/Ot));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),n]}function qt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ht(t){return t>Bt?Math.pow(t,1/3):t/Ft+Dt}function Gt([t,e,r,n]){let i=(t+16)/116,a=isNaN(e)?i:i+e/500,o=isNaN(r)?i:i-r/200;return i=1*Wt(i),a=zt*Wt(a),o=Ot*Wt(o),[Zt(3.1338561*a-1.6168667*i-.4906146*o),Zt(-.9787684*a+1.9161415*i+.033454*o),Zt(.0719453*a-.2289914*i+1.4052427*o),n]}function Zt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Wt(t){return t>Rt?t*t*t:Ft*(t-Dt)}function Yt(t){return parseInt(t.padEnd(2,t),16)/255}function Xt(t,e){return $t(e?t/100:t,0,1)}function $t(t,e,r){return Math.min(Math.max(e,t),r)}function Jt(t){return!t.some(Number.isNaN)}let Kt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Qt{constructor(t,e,r,n=1,i=!0){this.r=t,this.g=e,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,e,r,n]))}static parse(t){if(t instanceof Qt)return t;if("string"!=typeof t)return;let e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];let e=Kt[t];if(e){let[t,r,n]=e;return[t/255,r/255,n/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let e=t.length<6?1:2,r=1;return[Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+e)||"ff")]}if(t.startsWith("rgb")){let e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){let[t,r,n,i,a,o,s,l,u,c,h,f]=e,p=[i||" ",s||" ",c].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){let t=[n,o,u].join(""),e="%%%"===t?100:""===t?255:0;if(e){let t=[$t(+r/e,0,1),$t(+a/e,0,1),$t(+l/e,0,1),h?Xt(+h,f):1];if(Jt(t))return t}}return}}let r=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[t,e,n,i,a,o,s,l,u]=r,c=[n||" ",a||" ",s].join("");if(" "===c||" /"===c||",,"===c||",,,"===c){let t=[+e,$t(+i,0,100),$t(+o,0,100),l?Xt(+l,u):1];if(Jt(t))return function([t,e,r,n]){function i(n){let i=(n+t/30)%12,a=e*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return t=Ut(t),e/=100,r/=100,[i(0),i(8),i(4),n]}(t)}}}(t);return e?new Qt(...e,!1):void 0}get rgb(){let{r:t,g:e,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[t/i,e/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(t){let[e,r,n,i]=Vt(t),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ut(Math.atan2(n,r)*jt):NaN,a,e,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Vt(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){let[t,e,r,n]=this.rgb;return`rgba(${[t,e,r].map(t=>Math.round(255*t)).join(",")},${n})`}}Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);class te{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ee{constructor(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i}}class re{constructor(t){this.sections=t}static fromString(t){return new re([new ee(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof re?t:re.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}}class ne{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ne)return t;if("number"==typeof t)return new ne([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new ne(t)}}toString(){return JSON.stringify(this.values)}}let ie=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ae{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ae)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){let r=t[e],n=t[e+1];if("string"!=typeof r||!ie.has(r)||!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new ae(t)}}toString(){return JSON.stringify(this.values)}}class oe{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new oe({name:t,available:!1}):null}}function se(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function le(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Qt||t instanceof te||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe)return!0;if(Array.isArray(t)){for(let e of t)if(!le(e))return!1;return!0}if("object"==typeof t){for(let e in t)if(!le(t[e]))return!1;return!0}return!1}function ue(t){if(null===t)return dt;if("string"==typeof t)return gt;if("boolean"==typeof t)return yt;if("number"==typeof t)return mt;if(t instanceof Qt)return vt;if(t instanceof te)return bt;if(t instanceof re)return wt;if(t instanceof ne)return Tt;if(t instanceof ae)return At;if(t instanceof oe)return kt;if(Array.isArray(t)){let e,r=t.length;for(let r of t){let t=ue(r);if(e){if(e===t)continue;e=_t;break}e=t}return Mt(e||_t,r)}return xt}function ce(t){let e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe?t.toString():JSON.stringify(t)}class he{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!le(t[1]))return e.error("invalid value");let r=t[1],n=ue(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new he(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class fe{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}let pe={string:gt,number:mt,boolean:yt,object:xt};class de{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1,i=t[0];if("array"===i){let i,a;if(t.length>2){let r=t[1];if("string"!=typeof r||!(r in pe)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=pe[r],n++}else i=_t;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Mt(i,a)}else{if(!pe[i])throw new Error(`Types doesn't contain name = ${i}`);r=pe[i]}let a=[];for(;n<t.length;n++){let r=e.parse(t[n],n,_t);if(!r)return null;a.push(r)}return new de(r,a)}evaluate(t){for(let e=0;e<this.args.length;e++){let r=this.args[e].evaluate(t);if(!Ct(this.type,ue(r)))return r;if(e===this.args.length-1)throw new fe(`Expected value to be of type ${St(this.type)}, but found ${St(ue(r))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}let me={"to-boolean":yt,"to-color":vt,"to-number":mt,"to-string":gt};class ge{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r=t[0];if(!me[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");let n=me[r],i=[];for(let r=1;r<t.length;r++){let n=e.parse(t[r],r,_t);if(!n)return null;i.push(n)}return new ge(n,i)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let e,r;for(let n of this.args){if(e=n.evaluate(t),r=null,e instanceof Qt)return e;if("string"==typeof e){let r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&(r=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:se(e[0],e[1],e[2],e[3]),!r))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new fe(r||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(let r of this.args){e=r.evaluate(t);let n=ne.parse(e);if(n)return n}throw new fe(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(let r of this.args){e=r.evaluate(t);let n=ae.parse(e);if(n)return n}throw new fe(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(let r of this.args){if(e=r.evaluate(t),null===e)return 0;let n=Number(e);if(!isNaN(n))return n}throw new fe(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return re.fromString(ce(this.args[0].evaluate(t)));case"resolvedImage":return oe.fromString(ce(this.args[0].evaluate(t)));default:return ce(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}let ye=["Unknown","Point","LineString","Polygon"];class ve{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ye[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e}}class xe{constructor(t,e,r=[],n,i=new pt,a=[]){this.registry=t,this.path=r,this.key=r.map(t=>`[${t}]`).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=e}parse(t,e,r,n,i={}){return e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}_parse(t,e){function r(t,e,r){return"assert"===r?new de(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[n];if(i){let n=i.parse(t,this);if(!n)return null;if(this.expectedType){let t=this.expectedType,i=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==t.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==t.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(t,i))return null}else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"assert")}if(!(n instanceof he)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){let t=new ve;try{n=new he(n.type,n.evaluate(t))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){let n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new xe(this.registry,this._isConstant,n,e||null,i,this.errors)}error(t,...e){let r=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new ft(r,t))}checkSubtype(t,e){let r=Ct(t,e);return r&&this.error(r),r}}class _e{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let n=1;n<t.length-1;n+=2){let i=t[n];if("string"!=typeof i)return e.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);let a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a])}let n=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return n?new _e(r,n):null}outputDefined(){return this.result.outputDefined()}}class be{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");let r=t[1];return e.scope.has(r)?new be(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class we{constructor(t,e,r){this.type=t,this.index=e,this.input=r}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=e.parse(t[1],1,mt),n=e.parse(t[2],2,Mt(e.expectedType||_t));return r&&n?new we(n.type.itemType,r,n):null}evaluate(t){let e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new fe(`Array index out of bounds: ${e} < 0.`);if(e>=r.length)throw new fe(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new fe(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Te{constructor(t,e){this.type=yt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);return r&&n?It(r.type,[yt,gt,mt,dt,_t])?new Te(r,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`):null}evaluate(t){let e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Lt(e,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ue(e))} instead.`);if(!Lt(r,["string","array"]))throw new fe(`Expected second argument to be of type array or string, but found ${St(ue(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ke{constructor(t,e,r){this.type=mt,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);if(!r||!n)return null;if(!It(r.type,[yt,gt,mt,dt,_t]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`);if(4===t.length){let i=e.parse(t[3],3,mt);return i?new ke(r,n,i):null}return new ke(r,n)}evaluate(t){let e,r=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Lt(r,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ue(r))} instead.`);if(this.fromIndex&&(e=this.fromIndex.evaluate(t)),Lt(n,["string"])){let t=n.indexOf(r,e);return-1===t?-1:[...n.slice(0,t)].length}if(Lt(n,["array"]))return n.indexOf(r,e);throw new fe(`Expected second argument to be of type array or string, but found ${St(ue(n))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Ae{constructor(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);let i={},a=[];for(let o=2;o<t.length-1;o+=2){let s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);let u=e.concat(o);if(0===s.length)return u.error("Expected at least one branch label.");for(let t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ue(t)))return null}else r=ue(t);if(void 0!==i[String(t)])return u.error("Branch labels must be unique.");i[String(t)]=a.length}let c=e.parse(l,o,n);if(!c)return null;n=n||c.type,a.push(c)}let o=e.parse(t[1],1,_t);if(!o)return null;let s=e.parse(t[t.length-1],t.length-1,n);return s?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Ae(r,n,o,i,a,s):null}evaluate(t){let e=this.input.evaluate(t);return(ue(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Me{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);let n=[];for(let i=1;i<t.length-1;i+=2){let a=e.parse(t[i],i,yt);if(!a)return null;let o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}let i=e.parse(t[t.length-1],t.length-1,r);if(!i)return null;if(!r)throw new Error("Can't infer output type");return new Me(r,n,i)}evaluate(t){for(let[e,r]of this.branches)if(e.evaluate(t))return r.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[e,r]of this.branches)t(e),t(r);t(this.otherwise)}outputDefined(){return this.branches.every(([t,e])=>e.outputDefined())&&this.otherwise.outputDefined()}}class Se{constructor(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=e.parse(t[1],1,_t),n=e.parse(t[2],2,mt);if(!r||!n)return null;if(!It(r.type,[Mt(_t),gt,_t]))return e.error(`Expected first argument to be of type array or string, but found ${St(r.type)} instead`);if(4===t.length){let i=e.parse(t[3],3,mt);return i?new Se(r.type,r,n,i):null}return new Se(r.type,r,n)}evaluate(t){let e,r=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(this.endIndex&&(e=this.endIndex.evaluate(t)),Lt(r,["string"]))return[...r].slice(n,e).join("");if(Lt(r,["array"]))return r.slice(n,e);throw new fe(`Expected first argument to be of type array or string, but found ${St(ue(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ee(t,e){let r,n,i=t.length-1,a=0,o=i,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),r=t[s],n=t[s+1],r<=e){if(s===i||e<n)return s;a=s+1}else{if(!(r>e))throw new fe("Input is not a number.");o=s-1}return 0}class Ce{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(let[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");let r=e.parse(t[1],1,mt);if(!r)return null;let n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let r=1;r<t.length;r+=2){let a=1===r?-1/0:t[r],o=t[r+1],s=r,l=r+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);let u=e.parse(o,l,i);if(!u)return null;i=i||u.type,n.push([a,u])}return new Ce(i,r,n)}evaluate(t){let e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);let n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);let i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ee(e,n)].evaluate(t)}eachChild(t){t(this.input);for(let e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}var Ie=Le;function Le(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}Le.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Pe,ze=(Pe=Ie)&&Pe.__esModule&&Object.prototype.hasOwnProperty.call(Pe,"default")?Pe.default:Pe;function Oe(t,e,r){return t+r*(e-t)}function De(t,e,r){return t.map((t,n)=>Oe(t,e[n],r))}let Re={number:Oe,color:function(t,e,r,n="rgb"){switch(n){case"rgb":{let[n,i,a,o]=De(t.rgb,e.rgb,r);return new Qt(n,i,a,o,!1)}case"hcl":{let n,i,[a,o,s,l]=t.hcl,[u,c,h,f]=e.hcl;if(isNaN(a)||isNaN(u))isNaN(a)?isNaN(u)?n=NaN:(n=u,1!==s&&0!==s||(i=c)):(n=a,1!==h&&0!==h||(i=o));else{let t=u-a;u>a&&t>180?t-=360:u<a&&a-u>180&&(t+=360),n=a+r*t}let[p,d,m,g]=function([t,e,r,n]){return t=isNaN(t)?0:t*Nt,Gt([r,Math.cos(t)*e,Math.sin(t)*e,n])}([n,null!=i?i:Oe(o,c,r),Oe(s,h,r),Oe(l,f,r)]);return new Qt(p,d,m,g,!1)}case"lab":{let[n,i,a,o]=Gt(De(t.lab,e.lab,r));return new Qt(n,i,a,o,!1)}}},array:De,padding:function(t,e,r){return new ne(De(t.values,e.values,r))},variableAnchorOffsetCollection:function(t,e,r){let n=t.values,i=e.values;if(n.length!==i.length)throw new fe(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);let a=[];for(let t=0;t<n.length;t+=2){if(n[t]!==i[t])throw new fe(`Cannot interpolate values containing mismatched anchors. from[${t}]: ${n[t]}, to[${t}]: ${i[t]}`);a.push(n[t]);let[e,o]=n[t+1],[s,l]=i[t+1];a.push([Oe(e,s,r),Oe(o,l,r)])}return new ae(a)}};class Fe{constructor(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(let[t,e]of i)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,r,n){let i=0;if("exponential"===t.name)i=Be(e,t.base,r,n);else if("linear"===t.name)i=Be(e,1,r,n);else if("cubic-bezier"===t.name){let a=t.controlPoints;i=new ze(a[0],a[1],a[2],a[3]).solve(Be(e,1,r,n))}return i}static parse(t,e){let[r,n,i,...a]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){let t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{let t=n.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,mt),!i)return null;let o=[],s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=vt:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t<a.length;t+=2){let r=a[t],n=a[t+1],i=t+3,l=t+4;if("number"!=typeof r)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(o.length&&o[o.length-1][0]>=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);let u=e.parse(n,l,s);if(!u)return null;s=s||u.type,o.push([r,u])}return Pt(s,mt)||Pt(s,vt)||Pt(s,Tt)||Pt(s,At)||Pt(s,Mt(mt))?new Fe(s,r,n,i,o):e.error(`Type ${St(s)} is not interpolatable.`)}evaluate(t){let e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);let n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);let i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);let a=Ee(e,n),o=Fe.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),l=r[a+1].evaluate(t);switch(this.operator){case"interpolate":return Re[this.type.kind](s,l,o);case"interpolate-hcl":return Re.color(s,l,o,"hcl");case"interpolate-lab":return Re.color(s,l,o,"lab")}}eachChild(t){t(this.input);for(let e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Be(t,e,r,n){let i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}class Ne{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);let i=[];for(let n of t.slice(1)){let t=e.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r=r||t.type,i.push(t)}if(!r)throw new Error("No output type");let a=n&&i.some(t=>Ct(n,t.type));return new Ne(a?_t:r,i)}evaluate(t){let e,r=null,n=0;for(let i of this.args)if(n++,r=i.evaluate(t),r&&r instanceof oe&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null!==r)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function je(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ue(t,e,r,n){return 0===n.compare(e,r)}function Ve(t,e,r){let n="=="!==t&&"!="!==t;return class i{constructor(t,e,r){this.type=yt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");let r=t[0],a=e.parse(t[1],1,_t);if(!a)return null;if(!je(r,a.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${St(a.type)}'.`);let o=e.parse(t[2],2,_t);if(!o)return null;if(!je(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${St(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${St(a.type)}' and '${St(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new de(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new de(a.type,[o])));let s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,bt),!s)return null}return new i(a,o,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){let e=ue(a),r=ue(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new fe(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let t=ue(a),r=ue(o);if("string"!==t.kind||"string"!==r.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}let qe=Ve("==",function(t,e,r){return e===r},Ue),He=Ve("!=",function(t,e,r){return e!==r},function(t,e,r,n){return!Ue(0,e,r,n)}),Ge=Ve("<",function(t,e,r){return e<r},function(t,e,r,n){return n.compare(e,r)<0}),Ze=Ve(">",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),We=Ve("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),Ye=Ve(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0});class Xe{constructor(t,e,r){this.type=bt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");let r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");let n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,yt);if(!n)return null;let i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,yt);if(!i)return null;let a=null;return r.locale&&(a=e.parse(r.locale,1,gt),!a)?null:new Xe(n,i,a)}evaluate(t){return new te(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class $e{constructor(t,e,r,n,i){this.type=gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");let r=e.parse(t[1],1,mt);if(!r)return null;let n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=e.parse(n.locale,1,gt),!i))return null;let a=null;if(n.currency&&(a=e.parse(n.currency,1,gt),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=e.parse(n["min-fraction-digits"],1,mt),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=e.parse(n["max-fraction-digits"],1,mt),!s)?null:new $e(r,i,a,o,s)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Je{constructor(t){this.type=wt,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");let n=[],i=!1;for(let r=1;r<=t.length-1;++r){let a=t[r];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;let t=null;if(a["font-scale"]&&(t=e.parse(a["font-scale"],1,mt),!t))return null;let r=null;if(a["text-font"]&&(r=e.parse(a["text-font"],1,Mt(gt)),!r))return null;let o=null;if(a["text-color"]&&(o=e.parse(a["text-color"],1,vt),!o))return null;let s=n[n.length-1];s.scale=t,s.font=r,s.textColor=o}else{let a=e.parse(t[r],1,_t);if(!a)return null;let o=a.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:a,scale:null,font:null,textColor:null})}}return new Je(n)}evaluate(t){return new re(this.sections.map(e=>{let r=e.content.evaluate(t);return ue(r)===kt?new ee("",r,null,null,null):new ee(ce(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))}eachChild(t){for(let e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}}class Ke{constructor(t){this.type=kt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");let r=e.parse(t[1],1,gt);return r?new Ke(r):e.error("No image name provided.")}evaluate(t){let e=this.input.evaluate(t),r=oe.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}}class Qe{constructor(t){this.type=mt,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${St(r.type)} instead.`):new Qe(r):null}evaluate(t){let e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new fe(`Expected value to be of type string or array, but found ${St(ue(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}let tr=8192;function er(t,e){let r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*tr),Math.round(n*i*tr)]}function rr(t,e){let r=Math.pow(2,e.z);return[(i=(t[0]/tr+e.x)/r,360*i-180),(n=(t[1]/tr+e.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function nr(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function ir(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ar(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function or(t,e,r,n){return(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-i[1]*a[0]!=0&&!(!fr(t,e,r,n)||!fr(r,n,t,e));var i,a}function sr(t,e,r){for(let n of r)for(let r=0;r<n.length-1;++r)if(or(t,e,n[r],n[r+1]))return!0;return!1}function lr(t,e,r=!1){let n=!1;for(let s of e)for(let e=0;e<s.length-1;e++){if(ar(t,s[e],s[e+1]))return r;(a=s[e])[1]>(i=t)[1]!=(o=s[e+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}var i,a,o;return n}function ur(t,e){for(let r of e)if(lr(t,r))return!0;return!1}function cr(t,e){for(let r of t)if(!lr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(sr(t[r],t[r+1],e))return!1;return!0}function hr(t,e){for(let r of e)if(cr(t,r))return!0;return!1}function fr(t,e,r,n){let i=n[0]-r[0],a=n[1]-r[1],o=(t[0]-r[0])*a-i*(t[1]-r[1]),s=(e[0]-r[0])*a-i*(e[1]-r[1]);return o>0&&s<0||o<0&&s>0}function pr(t,e,r){let n=[];for(let i=0;i<t.length;i++){let a=[];for(let n=0;n<t[i].length;n++){let o=er(t[i][n],r);nr(e,o),a.push(o)}n.push(a)}return n}function dr(t,e,r){let n=[];for(let i=0;i<t.length;i++){let a=pr(t[i],e,r);n.push(a)}return n}function mr(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let e=.5*n,i=t[0]-r[0]>e?-n:r[0]-t[0]>e?n:0;0===i&&(i=t[0]-r[2]>e?-n:r[2]-t[0]>e?n:0),t[0]+=i}nr(e,t)}function gr(t,e,r,n){let i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(let n of t)for(let t of n){let n=[t.x+a[0],t.y+a[1]];mr(n,e,r,i),o.push(n)}return o}function yr(t,e,r,n){let i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(let r of t){let t=[];for(let n of r){let r=[n.x+a[0],n.y+a[1]];nr(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=i/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(let t of o)for(let n of t)mr(n,e,r,i)}var s;return o}class vr{constructor(t,e){this.type=yt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){let e=t[1];if("FeatureCollection"===e.type){let t=[];for(let r of e.features){let{type:e,coordinates:n}=r.geometry;"Polygon"===e&&t.push(n),"MultiPolygon"===e&&t.push(...n)}if(t.length)return new vr(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){let t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new vr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new vr(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){let a=pr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!lr(t,a))return!1}if("MultiPolygon"===e.type){let a=dr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!ur(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){let a=pr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!cr(t,a))return!1}if("MultiPolygon"===e.type){let a=dr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!hr(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xr=class{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,n=e[t];for(;t>0;){let i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){let{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t<n;){let n=1+(t<<1),a=n+1;if(a<this.length&&r(e[a],e[n])<0&&(n=a),r(e[n],i)>=0)break;e[t]=e[n],t=n}e[t]=i}};function _r(t,e,r,n,i){br(t,e,r,n||t.length-1,i||Tr)}function br(t,e,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);br(t,e,Math.max(r,Math.floor(e-o*l/a+u)),Math.min(n,Math.floor(e+(a-o)*l/a+u)),i)}var c=t[e],h=r,f=n;for(wr(t,r,e),i(t[n],c)>0&&wr(t,r,n);h<f;){for(wr(t,h,f),h++,f--;i(t[h],c)<0;)h++;for(;i(t[f],c)>0;)f--}0===i(t[r],c)?wr(t,r,f):wr(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function wr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Tr(t,e){return t<e?-1:t>e?1:0}function kr(t,e){if(t.length<=1)return[t];let r,n,i=[];for(let e of t){let t=Mr(e);0!==t&&(e.area=Math.abs(t),void 0===n&&(n=t<0),n===t<0?(r&&i.push(r),r=[e]):r.push(e))}if(r&&i.push(r),e>1)for(let t=0;t<i.length;t++)i[t].length<=e||(_r(i[t],e,1,i[t].length-1,Ar),i[t]=i[t].slice(0,e));return i}function Ar(t,e){return e.area-t.area}function Mr(t){let e=0;for(let r,n,i=0,a=t.length,o=a-1;i<a;o=i++)r=t[i],n=t[o],e+=(n.x-r.x)*(r.y+n.y);return e}let Sr=1/298.257223563,Er=Sr*(2-Sr),Cr=Math.PI/180;class Ir{constructor(t){let e=6378.137*Cr*1e3,r=Math.cos(t*Cr),n=1/(1-Er*(1-r*r)),i=Math.sqrt(n);this.kx=e*i*r,this.ky=e*i*n*(1-Er)}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,n=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(t,e){let r,n,i,a,o=1/0;for(let s=0;s<t.length-1;s++){let l=t[s][0],u=t[s][1],c=this.wrap(t[s+1][0]-l)*this.kx,h=(t[s+1][1]-u)*this.ky,f=0;0===c&&0===h||(f=(this.wrap(e[0]-l)*this.kx*c+(e[1]-u)*this.ky*h)/(c*c+h*h),f>1?(l=t[s+1][0],u=t[s+1][1]):f>0&&(l+=c/this.kx*f,u+=h/this.ky*f)),c=this.wrap(e[0]-l)*this.kx,h=(e[1]-u)*this.ky;let p=c*c+h*h;p<o&&(o=p,r=l,n=u,i=s,a=f)}return{point:[r,n],index:i,t:Math.max(0,Math.min(1,a))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Lr(t,e){return e[0]-t[0]}function Pr(t){return t[1]-t[0]+1}function zr(t,e){return t[1]>=t[0]&&t[1]<e}function Or(t,e){if(t[0]>t[1])return[null,null];let r=Pr(t);if(e){if(2===r)return[t,null];let e=Math.floor(r/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===r)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function Dr(t,e){if(!zr(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)nr(r,t[n]);return r}function Rr(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let t of r)nr(e,t);return e}function Fr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Br(t,e,r){if(!Fr(t)||!Fr(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function Nr(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}function jr(t,e,r,n,i){let a=Math.min(Nr(t,[r,n],i),Nr(e,[r,n],i)),o=Math.min(Nr(r,[t,e],i),Nr(n,[t,e],i));return Math.min(a,o)}function Ur(t,e,r,n,i){if(!zr(e,t.length)||!zr(n,r.length))return 1/0;let a=1/0;for(let o=e[0];o<e[1];++o){let e=t[o],s=t[o+1];for(let t=n[0];t<n[1];++t){let n=r[t],o=r[t+1];if(or(e,s,n,o))return 0;a=Math.min(a,jr(e,s,n,o,i))}}return a}function Vr(t,e,r,n,i){if(!zr(e,t.length)||!zr(n,r.length))return NaN;let a=1/0;for(let o=e[0];o<=e[1];++o)for(let e=n[0];e<=n[1];++e)if(a=Math.min(a,i.distance(t[o],r[e])),0===a)return a;return a}function qr(t,e,r){if(lr(t,e,!0))return 0;let n=1/0;for(let i of e){let e=i[0],a=i[i.length-1];if(e!==a&&(n=Math.min(n,Nr(t,[a,e],r)),0===n))return n;let o=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,o.point)),0===n)return n}return n}function Hr(t,e,r,n){if(!zr(e,t.length))return NaN;for(let n=e[0];n<=e[1];++n)if(lr(t[n],r,!0))return 0;let i=1/0;for(let a=e[0];a<e[1];++a){let e=t[a],o=t[a+1];for(let t of r)for(let r=0,a=t.length,s=a-1;r<a;s=r++){let a=t[s],l=t[r];if(or(e,o,a,l))return 0;i=Math.min(i,jr(e,o,a,l,n))}}return i}function Gr(t,e){for(let r of t)for(let t of r)if(lr(t,e,!0))return!0;return!1}function Zr(t,e,r,n=1/0){let i=Rr(t),a=Rr(e);if(n!==1/0&&Br(i,a,r)>=n)return n;if(ir(i,a)){if(Gr(t,e))return 0}else if(Gr(e,t))return 0;let o=1/0;for(let n of t)for(let t=0,i=n.length,a=i-1;t<i;a=t++){let i=n[a],s=n[t];for(let t of e)for(let e=0,n=t.length,a=n-1;e<n;a=e++){let n=t[a],l=t[e];if(or(i,s,n,l))return 0;o=Math.min(o,jr(i,s,n,l,r))}}return o}function Wr(t,e,r,n,i,a){if(!a)return;let o=Br(Dr(n,a),i,r);o<e&&t.push([o,a,[0,0]])}function Yr(t,e,r,n,i,a,o){if(!a||!o)return;let s=Br(Dr(n,a),Dr(i,o),r);s<e&&t.push([s,a,o])}function Xr(t,e,r,n,i=1/0){let a=Math.min(n.distance(t[0],r[0][0]),i);if(0===a)return a;let o=new xr([[0,[0,t.length-1],[0,0]]],Lr),s=Rr(r);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let l=i[1],u=e?50:100;if(Pr(l)<=u){if(!zr(l,t.length))return NaN;if(e){let e=Hr(t,l,r,n);if(isNaN(e)||0===e)return e;a=Math.min(a,e)}else for(let e=l[0];e<=l[1];++e){let i=qr(t[e],r,n);if(a=Math.min(a,i),0===a)return 0}}else{let r=Or(l,e);Wr(o,a,n,t,s,r[0]),Wr(o,a,n,t,s,r[1])}}return a}function $r(t,e,r,n,i,a=1/0){let o=Math.min(a,i.distance(t[0],r[0]));if(0===o)return o;let s=new xr([[0,[0,t.length-1],[0,r.length-1]]],Lr);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let l=a[1],u=a[2],c=e?50:100,h=n?50:100;if(Pr(l)<=c&&Pr(u)<=h){if(!zr(l,t.length)&&zr(u,r.length))return NaN;let a;if(e&&n)a=Ur(t,l,r,u,i),o=Math.min(o,a);else if(e&&!n){let e=t.slice(l[0],l[1]+1);for(let t=u[0];t<=u[1];++t)if(a=Nr(r[t],e,i),o=Math.min(o,a),0===o)return o}else if(!e&&n){let e=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Nr(t[r],e,i),o=Math.min(o,a),0===o)return o}else a=Vr(t,l,r,u,i),o=Math.min(o,a)}else{let a=Or(l,e),c=Or(u,n);Yr(s,o,i,t,r,a[0],c[0]),Yr(s,o,i,t,r,a[0],c[1]),Yr(s,o,i,t,r,a[1],c[0]),Yr(s,o,i,t,r,a[1],c[1])}}return o}function Jr(t){return"MultiPolygon"===t.type?t.coordinates.map(t=>({type:"Polygon",coordinates:t})):"MultiLineString"===t.type?t.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===t.type?t.coordinates.map(t=>({type:"Point",coordinates:t})):[t]}class Kr{constructor(t,e){this.type=mt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){let e=t[1];if("FeatureCollection"===e.type)return new Kr(e,e.features.map(t=>Jr(t.geometry)).flat());if("Feature"===e.type)return new Kr(e,Jr(e.geometry));if("type"in e&&"coordinates"in e)return new Kr(e,Jr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){let r=t.geometry(),n=r.flat().map(e=>rr([e.x,e.y],t.canonical));if(0===r.length)return NaN;let i=new Ir(n[0][1]),a=1/0;for(let t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!1,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!1,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!1,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){let r=t.geometry(),n=r.flat().map(e=>rr([e.x,e.y],t.canonical));if(0===r.length)return NaN;let i=new Ir(n[0][1]),a=1/0;for(let t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!0,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!0,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!0,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){let r=t.geometry();if(0===r.length||0===r[0].length)return NaN;let n=kr(r,0).map(e=>e.map(e=>e.map(e=>rr([e.x,e.y],t.canonical)))),i=new Ir(n[0][0][0][1]),a=1/0;for(let t of e)for(let e of n){switch(t.type){case"Point":a=Math.min(a,Xr([t.coordinates],!1,e,i,a));break;case"LineString":a=Math.min(a,Xr(t.coordinates,!0,e,i,a));break;case"Polygon":a=Math.min(a,Zr(e,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Qr={"==":qe,"!=":He,">":Ze,"<":Ge,">=":Ye,"<=":We,array:de,at:we,boolean:de,case:Me,coalesce:Ne,collator:Xe,format:Je,image:Ke,in:Te,"index-of":ke,interpolate:Fe,"interpolate-hcl":Fe,"interpolate-lab":Fe,length:Qe,let:_e,literal:he,match:Ae,number:de,"number-format":$e,object:de,slice:Se,step:Ce,string:de,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:be,within:vr,distance:Kr};class tn{constructor(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){let r=t[0],n=tn.definitions[r];if(!n)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),s=null;for(let[n,a]of o){s=new xe(e.registry,on,e.path,null,e.scope);let o=[],l=!1;for(let e=1;e<t.length;e++){let r=t[e],i=Array.isArray(n)?n[e-1]:n.type,a=s.parse(r,1+o.length,i);if(!a){l=!0;break}o.push(a)}if(!l)if(Array.isArray(n)&&n.length!==o.length)s.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){let e=Array.isArray(n)?n[t]:n.type,r=o[t];s.concat(t+1).checkSubtype(e,r.type)}if(0===s.errors.length)return new tn(r,i,a,o)}}if(1===o.length)e.errors.push(...s.errors);else{let r=(o.length?o:a).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(St).join(", ")})`:`(${St(e.type)}...)`;var e}).join(" | "),n=[];for(let r=1;r<t.length;r++){let i=e.parse(t[r],1+n.length);if(!i)return null;n.push(St(i.type))}e.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){tn.definitions=e;for(let r in e)t[r]=tn}}function en(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let a=i?i.evaluate(t):1,o=se(e,r,n,a);if(o)throw new fe(o);return new Qt(e/255,r/255,n/255,a,!1)}function rn(t,e){return t in e}function nn(t,e){let r=e[t];return void 0===r?null:r}function an(t){return{type:t}}function on(t){if(t instanceof be)return on(t.boundExpression);if(t instanceof tn&&"error"===t.name||t instanceof Xe||t instanceof vr||t instanceof Kr)return!1;let e=t instanceof ge||t instanceof de,r=!0;return t.eachChild(t=>{r=e?r&&on(t):r&&t instanceof he}),!!r&&sn(t)&&un(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function sn(t){if(t instanceof tn&&("get"===t.name&&1===t.args.length||"feature-state"===t.name||"has"===t.name&&1===t.args.length||"properties"===t.name||"geometry-type"===t.name||"id"===t.name||/^filter-/.test(t.name))||t instanceof vr||t instanceof Kr)return!1;let e=!0;return t.eachChild(t=>{e&&!sn(t)&&(e=!1)}),e}function ln(t){if(t instanceof tn&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!ln(t)&&(e=!1)}),e}function un(t,e){if(t instanceof tn&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(t=>{r&&!un(t,e)&&(r=!1)}),r}function cn(t){return{result:"success",value:t}}function hn(t){return{result:"error",value:t}}function fn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function pn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function dn(t){return!!t.expression&&t.expression.interpolated}function mn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function gn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function yn(t){return t}function vn(t,e){let r="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],i=n||!(n||void 0!==t.property),a=t.type||(dn(e)?"exponential":"interval");if(r||"padding"===e.type){let n=r?Qt.parse:ne.parse;(t=ht({},t)).stops&&(t.stops=t.stops.map(t=>[t[0],n(t[1])])),t.default=n(t.default?t.default:e.default)}if(t.colorSpace&&"rgb"!==(o=t.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${t.colorSpace}"`);var o;let s,l,u;if("exponential"===a)s=wn;else if("interval"===a)s=bn;else if("categorical"===a){s=_n,l=Object.create(null);for(let e of t.stops)l[e[0]]=e[1];u=typeof t.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=Tn}if(n){let r={},n=[];for(let e=0;e<t.stops.length;e++){let i=t.stops[e],a=i[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:t.type,property:t.property,default:t.default,stops:[]},n.push(a)),r[a].stops.push([i[0].value,i[1]])}let i=[];for(let t of n)i.push([r[t].zoom,vn(r[t],e)]);let a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:Fe.interpolationFactor.bind(void 0,a),zoomStops:i.map(t=>t[0]),evaluate:({zoom:r},n)=>wn({stops:i,base:t.base},e,r).evaluate(r,n)}}if(i){let r="exponential"===a?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Fe.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:r})=>s(t,e,r,l,u)}}return{kind:"source",evaluate(r,n){let i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?xn(t.default,e.default):s(t,e,i,l,u)}}}function xn(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function _n(t,e,r,n,i){return xn(typeof r===i?n[r]:void 0,t.default,e.default)}function bn(t,e,r){if("number"!==mn(r))return xn(t.default,e.default);let n=t.stops.length;if(1===n||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=Ee(t.stops.map(t=>t[0]),r);return t.stops[i][1]}function wn(t,e,r){let n=void 0!==t.base?t.base:1;if("number"!==mn(r))return xn(t.default,e.default);let i=t.stops.length;if(1===i||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let a=Ee(t.stops.map(t=>t[0]),r),o=function(t,e,r,n){let i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=Re[e.type]||yn;return"function"==typeof s.evaluate?{evaluate(...e){let r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return u(r,n,o,t.colorSpace)}}:u(s,l,o,t.colorSpace)}function Tn(t,e,r){switch(e.type){case"color":r=Qt.parse(r);break;case"formatted":r=re.fromString(r.toString());break;case"resolvedImage":r=oe.fromString(r.toString());break;case"padding":r=ne.parse(r);break;default:mn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0)}return xn(r,t.default,e.default)}tn.register(Qr,{error:[{kind:"error"},[gt],(t,[e])=>{throw new fe(e.evaluate(t))}],typeof:[gt,[_t],(t,[e])=>St(ue(e.evaluate(t)))],"to-rgba":[Mt(mt,4),[vt],(t,[e])=>{let[r,n,i,a]=e.evaluate(t).rgb;return[255*r,255*n,255*i,a]}],rgb:[vt,[mt,mt,mt],en],rgba:[vt,[mt,mt,mt,mt],en],has:{type:yt,overloads:[[[gt],(t,[e])=>rn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>rn(e.evaluate(t),r.evaluate(t))]]},get:{type:_t,overloads:[[[gt],(t,[e])=>nn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>nn(e.evaluate(t),r.evaluate(t))]]},"feature-state":[_t,[gt],(t,[e])=>nn(e.evaluate(t),t.featureState||{})],properties:[xt,[],t=>t.properties()],"geometry-type":[gt,[],t=>t.geometryType()],id:[_t,[],t=>t.id()],zoom:[mt,[],t=>t.globals.zoom],"heatmap-density":[mt,[],t=>t.globals.heatmapDensity||0],"line-progress":[mt,[],t=>t.globals.lineProgress||0],accumulated:[_t,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[mt,an(mt),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[mt,an(mt),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:mt,overloads:[[[mt,mt],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[mt],(t,[e])=>-e.evaluate(t)]]},"/":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[mt,[],()=>Math.LN2],pi:[mt,[],()=>Math.PI],e:[mt,[],()=>Math.E],"^":[mt,[mt,mt],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[mt,[mt],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))],log2:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[mt,[mt],(t,[e])=>Math.sin(e.evaluate(t))],cos:[mt,[mt],(t,[e])=>Math.cos(e.evaluate(t))],tan:[mt,[mt],(t,[e])=>Math.tan(e.evaluate(t))],asin:[mt,[mt],(t,[e])=>Math.asin(e.evaluate(t))],acos:[mt,[mt],(t,[e])=>Math.acos(e.evaluate(t))],atan:[mt,[mt],(t,[e])=>Math.atan(e.evaluate(t))],min:[mt,an(mt),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[mt,an(mt),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[mt,[mt],(t,[e])=>Math.abs(e.evaluate(t))],round:[mt,[mt],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[mt,[mt],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[mt,[mt],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[yt,[gt,_t],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[yt,[_t],(t,[e])=>t.id()===e.value],"filter-type-==":[yt,[gt],(t,[e])=>t.geometryType()===e.value],"filter-<":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[yt,[_t],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[yt,[_t],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[yt,[_t],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[yt,[_t],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[yt,[_t],(t,[e])=>e.value in t.properties()],"filter-has-id":[yt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[yt,[Mt(gt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[yt,[Mt(_t)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[yt,[gt,Mt(_t)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[yt,[gt,Mt(_t)],(t,[e,r])=>function(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[an(yt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[an(yt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[yt,[yt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[yt,[gt],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[gt,[gt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[gt,[gt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[gt,an(_t),(t,e)=>e.map(e=>ce(e.evaluate(t))).join("")],"resolved-locale":[gt,[bt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class kn{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new ve,this._defaultValue=e?"color"===(r=e).type&&gn(r.default)?new Qt(0,0,0,0):"color"===r.type?Qt.parse(r.default)||null:"padding"===r.type?ne.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?ae.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new fe(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function An(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Qr}function Mn(t,e){let r=new xe(Qr,on,[],e?function(t){let e={color:vt,string:gt,number:mt,enum:gt,boolean:yt,formatted:wt,padding:Tt,resolvedImage:kt,variableAnchorOffsetCollection:At};return"array"===t.type?Mt(e[t.value]||_t,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?cn(new kn(n,e)):hn(r.errors)}class Sn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ln(e.expression)}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}}class En{constructor(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ln(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}interpolationFactor(t,e,r){return this.interpolationType?Fe.interpolationFactor(this.interpolationType,t,e,r):0}}function Cn(t,e){let r=Mn(t,e);if("error"===r.result)return r;let n=r.value.expression,i=sn(n);if(!i&&!fn(e))return hn([new ft("","data expressions not supported")]);let a=un(n,["zoom"]);if(!a&&!pn(e))return hn([new ft("","zoom expressions not supported")]);let o=Ln(n);return o||a?o instanceof ft?hn([o]):o instanceof Fe&&!dn(e)?hn([new ft("",'"interpolate" expressions cannot be used with this property')]):cn(o?new En(i?"camera":"composite",r.value,o.labels,o instanceof Fe?o.interpolation:void 0):new Sn(i?"constant":"source",r.value)):hn([new ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class In{constructor(t,e){this._parameters=t,this._specification=e,ht(this,vn(this._parameters,this._specification))}static deserialize(t){return new In(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ln(t){let e=null;if(t instanceof _e)e=Ln(t.result);else if(t instanceof Ne){for(let r of t.args)if(e=Ln(r),e)break}else(t instanceof Ce||t instanceof Fe)&&t.input instanceof tn&&"zoom"===t.input.name&&(e=t);return e instanceof ft||t.eachChild(t=>{let r=Ln(t);r instanceof ft?e=r:!e&&r?e=new ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new ft("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Pn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!Pn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}let zn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function On(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Pn(t)||(t=Fn(t));let e=Mn(t,zn);if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,r,n)=>e.value.evaluate(t,r,{},n),needGeometry:Rn(t)}}function Dn(t,e){return t<e?-1:t>e?1:0}function Rn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(Rn(t[e]))return!0;return!1}function Fn(t){if(!t)return!0;let e=t[0];return t.length<=1?"any"!==e:"=="===e?Bn(t[1],t[2],"=="):"!="===e?Un(Bn(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Bn(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fn))):"all"===e?["all"].concat(t.slice(1).map(Fn)):"none"===e?["all"].concat(t.slice(1).map(Fn).map(Un)):"in"===e?Nn(t[1],t.slice(2)):"!in"===e?Un(Nn(t[1],t.slice(2))):"has"===e?jn(t[1]):"!has"!==e||Un(jn(t[1]));var r}function Bn(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Nn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Dn)]]:["filter-in-small",t,["literal",e]]}}function jn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Un(t){return["!",t]}function Vn(t){let e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(let r of t)e+=`${Vn(r)},`;return`${e}]`}let r=Object.keys(t).sort(),n="{";for(let e=0;e<r.length;e++)n+=`${JSON.stringify(r[e])}:${Vn(t[r[e]])},`;return`${n}}`}function qn(t){let e="";for(let r of Q)e+=`/${Vn(t[r])}`;return e}function Hn(t){let e=t.value;return e?[new ct(t.key,e,"constants have been deprecated as of v8")]:[]}function Gn(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Zn(t){if(Array.isArray(t))return t.map(Zn);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Zn(t[r]);return e}return Gn(t)}function Wn(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=t.validateSpec,l=[],u=mn(r);if("object"!==u)return[new ct(e,r,`object expected, ${u} found`)];for(let t in r){let u,c=t.split(".")[0],h=n[c]||n["*"];if(i[c])u=i[c];else if(n[c])u=s;else if(i["*"])u=i["*"];else{if(!n["*"]){l.push(new ct(e,r[t],`unknown property "${t}"`));continue}u=s}l=l.concat(u({key:(e&&`${e}.`)+t,value:r[t],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:t,validateSpec:s},r))}for(let t in n)i[t]||n[t].required&&void 0===n[t].default&&void 0===r[t]&&l.push(new ct(e,r,`missing required property "${t}"`));return l}function Yn(t){let e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||t.validateSpec;if("array"!==mn(e))return[new ct(a,e,`array expected, ${mn(e)} found`)];if(r.length&&e.length!==r.length)return[new ct(a,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new ct(a,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===mn(r.value)&&(s=r.value);let l=[];for(let r=0;r<e.length;r++)l=l.concat(o({array:e,arrayIndex:r,value:e[r],valueSpec:s,validateSpec:t.validateSpec,style:n,styleSpec:i,key:`${a}[${r}]`}));return l}function Xn(t){let e=t.key,r=t.value,n=t.valueSpec,i=mn(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new ct(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new ct(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new ct(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function $n(t){let e,r,n,i=t.valueSpec,a=Gn(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===mn(t.value.stops)&&"array"===mn(t.value.stops[0])&&"object"===mn(t.value.stops[0][0]),c=Wn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new ct(t.key,t.value,'identity function may not have a "stops" property')];let e=[],r=t.value;return e=e.concat(Yn({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===mn(r)&&0===r.length&&e.push(new ct(t.key,r,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:i,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&c.push(new ct(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||c.push(new ct(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!dn(t.valueSpec)&&c.push(new ct(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!fn(t.valueSpec)?c.push(new ct(t.key,t.value,"property functions not supported")):s&&!pn(t.valueSpec)&&c.push(new ct(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||c.push(new ct(t.key,t.value,'"property" property is required')),c;function h(t){let e=[],a=t.value,s=t.key;if("array"!==mn(a))return[new ct(s,a,`array expected, ${mn(a)} found`)];if(2!==a.length)return[new ct(s,a,`array length 2 expected, length ${a.length} found`)];if(u){if("object"!==mn(a[0]))return[new ct(s,a,`object expected, ${mn(a[0])} found`)];if(void 0===a[0].zoom)return[new ct(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new ct(s,a,"object stop key must have value")];if(n&&n>Gn(a[0].zoom))return[new ct(s,a[0].zoom,"stop zoom values must appear in ascending order")];Gn(a[0].zoom)!==n&&(n=Gn(a[0].zoom),r=void 0,o={}),e=e.concat(Wn({key:`${s}[0]`,value:a[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Xn,value:f}}))}else e=e.concat(f({key:`${s}[0]`,value:a[0],validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},a));return An(Zn(a[1]))?e.concat([new ct(`${s}[1]`,a[1],"expressions are not allowed in function stops.")]):e.concat(t.validateSpec({key:`${s}[1]`,value:a[1],valueSpec:i,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){let s=mn(t.value),l=Gn(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new ct(t.key,u,`${s} stop domain type must match previous stop domain type ${e}`)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ct(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){let e=`number expected, ${s} found`;return fn(i)&&void 0===a&&(e+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ct(t.key,u,e)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new ct(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new ct(t.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new ct(t.key,u,`integer expected, found ${l}`)]}}function Jn(t){let e=("property"===t.expressionContext?Cn:Mn)(Zn(t.value),t.valueSpec);if("error"===e.result)return e.value.map(e=>new ct(`${t.key}${e.key}`,t.value,e.message));let r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new ct(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ln(r))return[new ct(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ln(r))return[new ct(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!un(r,["zoom","feature-state"]))return[new ct(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!sn(r))return[new ct(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Kn(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Gn(r))&&i.push(new ct(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Gn(r))&&i.push(new ct(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(t){return Pn(Zn(t.value))?Jn(ht({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ti(t)}function ti(t){let e=t.value,r=t.key;if("array"!==mn(e))return[new ct(r,e,`array expected, ${mn(e)} found`)];let n,i=t.styleSpec,a=[];if(e.length<1)return[new ct(r,e,"filter array must have at least 1 element")];switch(a=a.concat(Kn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Gn(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Gn(e[1])&&a.push(new ct(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&a.push(new ct(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=mn(e[1]),"string"!==n&&a.push(new ct(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let o=2;o<e.length;o++)n=mn(e[o]),"$type"===Gn(e[1])?a=a.concat(Kn({key:`${r}[${o}]`,value:e[o],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new ct(`${r}[${o}]`,e[o],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let n=1;n<e.length;n++)a=a.concat(ti({key:`${r}[${n}]`,value:e[n],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=mn(e[1]),2!==e.length?a.push(new ct(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==n&&a.push(new ct(`${r}[1]`,e[1],`string expected, ${n} found`))}return a}function ei(t,e){let r=t.key,n=t.validateSpec,i=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[`${e}_${t.layerType}`];if(!l)return[];let u=s.match(/^(.*)-transition$/);if("paint"===e&&u&&l[u[1]]&&l[u[1]].transition)return n({key:r,value:o,valueSpec:a.transition,style:i,styleSpec:a});let c,h=t.valueSpec||l[s];if(!h)return[new ct(r,o,`unknown property "${s}"`)];if("string"===mn(o)&&fn(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new ct(r,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];let f=[];return"symbol"===t.layerType&&("text-field"===s&&i&&!i.glyphs&&f.push(new ct(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&gn(Zn(o))&&"identity"===Gn(o.type)&&f.push(new ct(r,o,'"text-font" does not support identity functions'))),f.concat(n({key:t.key,value:o,valueSpec:h,style:i,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:s}))}function ri(t){return ei(t,"paint")}function ni(t){return ei(t,"layout")}function ii(t){let e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new ct(n,r,'either "type" or "ref" is required'));let o=Gn(r.type),s=Gn(r.ref);if(r.id){let a=Gn(r.id);for(let o=0;o<t.arrayIndex;o++){let t=i.layers[o];Gn(t.id)===a&&e.push(new ct(n,r.id,`duplicate layer id "${r.id}", previously used at line ${t.id.__line__}`))}}if("ref"in r){let t;["type","source","source-layer","filter","layout"].forEach(t=>{t in r&&e.push(new ct(n,r[t],`"${t}" is prohibited for ref layers`))}),i.layers.forEach(e=>{Gn(e.id)===s&&(t=e)}),t?t.ref?e.push(new ct(n,r.ref,"ref cannot reference another ref layer")):o=Gn(t.type):e.push(new ct(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){let t=i.sources&&i.sources[r.source],a=t&&Gn(t.type);t?"vector"===a&&"raster"===o?e.push(new ct(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?e.push(new ct(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?e.push(new ct(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?e.push(new ct(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&t.lineMetrics||e.push(new ct(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ct(n,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new ct(n,r.source,`source "${r.source}" not found`))}else e.push(new ct(n,r,'missing required property "source"'));return e=e.concat(Wn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"}),filter:Qn,layout:t=>Wn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ni(ht({layerType:o},t))}}),paint:t=>Wn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ri(ht({layerType:o},t))}})}})),e}function ai(t){let e=t.value,r=t.key,n=mn(e);return"string"!==n?[new ct(r,e,`string expected, ${n} found`)]:[]}let oi={promoteId:function({key:t,value:e}){if("string"===mn(e))return ai({key:t,value:e});{let r=[];for(let n in e)r.push(...ai({key:`${t}.${n}`,value:e[n]}));return r}}};function si(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,a=t.validateSpec;if(!e.type)return[new ct(r,e,'"type" is required')];let o,s=Gn(e.type);switch(s){case"vector":case"raster":return o=Wn({key:r,value:e,valueSpec:n[`source_${s.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:oi,validateSpec:a}),o;case"raster-dem":return o=function(t){var e;let r=null!==(e=t.sourceName)&&void 0!==e?e:"",n=t.value,i=t.styleSpec,a=i.source_raster_dem,o=t.style,s=[],l=mn(n);if(void 0===n)return s;if("object"!==l)return s.push(new ct("source_raster_dem",n,`object expected, ${l} found`)),s;let u="custom"===Gn(n.encoding),c=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let e in n)!u&&c.includes(e)?s.push(new ct(e,n[e],`In "${r}": "${e}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[e]?s=s.concat(t.validateSpec({key:e,value:n[e],valueSpec:a[e],validateSpec:t.validateSpec,style:o,styleSpec:i})):s.push(new ct(e,n[e],`unknown property "${e}"`));return s}({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:a}),o;case"geojson":if(o=Wn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:oi}),e.cluster)for(let t in e.clusterProperties){let[n,i]=e.clusterProperties[t],a="string"==typeof n?[n,["accumulated"],["get",t]]:n;o.push(...Jn({key:`${r}.${t}.map`,value:i,expressionContext:"cluster-map"})),o.push(...Jn({key:`${r}.${t}.reduce`,value:a,expressionContext:"cluster-reduce"}))}return o;case"video":return Wn({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return Wn({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ct(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Kn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function li(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ct("light",e,`object expected, ${o} found`)]),a;for(let o in e){let s=o.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r}):n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ct(o,e[o],`unknown property "${o}"`)])}return a}function ui(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ct("sky",e,`object expected, ${a} found`)];let o=[];for(let a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ct(a,e[a],`unknown property "${a}"`)]);return o}function ci(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,a=[],o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ct("terrain",e,`object expected, ${o} found`)]),a;for(let o in e)a=a.concat(n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ct(o,e[o],`unknown property "${o}"`)]);return a}function hi(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],a=[];for(let o in r)r[o].id&&i.includes(r[o].id)&&e.push(new ct(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&e.push(new ct(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),e=e.concat(Wn({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return ai({key:n,value:r})}let fi={"*":()=>[],array:Yn,boolean:function(t){let e=t.value,r=t.key,n=mn(e);return"boolean"!==n?[new ct(r,e,`boolean expected, ${n} found`)]:[]},number:Xn,color:function(t){let e=t.key,r=t.value,n=mn(r);return"string"!==n?[new ct(e,r,`color expected, ${n} found`)]:Qt.parse(String(r))?[]:[new ct(e,r,`color expected, "${r}" found`)]},constants:Hn,enum:Kn,filter:Qn,function:$n,layer:ii,object:Wn,source:si,light:li,sky:ui,terrain:ci,projection:function(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ct("projection",e,`object expected, ${a} found`)];let o=[];for(let a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ct(a,e[a],`unknown property "${a}"`)]);return o},string:ai,formatted:function(t){return 0===ai(t).length?[]:Jn(t)},resolvedImage:function(t){return 0===ai(t).length?[]:Jn(t)},padding:function(t){let e=t.key,r=t.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ct(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let n={type:"number"},i=[];for(let a=0;a<r.length;a++)i=i.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:n}));return i}return Xn({key:e,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(t){let e=t.key,r=t.value,n=mn(r),i=t.styleSpec;if("array"!==n||r.length<1||r.length%2!=0)return[new ct(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let n=0;n<r.length;n+=2)a=a.concat(Kn({key:`${e}[${n}]`,value:r[n],valueSpec:i.layout_symbol["text-anchor"]})),a=a.concat(Yn({key:`${e}[${n+1}]`,value:r[n+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return a},sprite:hi};function pi(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=pi,r.expression&&gn(Gn(e))?$n(t):r.expression&&An(Zn(e))?Jn(t):r.type&&fi[r.type]?fi[r.type](t):Wn(ht({},t,{valueSpec:r.type?n[r.type]:r}))}function di(t){let e=t.value,r=t.key,n=ai(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new ct(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new ct(r,e,'"glyphs" url must include a "{range}" token'))),n}function mi(t,e=K){let r=[];return r=r.concat(pi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:pi,objectElementValidators:{glyphs:di,"*":()=>[]}})),t.constants&&(r=r.concat(Hn({key:"constants",value:t.constants}))),yi(r)}function gi(t){return function(e){return t(((t,e)=>r(t,i(e)))(((t,e)=>{for(var r in e||(e={}))l.call(e,r)&&c(t,r,e[r]);if(o)for(var r of o(e))u.call(e,r)&&c(t,r,e[r]);return t})({},e),{validateSpec:pi}))}}function yi(t){return[].concat(t).sort((t,e)=>t.line-e.line)}function vi(t){return function(...e){return yi(t.apply(this,e))}}mi.source=vi(gi(si)),mi.sprite=vi(gi(hi)),mi.glyphs=vi(gi(di)),mi.light=vi(gi(li)),mi.sky=vi(gi(ui)),mi.terrain=vi(gi(ci)),mi.layer=vi(gi(ii)),mi.filter=vi(gi(Qn)),mi.paintProperty=vi(gi(ri)),mi.layoutProperty=vi(gi(ni));let xi=mi,_i=xi.light,bi=xi.sky,wi=xi.paintProperty,Ti=xi.layoutProperty;function ki(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new $(new Error(n.message))),r=!0;return r}class Ai{constructor(t,e,r){let n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(let t=0;t<this.d*this.d;t++){let e=i[3+t],r=i[3+t+1];n.push(e===r?null:i.subarray(e,r))}let a=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=e+2*r;for(let t=0;t<this.d*this.d;t++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;let i=r/e*t;this.min=-i,this.max=t+i}insert(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,r,n,i,a){this.cells[i].push(a)}query(t,e,r,n,i){let a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);{let a=[];return this._forEachCell(t,e,r,n,this._queryCell,a,{},i),a}}_queryCell(t,e,r,n,i,a,o,s){let l=this.cells[i];if(null!==l){let i=this.keys,u=this.bboxes;for(let c=0;c<l.length;c++){let h=l[c];if(void 0===o[h]){let l=4*h;(s?s(u[l+0],u[l+1],u[l+2],u[l+3]):t<=u[l+2]&&e<=u[l+3]&&r>=u[l+0]&&n>=u[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(t,e,r,n,i,a,o,s){let l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let f=l;f<=c;f++)for(let l=u;l<=h;l++){let u=this.d*l+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(l),this._convertFromCellCoord(f+1),this._convertFromCellCoord(l+1)))&&i.call(this,t,e,r,n,u,a,o,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,e=3+this.cells.length+1+1,r=0;for(let t=0;t<this.cells.length;t++)r+=this.cells[t].length;let n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let i=e;for(let e=0;e<t.length;e++){let r=t[e];n[3+e]=i,n.set(r,i),i+=r.length}return n[3+t.length]=i,n.set(this.keys,i),i+=this.keys.length,n[3+t.length+1]=i,n.set(this.bboxes,i),i+=this.bboxes.length,n.buffer}static serialize(t,e){let r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}}static deserialize(t){return new Ai(t.buffer)}}let Mi={};function Si(t,e,r={}){if(Mi[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Mi[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}Si("Object",Object),Si("TransferableGridIndex",Ai),Si("Color",Qt),Si("Error",Error),Si("AJAXError",q),Si("ResolvedImage",oe),Si("StylePropertyFunction",In),Si("StyleExpression",kn,{omit:["_evaluator"]}),Si("ZoomDependentExpression",En),Si("ZoomConstantExpression",Sn),Si("CompoundExpression",tn,{omit:["_evaluate"]});for(let t in Qr)Qr[t]._classRegistryKey||Si(`Expression_${t}`,Qr[t]);function Ei(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Ci(t){return t.$name||t.constructor._classRegistryKey}function Ii(t){return!function(t){if(null===t||"object"!=typeof t)return!1;let e=Ci(t);return!(!e||"Object"===e)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Ei(t)||z(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function Li(t,e){if(Ii(t))return(Ei(t)||z(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let r=[];for(let n of t)r.push(Li(n,e));return r}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);let r=Ci(t);if(!r)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!Mi[r])throw new Error(`${r} is not registered.`);let{klass:n}=Mi[r],i=n.serialize?n.serialize(t,e):{};if(n.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let n in t){if(!t.hasOwnProperty(n)||Mi[r].omit.indexOf(n)>=0)continue;let a=t[n];i[n]=Mi[r].shallow.indexOf(n)>=0?a:Li(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Pi(t){if(Ii(t))return t;if(Array.isArray(t))return t.map(Pi);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);let e=Ci(t)||"Object";if(!Mi[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Mi[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let n=Object.create(r.prototype);for(let r of Object.keys(t)){if("$name"===r)continue;let i=t[r];n[r]=Mi[e].shallow.indexOf(r)>=0?i:Pi(i)}return n}class zi{constructor(){this.first=!0}update(t,e){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))}}let Oi=t=>t>=128&&t<=255,Di=t=>t>=6016&&t<=6143,Ri=t=>t>=8192&&t<=8303,Fi=t=>t>=8448&&t<=8527,Bi=t=>t>=8528&&t<=8591,Ni=t=>t>=8960&&t<=9215,ji=t=>t>=9216&&t<=9279,Ui=t=>t>=9280&&t<=9311,Vi=t=>t>=9312&&t<=9471,qi=t=>t>=9632&&t<=9727,Hi=t=>t>=9728&&t<=9983,Gi=t=>t>=11008&&t<=11263,Zi=t=>t>=12272&&t<=12287,Wi=t=>t>=12288&&t<=12351,Yi=t=>t>=12448&&t<=12543,Xi=t=>t>=12688&&t<=12703,$i=t=>t>=12736&&t<=12783,Ji=t=>t>=12800&&t<=13055,Ki=t=>t>=13056&&t<=13311,Qi=t=>t>=19904&&t<=19967,ta=t=>t>=57344&&t<=63743,ea=t=>t>=65040&&t<=65055,ra=t=>t>=65072&&t<=65103,na=t=>t>=65104&&t<=65135,ia=t=>t>=65280&&t<=65519;function aa(t){for(let e of t)if(ha(e.charCodeAt(0)))return!0;return!1}function oa(t){for(let e of t)if(!ua(e.charCodeAt(0)))return!1;return!0}function sa(t){let e=t.map(t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}}).filter(t=>t);return new RegExp(e.join("|"),"u")}let la=sa(["Arab","Dupl","Mong","Ougr","Syrc"]);function ua(t){return!la.test(String.fromCodePoint(t))}let ca=sa(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ha(t){return!(746!==t&&747!==t&&(t<4352||!(ra(t)&&!(t>=65097&&t<=65103)||Ki(t)||$i(t)||!(!Wi(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ji(t)||Zi(t)||Xi(t)||Yi(t)&&12540!==t||!(!ia(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!na(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||ea(t)||Qi(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||ca.test(String.fromCodePoint(t)))))}function fa(t){return!(ha(t)||(e=t,Oi(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Ri(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Fi(e)||Bi(e)||Ni(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||ji(e)&&9251!==e||Ui(e)||Vi(e)||qi(e)||Hi(e)&&!(e>=9754&&e<=9759)||Gi(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Wi(e)||Yi(e)||ta(e)||ra(e)||na(e)||ia(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}let pa=sa(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function da(t){return pa.test(String.fromCodePoint(t))}function ma(t,e){return!(!e&&da(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Di(t))}function ga(t){for(let e of t)if(da(e.charCodeAt(0)))return!0;return!1}let ya=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class va{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zi,this.transition={})}isSupportedScript(t){return function(t,e){for(let r of t)if(!ma(r.charCodeAt(0),e))return!1;return!0}(t,"loaded"===ya.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}}class xa{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(gn(t))return new In(t,e);if(An(t)){let r=Cn(t,e);if("error"===r.result)throw new Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));return r.value}{let r=t;return"color"===e.type&&"string"==typeof t?r=Qt.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)&&(r=ae.parse(t)):r=ne.parse(t),{kind:"constant",evaluate:()=>r}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}}class _a{constructor(t){this.property=t,this.value=new xa(t,void 0)}transitioned(t,e){return new wa(this.property,this.value,e,T({},t.transition,this.transition),t.now)}untransitioned(){return new wa(this.property,this.value,null,{},0)}}class ba{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return S(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _a(this._values[t].property)),this._values[t].value=new xa(this._values[t].property,null===e?void 0:S(e))}getTransition(t){return S(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _a(this._values[t].property)),this._values[t].transition=S(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);void 0!==r&&(t[e]=r);let n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){let r=new Ta(this._properties);for(let n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(t,e._values[n]);return r}untransitioned(){let t=new Ta(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class wa{constructor(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);{let o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}}return i}}class Ta{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){let n=new Ma(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class ka{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return S(this._values[t].value)}setValue(t,e){this._values[t]=new xa(this._values[t].property,null===e?void 0:S(e))}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);void 0!==r&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){let n=new Ma(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class Aa{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)}}class Ma{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Sa{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,r){let n=Re[this.specification.type];return n?n(t,e,r):t}}class Ea{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,r,n){return new Aa(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)}interpolate(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Aa(this,{kind:"constant",value:void 0},t.parameters);let n=Re[this.specification.type];if(n){let i=n(t.value.value,e.value.value,r);return new Aa(this,{kind:"constant",value:i},t.parameters)}return t}evaluate(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)}}class Ca extends Ea{possiblyEvaluate(t,e,r,n){if(void 0===t.value)return new Aa(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){let i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new Aa(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){let r=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Aa(this,{kind:"constant",value:r},e)}return new Aa(this,t.expression,e)}evaluate(t,e,r,n,i,a){if("source"===t.kind){let o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class Ia{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){let i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new va(Math.floor(e.zoom-1),e)),t.expression.evaluate(new va(Math.floor(e.zoom),e)),t.expression.evaluate(new va(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class La{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)}interpolate(){return!1}}class Pa{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let n=this.defaultPropertyValues[e]=new xa(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new _a(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}Si("DataDrivenProperty",Ea),Si("DataConstantProperty",Sa),Si("CrossFadedDataDrivenProperty",Ca),Si("CrossFadedProperty",Ia),Si("ColorRampProperty",La);let za="-transition";class Oa extends J{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new ka(e.layout)),e.paint)){this._transitionablePaint=new ba(e.paint);for(let e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(let e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ma(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,r={}){null!=e&&this._validate(Ti,`layers.${this.id}.layout.${t}`,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(za)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(null!=e&&this._validate(wi,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(za))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let o=this._transitionablePaint._values[t].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(t,a,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),M(t,(t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length))}_validate(t,e,r,n,i={}){return(!i||!1!==i.validate)&&ki(this,t.call(xi,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:K,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof Aa&&fn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}let Da={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ra{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Fa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ba(t,e=1){let r=0,n=0;return{members:t.map(t=>{let i=Da[t.type].BYTES_PER_ELEMENT,a=r=Na(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}}),size:Na(r,Math.max(n,e)),alignment:e}}function Na(t,e){return Math.ceil(t/e)*e}class ja extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t}}ja.prototype.bytesPerElement=4,Si("StructArrayLayout2i4",ja);class Ua extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}Ua.prototype.bytesPerElement=6,Si("StructArrayLayout3i6",Ua);class Va extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){let a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t}}Va.prototype.bytesPerElement=8,Si("StructArrayLayout4i8",Va);class qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}qa.prototype.bytesPerElement=12,Si("StructArrayLayout2i4i12",qa);class Ha extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t}}Ha.prototype.bytesPerElement=8,Si("StructArrayLayout2i4ub8",Ha);class Ga extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t}}Ga.prototype.bytesPerElement=8,Si("StructArrayLayout2f8",Ga);class Za extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l,u)}emplace(t,e,r,n,i,a,o,s,l,u,c){let h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t}}Za.prototype.bytesPerElement=20,Si("StructArrayLayout10ui20",Za);class Wa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,u,c,h){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,u,c,h)}emplace(t,e,r,n,i,a,o,s,l,u,c,h,f){let p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=h,this.int16[p+11]=f,t}}Wa.prototype.bytesPerElement=24,Si("StructArrayLayout4i4ui4i24",Wa);class Ya extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}Ya.prototype.bytesPerElement=12,Si("StructArrayLayout3f12",Ya);class Xa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Xa.prototype.bytesPerElement=4,Si("StructArrayLayout1ul4",Xa);class $a extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l)}emplace(t,e,r,n,i,a,o,s,l,u){let c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[h+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t}}$a.prototype.bytesPerElement=20,Si("StructArrayLayout6i1ul2ui20",$a);class Ja extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}Ja.prototype.bytesPerElement=12,Si("StructArrayLayout2i2i2i12",Ja);class Ka extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)}emplace(t,e,r,n,i,a){let o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t}}Ka.prototype.bytesPerElement=16,Si("StructArrayLayout2f1f2i16",Ka);class Qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=16*t,l=4*t,u=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[u+6]=a,this.int16[u+7]=o,t}}Qa.prototype.bytesPerElement=16,Si("StructArrayLayout2ub2f2i16",Qa);class to extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t}}to.prototype.bytesPerElement=6,Si("StructArrayLayout3ui6",to);class eo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g){let y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g)}emplace(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y){let v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t}}eo.prototype.bytesPerElement=48,Si("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",eo);class ro extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){let E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)}emplace(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){let C=32*t,I=16*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.uint16[C+30]=S,this.uint16[C+31]=E,t}}ro.prototype.bytesPerElement=64,Si("StructArrayLayout8i15ui1ul2f2ui64",ro);class no extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}no.prototype.bytesPerElement=4,Si("StructArrayLayout1f4",no);class io extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.uint16[6*t+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}io.prototype.bytesPerElement=12,Si("StructArrayLayout1ui2f12",io);class ao extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t}}ao.prototype.bytesPerElement=8,Si("StructArrayLayout1ul2ui8",ao);class oo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t}}oo.prototype.bytesPerElement=4,Si("StructArrayLayout2ui4",oo);class so extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}so.prototype.bytesPerElement=2,Si("StructArrayLayout1ui2",so);class lo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){let a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t}}lo.prototype.bytesPerElement=16,Si("StructArrayLayout4f16",lo);class uo extends Ra{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new h(this.anchorPointX,this.anchorPointY)}}uo.prototype.size=20;class co extends $a{get(t){return new uo(this,t)}}Si("CollisionBoxArray",co);class ho extends Ra{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ho.prototype.size=48;class fo extends eo{get(t){return new ho(this,t)}}Si("PlacedSymbolArray",fo);class po extends Ra{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}po.prototype.size=64;class mo extends ro{get(t){return new po(this,t)}}Si("SymbolInstanceArray",mo);class go extends no{getoffsetX(t){return this.float32[1*t+0]}}Si("GlyphOffsetArray",go);class yo extends Ua{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Si("SymbolLineVertexArray",yo);class vo extends Ra{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}vo.prototype.size=12;class xo extends io{get(t){return new vo(this,t)}}Si("TextAnchorOffsetArray",xo);class _o extends Ra{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}_o.prototype.size=8;class bo extends ao{get(t){return new _o(this,t)}}Si("FeatureIndexArray",bo);class wo extends ja{}class To extends ja{}class ko extends ja{}class Ao extends qa{}class Mo extends Ha{}class So extends Ga{}class Eo extends Za{}class Co extends Wa{}class Io extends Ya{}class Lo extends Xa{}class Po extends Ja{}class zo extends Qa{}class Oo extends to{}class Do extends oo{}let Ro=Ba([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fo}=Ro;class Bo{constructor(t=[]){this.segments=t}prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>Bo.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${Bo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>Bo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(let t of this.segments)for(let e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,r,n){return new Bo([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function No(t,e){return 256*(t=b(Math.floor(t),0,255))+b(Math.floor(e),0,255)}Bo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Si("SegmentVector",Bo);let jo=Ba([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Uo={exports:{}},Vo={exports:{}};Vo.exports=function(t,e){var r,n,i,a,o,s,l,u;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var qo=Vo.exports,Ho={exports:{}};Ho.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var Go=qo,Zo=Ho.exports;Uo.exports=Go,Uo.exports.murmur3=Go,Uo.exports.murmur2=Zo;var Wo=n(Uo.exports);class Yo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,r,n){this.ids.push(Xo(t)),this.positions.push(e,r,n)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let e=Xo(t),r=0,n=this.ids.length-1;for(;r<n;){let t=r+n>>1;this.ids[t]>=e?n=t:r=t+1}let i=[];for(;this.ids[r]===e;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(t,e){let r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return $o(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){let e=new Yo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function Xo(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Wo(String(t))}function $o(t,e,r,n){for(;r<n;){let i=t[r+n>>1],a=r-1,o=n+1;for(;;){do{a++}while(t[a]<i);do{o--}while(t[o]>i);if(a>=o)break;Jo(t,a,o),Jo(e,3*a,3*o),Jo(e,3*a+1,3*o+1),Jo(e,3*a+2,3*o+2)}o-r<n-o?($o(t,e,r,o),r=o+1):($o(t,e,o+1,n),n=o)}}function Jo(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}Si("FeaturePositionMap",Yo);class Ko{constructor(t,e){this.gl=t.gl,this.location=e}}class Qo extends Ko{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class ts extends Ko{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class es extends Ko{constructor(t,e){super(t,e),this.current=Qt.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}let rs=new Float32Array(16);function ns(t){return[No(255*t.r,255*t.g),No(255*t.b,255*t.a)]}class is{constructor(t,e,r){this.value=t,this.uniformNames=e.map(t=>`u_${t}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return"color"===this.type?new es(t,e):new Qo(t,e)}}class as{constructor(t,e){this.uniformNames=e.map(t=>`u_${t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,r,n){let i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)}getBinding(t,e,r){return"u_pattern"===r.substr(0,9)?new ts(t,e):new Qo(t,e)}}class os{constructor(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===r?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(t,e,r,n,i){let a=this.paintVertexArray.length,o=this.expression.evaluate(new va(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)}updatePaintArray(t,e,r,n){let i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)}_setPaintValue(t,e,r){if("color"===this.type){let n=ns(r);for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ss{constructor(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map(t=>`u_${t}_t`),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===r?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r,n,i){let a=this.expression.evaluate(new va(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new va(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)}updatePaintArray(t,e,r,n){let i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)}_setPaintValue(t,e,r,n){if("color"===this.type){let i=ns(r),a=ns(n);for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i[0],i[1],a[0],a[1])}else{for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){let r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=b(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)}getBinding(t,e,r){return new Qo(t,e)}}class ls{constructor(t,e,r,n,i,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(t,e,r){let n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r)}updatePaintArray(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)}_setPaintValues(t,e,r,n){if(!n||!r)return;let{min:i,mid:a,max:o}=r,s=n[i],l=n[a],u=n[o];if(s&&l&&u)for(let r=t;r<e;r++)this.zoomInPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],l.pixelRatio,u.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,jo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,jo.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class us{constructor(t,e,r){this.binders={},this._buffers=[];let n=[];for(let i in t.paint._values){if(!r(i))continue;let a=t.paint.get(i);if(!(a instanceof Aa&&fn(a.property.specification)))continue;let o=hs(i,t.type),s=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,c=a.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[i]=h?new as(s.value,o):new is(s.value,o,l),n.push(`/u_${i}`);else if("source"===s.kind||h){let r=fs(i,l,"source");this.binders[i]=h?new ls(s,l,u,e,r,t.id):new os(s,o,l,r),n.push(`/a_${i}`)}else{let t=fs(i,l,"composite");this.binders[i]=new ss(s,o,l,u,e,t),n.push(`/z_${i}`)}}this.cacheKey=n.sort().join("")}getMaxValue(t){let e=this.binders[t];return e instanceof os||e instanceof ss?e.maxValue:0}populatePaintArrays(t,e,r,n,i){for(let a in this.binders){let o=this.binders[a];(o instanceof os||o instanceof ss||o instanceof ls)&&o.populatePaintArray(t,e,r,n,i)}}setConstantPatternPositions(t,e){for(let r in this.binders){let n=this.binders[r];n instanceof as&&n.setConstantPatternPositions(t,e)}}updatePaintArrays(t,e,r,n,i){let a=!1;for(let o in t){let s=e.getPositions(o);for(let e of s){let s=r.feature(e.index);for(let r in this.binders){let l=this.binders[r];if((l instanceof os||l instanceof ss||l instanceof ls)&&!0===l.expression.isStateDependent){let u=n.paint.get(r);l.expression=u.value,l.updatePaintArray(e.start,e.end,s,t[o],i),a=!0}}}}return a}defines(){let t=[];for(let e in this.binders){let r=this.binders[e];(r instanceof is||r instanceof as)&&t.push(...r.uniformNames.map(t=>`#define HAS_UNIFORM_${t}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof os||r instanceof ss)for(let e=0;e<r.paintVertexAttributes.length;e++)t.push(r.paintVertexAttributes[e].name);else if(r instanceof ls)for(let e=0;e<jo.members.length;e++)t.push(jo.members[e].name)}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof is||r instanceof as||r instanceof ss)for(let e of r.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let n in this.binders){let i=this.binders[n];if(i instanceof is||i instanceof as||i instanceof ss)for(let a of i.uniformNames)if(e[a]){let o=i.getBinding(t,e[a],a);r.push({name:a,property:n,binding:o})}}return r}setUniforms(t,e,r,n){for(let{name:t,property:i,binding:a}of e)this.binders[i].setUniform(a,n,r.get(i),t)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof ls){let e=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(r instanceof os||r instanceof ss)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof os||r instanceof ss||r instanceof ls)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof os||e instanceof ss||e instanceof ls)&&e.destroy()}}}class cs{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let n of t)this.programConfigurations[n.id]=new us(n,e,r);this.needsUpload=!1,this._featureMap=new Yo,this._bufferOffset=0}populatePaintArrays(t,e,r,n,i,a){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,n){for(let i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(t,this._featureMap,e,i,n)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}}function hs(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function fs(t,e,r){let n={color:{source:Ga,composite:lo},number:{source:no,composite:Ga}},i={"line-pattern":{source:Eo,composite:Eo},"fill-pattern":{source:Eo,composite:Eo},"fill-extrusion-pattern":{source:Eo,composite:Eo}}[t];return i&&i[r]||n[e][r]}Si("ConstantBinder",is),Si("CrossFadedConstantBinder",as),Si("SourceExpressionBinder",os),Si("CrossFadedCompositeBinder",ls),Si("CompositeExpressionBinder",ss),Si("ProgramConfiguration",us,{omit:["_buffers"]}),Si("ProgramConfigurationSet",cs);let ps,ds,ms=8192,gs=Math.pow(2,14)-1,ys=-gs-1;function vs(t){let e=ms/t.extent,r=t.loadGeometry();for(let t=0;t<r.length;t++){let n=r[t];for(let t=0;t<n.length;t++){let r=n[t],i=Math.round(r.x*e),a=Math.round(r.y*e);r.x=b(i,ys,gs),r.y=b(a,ys,gs),(i<r.x||i>r.x+1||a<r.y||a>r.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function xs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?vs(t):[]}}function _s(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}class bs{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new To,this.indexArray=new Oo,this.segments=new Bo,this.programConfigurations=new cs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,r){let n=this.layers[0],i=[],a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(let{feature:e,id:n,index:s,sourceLayerIndex:l}of t){let t=this.layers[0]._featureFilter.needGeometry,u=xs(e,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),u,r))continue;let c=o?a.evaluate(u,{},r):void 0,h={id:n,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?u.geometry:vs(e),patterns:{},sortKey:c};i.push(h)}o&&i.sort((t,e)=>t.sortKey-e.sortKey);for(let n of i){let{geometry:i,index:a,sourceLayerIndex:o}=n,s=t[a].feature;this.addFeature(n,i,a,r),e.featureIndex.insert(s,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,n){for(let r of e)for(let e of r){let r=e.x,n=e.y;if(r<0||r>=ms||n<0||n>=ms)continue;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=i.vertexLength;_s(this.layoutVertexArray,r,n,-1,-1),_s(this.layoutVertexArray,r,n,1,-1),_s(this.layoutVertexArray,r,n,1,1),_s(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)}}function ws(t,e){for(let r=0;r<t.length;r++)if(Ls(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Ls(t,e[r]))return!0;return!!Ms(t,e)}function Ts(t,e,r){return!!Ls(t,e)||!!Es(e,t,r)}function ks(t,e){if(1===t.length)return Is(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let e=0;e<n.length;e++)if(Ls(t,n[e]))return!0}for(let r=0;r<t.length;r++)if(Is(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Ms(t,e[r]))return!0;return!1}function As(t,e,r){if(t.length>1){if(Ms(t,e))return!0;for(let n=0;n<e.length;n++)if(Es(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(Es(t[n],e,r))return!0;return!1}function Ms(t,e){if(0===t.length||0===e.length)return!1;for(let r=0;r<t.length-1;r++){let n=t[r],i=t[r+1];for(let t=0;t<e.length-1;t++)if(Ss(n,i,e[t],e[t+1]))return!0}return!1}function Ss(t,e,r,n){return I(t,r,n)!==I(e,r,n)&&I(t,e,r)!==I(t,e,n)}function Es(t,e,r){let n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(let r=1;r<e.length;r++)if(Cs(t,e[r-1],e[r])<n)return!0;return!1}function Cs(t,e,r){let n=e.distSqr(r);if(0===n)return t.distSqr(e);let i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Is(t,e){let r,n,i,a=!1;for(let o=0;o<t.length;o++){r=t[o];for(let t=0,o=r.length-1;t<r.length;o=t++)n=r[t],i=r[o],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function Ls(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Ps(t,e,r){let n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;let a=I(t,e,r[0]);return a!==I(t,e,r[1])||a!==I(t,e,r[2])||a!==I(t,e,r[3])}function zs(t,e,r){let n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Os(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ds(t,e,r,n,i){if(!e[0]&&!e[1])return t;let a=h.convert(e)._mult(i);"viewport"===r&&a._rotate(-n);let o=[];for(let e=0;e<t.length;e++)o.push(t[e].sub(a));return o}Si("CircleBucket",bs,{omit:["layers"]});var Rs={get paint(){return ds=ds||new Pa({"circle-radius":new Ea(K.paint_circle["circle-radius"]),"circle-color":new Ea(K.paint_circle["circle-color"]),"circle-blur":new Ea(K.paint_circle["circle-blur"]),"circle-opacity":new Ea(K.paint_circle["circle-opacity"]),"circle-translate":new Sa(K.paint_circle["circle-translate"]),"circle-translate-anchor":new Sa(K.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Sa(K.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Sa(K.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ea(K.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ea(K.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ea(K.paint_circle["circle-stroke-opacity"])})},get layout(){return ps=ps||new Pa({"circle-sort-key":new Ea(K.layout_circle["circle-sort-key"])})}},Fs=1e-6,Bs="undefined"!=typeof Float32Array?Float32Array:Array;function Ns(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function js(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*h+w*m,t[1]=x*i+_*l+b*f+w*g,t[2]=x*a+_*u+b*p+w*y,t[3]=x*o+_*c+b*d+w*v,t[4]=(x=r[4])*n+(_=r[5])*s+(b=r[6])*h+(w=r[7])*m,t[5]=x*i+_*l+b*f+w*g,t[6]=x*a+_*u+b*p+w*y,t[7]=x*o+_*c+b*d+w*v,t[8]=(x=r[8])*n+(_=r[9])*s+(b=r[10])*h+(w=r[11])*m,t[9]=x*i+_*l+b*f+w*g,t[10]=x*a+_*u+b*p+w*y,t[11]=x*o+_*c+b*d+w*v,t[12]=(x=r[12])*n+(_=r[13])*s+(b=r[14])*h+(w=r[15])*m,t[13]=x*i+_*l+b*f+w*g,t[14]=x*a+_*u+b*p+w*y,t[15]=x*o+_*c+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Us,Vs=js;function qs(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Us=new Bs(4),Bs!=Float32Array&&(Us[0]=0,Us[1]=0,Us[2]=0,Us[3]=0);class Hs extends Oa{constructor(t){super(t,Rs)}createBucket(t){return new bs(t)}queryRadius(t){let e=t;return zs("circle-radius",this,e)+zs("circle-stroke-width",this,e)+Os(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o,s){let l=Ds(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:(p=s,l.map(t=>Gs(t,p))),f=c?u*o:u;var p;for(let t of n)for(let e of t){let t=c?e:Gs(e,s),r=f,n=qs([],[e.x,e.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),Ts(h,t,r))return!0}return!1}}function Gs(t,e){let r=qs([],[t.x,t.y,0,1],e);return new h(r[0]/r[3],r[1]/r[3])}class Zs extends bs{}let Ws;Si("HeatmapBucket",Zs,{omit:["layers"]});var Ys={get paint(){return Ws=Ws||new Pa({"heatmap-radius":new Ea(K.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ea(K.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Sa(K.paint_heatmap["heatmap-intensity"]),"heatmap-color":new La(K.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Sa(K.paint_heatmap["heatmap-opacity"])})}};function Xs(t,{width:e,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`)}else i=new Uint8Array(e*r*n);return t.width=e,t.height=r,t.data=i,t}function $s(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=Xs({},{width:e,height:r},n);Js(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}function Js(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let o=t.data,s=e.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){let u=((r.y+l)*t.width+r.x)*a,c=((n.y+l)*e.width+n.x)*a;for(let t=0;t<i.width*a;t++)s[c+t]=o[u+t]}return e}class Ks{constructor(t,e){Xs(this,t,1,e)}resize(t){$s(this,t,1)}clone(){return new Ks({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){Js(t,e,r,n,i,1)}}class Qs{constructor(t,e){Xs(this,t,4,e)}resize(t){$s(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Qs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){Js(t,e,r,n,i,4)}}function tl(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new Qs({width:r,height:n});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);let a=(r,n,a)=>{e[t.evaluationKey]=a;let o=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(t.clips)for(let e=0,i=0;e<n;++e,i+=4*r)for(let n=0,o=0;n<r;n++,o+=4){let s=n/(r-1),{start:l,end:u}=t.clips[e];a(i,o,l*(1-s)+u*s)}else for(let t=0,e=0;t<r;t++,e+=4)a(0,e,t/(r-1));return i}Si("AlphaImage",Ks),Si("RGBAImage",Qs);let el,rl="big-fb";class nl extends Oa{createBucket(t){return new Zs(t)}constructor(t){super(t,Ys),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=tl({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(rl)&&this.heatmapFbos.delete(rl)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}var il={get paint(){return el=el||new Pa({"hillshade-illumination-direction":new Sa(K.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Sa(K.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Sa(K.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Sa(K.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Sa(K.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Sa(K.paint_hillshade["hillshade-accent-color"])})}};class al extends Oa{constructor(t){super(t,il)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}let ol,sl,ll=Ba([{name:"a_pos",components:2,type:"Int16"}],4),{members:ul}=ll;function cl(t,e,r=2){let n,i,a,o=e&&e.length,s=o?e[0]*r:t.length,l=hl(t,0,s,r,!0),u=[];if(!l||l.next===l.prev)return u;if(o&&(l=function(t,e,r,n){let i=[];for(let r=0,a=e.length;r<a;r++){let o=hl(t,e[r]*n,r<a-1?e[r+1]*n:t.length,n,!1);o===o.next&&(o.steiner=!0),i.push(wl(o))}i.sort(vl);for(let t=0;t<i.length;t++)r=xl(i[t],r);return r}(t,e,l,r)),t.length>80*r){n=1/0,i=1/0;let e=-1/0,o=-1/0;for(let a=r;a<s;a+=r){let r=t[a],s=t[a+1];r<n&&(n=r),s<i&&(i=s),r>e&&(e=r),s>o&&(o=s)}a=Math.max(e-n,o-i),a=0!==a?32767/a:0}return pl(l,u,r,n,i,a,0),u}function hl(t,e,r,n,i){let a;if(i===function(t,e,r,n){let i=0;for(let a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,r,n)>0)for(let i=e;i<r;i+=n)a=Pl(i/n|0,t[i],t[i+1],a);else for(let i=r-n;i>=e;i-=n)a=Pl(i/n|0,t[i],t[i+1],a);return a&&Ml(a,a.next)&&(zl(a),a=a.next),a}function fl(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!Ml(n,n.next)&&0!==Al(n.prev,n,n.next))n=n.next;else{if(zl(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function pl(t,e,r,n,i,a,o){if(!t)return;!o&&a&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=bl(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let a=null;for(e=0;i;){e++;let o=i,s=0;for(let t=0;t<r&&(s++,o=o.nextZ,o);t++);let l=r;for(;s>0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(e>1)}(i)}(t,n,i,a);let s=t;for(;t.prev!==t.next;){let l=t.prev,u=t.next;if(a?ml(t,n,i,a):dl(t))e.push(l.i,t.i,u.i),zl(t),t=u.next,s=u.next;else if((t=u)===s){o?1===o?pl(t=gl(fl(t),e),e,r,n,i,a,2):2===o&&yl(t,e,r,n,i,a):pl(fl(t),e,r,n,i,a,1);break}}}function dl(t){let e=t.prev,r=t,n=t.next;if(Al(e,r,n)>=0)return!1;let i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,u=n.y,c=i<a?i<o?i:o:a<o?a:o,h=s<l?s<u?s:u:l<u?l:u,f=i>a?i>o?i:o:a>o?a:o,p=s>l?s>u?s:u:l>u?l:u,d=n.next;for(;d!==e;){if(d.x>=c&&d.x<=f&&d.y>=h&&d.y<=p&&Tl(i,s,a,l,o,u,d.x,d.y)&&Al(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function ml(t,e,r,n){let i=t.prev,a=t,o=t.next;if(Al(i,a,o)>=0)return!1;let s=i.x,l=a.x,u=o.x,c=i.y,h=a.y,f=o.y,p=s<l?s<u?s:u:l<u?l:u,d=c<h?c<f?c:f:h<f?h:f,m=s>l?s>u?s:u:l>u?l:u,g=c>h?c>f?c:f:h>f?h:f,y=bl(p,d,e,r,n),v=bl(m,g,e,r,n),x=t.prevZ,_=t.nextZ;for(;x&&x.z>=y&&_&&_.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&Tl(s,c,l,h,u,f,x.x,x.y)&&Al(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&Tl(s,c,l,h,u,f,_.x,_.y)&&Al(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&Tl(s,c,l,h,u,f,x.x,x.y)&&Al(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=v;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&Tl(s,c,l,h,u,f,_.x,_.y)&&Al(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function gl(t,e){let r=t;do{let n=r.prev,i=r.next.next;!Ml(n,i)&&Sl(n,r,r.next,i)&&Il(n,i)&&Il(i,n)&&(e.push(n.i,r.i,i.i),zl(r),zl(r.next),r=t=i),r=r.next}while(r!==t);return fl(r)}function yl(t,e,r,n,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&kl(o,t)){let s=Ll(o,t);return o=fl(o,o.next),s=fl(s,s.next),pl(o,e,r,n,i,a,0),void pl(s,e,r,n,i,a,0)}t=t.next}o=o.next}while(o!==t)}function vl(t,e){return t.x-e.x}function xl(t,e){let r=function(t,e){let r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){let t=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>o&&(o=t,r=n.x<n.next.x?n:n.next,t===i))return r}n=n.next}while(n!==e);if(!r)return null;let s=r,l=r.x,u=r.y,c=1/0;n=r;do{if(i>=n.x&&n.x>=l&&i!==n.x&&Tl(a<u?i:o,a,l,u,a<u?o:i,a,n.x,n.y)){let e=Math.abs(a-n.y)/(i-n.x);Il(n,t)&&(e<c||e===c&&(n.x>r.x||n.x===r.x&&_l(r,n)))&&(r=n,c=e)}n=n.next}while(n!==s);return r}(t,e);if(!r)return e;let n=Ll(r,t);return fl(n,n.next),fl(r,r.next)}function _l(t,e){return Al(t.prev,t,e.prev)<0&&Al(e.next,t,t.next)<0}function bl(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wl(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Tl(t,e,r,n,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function kl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Sl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Il(t,e)&&Il(e,t)&&function(t,e){let r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Al(t.prev,t,e.prev)||Al(t,e.prev,e))||Ml(t,e)&&Al(t.prev,t,t.next)>0&&Al(e.prev,e,e.next)>0)}function Al(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ml(t,e){return t.x===e.x&&t.y===e.y}function Sl(t,e,r,n){let i=Cl(Al(t,e,r)),a=Cl(Al(t,e,n)),o=Cl(Al(r,n,t)),s=Cl(Al(r,n,e));return i!==a&&o!==s||!(0!==i||!El(t,r,e))||!(0!==a||!El(t,n,e))||!(0!==o||!El(r,t,n))||!(0!==s||!El(r,e,n))}function El(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Cl(t){return t>0?1:t<0?-1:0}function Il(t,e){return Al(t.prev,t,t.next)<0?Al(t,e,t.next)>=0&&Al(t,t.prev,e)>=0:Al(t,e,t.prev)<0||Al(t,t.next,e)<0}function Ll(t,e){let r=Ol(t.i,t.x,t.y),n=Ol(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Pl(t,e,r,n){let i=Ol(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function zl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ol(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Dl(t,e,r){let n=r.patternDependencies,i=!1;for(let r of e){let e=r.paint.get(`${t}-pattern`);e.isConstant()||(i=!0);let a=e.constantOr(null);a&&(i=!0,n[a.to]=!0,n[a.from]=!0)}return i}function Rl(t,e,r,n,i){let a=i.patternDependencies;for(let o of e){let e=o.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n-1},r,{},i.availableImages),s=e.evaluate({zoom:n},r,{},i.availableImages),l=e.evaluate({zoom:n+1},r,{},i.availableImages);t=t&&t.name?t.name:t,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[t]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:t,mid:s,max:l}}}return r}class Fl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ko,this.indexArray=new Oo,this.indexArray2=new Do,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new Bo,this.segments2=new Bo,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,r){this.hasPattern=Dl("fill",this.layers,e);let n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(let{feature:o,id:s,index:l,sourceLayerIndex:u}of t){let t=this.layers[0]._featureFilter.needGeometry,c=xs(o,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),c,r))continue;let h=i?n.evaluate(c,{},r,e.availableImages):void 0,f={id:s,properties:o.properties,type:o.type,sourceLayerIndex:u,index:l,geometry:t?c.geometry:vs(o),patterns:{},sortKey:h};a.push(f)}i&&a.sort((t,e)=>t.sortKey-e.sortKey);for(let n of a){let{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){let t=Rl("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(let t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ul),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,n,i){for(let t of kr(e,500)){let e=0;for(let r of t)e+=r.length;let r=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],a=[];for(let e of t){if(0===e.length)continue;e!==t[0]&&a.push(i.length/2);let r=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),i.push(e[0].x),i.push(e[0].y);for(let t=1;t<e.length;t++)this.layoutVertexArray.emplaceBack(e[t].x,e[t].y),this.indexArray2.emplaceBack(n+t-1,n+t),i.push(e[t].x),i.push(e[t].y);r.vertexLength+=e.length,r.primitiveLength+=e.length}let o=cl(i,a);for(let t=0;t<o.length;t+=3)this.indexArray.emplaceBack(n+o[t],n+o[t+1],n+o[t+2]);r.vertexLength+=e,r.primitiveLength+=o.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}}Si("FillBucket",Fl,{omit:["layers","patternFeatures"]});var Bl={get paint(){return sl=sl||new Pa({"fill-antialias":new Sa(K.paint_fill["fill-antialias"]),"fill-opacity":new Ea(K.paint_fill["fill-opacity"]),"fill-color":new Ea(K.paint_fill["fill-color"]),"fill-outline-color":new Ea(K.paint_fill["fill-outline-color"]),"fill-translate":new Sa(K.paint_fill["fill-translate"]),"fill-translate-anchor":new Sa(K.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ca(K.paint_fill["fill-pattern"])})},get layout(){return ol=ol||new Pa({"fill-sort-key":new Ea(K.layout_fill["fill-sort-key"])})}};class Nl extends Oa{constructor(t){super(t,Bl)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Fl(t)}queryRadius(){return Os(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){return ks(Ds(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)}isTileClipped(){return!0}}let jl=Ba([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ul=Ba([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Vl}=jl;var ql={},Hl=a,Gl=Zl;function Zl(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(Wl,this,e)}function Wl(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Yl(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)n+=((r=t[o]).x-(e=t[i]).x)*(e.y+r.y);return n}Zl.types=["Unknown","Point","LineString","Polygon"],Zl.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=[];t.pos<r;){if(i<=0){var l=t.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new Hl(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},Zl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},Zl.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=Zl.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=Yl(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)c(l[n][i])}1===l.length?l=l[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Xl=Gl,$l=Jl;function Jl(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Kl,this,e),this.length=this._features.length}function Kl(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}Jl.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Xl(this._pbf,e,this.extent,this._keys,this._values)};var Ql=$l;function tu(t,e,r){if(3===t){var n=new Ql(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ql.VectorTile=function(t,e){this.layers=t.readFields(tu,{},e)},ql.VectorTileFeature=Gl,ql.VectorTileLayer=$l;let eu,ru=ql.VectorTileFeature.types,nu=Math.pow(2,13);function iu(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*nu)+o,i*nu*2,a*nu*2,Math.round(s))}class au{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ao,this.centroidVertexArray=new wo,this.indexArray=new Oo,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new Bo,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,r){this.features=[],this.hasPattern=Dl("fill-extrusion",this.layers,e);for(let{feature:n,id:i,index:a,sourceLayerIndex:o}of t){let t=this.layers[0]._featureFilter.needGeometry,s=xs(n,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),s,r))continue;let l={id:i,sourceLayerIndex:o,index:a,geometry:t?s.geometry:vs(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(Rl("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,a,r,{}),e.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(t,e,r){for(let t of this.features){let{geometry:n}=t;this.addFeature(t,n,t.index,e,r)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vl),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Ul.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,n,i){for(let r of kr(e,500)){let e={x:0,y:0,vertexCount:0},n=0;for(let t of r)n+=t.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let t of r){if(0===t.length||su(t))continue;let r=0;for(let n=0;n<t.length;n++){let a=t[n];if(n>=1){let o=t[n-1];if(!ou(a,o)){i.vertexLength+4>Bo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let t=a.sub(o)._perp()._unit(),n=o.dist(a);r+n>32768&&(r=0),iu(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,r),iu(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,1,r),e.x+=2*a.x,e.y+=2*a.y,e.vertexCount+=2,r+=n,iu(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,0,r),iu(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,1,r),e.x+=2*o.x,e.y+=2*o.y,e.vertexCount+=2;let s=i.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+n>Bo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(n,this.layoutVertexArray,this.indexArray)),"Polygon"!==ru[t.type])continue;let a=[],o=[],s=i.vertexLength;for(let t of r)if(0!==t.length){t!==r[0]&&o.push(a.length/2);for(let r=0;r<t.length;r++){let n=t[r];iu(this.layoutVertexArray,n.x,n.y,0,0,1,1,0),e.x+=n.x,e.y+=n.y,e.vertexCount+=1,a.push(n.x),a.push(n.y)}}let l=cl(a,o);for(let t=0;t<l.length;t+=3)this.indexArray.emplaceBack(s+l[t],s+l[t+2],s+l[t+1]);i.primitiveLength+=l.length/3,i.vertexLength+=n;for(let t=0;t<e.vertexCount;t++){let t=Math.floor(e.x/e.vertexCount),r=Math.floor(e.y/e.vertexCount);this.centroidVertexArray.emplaceBack(t,r)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}}function ou(t,e){return t.x===e.x&&(t.x<0||t.x>ms)||t.y===e.y&&(t.y<0||t.y>ms)}function su(t){return t.every(t=>t.x<0)||t.every(t=>t.x>ms)||t.every(t=>t.y<0)||t.every(t=>t.y>ms)}Si("FillExtrusionBucket",au,{omit:["layers","features"]});var lu={get paint(){return eu=eu||new Pa({"fill-extrusion-opacity":new Sa(K["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ea(K["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Sa(K["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Sa(K["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ca(K["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ea(K["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ea(K["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Sa(K["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class uu extends Oa{constructor(t){super(t,lu)}createBucket(t){return new au(t)}queryRadius(){return Os(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,r,n,i,a,o,s){let l=Ds(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),u=this.paint.get("fill-extrusion-height").evaluate(e,r),c=this.paint.get("fill-extrusion-base").evaluate(e,r),f=function(t,e){let r=[];for(let n of t){let t=[n.x,n.y,0,1];qs(t,t,e),r.push(new h(t[0]/t[3],t[1]/t[3]))}return r}(l,s),p=function(t,e,r,n){let i=[],a=[],o=n[8]*e,s=n[9]*e,l=n[10]*e,u=n[11]*e,c=n[8]*r,f=n[9]*r,p=n[10]*r,d=n[11]*r;for(let e of t){let t=[],r=[];for(let i of e){let e=i.x,a=i.y,m=n[0]*e+n[4]*a+n[12],g=n[1]*e+n[5]*a+n[13],y=n[2]*e+n[6]*a+n[14],v=n[3]*e+n[7]*a+n[15],x=y+l,_=v+u,b=m+c,w=g+f,T=y+p,k=v+d,A=new h((m+o)/_,(g+s)/_);A.z=x/_,t.push(A);let M=new h(b/k,w/k);M.z=T/k,r.push(M)}i.push(t),a.push(r)}return[i,a]}(n,c,u,s);return function(t,e,r){let n=1/0;ks(r,e)&&(n=hu(r,e[0]));for(let i=0;i<e.length;i++){let a=e[i],o=t[i];for(let t=0;t<a.length-1;t++){let e=a[t],i=[e,a[t+1],o[t+1],o[t],e];ws(r,i)&&(n=Math.min(n,hu(r,i)))}}return n!==1/0&&n}(p[0],p[1],f)}}function cu(t,e){return t.x*e.x+t.y*e.y}function hu(t,e){if(1===t.length){let r,n=0,i=e[n++];for(;!r||i.equals(r);)if(r=e[n++],!r)return 1/0;for(;n<e.length;n++){let a=e[n],o=t[0],s=r.sub(i),l=a.sub(i),u=o.sub(i),c=cu(s,s),h=cu(s,l),f=cu(l,l),p=cu(u,s),d=cu(u,l),m=c*f-h*h,g=(f*p-h*d)/m,y=(c*d-h*p)/m,v=i.z*(1-g-y)+r.z*g+a.z*y;if(isFinite(v))return v}return 1/0}{let t=1/0;for(let r of e)t=Math.min(t,r.z);return t}}let fu,pu,du=Ba([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:mu}=du,gu=Ba([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:yu}=gu,vu=ql.VectorTileFeature.types,xu=Math.cos(Math.PI/180*37.5),_u=Math.pow(2,14)/.5;class bu{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(t=>{this.gradients[t.id]={}}),this.layoutVertexArray=new Mo,this.layoutVertexArray2=new So,this.indexArray=new Oo,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new Bo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,r){this.hasPattern=Dl("line",this.layers,e);let n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(let{feature:e,id:o,index:s,sourceLayerIndex:l}of t){let t=this.layers[0]._featureFilter.needGeometry,u=xs(e,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),u,r))continue;let c=i?n.evaluate(u,{},r):void 0,h={id:o,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?u.geometry:vs(e),patterns:{},sortKey:c};a.push(h)}i&&a.sort((t,e)=>t.sortKey-e.sortKey);for(let n of a){let{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){let t=Rl("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(let t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,yu)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,mu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,r,n,i){let a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(let r of e)this.addLine(r,t,o,s,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}addLine(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let o="Polygon"===vu[e.type],s=t.length;for(;s>=2&&t[s-1].equals(t[s-2]);)s--;let l=0;for(;l<s-1&&t[l].equals(t[l+1]);)l++;if(s<(o?3:2))return;"bevel"===r&&(i=1.05);let u,c,h,f,p,d=this.overscaling<=16?15*ms/(512*this.overscaling):0,m=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,o&&(u=t[s-2],p=t[l].sub(u)._unit()._perp());for(let e=l;e<s;e++){if(h=e===s-1?o?t[l+1]:void 0:t[e+1],h&&t[e].equals(h))continue;p&&(f=p),u&&(c=u),u=t[e],p=h?h.sub(u)._unit()._perp():f,f=f||p;let g=f.add(p);0===g.x&&0===g.y||g._unit();let y=f.x*p.x+f.y*p.y,v=g.x*p.x+g.y*p.y,x=0!==v?1/v:1/0,_=2*Math.sqrt(2-2*v),b=v<xu&&c&&h,w=f.x*p.y-f.y*p.x>0;if(b&&e>l){let t=u.dist(c);if(t>2*d){let e=u.sub(u.sub(c)._mult(d/t)._round());this.updateDistance(c,e),this.addCurrentVertex(e,f,0,0,m),c=e}}let T=c&&h,k=T?r:o?"butt":n;if(T&&"round"===k&&(x<a?k="miter":x<=2&&(k="fakeround")),"miter"===k&&x>i&&(k="bevel"),"bevel"===k&&(x>2&&(k="flipbevel"),x<i&&(k="miter")),c&&this.updateDistance(c,u),"miter"===k)g._mult(x),this.addCurrentVertex(u,g,0,0,m);else if("flipbevel"===k){if(x>100)g=p.mult(-1);else{let t=x*f.add(p).mag()/f.sub(p).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(u,g,0,0,m),this.addCurrentVertex(u,g.mult(-1),0,0,m)}else if("bevel"===k||"fakeround"===k){let t=-Math.sqrt(x*x-1),e=w?t:0,r=w?0:t;if(c&&this.addCurrentVertex(u,f,e,r,m),"fakeround"===k){let t=Math.round(180*_/Math.PI/20);for(let e=1;e<t;e++){let r=e/t;if(.5!==r){let t=r-.5;r+=r*t*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*t*t+(.848013+y*(.215638*y-1.06021)))}let n=p.sub(f)._mult(r)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(u,n.x,n.y,!1,w,0,m)}}h&&this.addCurrentVertex(u,p,-e,-r,m)}else if("butt"===k)this.addCurrentVertex(u,g,0,0,m);else if("square"===k){let t=c?1:-1;this.addCurrentVertex(u,g,t,t,m)}else"round"===k&&(c&&(this.addCurrentVertex(u,f,0,0,m),this.addCurrentVertex(u,f,1,1,m,!0)),h&&(this.addCurrentVertex(u,p,-1,-1,m,!0),this.addCurrentVertex(u,p,0,0,m)));if(b&&e<s-1){let t=u.dist(h);if(t>2*d){let e=u.add(h.sub(u)._mult(d/t)._round());this.updateDistance(u,e),this.addCurrentVertex(e,p,0,0,m),u=e}}}}addCurrentVertex(t,e,r,n,i,a=!1){let o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>_u/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,n,i,a))}addHalfVertex({x:t,y:e},r,n,i,a,o,s){let l=.5*(this.lineClips?this.scaledDistance*(_u-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(i?1:0),(e<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let u=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),s.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}Si("LineBucket",bu,{omit:["layers","patternFeatures"]});var wu={get paint(){return pu=pu||new Pa({"line-opacity":new Ea(K.paint_line["line-opacity"]),"line-color":new Ea(K.paint_line["line-color"]),"line-translate":new Sa(K.paint_line["line-translate"]),"line-translate-anchor":new Sa(K.paint_line["line-translate-anchor"]),"line-width":new Ea(K.paint_line["line-width"]),"line-gap-width":new Ea(K.paint_line["line-gap-width"]),"line-offset":new Ea(K.paint_line["line-offset"]),"line-blur":new Ea(K.paint_line["line-blur"]),"line-dasharray":new Ia(K.paint_line["line-dasharray"]),"line-pattern":new Ca(K.paint_line["line-pattern"]),"line-gradient":new La(K.paint_line["line-gradient"])})},get layout(){return fu=fu||new Pa({"line-cap":new Sa(K.layout_line["line-cap"]),"line-join":new Ea(K.layout_line["line-join"]),"line-miter-limit":new Sa(K.layout_line["line-miter-limit"]),"line-round-limit":new Sa(K.layout_line["line-round-limit"]),"line-sort-key":new Ea(K.layout_line["line-sort-key"])})}};class Tu extends Ea{possiblyEvaluate(t,e){return e=new va(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,n){return e=T({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,n)}}let ku;class Au extends Oa{constructor(t){super(t,wu),this.gradientVersion=0,ku||(ku=new Tu(wu.paint.properties["line-width"].specification),ku.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){let t=this.gradientExpression();this.stepInterpolant=!(void 0===t._styleExpression)&&t._styleExpression.expression instanceof Ce,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=ku.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new bu(t)}queryRadius(t){let e=t,r=Mu(zs("line-width",this,e),zs("line-gap-width",this,e)),n=zs("line-offset",this,e);return r/2+Math.abs(n)+Os(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){let s=Ds(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Mu(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],a=[];for(let t=0;t<i.length;t++){let r=i[t-1],n=i[t],o=i[t+1],s=0===t?new h(0,0):n.sub(r)._unit()._perp(),l=t===i.length-1?new h(0,0):o.sub(n)._unit()._perp(),u=s._add(l)._unit(),c=u.x*l.x+u.y*l.y;0!==c&&u._mult(1/c),a.push(u._mult(e)._add(n))}r.push(a)}return r}(n,u*o)),function(t,e,r){for(let n=0;n<e.length;n++){let i=e[n];if(t.length>=3)for(let e=0;e<i.length;e++)if(Ls(t,i[e]))return!0;if(As(t,i,r))return!0}return!1}(s,n,l)}isTileClipped(){return!0}}function Mu(t,e){return e>0?e+2*t:t}let Su=Ba([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Eu=Ba([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ba([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let Cu=Ba([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ba([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let Iu=Ba([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Lu=Ba([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Pu(t,e,r){return t.sections.forEach(t=>{t.text=function(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ya.applyArabicShaping&&(t=ya.applyArabicShaping(t)),t}(t.text,e,r)}),t}Ba([{name:"triangle",components:3,type:"Uint16"}]),Ba([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ba([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Ba([{type:"Float32",name:"offsetX"}]),Ba([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ba([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let zu={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ou=24,Du=Bu,Ru=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=i-1,f=t[e+h];for(h+=-1,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=-1,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=-1,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=u}return(f?-1:1)*o*Math.pow(2,a-n)},Fu=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=0,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=1,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+p]=255&o,p+=1,o/=256,u-=8);t[r+p-1]|=128*d};function Bu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Bu.Varint=0,Bu.Fixed64=1,Bu.Bytes=2,Bu.Fixed32=5;var Nu=4294967296,ju=1/Nu,Uu="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function Vu(t){return t.type===Bu.Bytes?t.readVarint()+t.pos:t.pos+1}function qu(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Hu(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Gu(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Zu(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Wu(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Yu(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Xu(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function $u(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Ju(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Ku(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Qu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function tc(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function ec(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Bu.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Qu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ec(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Qu(this.buf,this.pos)+Qu(this.buf,this.pos+4)*Nu;return this.pos+=8,t},readSFixed64:function(){var t=Qu(this.buf,this.pos)+ec(this.buf,this.pos+4)*Nu;return this.pos+=8,t},readFloat:function(){var t=Ru(this.buf,this.pos,0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ru(this.buf,this.pos,0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128||(n|=(127&(i=a[r.pos++]))<<3,i<128)||(n|=(127&(i=a[r.pos++]))<<10,i<128)||(n|=(127&(i=a[r.pos++]))<<17,i<128)||(n|=(127&(i=a[r.pos++]))<<24,i<128)||(n|=(1&(i=a[r.pos++]))<<31,i<128))return function(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[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!!this.readVarint()},readString:function(){var t,e,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&Uu?(t=this.buf,e=i,r=n,Uu.decode(t.subarray(e,r))):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=t[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(this.buf,i,n)},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!==Bu.Bytes)return t.push(this.readVarint(e));var r=Vu(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Bu.Bytes)return t.push(this.readSVarint());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Bu.Bytes)return t.push(this.readBoolean());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Bu.Bytes)return t.push(this.readFloat());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Bu.Bytes)return t.push(this.readDouble());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Bu.Bytes)return t.push(this.readFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Bu.Bytes)return t.push(this.readSFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Bu.Bytes)return t.push(this.readFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Bu.Bytes)return t.push(this.readSFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Bu.Varint)for(;this.buf[this.pos++]>127;);else if(e===Bu.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Bu.Fixed32)this.pos+=4;else{if(e!==Bu.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 r=new Uint8Array(e);r.set(this.buf),this.buf=r,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),tc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),tc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),tc(this.buf,-1&t,this.pos),tc(this.buf,Math.floor(t*ju),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),tc(this.buf,-1&t,this.pos),tc(this.buf,Math.floor(t*ju),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n,i,a;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),i=r,(a=e).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((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)))))}(n,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(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&qu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Fu(this.buf,t,this.pos,0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Fu(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 r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&qu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Bu.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Hu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Gu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Yu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Zu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Wu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Xu,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,$u,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ju,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Ku,e)},writeBytesField:function(t,e){this.writeTag(t,Bu.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Bu.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Bu.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Bu.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Bu.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Bu.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Bu.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Bu.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Bu.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Bu.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var rc,nc=n(Du);function ic(t,e,r){1===t&&r.readMessage(ac,e)}function ac(t,e,r){if(3===t){let{id:t,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(oc,{});e.push({id:t,bitmap:new Ks({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function oc(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function sc(t){let e=0,r=0;for(let n of t)e+=n.w*n.h,r=Math.max(r,n.w);t.sort((t,e)=>e.h-t.h);let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],i=0,a=0;for(let e of t)for(let t=n.length-1;t>=0;t--){let r=n[t];if(!(e.w>r.w||e.h>r.h)){if(e.x=r.x,e.y=r.y,a=Math.max(a,e.y+e.h),i=Math.max(i,e.x+e.w),e.w===r.w&&e.h===r.h){let e=n.pop();t<n.length&&(n[t]=e)}else e.h===r.h?(r.x+=e.w,r.w-=e.w):e.w===r.w?(r.y+=e.h,r.h-=e.h):(n.push({x:r.x+e.w,y:r.y,w:r.w-e.w,h:e.h}),r.y+=e.h,r.h-=e.h);break}}return{w:i,h:a,fill:e/(i*a)||0}}class lc{constructor(t,{pixelRatio:e,version:r,stretchX:n,stretchY:i,content:a,textFitWidth:o,textFitHeight:s}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=i,this.content=a,this.version=r,this.textFitWidth=o,this.textFitHeight=s}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class uc{constructor(t,e){let r={},n={};this.haveRenderCallbacks=[];let i=[];this.addImages(t,r,i),this.addImages(e,n,i);let{w:a,h:o}=sc(i),s=new Qs({width:a||1,height:o||1});for(let e in t){let n=t[e],i=r[e].paddedRect;Qs.copy(n.data,s,{x:0,y:0},{x:i.x+1,y:i.y+1},n.data)}for(let t in e){let r=e[t],i=n[t].paddedRect,a=i.x+1,o=i.y+1,l=r.data.width,u=r.data.height;Qs.copy(r.data,s,{x:0,y:0},{x:a,y:o},r.data),Qs.copy(r.data,s,{x:0,y:u-1},{x:a,y:o-1},{width:l,height:1}),Qs.copy(r.data,s,{x:0,y:0},{x:a,y:o+u},{width:l,height:1}),Qs.copy(r.data,s,{x:l-1,y:0},{x:a-1,y:o},{width:1,height:u}),Qs.copy(r.data,s,{x:0,y:0},{x:a+l,y:o},{width:1,height:u})}this.image=s,this.iconPositions=r,this.patternPositions=n}addImages(t,e,r){for(let n in t){let i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new lc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let r in t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)}patchUpdatedImage(t,e,r){if(!t||!e||t.version===e.version)return;t.version=e.version;let[n,i]=t.tl;r.update(e.data,void 0,{x:n,y:i})}}Si("ImagePosition",lc),Si("ImageAtlas",uc),t.ah=void 0,(rc=t.ah||(t.ah={}))[rc.none=0]="none",rc[rc.horizontal=1]="horizontal",rc[rc.vertical=2]="vertical",rc[rc.horizontalOnly=3]="horizontalOnly";let cc=-17;class hc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){let r=new hc;return r.scale=t||1,r.fontStack=e,r}static forImage(t){let e=new hc;return e.imageName=t,e}}class fc{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){let r=new fc;for(let n=0;n<t.sections.length;n++){let i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&fa(n)&&!zu[t[r+1]]||i&&fa(i)&&!zu[t[r-1]]||!zu[t[r]]?t[r]:zu[t[r]]}return e}(this.text)}trim(){let t=0;for(let e=0;e<this.text.length&&dc[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let r=this.text.length-1;r>=0&&r>=t&&dc[this.text.charCodeAt(r)];r--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){let r=new fc;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,e)=>Math.max(t,this.sections[e].scale),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(hc.forText(t.scale,t.fontStack||e));let r=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(r)}addImageSection(t){let e=t.image?t.image.name:"";if(0===e.length)return void C("Can't add FormattedSection with an empty image.");let r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(hc.forImage(e)),this.sectionIndex.push(this.sections.length-1)):C("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function pc(e,r,n,i,a,o,s,l,u,c,h,f,p,d,m){let g,y=fc.fromFeature(e,a);f===t.ah.vertical&&y.verticalizePunctuation();let{processBidirectionalText:v,processStyledBidirectionalText:x}=ya;if(v&&1===y.sections.length){g=[];let t=v(y.toString(),wc(y,c,o,r,i,d));for(let e of t){let t=new fc;t.text=e,t.sections=y.sections;for(let r=0;r<e.length;r++)t.sectionIndex.push(0);g.push(t)}}else if(x){g=[];let t=x(y.text,y.sectionIndex,wc(y,c,o,r,i,d));for(let e of t){let t=new fc;t.text=e[0],t.sectionIndex=e[1],t.sections=y.sections,g.push(t)}}else g=function(t,e){let r=[],n=t.text,i=0;for(let n of e)r.push(t.substring(i,n)),i=n;return i<n.length&&r.push(t.substring(i,n.length)),r}(y,wc(y,c,o,r,i,d));let _=[],b={positionedLines:_,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:f,iconsInText:!1,verticalizable:!1};return function(e,r,n,i,a,o,s,l,u,c,h,f){let p=0,d=cc,m=0,g=0,y="right"===l?1:"left"===l?0:.5,v=0;for(let s of a){s.trim();let a=s.getMaxScale(),l=(a-1)*Ou,_={positionedGlyphs:[],lineOffset:0};e.positionedLines[v]=_;let b=_.positionedGlyphs,w=0;if(!s.length()){d+=o,++v;continue}for(let o=0;o<s.length();o++){let m=s.getSection(o),g=s.getSectionIndex(o),y=s.getCharCode(o),v=0,_=null,T=null,k=null,A=Ou,M=!(u===t.ah.horizontal||!h&&!ha(y)||h&&(dc[y]||(x=y,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(x)))));if(m.imageName){let t=i[m.imageName];if(!t)continue;k=m.imageName,e.iconsInText=e.iconsInText||!0,T=t.paddedRect;let r=t.displaySize;m.scale=m.scale*Ou/f,_={width:r[0],height:r[1],left:1,top:-3,advance:M?r[1]:r[0]},v=l+(Ou-r[1]*m.scale),A=_.advance;let n=M?r[0]*m.scale-Ou*a:r[1]*m.scale-Ou*a;n>0&&n>w&&(w=n)}else{let t=n[m.fontStack],e=t&&t[y];if(e&&e.rect)T=e.rect,_=e.metrics;else{let t=r[m.fontStack],e=t&&t[y];if(!e)continue;_=e.metrics}v=(a-m.scale)*Ou}M?(e.verticalizable=!0,b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=A*m.scale+c):(b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=_.advance*m.scale+c)}0!==b.length&&(m=Math.max(p-c,m),kc(b,0,b.length-1,y,w)),p=0;let T=o*a+w;_.lineOffset=Math.max(w,l),d+=T,g=Math.max(T,g),++v}var x;let _=d-cc,{horizontalAlign:b,verticalAlign:w}=Tc(s);(function(t,e,r,n,i,a,o,s,l){let u=(e-r)*i,c=0;c=a!==o?-s*n-cc:(-n*l+.5)*o;for(let e of t)for(let t of e.positionedGlyphs)t.x+=u,t.y+=c})(e.positionedLines,y,b,w,m,g,o,_,a.length),e.top+=-w*_,e.bottom=e.top+_,e.left+=-b*m,e.right=e.left+m}(b,r,n,i,g,s,l,u,f,c,p,m),!function(t){for(let e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(_)&&b}let dc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},mc={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},gc={40:!0};function yc(t,e,r,n,i,a){if(e.imageName){let t=n[e.imageName];return t?t.displaySize[0]*e.scale*Ou/a+i:0}{let n=r[e.fontStack],a=n&&n[t];return a?a.metrics.advance*e.scale+i:0}}function vc(t,e,r,n){let i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function xc(t,e,r){let n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function _c(t,e,r,n,i,a){let o=null,s=vc(e,r,i,a);for(let t of n){let n=vc(e-t.x,r,i,a)+t.badness;n<=s&&(o=t,s=n)}return{index:t,x:e,priorBreak:o,badness:s}}function bc(t){return t?bc(t.priorBreak).concat(t.index):[]}function wc(t,e,r,n,i,a){if(!t)return[];let o=[],s=function(t,e,r,n,i,a){let o=0;for(let r=0;r<t.length();r++){let s=t.getSection(r);o+=yc(t.getCharCode(r),s,n,i,e,a)}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,a),l=t.text.indexOf("")>=0,u=0;for(let r=0;r<t.length();r++){let h=t.getSection(r),f=t.getCharCode(r);if(dc[f]||(u+=yc(f,h,n,i,e,a)),r<t.length()-1){let e=!((c=f)<11904)&&(!!ra(c)||!!Ki(c)||!!$i(c)||!!Wi(c)||!!Ji(c)||!!ia(c)||!!Zi(c)||!!ea(c)||ca.test(String.fromCodePoint(c)));(mc[f]||e||h.imageName||r!==t.length()-2&&gc[t.getCharCode(r+1)])&&o.push(_c(r+1,u,s,o,xc(f,t.getCharCode(r+1),e&&l),!1))}}var c;return bc(_c(t.length(),u,s,o,0,!0))}function Tc(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function kc(t,e,r,n,i){if(!n&&!i)return;let a=t[r],o=(t[r].x+a.metrics.advance*a.scale)*n;for(let n=e;n<=r;n++)t[n].x-=o,t[n].y+=i}function Ac(t,e,r){let{horizontalAlign:n,verticalAlign:i}=Tc(r),a=e[0]-t.displaySize[0]*n,o=e[1]-t.displaySize[1]*i;return{image:t,top:o,bottom:o+t.displaySize[1],left:a,right:a+t.displaySize[0]}}function Mc(t){var e,r;let n=t.left,i=t.top,a=t.right-n,o=t.bottom-i,s=null!==(e=t.image.textFitWidth)&&void 0!==e?e:"stretchOrShrink",l=null!==(r=t.image.textFitHeight)&&void 0!==r?r:"stretchOrShrink",u=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&a/o<u||"proportional"===s){let t=Math.ceil(o*u);n*=t/a,a=t}}else if("proportional"===s&&"stretchOnly"===l&&0!==u&&a/o>u){let t=Math.ceil(a/u);i*=t/o,o=t}return{x1:n,y1:i,x2:n+a,y2:i+o}}function Sc(t,e,r,n,i,a){let o,s=t.image;if(s.content){let t=s.content,e=s.pixelRatio||1;o=[t[0]/e,t[1]/e,s.displaySize[0]-t[2]/e,s.displaySize[1]-t[3]/e]}let l,u,c,h,f=e.left*a,p=e.right*a;"width"===r||"both"===r?(h=i[0]+f-n[3],u=i[0]+p+n[1]):(h=i[0]+(f+p-s.displaySize[0])/2,u=h+s.displaySize[0]);let d=e.top*a,m=e.bottom*a;return"height"===r||"both"===r?(l=i[1]+d-n[0],c=i[1]+m+n[2]):(l=i[1]+(d+m-s.displaySize[1])/2,c=l+s.displaySize[1]),{image:s,top:l,right:u,bottom:c,left:h,collisionPadding:o}}let Ec=128,Cc=32640;function Ic(t,e){let{expression:r}=e;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new va(t+1))};if("source"===r.kind)return{kind:"source"};{let{zoomStops:e,interpolationType:n}=r,i=0;for(;i<e.length&&e[i]<=t;)i++;i=Math.max(0,i-1);let a=i;for(;a<e.length&&e[a]<t+1;)a++;a=Math.min(e.length-1,a);let o=e[i],s=e[a];return"composite"===r.kind?{kind:"composite",minZoom:o,maxZoom:s,interpolationType:n}:{kind:"camera",minZoom:o,maxZoom:s,minSize:r.evaluate(new va(o)),maxSize:r.evaluate(new va(s)),interpolationType:n}}}function Lc(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}let Pc,zc,Oc=ql.VectorTileFeature.types,Dc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Rc(t,e,r,n,i,a,o,s,l,u,c,h,f){let p=s?Math.min(Cc,Math.round(s[0])):0,d=s?Math.min(Cc,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(p<<1)+(l?1:0),d,16*u,16*c,256*h,256*f)}function Fc(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Bc(t){for(let e of t.sections)if(ga(e.text))return!0;return!1}class Nc{constructor(t){this.layoutVertexArray=new Co,this.indexArray=new Oo,this.programConfigurations=t,this.segments=new Bo,this.dynamicLayoutVertexArray=new Io,this.opacityVertexArray=new Lo,this.hasVisibleVertices=!1,this.placedSymbolArray=new fo}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Su.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Eu.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Dc,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Si("SymbolBuffers",Nc);class jc{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Bo,this.collisionVertexArray=new zo}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Cu.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Si("CollisionBuffers",jc);class Uc{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ns([]),this.placementViewportMatrix=Ns([]);let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ic(this.zoom,r["text-size"]),this.iconSizeData=Ic(this.zoom,r["icon-size"]);let n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==Lc(n,"text-overlap","text-allow-overlap")||"never"!==Lc(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map(e=>t.ah[e])),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id),this.sourceID=e.sourceID}createArrays(){this.text=new Nc(new cs(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new Nc(new cs(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new go,this.lineVertexArray=new yo,this.symbolInstances=new mo,this.textAnchorOffsets=new xo}calculateGlyphDependencies(t,e,r,n,i){for(let a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){let r=zu[t.charAt(a)];r&&(e[r.charCodeAt(0)]=!0)}}populate(e,r,n){let i=this.layers[0],a=i.layout,o=a.get("text-font"),s=a.get("text-field"),l=a.get("icon-image"),u=("constant"!==s.value.kind||s.value.value instanceof re&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let f=r.iconDependencies,p=r.glyphDependencies,d=r.availableImages,m=new va(this.zoom);for(let{feature:r,id:s,index:l,sourceLayerIndex:g}of e){let e,y,v=i._featureFilter.needGeometry,x=xs(r,v);if(!i._featureFilter.filter(m,x,n))continue;if(v||(x.geometry=vs(r)),u){let t=i.getValueAndResolveTokens("text-field",x,n,d),r=re.factory(t),a=this.hasRTLText=this.hasRTLText||Bc(r);(!a||"unavailable"===ya.getRTLTextPluginStatus()||a&&ya.isParsed())&&(e=Pu(r,i,x))}if(c){let t=i.getValueAndResolveTokens("icon-image",x,n,d);y=t instanceof oe?t:oe.fromString(t)}if(!e&&!y)continue;let _=this.sortFeaturesByKey?h.evaluate(x,{},n):void 0;if(this.features.push({id:s,text:e,icon:y,index:l,sourceLayerIndex:g,geometry:x.geometry,properties:r.properties,type:Oc[r.type],sortKey:_}),y&&(f[y.name]=!0),e){let r=o.evaluate(x,{},n).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(let t of e.sections)if(t.image)f[t.image.name]=!0;else{let n=aa(e.toString()),a=t.fontStack||r,o=p[a]=p[a]||{};this.calculateGlyphDependencies(t.text,o,i,this.allowVerticalPlacement,n)}}}"line"===a.get("symbol-placement")&&(this.features=function(t){let e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){let a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){let a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){let n=r?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let u=0;u<t.length;u++){let c=t[u],h=c.geometry,f=c.text?c.text.toString():null;if(!f){a(u);continue}let p=l(f,h),d=l(f,h,!0);if(p in r&&d in e&&r[p]!==e[d]){let t=s(p,d,h),i=o(p,d,n[t].geometry);delete e[p],delete r[d],r[l(f,n[i].geometry,!0)]=i,n[t].geometry=null}else p in r?o(p,d,h):d in e?s(p,d,h):(a(u),e[p]=i-1,r[d]=i-1)}return n.filter(t=>t.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((t,e)=>t.sortKey-e.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(void 0!==t.segment){let r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),i={};for(let n=t.segment+1;n<e.length;n++)i[n]={x:e[n].x,y:e[n].y,tileUnitDistanceFromAnchor:r},n<e.length-1&&(r+=e[n+1].dist(e[n]));for(let r=t.segment||0;r>=0;r--)i[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:n},r>0&&(n+=e[r-1].dist(e[r]));for(let t=0;t<e.length;t++){let e=i[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,r,n,i,a,o,s,l,u,c,h,f){let p=e.indexArray,d=e.layoutVertexArray,m=e.segments.prepareSegment(4*r.length,d,p,this.canOverlap?o.sortKey:void 0),g=this.glyphOffsetArray.length,y=m.vertexLength,v=this.allowVerticalPlacement&&s===t.ah.vertical?Math.PI/2:0,x=o.text&&o.text.sections;for(let t=0;t<r.length;t++){let{tl:i,tr:a,bl:s,br:u,tex:c,pixelOffsetTL:h,pixelOffsetBR:g,minFontScaleX:y,minFontScaleY:_,glyphOffset:b,isSDF:w,sectionIndex:T}=r[t],k=m.vertexLength,A=b[1];Rc(d,l.x,l.y,i.x,A+i.y,c.x,c.y,n,w,h.x,h.y,y,_),Rc(d,l.x,l.y,a.x,A+a.y,c.x+c.w,c.y,n,w,g.x,h.y,y,_),Rc(d,l.x,l.y,s.x,A+s.y,c.x,c.y+c.h,n,w,h.x,g.y,y,_),Rc(d,l.x,l.y,u.x,A+u.y,c.x+c.w,c.y+c.h,n,w,g.x,g.y,y,_),Fc(e.dynamicLayoutVertexArray,l,v),p.emplaceBack(k,k+1,k+2),p.emplaceBack(k+1,k+2,k+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),t!==r.length-1&&T===r[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(d.length,o,o.index,{},f,x&&x[T])}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,y,u,c,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,h)}_addCollisionDebugVertex(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,e,r,n,i,a,o){let s=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=s.vertexLength,u=i.layoutVertexArray,c=i.collisionVertexArray,f=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(u,c,a,f,p,new h(t,e)),this._addCollisionDebugVertex(u,c,a,f,p,new h(r,e)),this._addCollisionDebugVertex(u,c,a,f,p,new h(r,n)),this._addCollisionDebugVertex(u,c,a,f,p,new h(t,n)),s.vertexLength+=4;let d=i.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),s.primitiveLength+=4}addDebugCollisionBoxes(t,e,r,n){for(let i=t;i<e;i++){let t=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,n?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new jc(Po,Iu.members,Do),this.iconCollisionBox=new jc(Po,Iu.members,Do);for(let t=0;t<this.symbolInstances.length;t++){let e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,r,n,i,a,o,s,l){let u={};for(let n=e;n<r;n++){let e=t.get(n);u.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},u.textFeatureIndex=e.featureIndex;break}for(let e=n;e<i;e++){let r=t.get(e);u.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalTextFeatureIndex=r.featureIndex;break}for(let e=a;e<o;e++){let r=t.get(e);u.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.iconFeatureIndex=r.featureIndex;break}for(let e=s;e<l;e++){let r=t.get(e);u.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalIconFeatureIndex=r.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs;for(let e=r.vertexStartIndex;e<n;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[];for(let t=0;t<this.symbolInstances.length;++t){a.push(t);let o=this.symbolInstances.get(t);n.push(0|Math.round(e*o.anchorX+r*o.anchorY)),i.push(o.featureIndex)}return a.sort((t,e)=>n[t]-n[e]||i[e]-i[t]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let t of this.symbolInstanceIndexes){let e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach((t,e,r)=>{t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Si("SymbolBucket",Uc,{omit:["layers","collisionBoxArray","features","compareText"]}),Uc.MAX_GLYPHS=65535,Uc.addDynamicAttributes=Fc;var Vc={get paint(){return zc=zc||new Pa({"icon-opacity":new Ea(K.paint_symbol["icon-opacity"]),"icon-color":new Ea(K.paint_symbol["icon-color"]),"icon-halo-color":new Ea(K.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ea(K.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ea(K.paint_symbol["icon-halo-blur"]),"icon-translate":new Sa(K.paint_symbol["icon-translate"]),"icon-translate-anchor":new Sa(K.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ea(K.paint_symbol["text-opacity"]),"text-color":new Ea(K.paint_symbol["text-color"],{runtimeType:vt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Ea(K.paint_symbol["text-halo-color"]),"text-halo-width":new Ea(K.paint_symbol["text-halo-width"]),"text-halo-blur":new Ea(K.paint_symbol["text-halo-blur"]),"text-translate":new Sa(K.paint_symbol["text-translate"]),"text-translate-anchor":new Sa(K.paint_symbol["text-translate-anchor"])})},get layout(){return Pc=Pc||new Pa({"symbol-placement":new Sa(K.layout_symbol["symbol-placement"]),"symbol-spacing":new Sa(K.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Sa(K.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ea(K.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Sa(K.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Sa(K.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Sa(K.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Sa(K.layout_symbol["icon-ignore-placement"]),"icon-optional":new Sa(K.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Sa(K.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ea(K.layout_symbol["icon-size"]),"icon-text-fit":new Sa(K.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Sa(K.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ea(K.layout_symbol["icon-image"]),"icon-rotate":new Ea(K.layout_symbol["icon-rotate"]),"icon-padding":new Ea(K.layout_symbol["icon-padding"]),"icon-keep-upright":new Sa(K.layout_symbol["icon-keep-upright"]),"icon-offset":new Ea(K.layout_symbol["icon-offset"]),"icon-anchor":new Ea(K.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Sa(K.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Sa(K.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Sa(K.layout_symbol["text-rotation-alignment"]),"text-field":new Ea(K.layout_symbol["text-field"]),"text-font":new Ea(K.layout_symbol["text-font"]),"text-size":new Ea(K.layout_symbol["text-size"]),"text-max-width":new Ea(K.layout_symbol["text-max-width"]),"text-line-height":new Sa(K.layout_symbol["text-line-height"]),"text-letter-spacing":new Ea(K.layout_symbol["text-letter-spacing"]),"text-justify":new Ea(K.layout_symbol["text-justify"]),"text-radial-offset":new Ea(K.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Sa(K.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ea(K.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ea(K.layout_symbol["text-anchor"]),"text-max-angle":new Sa(K.layout_symbol["text-max-angle"]),"text-writing-mode":new Sa(K.layout_symbol["text-writing-mode"]),"text-rotate":new Ea(K.layout_symbol["text-rotate"]),"text-padding":new Sa(K.layout_symbol["text-padding"]),"text-keep-upright":new Sa(K.layout_symbol["text-keep-upright"]),"text-transform":new Ea(K.layout_symbol["text-transform"]),"text-offset":new Ea(K.layout_symbol["text-offset"]),"text-allow-overlap":new Sa(K.layout_symbol["text-allow-overlap"]),"text-overlap":new Sa(K.layout_symbol["text-overlap"]),"text-ignore-placement":new Sa(K.layout_symbol["text-ignore-placement"]),"text-optional":new Sa(K.layout_symbol["text-optional"])})}};class qc{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dt,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Si("FormatSectionOverride",qc,{omit:["defaultValue"]});class Hc extends Oa{constructor(t){super(t,Vc)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let t=this.layout.get("text-writing-mode");if(t){let e=[];for(let r of t)e.indexOf(r)<0&&e.push(r);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,r,n){let i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||An(a.value)||!i?i:(o=e.properties,i.replace(/{([^{}]+)}/g,(t,e)=>o&&e in o?String(o[e]):""));var o}createBucket(t){return new Uc(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of Vc.paint.overridableProperties){if(!Hc.hasPaintOverride(this.layout,t))continue;let e=this.paint.get(t),r=new qc(e),n=new kn(r,e.property.specification),i=null;i="constant"===e.value.kind||"source"===e.value.kind?new Sn("source",n):new En("composite",n,e.value.zoomStops),this.paint._values[t]=new Aa(e.property,i,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&Hc.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){let r=t.get("text-field"),n=Vc.paint.properties[e],i=!1,a=t=>{for(let e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof re)a(r.value.value.sections);else if("source"===r.value.kind){let t=e=>{i||(e instanceof he&&ue(e.value)===wt?a(e.value.sections):e instanceof Je?a(e.sections):e.eachChild(t))},e=r.value;e._styleExpression&&t(e._styleExpression.expression)}return i}}let Gc;var Zc={get paint(){return Gc=Gc||new Pa({"background-color":new Sa(K.paint_background["background-color"]),"background-pattern":new Ia(K.paint_background["background-pattern"]),"background-opacity":new Sa(K.paint_background["background-opacity"])})}};class Wc extends Oa{constructor(t){super(t,Zc)}}let Yc;var Xc={get paint(){return Yc=Yc||new Pa({"raster-opacity":new Sa(K.paint_raster["raster-opacity"]),"raster-hue-rotate":new Sa(K.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Sa(K.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Sa(K.paint_raster["raster-brightness-max"]),"raster-saturation":new Sa(K.paint_raster["raster-saturation"]),"raster-contrast":new Sa(K.paint_raster["raster-contrast"]),"raster-resampling":new Sa(K.paint_raster["raster-resampling"]),"raster-fade-duration":new Sa(K.paint_raster["raster-fade-duration"])})}};class $c extends Oa{constructor(t){super(t,Xc)}}class Jc extends Oa{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Kc{constructor(t){this._methodToThrottle=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let Qc=6371008.8;class th{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${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")}wrap(){return new th(w(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Qc*Math.acos(Math.min(i,1))}static convert(t){if(t instanceof th)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new th(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new th(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let eh=2*Math.PI*Qc;function rh(t){return eh*Math.cos(t*Math.PI/180)}function nh(t){return(180+t)/360}function ih(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function ah(t,e){return t/rh(e)}function oh(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class sh{constructor(t,e,r=0){this.x=+t,this.y=+e,this.z=+r}static fromLngLat(t,e=0){let r=th.convert(t);return new sh(nh(r.lng),ih(r.lat),ah(e,r.lat))}toLngLat(){return new th(360*this.x-180,oh(this.y))}toAltitude(){return this.z*rh(oh(this.y))}meterInMercatorCoordinateUnits(){return 1/eh*(t=oh(this.y),1/Math.cos(t*Math.PI/180));var t}}function lh(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class uh{constructor(t,e,r){if(i=e,a=r,(n=t)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);var n,i,a;this.z=t,this.x=e,this.y=r,this.key=fh(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let n=(a=this.y,o=this.z,s=lh(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=lh(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;let u=function(t,e,r){let n,i="";for(let a=t;a>0;a--)n=1<<a-1,i+=(e&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,u).replace(/{bbox-epsg-3857}/g,n)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=Math.pow(2,this.z);return new h((t.x*e-this.x)*ms,(t.y*e-this.y)*ms)}toString(){return`${this.z}/${this.x}/${this.y}`}}class ch{constructor(t,e){this.wrap=t,this.canonical=e,this.key=fh(t,e.z,e.z,e.x,e.y)}}class hh{constructor(t,e,r,n,i){if(t<r)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${r}`);this.overscaledZ=t,this.wrap=e,this.canonical=new uh(r,+n,+i),this.key=fh(e,t,r,n,i)}clone(){return new hh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let e=this.canonical.z-t;return t>this.canonical.z?new hh(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new hh(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?fh(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):fh(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(t){if(t.wrap!==this.wrap)return!1;let e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new hh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new hh(e,this.wrap,e,r,n),new hh(e,this.wrap,e,r+1,n),new hh(e,this.wrap,e,r,n+1),new hh(e,this.wrap,e,r+1,n+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new hh(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new hh(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new ch(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new sh(t.x-this.wrap,t.y))}}function fh(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);let a=1<<r;return(a*a*t+a*i+n).toString(36)+r.toString(36)+e.toString(36)}Si("CanonicalTileID",uh),Si("OverscaledTileID",hh,{omit:["posMatrix"]});class ph{constructor(t,e,r,n=1,i=1,a=1,o=0){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void C(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=e.height;let s=this.dim=e.height-2;switch(this.data=new Uint32Array(e.data.buffer),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=i,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let t=0;t<s;t++)this.data[this._idx(-1,t)]=this.data[this._idx(0,t)],this.data[this._idx(s,t)]=this.data[this._idx(s-1,t)],this.data[this._idx(t,-1)]=this.data[this._idx(t,0)],this.data[this._idx(t,s)]=this.data[this._idx(t,s-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(s,-1)]=this.data[this._idx(s-1,0)],this.data[this._idx(-1,s)]=this.data[this._idx(0,s-1)],this.data[this._idx(s,s)]=this.data[this._idx(s-1,s-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let t=0;t<s;t++)for(let e=0;e<s;e++){let r=this.get(t,e);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(t,e){let r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return this.unpack(r[n],r[n+1],r[n+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,r){return t*this.redFactor+e*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Qs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}let s=-e*this.dim,l=-r*this.dim;for(let e=a;e<o;e++)for(let r=n;r<i;r++)this.data[this._idx(r,e)]=t.data[this._idx(r+s,e+l)]}}Si("DEMData",ph);class dh{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){let r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class mh{constructor(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class gh{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ai(ms,16,0),this.grid3D=new Ai(ms,16,0),this.featureIndexArray=new bo,this.promoteId=e}insert(t,e,r,n,i,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);let s=a?this.grid3D:this.grid;for(let t=0;t<e.length;t++){let r=e[t],n=[1/0,1/0,-1/0,-1/0];for(let t=0;t<r.length;t++){let e=r[t];n[0]=Math.min(n[0],e.x),n[1]=Math.min(n[1],e.y),n[2]=Math.max(n[2],e.x),n[3]=Math.max(n[3],e.y)}n[0]<ms&&n[1]<ms&&n[2]>=0&&n[3]>=0&&s.insert(o,n[0],n[1],n[2],n[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ql.VectorTile(new nc(this.rawTileData)).layers,this.sourceLayerCoder=new dh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();let i=t.params||{},a=ms/t.tileSize/t.scale,o=On(i.filter),s=t.queryGeometry,l=t.queryPadding*a,u=vh(s),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),f=vh(t.cameraQueryGeometry),p=this.grid3D.query(f.minX-l,f.minY-l,f.maxX+l,f.maxY+l,(e,r,n,i)=>function(t,e,r,n,i){for(let a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let a=[new h(e,r),new h(e,i),new h(n,i),new h(n,r)];if(t.length>2)for(let e of a)if(Ls(t,e))return!0;for(let e=0;e<t.length-1;e++)if(Ps(t[e],t[e+1],a))return!0;return!1}(t.cameraQueryGeometry,e-l,r-l,n+l,i+l));for(let t of p)c.push(t);c.sort(xh);let d,m={};for(let l=0;l<c.length;l++){let u=c[l];if(u===d)continue;d=u;let h=this.featureIndexArray.get(u),f=null;this.loadMatchingFeature(m,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,o,i.layers,i.availableImages,e,r,n,(e,r,n)=>(f||(f=vs(e)),r.queryIntersectsFeature(s,e,n,f,this.z,t.transform,a,t.pixelPosMatrix)))}return m}loadMatchingFeature(t,e,r,n,i,a,o,s,l,u,c){let h=this.bucketLayerIDs[e];if(a&&!function(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(a,h))return;let f=this.sourceLayerCoder.decode(r),p=this.vtLayers[f].feature(n);if(i.needGeometry){let t=xs(p,!0);if(!i.filter(new va(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new va(this.tileID.overscaledZ),p))return;let d=this.getId(p,f);for(let e=0;e<h.length;e++){let r=h[e];if(a&&a.indexOf(r)<0)continue;let i=s[r];if(!i)continue;let f={};d&&u&&(f=u.getState(i.sourceLayer||"_geojsonTileLayer",d));let m=T({},l[r]);m.paint=yh(m.paint,i.paint,p,f,o),m.layout=yh(m.layout,i.layout,p,f,o);let g=!c||c(p,i,f);if(!g)continue;let y=new mh(p,this.z,this.x,this.y,d);y.layer=m;let v=t[r];void 0===v&&(v=t[r]=[]),v.push({featureIndex:n,feature:y,intersectionZ:g})}}lookupSymbolFeatures(t,e,r,n,i,a,o,s){let l={};this.loadVTLayers();let u=On(i);for(let i of t)this.loadMatchingFeature(l,r,n,i,u,a,o,s,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){let r=t.id;return this.promoteId&&(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof r&&(r=Number(r))),r}}function yh(t,e,r,n,i){return A(t,(t,a)=>{let o=e instanceof Ma?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o})}function vh(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:e,minY:r,maxX:n,maxY:i}}function xh(t,e){return e-t}function _h(t,e,r,n,i){let a=[];for(let o=0;o<t.length;o++){let s,l=t[o];for(let t=0;t<l.length-1;t++){let o=l[t],u=l[t+1];o.x<e&&u.x<e||(o.x<e?o=new h(e,o.y+(e-o.x)/(u.x-o.x)*(u.y-o.y))._round():u.x<e&&(u=new h(e,o.y+(e-o.x)/(u.x-o.x)*(u.y-o.y))._round()),o.y<r&&u.y<r||(o.y<r?o=new h(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r)._round():u.y<r&&(u=new h(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r)._round()),o.x>=n&&u.x>=n||(o.x>=n?o=new h(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y))._round():u.x>=n&&(u=new h(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y))._round()),o.y>=i&&u.y>=i||(o.y>=i?o=new h(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i)._round():u.y>=i&&(u=new h(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i)._round()),s&&o.equals(s[s.length-1])||(s=[o],a.push(s)),s.push(u)))))}}return a}Si("FeatureIndex",gh,{omit:["rawTileData","sourceLayerCoder"]});class bh extends h{constructor(t,e,r,n){super(t,e),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new bh(this.x,this.y,this.angle,this.segment)}}function wh(t,e,r,n,i){if(void 0===e.segment||0===r)return!0;let a=e,o=e.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;let l=[],u=0;for(;s<r/2;){let e=t[o],r=t[o+1];if(!r)return!1;let a=t[o-1].angleTo(e)-e.angleTo(r);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:a}),u+=a;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=e.dist(r)}return!0}function Th(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function kh(t,e,r){return t?.6*e*r:0}function Ah(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Mh(t,e,r,n,i,a){let o=kh(r,i,a),s=Ah(r,n)*a,l=0,u=Th(t)/2;for(let r=0;r<t.length-1;r++){let n=t[r],i=t[r+1],a=n.dist(i);if(l+a>u){let c=(u-l)/a,h=Re.number(n.x,i.x,c),f=Re.number(n.y,i.y,c),p=new bh(h,f,i.angleTo(n),r);return p._round(),!o||wh(t,p,s,o,e)?p:void 0}l+=a}}function Sh(t,e,r,n,i,a,o,s,l){let u=kh(n,a,o),c=Ah(n,i),h=c*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),Eh(t,f?e/2*s%e:(c/2+2*a)*o*s%e,e,u,r,h,f,!1,l)}function Eh(t,e,r,n,i,a,o,s,l){let u=a/2,c=Th(t),h=0,f=e-r,p=[];for(let e=0;e<t.length-1;e++){let o=t[e],s=t[e+1],d=o.dist(s),m=s.angleTo(o);for(;f+r<h+d;){f+=r;let g=(f-h)/d,y=Re.number(o.x,s.x,g),v=Re.number(o.y,s.y,g);if(y>=0&&y<l&&v>=0&&v<l&&f-u>=0&&f+u<=c){let r=new bh(y,v,m,e);r._round(),n&&!wh(t,r,a,n,i)||p.push(r)}}h+=d}return s||p.length||o||(p=Eh(t,h/2,r,n,i,a,o,!0,l)),p}function Ch(t,e,r,n){let i=[],a=t.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},c=a.stretchX||[[0,s]],f=a.stretchY||[[0,l]],p=(t,e)=>t+e[1]-e[0],d=c.reduce(p,0),m=f.reduce(p,0),g=s-d,y=l-m,v=0,x=d,_=0,b=m,w=0,T=g,k=0,A=y;if(a.content&&n){let e=a.content,r=e[2]-e[0],n=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(u=Mc(t)),v=Ih(c,0,e[0]),_=Ih(f,0,e[1]),x=Ih(c,e[0],e[2]),b=Ih(f,e[1],e[3]),w=e[0]-v,k=e[1]-_,T=r-x,A=n-b}let M=u.x1,S=u.y1,E=u.x2-M,C=u.y2-S,I=(t,n,i,s)=>{let l=Ph(t.stretch-v,x,E,M),u=zh(t.fixed-w,T,t.stretch,d),c=Ph(n.stretch-_,b,C,S),f=zh(n.fixed-k,A,n.stretch,m),p=Ph(i.stretch-v,x,E,M),g=zh(i.fixed-w,T,i.stretch,d),y=Ph(s.stretch-_,b,C,S),I=zh(s.fixed-k,A,s.stretch,m),L=new h(l,c),P=new h(p,c),z=new h(p,y),O=new h(l,y),D=new h(u/o,f/o),R=new h(g/o,I/o),F=e*Math.PI/180;if(F){let t=Math.sin(F),e=Math.cos(F),r=[e,-t,t,e];L._matMult(r),P._matMult(r),O._matMult(r),z._matMult(r)}let B=t.stretch+t.fixed,N=n.stretch+n.fixed;return{tl:L,tr:P,bl:O,br:z,tex:{x:a.paddedRect.x+1+B,y:a.paddedRect.y+1+N,w:i.stretch+i.fixed-B,h:s.stretch+s.fixed-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:R,minFontScaleX:T/o/E,minFontScaleY:A/o/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){let t=Lh(c,g,d),e=Lh(f,y,m);for(let r=0;r<t.length-1;r++){let n=t[r],a=t[r+1];for(let t=0;t<e.length-1;t++)i.push(I(n,e[t],a,e[t+1]))}}else i.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return i}function Ih(t,e,r){let n=0;for(let i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}function Lh(t,e,r){let n=[{fixed:-1,stretch:0}];for(let[e,r]of t){let t=n[n.length-1];n.push({fixed:e-t.stretch,stretch:t.stretch}),n.push({fixed:e-t.stretch,stretch:t.stretch+(r-e)})}return n.push({fixed:e+1,stretch:r}),n}function Ph(t,e,r,n){return t/e*r+n}function zh(t,e,r,n){return t-e*r/n}Si("Anchor",bh);class Oh{constructor(t,e,r,n,i,a,o,s,l,u){var c;if(this.boxStartIndex=t.length,l){let t=a.top,e=a.bottom,r=a.collisionPadding;r&&(t-=r[1],e+=r[3]);let n=e-t;n>0&&(n=Math.max(10,n),this.circleDiameter=n)}else{let l=null!==(c=a.image)&&void 0!==c&&c.content&&(a.image.textFitWidth||a.image.textFitHeight)?Mc(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*o-s[0],l.y2=l.y2*o+s[2],l.x1=l.x1*o-s[3],l.x2=l.x2*o+s[1];let f=a.collisionPadding;if(f&&(l.x1-=f[0]*o,l.y1-=f[1]*o,l.x2+=f[2]*o,l.y2+=f[3]*o),u){let t=new h(l.x1,l.y1),e=new h(l.x2,l.y1),r=new h(l.x1,l.y2),n=new h(l.x2,l.y2),i=u*Math.PI/180;t._rotate(i),e._rotate(i),r._rotate(i),n._rotate(i),l.x1=Math.min(t.x,e.x,r.x,n.x),l.x2=Math.max(t.x,e.x,r.x,n.x),l.y1=Math.min(t.y,e.y,r.y,n.y),l.y2=Math.max(t.y,e.y,r.y,n.y)}t.emplaceBack(e.x,e.y,l.x1,l.y1,l.x2,l.y2,r,n,i)}this.boxEndIndex=t.length}}class Dh{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,n=e[t];for(;t>0;){let i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){let{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t<n;){let n=1+(t<<1),a=n+1;if(a<this.length&&r(e[a],e[n])<0&&(n=a),r(e[n],i)>=0)break;e[t]=e[n],t=n}e[t]=i}}function Rh(t,e=1,r=!1){let n=1/0,i=1/0,a=-1/0,o=-1/0,s=t[0];for(let t=0;t<s.length;t++){let e=s[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<i)&&(i=e.y),(!t||e.x>a)&&(a=e.x),(!t||e.y>o)&&(o=e.y)}let l=Math.min(a-n,o-i),u=l/2,c=new Dh([],Fh);if(0===l)return new h(n,i);for(let e=n;e<a;e+=l)for(let r=i;r<o;r+=l)c.push(new Bh(e+u,r+u,u,t));let f=function(t){let e=0,r=0,n=0,i=t[0];for(let t=0,a=i.length,o=a-1;t<a;o=t++){let a=i[t],s=i[o],l=a.x*s.y-s.x*a.y;r+=(a.x+s.x)*l,n+=(a.y+s.y)*l,e+=3*l}return new Bh(r/e,n/e,0,t)}(t),p=c.length;for(;c.length;){let n=c.pop();(n.d>f.d||!f.d)&&(f=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-f.d<=e||(u=n.h/2,c.push(new Bh(n.p.x-u,n.p.y-u,u,t)),c.push(new Bh(n.p.x+u,n.p.y-u,u,t)),c.push(new Bh(n.p.x-u,n.p.y+u,u,t)),c.push(new Bh(n.p.x+u,n.p.y+u,u,t)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${f.d}`)),f.p}function Fh(t,e){return e.max-t.max}function Bh(t,e,r,n){this.p=new h(t,e),this.h=r,this.d=function(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){let a=e[i];for(let e=0,i=a.length,o=i-1;e<i;o=e++){let i=a[e],s=a[o];i.y>t.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,Cs(t,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Nh;t.aq=void 0,(Nh=t.aq||(t.aq={}))[Nh.center=1]="center",Nh[Nh.left=2]="left",Nh[Nh.right=3]="right",Nh[Nh.top=4]="top",Nh[Nh.bottom=5]="bottom",Nh[Nh["top-left"]=6]="top-left",Nh[Nh["top-right"]=7]="top-right",Nh[Nh["bottom-left"]=8]="bottom-left",Nh[Nh["bottom-right"]=9]="bottom-right";let jh=Number.POSITIVE_INFINITY;function Uh(t,e){return e[1]!==jh?function(t,e,r){let n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){let r=0,n=0;e<0&&(e=0);let i=e/Math.SQRT2;switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Vh(t,e,r){var n;let i=t.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(e,{},r);if(a){let t=a.values,e=[];for(let r=0;r<t.length;r+=2){let n=e[r]=t[r],i=t[r+1].map(t=>t*Ou);n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),e[r+1]=i}return new ae(e)}let o=i.get("text-variable-anchor");if(o){let n;n=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(e,{},r)*Ou,jh]:i.get("text-offset").evaluate(e,{},r).map(t=>t*Ou);let a=[];for(let t of o)a.push(t,Uh(t,n));return new ae(a)}return null}function qh(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Hh(e,r,n,i,a,o,s,l,u,c,h){let f=o.textMaxSize.evaluate(r,{});void 0===f&&(f=s);let p,d=e.layers[0].layout,m=d.get("icon-offset").evaluate(r,{},h),g=Zh(n.horizontal),y=s/24,v=e.tilePixelRatio*y,x=e.tilePixelRatio*f/24,_=e.tilePixelRatio*l,b=e.tilePixelRatio*d.get("symbol-spacing"),w=d.get("text-padding")*e.tilePixelRatio,T=function(t,e,r,n=1){let i=t.get("icon-padding").evaluate(e,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(d,r,h,e.tilePixelRatio),k=d.get("text-max-angle")/180*Math.PI,A="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),M="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),S=d.get("symbol-placement"),E=b/2,I=d.get("icon-text-fit");i&&"none"!==I&&(e.allowVerticalPlacement&&n.vertical&&(p=Sc(i,n.vertical,I,d.get("icon-text-fit-padding"),m,y)),g&&(i=Sc(i,g,I,d.get("icon-text-fit-padding"),m,y)));let L=(l,f)=>{f.x<0||f.x>=ms||f.y<0||f.y>=ms||function(e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A){let M,S,E,I,L=e.addToLineVertexArray(r,n),P=0,z=0,O=0,D=0,R=-1,F=-1,B={},N=Wo("");if(e.allowVerticalPlacement&&i.vertical){let t=l.layout.get("text-rotate").evaluate(b,{},k)+90;E=new Oh(u,r,c,h,f,i.vertical,p,d,m,t),s&&(I=new Oh(u,r,c,h,f,s,y,v,m,t))}if(a){let n=l.layout.get("icon-rotate").evaluate(b,{}),i="none"!==l.layout.get("icon-text-fit"),o=Ch(a,n,T,i),p=s?Ch(s,n,T,i):void 0;S=new Oh(u,r,c,h,f,a,y,v,!1,n),P=4*o.length;let d=e.iconSizeData,m=null;"source"===d.kind?(m=[Ec*l.layout.get("icon-size").evaluate(b,{})],m[0]>Cc&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(m=[Ec*w.compositeIconSizes[0].evaluate(b,{},k),Ec*w.compositeIconSizes[1].evaluate(b,{},k)],(m[0]>Cc||m[1]>Cc)&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,o,m,_,x,b,t.ah.none,r,L.lineStartIndex,L.lineLength,-1,k),R=e.icon.placedSymbolArray.length-1,p&&(z=4*p.length,e.addSymbols(e.icon,p,m,_,x,b,t.ah.vertical,r,L.lineStartIndex,L.lineLength,-1,k),F=e.icon.placedSymbolArray.length-1)}let j=Object.keys(i.horizontal);for(let n of j){let a=i.horizontal[n];if(!M){N=Wo(a.text);let t=l.layout.get("text-rotate").evaluate(b,{},k);M=new Oh(u,r,c,h,f,a,p,d,m,t)}let s=1===a.positionedLines.length;if(O+=Gh(e,r,a,o,l,m,b,g,L,i.vertical?t.ah.horizontal:t.ah.horizontalOnly,s?j:[n],B,R,w,k),s)break}i.vertical&&(D+=Gh(e,r,i.vertical,o,l,m,b,g,L,t.ah.vertical,["vertical"],B,F,w,k));let U=M?M.boxStartIndex:e.collisionBoxArray.length,V=M?M.boxEndIndex:e.collisionBoxArray.length,q=E?E.boxStartIndex:e.collisionBoxArray.length,H=E?E.boxEndIndex:e.collisionBoxArray.length,G=S?S.boxStartIndex:e.collisionBoxArray.length,Z=S?S.boxEndIndex:e.collisionBoxArray.length,W=I?I.boxStartIndex:e.collisionBoxArray.length,Y=I?I.boxEndIndex:e.collisionBoxArray.length,X=-1,$=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;X=$(M,X),X=$(E,X),X=$(S,X),X=$(I,X);let J=X>-1?1:0;J&&(X*=A/Ou),e.glyphOffsetArray.length>=Uc.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);let K=Vh(l,b,k),[Q,tt]=function(e,r){let n=e.length,i=null==r?void 0:r.values;if((null==i?void 0:i.length)>0)for(let r=0;r<i.length;r+=2){let n=i[r+1];e.emplaceBack(t.aq[i[r]],n[0],n[1])}return[n,e.length]}(e.textAnchorOffsets,K);e.symbolInstances.emplaceBack(r.x,r.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,U,V,q,H,G,Z,W,Y,c,O,D,P,z,J,0,p,X,Q,tt)}(e,f,l,n,i,a,p,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,v,[w,w,w,w],A,u,_,T,M,m,r,o,c,h,s)};if("line"===S)for(let t of _h(r.geometry,0,0,ms,ms)){let r=Sh(t,b,k,n.vertical||g,i,24,x,e.overscaling,ms);for(let n of r)g&&Wh(e,g.text,E,n)||L(t,n)}else if("line-center"===S){for(let t of r.geometry)if(t.length>1){let e=Mh(t,k,n.vertical||g,i,24,x);e&&L(t,e)}}else if("Polygon"===r.type)for(let t of kr(r.geometry,0)){let e=Rh(t,16);L(t[0],new bh(e.x,e.y,0))}else if("LineString"===r.type)for(let t of r.geometry)L(t,new bh(t[0].x,t[0].y,0));else if("Point"===r.type)for(let t of r.geometry)for(let e of t)L([e],new bh(e.x,e.y,0))}function Gh(t,e,r,n,i,a,o,s,l,u,c,f,p,d,m){let g=function(t,e,r,n,i,a,o,s){let l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let t of e.positionedLines)for(let n of t.positionedGlyphs){if(!n.rect)continue;let a=n.rect||{},c=4,f=!0,p=1,d=0,m=(i||s)&&n.vertical,g=n.metrics.advance*n.scale/2;if(s&&e.verticalizable&&(d=t.lineOffset/2-(n.imageName?-(Ou-n.metrics.width*n.scale)/2:(n.scale-1)*Ou)),n.imageName){let t=o[n.imageName];f=t.sdf,p=t.pixelRatio,c=1/p}let y=i?[n.x+g,n.y]:[0,0],v=i?[0,0]:[n.x+g+r[0],n.y+r[1]-d],x=[0,0];m&&(x=v,v=[0,0]);let _=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-c)*n.scale-g+v[0],w=(-n.metrics.top-c)*n.scale+v[1],T=b+a.w/_*n.scale/p,k=w+a.h/_*n.scale/p,A=new h(b,w),M=new h(T,w),S=new h(b,k),E=new h(T,k);if(m){let t=new h(-g,g-cc),e=-Math.PI/2,r=12-g,i=new h(22-r,-(n.imageName?r:0)),a=new h(...x);A._rotateAround(e,t)._add(i)._add(a),M._rotateAround(e,t)._add(i)._add(a),S._rotateAround(e,t)._add(i)._add(a),E._rotateAround(e,t)._add(i)._add(a)}if(l){let t=Math.sin(l),e=Math.cos(l),r=[e,-t,t,e];A._matMult(r),M._matMult(r),S._matMult(r),E._matMult(r)}let C=new h(0,0),I=new h(0,0);u.push({tl:A,tr:M,bl:S,br:E,tex:a,writingMode:e.writingMode,glyphOffset:y,sectionIndex:n.sectionIndex,isSDF:f,pixelOffsetTL:C,pixelOffsetBR:I,minFontScaleX:0,minFontScaleY:0})}return u}(0,r,s,i,a,o,n,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[Ec*i.layout.get("text-size").evaluate(o,{})],v[0]>Cc&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Ec*d.compositeTextSizes[0].evaluate(o,{},m),Ec*d.compositeTextSizes[1].evaluate(o,{},m)],(v[0]>Cc||v[1]>Cc)&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,v,s,a,o,u,e,l.lineStartIndex,l.lineLength,p,m);for(let e of c)f[e]=t.text.placedSymbolArray.length-1;return 4*g.length}function Zh(t){for(let e in t)return t[e];return null}function Wh(t,e,r,n){let i=t.compareText;if(e in i){let t=i[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])<r)return!0}else i[e]=[];return i[e].push(n),!1}let Yh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Xh{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[e,r]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");let n=r>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);let i=Yh[15&r];if(!i)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new Xh(o,a,i,t)}constructor(t,e=64,r=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let i=Yh.indexOf(this.ArrayType),a=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return $h(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){let u=s.pop()||0,c=s.pop()||0,h=s.pop()||0;if(c-h<=o){for(let o=h;o<=c;o++){let s=a[2*o],u=a[2*o+1];s>=t&&s<=r&&u>=e&&u<=n&&l.push(i[o])}continue}let f=h+c>>1,p=a[2*f],d=a[2*f+1];p>=t&&p<=r&&d>=e&&d<=n&&l.push(i[f]),(0===u?t<=p:e<=d)&&(s.push(h),s.push(f-1),s.push(1-u)),(0===u?r>=p:n>=d)&&(s.push(f+1),s.push(c),s.push(1-u))}return l}within(t,e,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){let u=o.pop()||0,c=o.pop()||0,h=o.pop()||0;if(c-h<=a){for(let r=h;r<=c;r++)tf(i[2*r],i[2*r+1],t,e)<=l&&s.push(n[r]);continue}let f=h+c>>1,p=i[2*f],d=i[2*f+1];tf(p,d,t,e)<=l&&s.push(n[f]),(0===u?t-r<=p:e-r<=d)&&(o.push(h),o.push(f-1),o.push(1-u)),(0===u?t+r>=p:e+r>=d)&&(o.push(f+1),o.push(c),o.push(1-u))}return s}}function $h(t,e,r,n,i,a){if(i-n<=r)return;let o=n+i>>1;Jh(t,e,o,n,i,a),$h(t,e,r,n,o-1,1-a),$h(t,e,r,o+1,i,1-a)}function Jh(t,e,r,n,i,a){for(;i>n;){if(i-n>600){let o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);Jh(t,e,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(i,Math.floor(r+(o-s)*u/o+c)),a)}let o=e[2*r+a],s=n,l=i;for(Kh(t,e,n,r),e[2*i+a]>o&&Kh(t,e,n,i);s<l;){for(Kh(t,e,s,l),s++,l--;e[2*s+a]<o;)s++;for(;e[2*l+a]>o;)l--}e[2*n+a]===o?Kh(t,e,n,l):(l++,Kh(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Kh(t,e,r,n){Qh(t,r,n),Qh(e,2*r,2*n),Qh(e,2*r+1,2*n+1)}function Qh(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function tf(t,e,r,n){let i=t-r,a=e-n;return i*i+a*a}var ef;t.bg=void 0,(ef=t.bg||(t.bg={})).create="create",ef.load="load",ef.fullLoad="fullLoad";let rf=null,nf=[],af=1e3/60,of="loadTime",sf="fullLoadTime",lf={mark(t){performance.mark(t)},frame(t){let e=t;null!=rf&&nf.push(e-rf),rf=e},clearMetrics(){rf=null,nf=[],performance.clearMeasures(of),performance.clearMeasures(sf);for(let e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(of,t.bg.create,t.bg.load),performance.measure(sf,t.bg.create,t.bg.fullLoad);let e=performance.getEntriesByName(of)[0].duration,r=performance.getEntriesByName(sf)[0].duration,n=nf.length,i=1/(nf.reduce((t,e)=>t+e,0)/n/1e3),a=nf.filter(t=>t>af).reduce((t,e)=>t+(e-af)/af,0);return{loadTime:e,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};t.$=class extends Va{},t.A=Bs,t.B=bi,t.C=function(t){if(null==P){let e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return P},t.D=Sa,t.E=J,t.F=class{constructor(t,e){var r,n,i;this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Kc(()=>this.process()),this.subscription=(r=this.target,n="message",i=t=>this.receive(t),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=L(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise((r,n)=>{let i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},e&&e.signal.addEventListener("abort",()=>{delete this.resolveRejects[i];let e={id:i,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)},{once:!0});let a=[],o=Object.assign(Object.assign({},t),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Li(t.data,a)});this.target.postMessage(o,{transfer:a})})}receive(t){let e=t.data,r=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if("<cancel>"===e.type){delete this.tasks[r];let t=this.abortControllers[r];return delete this.abortControllers[r],void(t&&t.abort())}if(L(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(0===this.taskQueue.length)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,r){return e(this,void 0,void 0,function*(){if("<response>"===r.type){let e=this.resolveRejects[t];return delete this.resolveRejects[t],e?void(r.error?e.reject(Pi(r.error)):e.resolve(Pi(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let e=Pi(r.data),n=new AbortController;this.abortControllers[t]=n;try{let i=yield this.messageHandlers[r.type](r.sourceMapId,e,n);this.completeTask(t,null,i)}catch(e){this.completeTask(t,e)}})}completeTask(t,e,r){let n=[];delete this.abortControllers[t];let i={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Li(e):null,data:Li(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=V,t.H=function(){var t=new Bs(16);return Bs!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.I=lc,t.J=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,p,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+f*y+e[13],t[14]=a*m+u*g+p*y+e[14],t[15]=o*m+c*g+d*y+e[15]),t},t.K=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=js,t.M=function(t,e){let r={};for(let n=0;n<e.length;n++){let i=e[n];i in t&&(r[i]=t[i])}return r},t.N=th,t.O=nh,t.P=h,t.Q=ih,t.R=Qs,t.S=hh,t.T=ba,t.U=y,t.V=v,t.W=D,t.X=ms,t.Y=Ba,t.Z=sh,t._=e,t.a=j,t.a$=function(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],f=t[10],p=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=e[0],x=e[1],_=e[2],b=e[3],w=e[4],T=e[5],k=e[6],A=e[7],M=e[8],S=e[9],E=e[10],C=e[11],I=e[12],L=e[13],P=e[14],z=e[15];return Math.abs(r-v)<=Fs*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-x)<=Fs*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-_)<=Fs*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(a-b)<=Fs*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(o-w)<=Fs*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=Fs*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-k)<=Fs*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-A)<=Fs*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-M)<=Fs*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(h-S)<=Fs*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-E)<=Fs*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(p-C)<=Fs*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(d-I)<=Fs*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(m-L)<=Fs*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(g-P)<=Fs*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-z)<=Fs*Math.max(1,Math.abs(y),Math.abs(z))},t.a0=Bo,t.a1=uh,t.a2=ct,t.a3=t=>{let e=window.document.createElement("video");return e.muted=!0,new Promise(r=>{e.onloadstart=()=>{r(e)};for(let r of t){let t=window.document.createElement("source");Z(r)||(e.crossOrigin="Anonymous"),t.src=r,e.appendChild(t)}})},t.a4=function(){return k++},t.a5=co,t.a6=Uc,t.a7=On,t.a8=xs,t.a9=mh,t.aA=function(t){if("custom"===t.type)return new Jc(t);switch(t.type){case"background":return new Wc(t);case"circle":return new Hs(t);case"fill":return new Nl(t);case"fill-extrusion":return new uu(t);case"heatmap":return new nl(t);case"hillshade":return new al(t);case"line":return new Au(t);case"raster":return new $c(t);case"symbol":return new Hc(t)}},t.aB=S,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let r=[];try{if(!et(t.version,e.version))return[{command:"setStyle",args:[e]}];et(t.center,e.center)||r.push({command:"setCenter",args:[e.center]}),et(t.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),et(t.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),et(t.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),et(t.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),et(t.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),et(t.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),et(t.light,e.light)||r.push({command:"setLight",args:[e.light]}),et(t.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),et(t.sky,e.sky)||r.push({command:"setSky",args:[e.sky]}),et(t.projection,e.projection)||r.push({command:"setProjection",args:[e.projection]});let n={},i=[];!function(t,e,r,n){let i;for(i in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)||it(i,r,n));for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)?et(t[i],e[i])||("geojson"===t[i].type&&"geojson"===e[i].type&&ot(t,e,i)?rt(r,{command:"setGeoJSONSourceData",args:[i,e[i].data]}):at(i,e,r,n)):nt(i,e,r))}(t.sources,e.sources,i,n);let a=[];t.layers&&t.layers.forEach(t=>{"source"in t&&n[t.source]?r.push({command:"removeLayer",args:[t.id]}):a.push(t)}),r=r.concat(i),function(t,e,r){e=e||[];let n,i,a,o,s,l=(t=t||[]).map(lt),u=e.map(lt),c=t.reduce(ut,{}),h=e.reduce(ut,{}),f=l.slice(),p=Object.create(null);for(let t=0,e=0;t<l.length;t++)n=l[t],Object.prototype.hasOwnProperty.call(h,n)?e++:(rt(r,{command:"removeLayer",args:[n]}),f.splice(f.indexOf(n,e),1));for(let t=0,e=0;t<u.length;t++)n=u[u.length-1-t],f[f.length-1-t]!==n&&(Object.prototype.hasOwnProperty.call(c,n)?(rt(r,{command:"removeLayer",args:[n]}),f.splice(f.lastIndexOf(n,f.length-e),1)):e++,o=f[f.length-t],rt(r,{command:"addLayer",args:[h[n],o]}),f.splice(f.length-t,0,n),p[n]=!0);for(let t=0;t<u.length;t++)if(n=u[t],i=c[n],a=h[n],!p[n]&&!et(i,a))if(et(i.source,a.source)&&et(i["source-layer"],a["source-layer"])&&et(i.type,a.type)){for(s in st(i.layout,a.layout,r,n,null,"setLayoutProperty"),st(i.paint,a.paint,r,n,null,"setPaintProperty"),et(i.filter,a.filter)||rt(r,{command:"setFilter",args:[n,a.filter]}),et(i.minzoom,a.minzoom)&&et(i.maxzoom,a.maxzoom)||rt(r,{command:"setLayerZoomRange",args:[n,a.minzoom,a.maxzoom]}),i)Object.prototype.hasOwnProperty.call(i,s)&&"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?st(i[s],a[s],r,n,s.slice(6),"setPaintProperty"):et(i[s],a[s])||rt(r,{command:"setLayerProperty",args:[n,s,a[s]]}));for(s in a)Object.prototype.hasOwnProperty.call(a,s)&&!Object.prototype.hasOwnProperty.call(i,s)&&"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?st(i[s],a[s],r,n,s.slice(6),"setPaintProperty"):et(i[s],a[s])||rt(r,{command:"setLayerProperty",args:[n,s,a[s]]}))}else rt(r,{command:"removeLayer",args:[n]}),o=f[f.lastIndexOf(n)+1],rt(r,{command:"addLayer",args:[a,o]})}(a,e.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:"setStyle",args:[e]}]}return r},t.aD=function(t){let e=[],r=t.id;return void 0===r&&e.push({message:`layers.${r}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${r}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},t.aE=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r||Object.keys(e).length!==Object.keys(r).length)return!1;for(let n in e)if(!t(e[n],r[n]))return!1;return!0}return e===r},t.aF=A,t.aG=M,t.aH=class extends Ko{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.aI=Qo,t.aJ=class extends Ko{constructor(t,e){super(t,e),this.current=rs}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.aK=ts,t.aL=es,t.aM=Qt,t.aN=class extends Ko{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.aO=class extends Ko{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.aP=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},t.aQ=Vs,t.aR=class extends Ka{},t.aS=Lu,t.aT=class extends to{},t.aU=rl,t.aV=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.aW=tl,t.aX=wo,t.aY=Oo,t.aZ=class extends so{},t.a_=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.aa=function(t){let e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(t,r,n,i)=>{let a=n||i;return e[r]=!a||a.toLowerCase(),""}),e["max-age"]){let t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){let r=[];for(let n in t)n in e||r.push(n);return r},t.ac=b,t.ad=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},t.ae=function(t){var e=new Bs(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.af=qs,t.ag=function(t,e){let r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){let{interpolationType:i,minZoom:a,maxZoom:o}=t,s=i?b(Fe.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=Re.number(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}},t.ai=function(t,{uSize:e,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===t.kind?n/Ec:"composite"===t.kind?Re.number(n/Ec,i/Ec,r):e},t.aj=Fc,t.ak=function(t,e,r,n){let i=e.y-t.y,a=e.x-t.x,o=n.y-r.y,s=n.x-r.x,l=o*a-s*i;if(0===l)return null;let u=(s*(t.y-r.y)-o*(t.x-r.x))/l;return new h(t.x+u*a,t.y+u*i)},t.al=_h,t.am=ws,t.an=Ns,t.ao=function(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[e,r,n,i]},t.ap=Ou,t.ar=Lc,t.as=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,_=r*u-a*o,b=n*l-i*s,w=n*u-a*s,T=i*u-a*l,k=c*m-h*d,A=c*g-f*d,M=c*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(t[0]=(s*C-l*E+u*S)*(I=1/I),t[1]=(i*E-n*C-a*S)*I,t[2]=(m*T-g*w+y*b)*I,t[3]=(f*w-h*T-p*b)*I,t[4]=(l*M-o*C-u*A)*I,t[5]=(r*C-i*M+a*A)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(c*T-f*_+p*x)*I,t[8]=(o*E-s*M+u*k)*I,t[9]=(n*M-r*E-a*k)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-c*w-p*v)*I,t[12]=(s*A-o*S-l*k)*I,t[13]=(r*S-n*A+i*k)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(c*b-h*x+f*v)*I,t):null},t.at=qh,t.au=Tc,t.av=Xh,t.aw=function(){let t={},e=K.$version;for(let r in K.$root){let n=K.$root[r];if(n.required){let i=null;i="version"===r?e:"array"===n.type?[]:{},null!=i&&(t[r]=i)}}return t},t.ax=zi,t.ay=H,t.az=function(t){t=t.slice();let e=Object.create(null);for(let r=0;r<t.length;r++)e[t[r].id]=t[r];for(let r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=tt(t[r],e[t[r].ref]));return t},t.b=z,t.b0=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.b1=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},t.b2=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.b3=w,t.b4=ch,t.b5=ah,t.b6=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(a=1/(n-i)),t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.b7=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},t.b8=x,t.b9=_,t.bA=Du,t.bB=function(t){return t.message===B},t.bC=Mn,t.bD=ya,t.ba=function(t){return t*Math.PI/180},t.bb=function(t,e){let{x:r,y:n}=sh.fromLngLat(e);return!(t<0||t>25||n<0||n>=1||r<0||r>=1)},t.bc=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.bd=class extends Ua{},t.be=Qc,t.bf=lf,t.bh=q,t.bi=function(t,e){j.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete j.REGISTERED_PROTOCOLS[t]},t.bk=function(t,e){let r={};for(let n=0;n<t.length;n++){let i=e&&e[t[n].id]||qn(t[n]);e&&(e[t[n].id]=i);let a=r[i];a||(a=r[i]=[]),a.push(t[n])}let n=[];for(let t in r)n.push(r[t]);return n},t.bl=Si,t.bm=dh,t.bn=gh,t.bo=uc,t.bp=function(e){e.bucket.createArrays(),e.bucket.tilePixelRatio=ms/(512*e.bucket.overscaling),e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,a={layoutIconSize:i["icon-size"].possiblyEvaluate(new va(e.bucket.zoom+1),e.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new va(e.bucket.zoom+1),e.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new va(18))};if("composite"===e.bucket.textSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.textSizeData;a.compositeTextSizes=[i["text-size"].possiblyEvaluate(new va(t),e.canonical),i["text-size"].possiblyEvaluate(new va(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;a.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new va(t),e.canonical),i["icon-size"].possiblyEvaluate(new va(r),e.canonical)]}let o=n.get("text-line-height")*Ou,s="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),l=n.get("text-keep-upright"),u=n.get("text-size");for(let i of e.bucket.features){let c,h=n.get("text-font").evaluate(i,{},e.canonical).join(","),f=u.evaluate(i,{},e.canonical),p=a.layoutTextSize.evaluate(i,{},e.canonical),d=a.layoutIconSize.evaluate(i,{},e.canonical),m={horizontal:{},vertical:void 0},g=i.text,y=[0,0];if(g){let a=g.toString(),u=n.get("text-letter-spacing").evaluate(i,{},e.canonical)*Ou,c=oa(a)?u:0,d=n.get("text-anchor").evaluate(i,{},e.canonical),v=Vh(r,i,e.canonical);if(!v){let t=n.get("text-radial-offset").evaluate(i,{},e.canonical);y=t?Uh(d,[t*Ou,jh]):n.get("text-offset").evaluate(i,{},e.canonical).map(t=>t*Ou)}let x=s?"center":n.get("text-justify").evaluate(i,{},e.canonical),_="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(i,{},e.canonical)*Ou:1/0,b=()=>{e.bucket.allowVerticalPlacement&&aa(a)&&(m.vertical=pc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,d,"left",c,y,t.ah.vertical,!0,p,f))};if(!s&&v){let r=new Set;if("auto"===x)for(let t=0;t<v.values.length;t+=2)r.add(qh(v.values[t]));else r.add(x);let n=!1;for(let i of r)if(!m.horizontal[i])if(n)m.horizontal[i]=m.horizontal[0];else{let r=pc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,"center",i,c,y,t.ah.horizontal,!1,p,f);r&&(m.horizontal[i]=r,n=1===r.positionedLines.length)}b()}else{"auto"===x&&(x=qh(d));let r=pc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,d,x,c,y,t.ah.horizontal,!1,p,f);r&&(m.horizontal[x]=r),b(),aa(a)&&s&&l&&(m.vertical=pc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,d,x,c,y,t.ah.vertical,!1,p,f))}}let v=!1;if(i.icon&&i.icon.name){let t=e.imageMap[i.icon.name];t&&(c=Ac(e.imagePositions[i.icon.name],n.get("icon-offset").evaluate(i,{},e.canonical),n.get("icon-anchor").evaluate(i,{},e.canonical)),v=!!t.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=v:e.bucket.sdfIcons!==v&&C("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.bucket.pixelRatio||0!==n.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}let x=Zh(m.horizontal)||m.vertical;e.bucket.iconsInText=!!x&&x.iconsInText,(x||c)&&Hh(e.bucket,i,m,c,e.imageMap,a,p,d,y,v,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.bq=bu,t.br=Fl,t.bs=au,t.bt=ql,t.bu=nc,t.bv=class{constructor(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let t=performance.getEntriesByName(this._marks.measure);return 0===t.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),t=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),t}},t.bw=function(t,r,n,i,a){return e(this,void 0,void 0,function*(){if(v())try{return yield D(t,r,n,i,a)}catch(t){}return function(t,e,r,n,i){let a=t.width,o=t.height;R&&F||(R=new OffscreenCanvas(a,o),F=R.getContext("2d",{willReadFrequently:!0})),R.width=a,R.height=o,F.drawImage(t,0,0,a,o);let s=F.getImageData(e,r,n,i);return F.clearRect(0,0,a,o),s.data}(t,r,n,i,a)})},t.bx=ph,t.by=n,t.bz=a,t.c=N,t.d=t=>e(void 0,void 0,void 0,function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=T,t.f=t=>new Promise((e,r)=>{let n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame(()=>{n.src=O})},n.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?URL.createObjectURL(i):O}),t.g=U,t.h=(t,e)=>G(T(t,{type:"json"}),e),t.i=L,t.j=$,t.k=X,t.l=(t,e)=>G(T(t,{type:"arrayBuffer"}),e),t.m=G,t.n=function(t){return new nc(t).readFields(ic,[])},t.o=Ks,t.p=sc,t.q=Pa,t.r=_i,t.s=Z,t.t=ki,t.u=xi,t.v=K,t.w=C,t.x=function([t,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(r),y:t*Math.sin(e)*Math.sin(r),z:t*Math.cos(r)}},t.y=Re,t.z=va}),n("worker",0,function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,r){for(let r of e){this._layerConfigs[r.id]=r;let e=this._layers[r.id]=t.aA(r);e._featureFilter=t.a7(e.filter),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(let t of r)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};let n=t.bk(Object.values(this._layerConfigs),this.keyCache);for(let t of n){let e=t.map(t=>this._layers[t.id]),r=e[0];if("none"===r.visibility)continue;let n=r.source||"",i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});let a=r.sourceLayer||"_geojsonTileLayer",o=i[a];o||(o=i[a]=[]),o.push(e)}}}class r{constructor(e){let r={},n=[];for(let t in e){let i=e[t],a=r[t]={};for(let t in i){let e=i[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;let r={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};n.push(r),a[t]={rect:r,metrics:e.metrics}}}let{w:i,h:a}=t.p(n),o=new t.o({width:i||1,height:a||1});for(let n in e){let i=e[n];for(let e in i){let a=i[+e];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;let s=r[n][e].rect;t.o.copy(a.bitmap,o,{x:0,y:0},{x:s.x+1,y:s.y+1},a.bitmap)}}this.image=o,this.positions=r}}t.bl("GlyphAtlas",r);class n{constructor(e){this.tileID=new t.S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,n,a,o){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a5;let s=new t.bm(Object.keys(e.layers).sort()),l=new t.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];let u={},c={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(let r in h){let n=e.layers[r];if(!n)continue;1===n.version&&t.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let o=s.encode(r),f=[];for(let t=0;t<n.length;t++){let e=n.feature(t),i=l.getId(e,r);f.push({feature:e,id:i,index:t,sourceLayerIndex:o})}for(let e of h[r]){let r=e[0];r.source!==this.source&&t.w(`layer.source = ${r.source} does not equal this.source = ${this.source}`),r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(i(e,this.zoom,a),(u[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(f,c,this.tileID.canonical),l.bucketLayerIDs.push(e.map(t=>t.id)))}}let f=t.aF(c.glyphDependencies,t=>Object.keys(t).map(Number));this.inFlightDependencies.forEach(t=>null==t?void 0:t.abort()),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(f).length){let t=new AbortController;this.inFlightDependencies.push(t),p=o.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}let d=Object.keys(c.iconDependencies),m=Promise.resolve({});if(d.length){let t=new AbortController;this.inFlightDependencies.push(t),m=o.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"icons"}},t)}let g=Object.keys(c.patternDependencies),y=Promise.resolve({});if(g.length){let t=new AbortController;this.inFlightDependencies.push(t),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},t)}let[v,x,_]=yield Promise.all([p,m,y]),b=new r(v),w=new t.bo(x,_);for(let e in u){let r=u[e];r instanceof t.a6?(i(r.layers,this.zoom,a),t.bp({bucket:r,glyphMap:v,glyphPositions:b.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof t.bq||r instanceof t.br||r instanceof t.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(c,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(u).filter(t=>!t.isEmpty()),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:b.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?b.positions:null}})}}function i(e,r,n){let i=new t.z(r);for(let t of e)t.recalculate(i,n)}class a{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,r){return t._(this,void 0,void 0,function*(){let n=yield t.l(e.request,r);try{return{vectorTile:new t.bt.VectorTile(new t.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(t){let r=new Uint8Array(n.data),i=`Unable to parse the tile at ${e.request.url}, `;throw i+=31===r[0]&&139===r[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(i)}})}loadTile(e){return t._(this,void 0,void 0,function*(){let r=e.uid,i=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request),a=new n(e);this.loading[r]=a;let o=new AbortController;a.abort=o;try{let n=yield this.loadVectorTile(e,o);if(delete this.loading[r],!n)return null;let s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);let u={};if(i){let t=i.finish();t&&(u.resourceTiming=JSON.parse(JSON.stringify(t)))}a.vectorTile=n.vectorTile;let c=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:u};try{let e=yield c;return t.e({rawTileData:s.slice(0)},e,l,u)}finally{delete this.fetching[r]}}catch(t){throw delete this.loading[r],a.status="done",this.loaded[r]=a,t}})}reloadTile(e){return t._(this,void 0,void 0,function*(){let r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,"parsing"===n.status){let e,i=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);if(this.fetching[r]){let{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],e=t.e({rawTileData:n.slice(0)},i,a,o)}else e=i;return e}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(e){return t._(this,void 0,void 0,function*(){let t=this.loading,r=e.uid;t&&t[r]&&t[r].abort&&(t[r].abort.abort(),delete t[r])})}removeTile(e){return t._(this,void 0,void 0,function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]})}}class o{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,function*(){let{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=e,u=i.width+2,c=i.height+2,h=t.b(i)?new t.R({width:u,height:c},yield t.bw(i,-1,-1,u,c)):i,f=new t.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=f,f})}removeTile(t){let e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]}}function s(t,e){if(0!==t.length){l(t[0],e);for(var r=1;r<t.length;r++)l(t[r],!e)}}function l(t,e){for(var r=0,n=0,i=0,a=t.length,o=a-1;i<a;o=i++){var s=(t[i][0]-t[o][0])*(t[o][1]+t[i][1]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}var u=t.by(function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n<e.features.length;n++)t(e.features[n],r);else if("GeometryCollection"===i)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],r);else if("Feature"===i)t(e.geometry,r);else if("Polygon"===i)s(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)s(e.coordinates[n],r);return e});let c=t.bt.VectorTileFeature.prototype.toGeoJSON;var h={exports:{}},f=t.bz,p=t.bt.VectorTileFeature,d=m;function m(t,e){this.options=e||{},this.features=t,this.length=t.length}function g(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}m.prototype.feature=function(t){return new g(this.features[t],this.options.extent)},g.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new f(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},g.prototype.toGeoJSON=p.prototype.toGeoJSON;var y=t.bA,v=d;function x(t){var e=new y;return function(t,e){for(var r in t.layers)e.writeMessage(3,_,t.layers[r])}(t,e),e.finish()}function _(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,b,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)e.writeMessage(4,M,a[r])}function b(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,w,t),e.writeVarintField(3,r.type),e.writeMessage(4,A,r)}function w(t,e){var r=t.feature,n=t.keys,i=t.values,a=t.keycache,o=t.valuecache;for(var s in r.properties){var l=r.properties[s],u=a[s];if(null!==l){void 0===u&&(n.push(s),a[s]=u=n.length-1),e.writeVarint(u);var c=typeof l;"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var h=c+":"+l,f=o[h];void 0===f&&(i.push(l),o[h]=f=i.length-1),e.writeVarint(f)}}}function T(t,e){return(e<<3)+(7&t)}function k(t){return t<<1^t>>31}function A(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],u=1;1===n&&(u=l.length),e.writeVarint(T(1,u));for(var c=3===n?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==n&&e.writeVarint(T(2,c-1));var f=l[h].x-i,p=l[h].y-a;e.writeVarint(k(f)),e.writeVarint(k(p)),i+=f,a+=p}3===n&&e.writeVarint(T(7,1))}}function M(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}h.exports=x,h.exports.fromVectorTileJs=x,h.exports.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new v(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return x({layers:r})},h.exports.GeoJSONWrapper=v;var S=t.by(h.exports);let E={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},C=Math.fround||(I=new Float32Array(1),t=>(I[0]=+t,I[0]));var I;class L{constructor(t){this.options=Object.assign(Object.create(E),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){let{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");let i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let a=[];for(let e=0;e<t.length;e++){let r=t[e];if(!r.geometry)continue;let[n,i]=r.geometry.coordinates,o=C(O(n)),s=C(D(i));a.push(o,s,1/0,e,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[n+1]=this._createTree(a);e&&console.timeEnd(i);for(let t=n;t>=r;t--){let r=+Date.now();o=this.trees[t]=this._createTree(this._cluster(o,t)),e&&console.log("z%d: %d clusters in %dms",t,o.numItems,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){let t=this.getClusters([r,n,180,a],e),o=this.getClusters([-180,n,i,a],e);return t.concat(o)}let o=this.trees[this._limitZoom(e)],s=o.range(O(r),D(a),O(i),D(n)),l=o.data,u=[];for(let t of s){let e=this.stride*t;u.push(l[e+5]>1?P(l,e,this.clusterProps):this.points[l[e+3]])}return u}getChildren(t){let e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);let a=i.data;if(e*this.stride>=a.length)throw new Error(n);let o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[e*this.stride],a[e*this.stride+1],o),l=[];for(let e of s){let r=e*this.stride;a[r+4]===t&&l.push(a[r+5]>1?P(a,r,this.clusterProps):this.points[a[r+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,r){let n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n}getTile(t,e,r){let n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,u=(r+1+s)/i,c={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,u),n.data,e,r,i,c),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,u),n.data,i,r,i,c),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,u),n.data,-1,r,i,c),c.features.length?c:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){let r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,i){let a=this.getChildren(e);for(let e of a){let a=e.properties;if(a&&a.cluster?i+a.point_count<=n?i+=a.point_count:i=this._appendLeaves(t,a.cluster_id,r,n,i):i<n?i++:t.push(e),t.length===r)break}return i}_createTree(e){let r=new t.av(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<e.length;t+=this.stride)r.add(e[t],e[t+1]);return r.finish(),r.data=e,r}_addTileFeatures(t,e,r,n,i,a){for(let o of t){let t,s,l,u=o*this.stride,c=e[u+5]>1;if(c)t=z(e,u,this.clusterProps),s=e[u],l=e[u+1];else{let r=this.points[e[u+3]];t=r.properties;let[n,i]=r.geometry.coordinates;s=O(n),l=D(i)}let h,f={type:1,geometry:[[Math.round(this.options.extent*(s*i-r)),Math.round(this.options.extent*(l*i-n))]],tags:t};h=c||this.options.generateId?e[u+3]:this.points[e[u+3]].id,void 0!==h&&(f.id=h),a.features.push(f)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){let{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,e)),s=t.data,l=[],u=this.stride;for(let r=0;r<s.length;r+=u){if(s[r+2]<=e)continue;s[r+2]=e;let n=s[r],c=s[r+1],h=t.within(s[r],s[r+1],o),f=s[r+5],p=f;for(let t of h){let r=t*u;s[r+2]>e&&(p+=s[r+5])}if(p>f&&p>=a){let t,a=n*f,o=c*f,d=-1,m=(r/u<<5)+(e+1)+this.points.length;for(let n of h){let l=n*u;if(s[l+2]<=e)continue;s[l+2]=e;let c=s[l+5];a+=s[l]*c,o+=s[l+1]*c,s[l+4]=m,i&&(t||(t=this._map(s,r,!0),d=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(s,l)))}s[r+4]=m,l.push(a/p,o/p,1/0,m,-1,p),i&&l.push(d)}else{for(let t=0;t<u;t++)l.push(s[r+t]);if(p>1)for(let t of h){let r=t*u;if(!(s[r+2]<=e)){s[r+2]=e;for(let t=0;t<u;t++)l.push(s[r+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){let n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}let n=this.points[t[e+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function P(t,e,r){return{type:"Feature",id:t[e+3],properties:z(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),R(t[e+1])]}};var n}function z(t,e,r){let n=t[e+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=t[e+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:i})}function O(t){return t/360+.5}function D(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function R(t){let e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function F(t,e,r,n){let i,a=n,o=e+(r-e>>1),s=r-e,l=t[e],u=t[e+1],c=t[r],h=t[r+1];for(let n=e+3;n<r;n+=3){let e=B(t[n],t[n+1],l,u,c,h);if(e>a)i=n,a=e;else if(e===a){let t=Math.abs(n-o);t<s&&(i=n,s=t)}}a>n&&(i-e>3&&F(t,e,i,n),t[i+2]=a,r-i>3&&F(t,i,r,n))}function B(t,e,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){let l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=t-r,s=e-n,o*o+s*s}function N(t,e,r,n){let i={id:null==t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)j(i,r);else if("Polygon"===e)j(i,r[0]);else if("MultiLineString"===e)for(let t of r)j(i,t);else if("MultiPolygon"===e)for(let t of r)j(i,t[0]);return i}function j(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function U(t,e,r,n){if(!e.geometry)return;let i=e.geometry.coordinates;if(i&&0===i.length)return;let a=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)V(i,s);else if("MultiPoint"===a)for(let t of i)V(t,s);else if("LineString"===a)q(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(let r of i)s=[],q(r,s,o,!1),t.push(N(l,"LineString",s,e.properties));return}H(i,s,o,!1)}else if("Polygon"===a)H(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(let i of e.geometry.geometries)U(t,{id:l,geometry:i,properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let t of i){let e=[];H(t,e,o,!0),s.push(e)}}t.push(N(l,a,s,e.properties))}function V(t,e){e.push(G(t[0]),Z(t[1]),0)}function q(t,e,r,n){let i,a,o=0;for(let r=0;r<t.length;r++){let s=G(t[r][0]),l=Z(t[r][1]);e.push(s,l,0),r>0&&(o+=n?(i*l-s*a)/2:Math.sqrt(Math.pow(s-i,2)+Math.pow(l-a,2))),i=s,a=l}let s=e.length-3;e[2]=1,F(e,0,s,r),e[s+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function H(t,e,r,n){for(let i=0;i<t.length;i++){let a=[];q(t[i],a,r,n),e.push(a)}}function G(t){return t/360+.5}function Z(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function W(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<n)return t;if(o<r||a>=n)return null;let l=[];for(let e of t){let t=e.geometry,a=e.type,o=0===i?e.minX:e.minY,u=0===i?e.maxX:e.maxY;if(o>=r&&u<n){l.push(e);continue}if(u<r||o>=n)continue;let c=[];if("Point"===a||"MultiPoint"===a)Y(t,c,r,n,i);else if("LineString"===a)X(t,c,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===a)J(t,c,r,n,i,!1);else if("Polygon"===a)J(t,c,r,n,i,!0);else if("MultiPolygon"===a)for(let e of t){let t=[];J(e,t,r,n,i,!0),t.length&&c.push(t)}if(c.length){if(s.lineMetrics&&"LineString"===a){for(let t of c)l.push(N(e.id,a,t,e.tags));continue}"LineString"!==a&&"MultiLineString"!==a||(1===c.length?(a="LineString",c=c[0]):a="MultiLineString"),"Point"!==a&&"MultiPoint"!==a||(a=3===c.length?"Point":"MultiPoint"),l.push(N(e.id,a,c,e.tags))}}return l.length?l:null}function Y(t,e,r,n,i){for(let a=0;a<t.length;a+=3){let o=t[a+i];o>=r&&o<=n&&K(e,t[a],t[a+1],t[a+2])}}function X(t,e,r,n,i,a,o){let s,l,u=$(t),c=0===i?Q:tt,h=t.start;for(let f=0;f<t.length-3;f+=3){let p=t[f],d=t[f+1],m=t[f+2],g=t[f+3],y=t[f+4],v=0===i?p:d,x=0===i?g:y,_=!1;o&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(d-y,2))),v<r?x>r&&(l=c(u,p,d,g,y,r),o&&(u.start=h+s*l)):v>n?x<n&&(l=c(u,p,d,g,y,n),o&&(u.start=h+s*l)):K(u,p,d,m),x<r&&v>=r&&(l=c(u,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=c(u,p,d,g,y,n),_=!0),!a&&_&&(o&&(u.end=h+s*l),e.push(u),u=$(t)),o&&(h+=s)}let f=t.length-3,p=t[f],d=t[f+1],m=0===i?p:d;m>=r&&m<=n&&K(u,p,d,t[f+2]),f=u.length-3,a&&f>=3&&(u[f]!==u[0]||u[f+1]!==u[1])&&K(u,u[0],u[1],u[2]),u.length&&e.push(u)}function $(t){let e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,r,n,i,a){for(let o of t)X(o,e,r,n,i,a,!1)}function K(t,e,r,n){t.push(e,r,n)}function Q(t,e,r,n,i,a){let o=(a-e)/(n-e);return K(t,a,r+(i-r)*o,1),o}function tt(t,e,r,n,i,a){let o=(a-r)/(i-r);return K(t,e+(n-e)*o,a,1),o}function et(t,e){let r=[];for(let n=0;n<t.length;n++){let i,a=t[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=rt(a.geometry,e);else if("MultiLineString"===o||"Polygon"===o){i=[];for(let t of a.geometry)i.push(rt(t,e))}else if("MultiPolygon"===o){i=[];for(let t of a.geometry){let r=[];for(let n of t)r.push(rt(n,e));i.push(r)}}r.push(N(a.id,o,i,a.tags))}return r}function rt(t,e){let r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(let n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function nt(t,e){if(t.transformed)return t;let r=1<<t.z,n=t.x,i=t.y;for(let a of t.features){let t=a.geometry,o=a.type;if(a.geometry=[],1===o)for(let o=0;o<t.length;o+=2)a.geometry.push(it(t[o],t[o+1],e,r,n,i));else for(let o=0;o<t.length;o++){let s=[];for(let a=0;a<t[o].length;a+=2)s.push(it(t[o][a],t[o][a+1],e,r,n,i));a.geometry.push(s)}}return t.transformed=!0,t}function it(t,e,r,n,i,a){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function at(t,e,r,n,i){let a=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let e of t)ot(o,e,a,i);return o}function ot(t,e,r,n){let i=e.geometry,a=e.type,o=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===a||"MultiPoint"===a)for(let e=0;e<i.length;e+=3)o.push(i[e],i[e+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)st(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(let e=0;e<i.length;e++)st(o,i[e],t,r,"Polygon"===a,0===e);else if("MultiPolygon"===a)for(let e=0;e<i.length;e++){let n=i[e];for(let e=0;e<n.length;e++)st(o,n[e],t,r,!0,0===e)}if(o.length){let r=e.tags||null;if("LineString"===a&&n.lineMetrics){r={};for(let t in e.tags)r[t]=e.tags[t];r.mapbox_clip_start=i.start/i.size,r.mapbox_clip_end=i.end/i.size}let s={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:r};null!==e.id&&(s.id=e.id),t.features.push(s)}}function st(t,e,r,n,i,a){let o=n*n;if(n>0&&e.size<(i?o:n))return void(r.numPoints+=e.length/3);let s=[];for(let t=0;t<e.length;t+=3)(0===n||e[t+2]>o)&&(r.numSimplified++,s.push(e[t],e[t+1])),r.numPoints++;i&&function(t,e){let r=0;for(let e=0,n=t.length,i=n-2;e<n;i=e,e+=2)r+=(t[e]-t[i])*(t[e+1]+t[i+1]);if(r>0===e)for(let e=0,r=t.length;e<r/2;e+=2){let n=t[e],i=t[e+1];t[e]=t[r-2-e],t[e+1]=t[r-1-e],t[r-2-e]=n,t[r-1-e]=i}}(s,a),t.push(s)}let lt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class ut{constructor(t,e){let r=(e=this.options=function(t,e){for(let r in e)t[r]=e[r];return t}(Object.create(lt),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(t,e){let r=[];if("FeatureCollection"===t.type)for(let n=0;n<t.features.length;n++)U(r,t.features[n],e,n);else U(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(t,e){let r=e.buffer/e.extent,n=t,i=W(t,1,-1-r,r,0,-1,2,e),a=W(t,1,1-r,2+r,0,-1,2,e);return(i||a)&&(n=W(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=et(i,1).concat(n)),a&&(n=n.concat(et(a,-1)))),n}(n,e),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,r,n,i,a,o){let s=[t,e,r,n],l=this.options,u=l.debug;for(;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();let c=1<<e,h=ct(e,r,n),f=this.tiles[h];if(!f&&(u>1&&console.time("creation"),f=this.tiles[h]=at(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));let t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){let t=i-e;if(r!==a>>t||n!==o>>t)continue}}if(f.source=null,0===t.length)continue;u>1&&console.time("clipping");let p=.5*l.buffer/l.extent,d=.5-p,m=.5+p,g=1+p,y=null,v=null,x=null,_=null,b=W(t,c,r-p,r+m,0,f.minX,f.maxX,l),w=W(t,c,r+d,r+g,0,f.minX,f.maxX,l);t=null,b&&(y=W(b,c,n-p,n+m,1,f.minY,f.maxY,l),v=W(b,c,n+d,n+g,1,f.minY,f.maxY,l),b=null),w&&(x=W(w,c,n-p,n+m,1,f.minY,f.maxY,l),_=W(w,c,n+d,n+g,1,f.minY,f.maxY,l),w=null),u>1&&console.timeEnd("clipping"),s.push(y||[],e+1,2*r,2*n),s.push(v||[],e+1,2*r,2*n+1),s.push(x||[],e+1,2*r+1,2*n),s.push(_||[],e+1,2*r+1,2*n+1)}}getTile(t,e,r){t=+t,e=+e,r=+r;let n=this.options,{extent:i,debug:a}=n;if(t<0||t>24)return null;let o=1<<t,s=ct(t,e=e+o&o-1,r);if(this.tiles[s])return nt(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);let l,u=t,c=e,h=r;for(;!l&&u>0;)u--,c>>=1,h>>=1,l=this.tiles[ct(u,c,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",u,c,h),console.time("drilling down")),this.splitTile(l.source,u,c,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?nt(this.tiles[s],i):null):null}}function ct(t,e,r){return 32*((1<<t)*r+e)+t}function ht(t,e){return e?t.properties[e]:t.id}function ft(t,e){if(null==t)return!0;if("Feature"===t.type)return null!=ht(t,e);if("FeatureCollection"===t.type){let r=new Set;for(let n of t.features){let t=ht(n,e);if(null==t||r.has(t))return!1;r.add(t)}return!0}return!1}function pt(t,e){let r=new Map;if(null!=t)if("Feature"===t.type)r.set(ht(t,e),t);else for(let n of t.features)r.set(ht(n,e),n);return r}class dt extends a{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(e,r){return t._(this,void 0,void 0,function*(){let r=e.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return null;let i=new class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.X,this.length=e.length,this._features=e}feature(e){return new class{constructor(e){this._feature=e,this.extent=t.X,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){let e=[];for(let r of this._feature.geometry)e.push([new t.P(r[0],r[1])]);return e}{let e=[];for(let r of this._feature.geometry){let n=[];for(let e of r)n.push(new t.P(e[0],e[1]));e.push(n)}return e}}toGeoJSON(t,e,r){return c.call(this,t,e,r)}}(this._features[e])}}(n.features),a=S(i);return 0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),{vectorTile:i,rawData:a.buffer}})}loadData(e){return t._(this,void 0,void 0,function*(){var r;null===(r=this._pendingRequest)||void 0===r||r.abort();let n=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(e,this._pendingRequest),this._geoJSONIndex=e.cluster?new L(function({superclusterOptions:e,clusterProperties:r}){if(!r||!e)return e;let n={},i={},a={accumulated:null,zoom:0},o={properties:null},s=Object.keys(r);for(let e of s){let[a,o]=r[e],s=t.bC(o),l=t.bC("string"==typeof a?[a,["accumulated"],["get",e]]:a);n[e]=s.value,i[e]=l.value}return e.map=t=>{o.properties=t;let e={};for(let t of s)e[t]=n[t].evaluate(a,o);return e},e.reduce=(t,e)=>{o.properties=e;for(let e of s)a.accumulated=t[e],t[e]=i[e].evaluate(a,o)},e}(e)).load((yield this._pendingData).features):(i=yield this._pendingData,new ut(i,e.geojsonVtOptions)),this.loaded={};let r={};if(n){let t=n.finish();t&&(r.resourceTiming={},r.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return r}catch(e){if(delete this._pendingRequest,t.bB(e))return{abandoned:!0};throw e}var i})}getData(){return t._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(t){let e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,r){return t._(this,void 0,void 0,function*(){let n=yield this.loadGeoJSON(e,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(u(n,!0),e.filter){let r=t.bC(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));n={type:"FeatureCollection",features:n.features.filter(t=>r.value.evaluate({zoom:0},t))}}return n})}loadGeoJSON(e,r){return t._(this,void 0,void 0,function*(){let{promoteId:n}=e;if(e.request){let i=yield t.h(e.request,r);return this._dataUpdateable=ft(i.data,n)?pt(i.data,n):void 0,i.data}if("string"==typeof e.data)try{let t=JSON.parse(e.data);return this._dataUpdateable=ft(t,n)?pt(t,n):void 0,t}catch(t){throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);return function(t,e,r){var n,i,a,o;if(e.removeAll&&t.clear(),e.remove)for(let r of e.remove)t.delete(r);if(e.add)for(let n of e.add){let e=ht(n,r);null!=e&&t.set(e,n)}if(e.update)for(let r of e.update){let e=t.get(r.id);if(null==e)continue;let s=!r.removeAllProperties&&((null===(n=r.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=r.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((r.newGeometry||r.removeAllProperties||s)&&(e=Object.assign({},e),t.set(r.id,e),s&&(e.properties=Object.assign({},e.properties))),r.newGeometry&&(e.geometry=r.newGeometry),r.removeAllProperties)e.properties={};else if((null===(a=r.removeProperties)||void 0===a?void 0:a.length)>0)for(let t of r.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(o=r.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(let{key:t,value:n}of r.addOrUpdateProperties)e.properties[t]=n}}(this._dataUpdateable,e.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(e){return t._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class mt{constructor(e){this.self=e,this.actor=new t.F(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=e=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(e)},this.actor.registerMessageHandler("LDT",(t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e)),this.actor.registerMessageHandler("RDT",(e,r)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})),this.actor.registerMessageHandler("GCEZ",(e,r)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})),this.actor.registerMessageHandler("GCC",(e,r)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})),this.actor.registerMessageHandler("GCL",(e,r)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})),this.actor.registerMessageHandler("LD",(t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e)),this.actor.registerMessageHandler("GD",(t,e)=>this._getWorkerSource(t,e.type,e.source).getData()),this.actor.registerMessageHandler("LT",(t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e)),this.actor.registerMessageHandler("RT",(t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e)),this.actor.registerMessageHandler("AT",(t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e)),this.actor.registerMessageHandler("RMT",(t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e)),this.actor.registerMessageHandler("RS",(e,r)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[e]||!this.workerSources[e][r.type]||!this.workerSources[e][r.type][r.source])return;let t=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],void 0!==t.removeSource&&t.removeSource(r)})),this.actor.registerMessageHandler("RM",e=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})),this.actor.registerMessageHandler("SR",(e,r)=>t._(this,void 0,void 0,function*(){this.referrer=r})),this.actor.registerMessageHandler("SRPS",(t,e)=>this._syncRTLPluginState(t,e)),this.actor.registerMessageHandler("IS",(e,r)=>t._(this,void 0,void 0,function*(){this.self.importScripts(r)})),this.actor.registerMessageHandler("SI",(t,e)=>this._setImages(t,e)),this.actor.registerMessageHandler("UL",(e,r)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(e).update(r.layers,r.removedIds)})),this.actor.registerMessageHandler("SL",(e,r)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(e).replace(r)}))}_setImages(e,r){return t._(this,void 0,void 0,function*(){this.availableImages[e]=r;for(let t in this.workerSources[e]){let n=this.workerSources[e][t];for(let t in n)n[t].availableImages=r}})}_syncRTLPluginState(e,r){return t._(this,void 0,void 0,function*(){if(t.bD.isParsed())return t.bD.getState();if("loading"!==r.pluginStatus)return t.bD.setState(r),r;let e=r.pluginURL;if(this.self.importScripts(e),t.bD.isParsed()){let r={pluginStatus:"loaded",pluginURL:e};return t.bD.setState(r),r}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let r=this.layerIndexes[t];return r||(r=this.layerIndexes[t]=new e),r}_getWorkerSource(t,e,r){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){let n={sendAsync:(e,r)=>(e.targetMapId=t,this.actor.sendAsync(e,r))};switch(e){case"vector":this.workerSources[t][e][r]=new a(n,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new dt(n,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](n,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new o),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new mt(self)),mt}),n("index",0,function(t,e){var r="4.7.1";let n,i,a={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:t=>new Promise((r,n)=>{let i=requestAnimationFrame(r);t.signal.addEventListener("abort",()=>{cancelAnimationFrame(i),n(e.c())})}),getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){let e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL:t=>(n||(n=document.createElement("a")),n.href=t,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(t){if(!o.docStyle)return t[0];for(let e=0;e<t.length;e++)if(t[e]in o.docStyle)return t[e];return t[0]}static create(t,e,r){let n=window.document.createElement(t);return void 0!==e&&(n.className=e),r&&r.appendChild(n),n}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){o.docStyle&&o.selectProp&&(o.userSelect=o.docStyle[o.selectProp],o.docStyle[o.selectProp]="none")}static enableDrag(){o.docStyle&&o.selectProp&&(o.docStyle[o.selectProp]=o.userSelect)}static setTransform(t,e){t.style[o.transformProp]=e}static addEventListener(t,e,r,n={}){t.addEventListener(e,r,"passive"in n?n:n.capture)}static removeEventListener(t,e,r,n={}){t.removeEventListener(e,r,"passive"in n?n:n.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",o.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",o.suppressClickInternal,!0)},0)}static getScale(t){let e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,r,n){let i=r.boundingClientRect;return new e.P((n.clientX-i.left)/r.x-t.clientLeft,(n.clientY-i.top)/r.y-t.clientTop)}static mousePos(t,e){let r=o.getScale(t);return o.getPoint(t,r,e)}static touchPos(t,e){let r=[],n=o.getScale(t);for(let i=0;i<e.length;i++)r.push(o.getPoint(t,n,e[i]));return r}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}o.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o.transformProp=o.testProp(["transform","WebkitTransform"]);let s,l,u={supported:!1,testSupport:function(t){!c&&l&&(h?f(t):s=t)}},c=!1,h=!1;function f(t){let e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,l),t.isContextLost())return;u.supported=!0}catch(t){}t.deleteTexture(e),c=!0}var p;"undefined"!=typeof document&&(l=document.createElement("img"),l.onload=()=>{s&&f(s),s=null,h=!0},l.onerror=()=>{c=!0,s=null},l.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let r,n,i,a;t.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},t.addThrottleControl=t=>{let e=i++;return a[e]=t,e},t.removeThrottleControl=t=>{delete a[t],s()},t.getImage=(t,n,i=!0)=>new Promise((a,o)=>{u.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),r.push({abortController:n,requestParameters:t,supportImageRefresh:i,state:"queued",onError:t=>{o(t)},onSuccess:t=>{a(t)}}),s()});let o=t=>e._(this,void 0,void 0,function*(){t.state="running";let{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:u}=t,c=!1===i&&!e.i(self)&&!e.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce((t,e)=>t&&"accept"===e,!0));n++;let h=c?l(r,u):e.m(r,u);try{let r=yield h;delete t.abortController,t.state="completed",r.data instanceof HTMLImageElement||e.b(r.data)?o(r):r.data&&o({data:yield(f=r.data,"function"==typeof createImageBitmap?e.d(f):e.f(f)),cacheControl:r.cacheControl,expires:r.expires})}catch(e){delete t.abortController,a(e)}finally{n--,s()}var f}),s=()=>{let t=(()=>{for(let t of Object.keys(a))if(a[t]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=n;e<t&&r.length>0;e++){let t=r.shift();t.abortController.signal.aborted?e--:o(t)}},l=(t,r)=>new Promise((n,i)=>{let a=new Image,o=t.url,s=t.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",()=>{a.src="",i(e.c())}),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=o})}(p||(p={})),p.resetRequestQueue();class d{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function m(t){var r=new e.A(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}var g,y=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};g=new e.A(3),e.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v,x=function(t){var e=t[0],r=t[1];return e*e+r*r};function _(t){let e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){let r=[];for(let{id:n,url:i}of t){let t=`${n}${i}`;-1===r.indexOf(t)&&(r.push(t),e.push({id:n,url:i}))}}return e}function b(t,e,r){let n=t.split("?");return n[0]+=`${e}${r}`,n.join("?")}v=new e.A(2),e.A!=Float32Array&&(v[0]=0,v[1]=0);class w{constructor(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,r,n){let{width:i,height:a}=t,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=!(!r||!r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,t.data);else{let{x:r,y:o}=n||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(t,e,r){let{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function T(t){let{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class k extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){let r=this.images[t];if(r&&!r.data&&r.spriteData){let t=r.spriteData;r.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,r){let n=!0,i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let r=0;for(let n of t){if(n[0]<r||n[1]<n[0]||e<n[1])return!1;r=n[1]}return!0}_validateContent(t,e){if(!t)return!0;if(4!==t.length)return!1;let r=e.spriteData,n=r&&r.width||e.data.width,i=r&&r.height||e.data.height;return!(t[0]<0||n<t[0]||t[1]<0||i<t[1]||t[2]<0||n<t[2]||t[3]<0||i<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,e,r=!0){let n=this.getImage(t);if(r&&(n.data.width!==e.data.width||n.data.height!==e.data.height))throw new Error(`size mismatch between old image (${n.data.width}x${n.data.height}) and new image (${e.data.width}x${e.data.height}).`);e.version=n.version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){let e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise((e,r)=>{let n=!0;if(!this.isLoaded())for(let e of t)this.images[e]||(n=!1);this.isLoaded()||n?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})})}_getImagesForIds(t){let r={};for(let n of t){let t=this.getImage(n);t||(this.fire(new e.k("styleimagemissing",{id:n})),t=this.getImage(n)),t?r[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:!(!t.userImage||!t.userImage.render)}:e.w(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return r}getPixelSize(){let{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){let r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{let r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new e.I(r,n);this.patterns[t]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new w(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let e in this.patterns)t.push(this.patterns[e].bin);let{w:r,h:n}=e.p(t),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(let t in this.patterns){let{bin:r}=this.patterns[t],n=r.x+1,a=r.y+1,o=this.getImage(t).data,s=o.width,l=o.height;e.R.copy(o,i,{x:0,y:0},{x:n,y:a},{width:s,height:l}),e.R.copy(o,i,{x:0,y:l-1},{x:n,y:a-1},{width:s,height:1}),e.R.copy(o,i,{x:0,y:0},{x:n,y:a+l},{width:s,height:1}),e.R.copy(o,i,{x:s-1,y:0},{x:n-1,y:a},{width:1,height:l}),e.R.copy(o,i,{x:0,y:0},{x:n+s,y:a},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let r of t){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;let t=this.getImage(r);t||e.w(`Image with ID: "${r}" was not found`),T(t)&&this.updateImage(r,t)}}}let A,M=1e20;function S(t,e,r,n,i,a,o,s,l){for(let u=e;u<e+n;u++)E(t,r*a+u,a,i,o,s,l);for(let u=r;u<r+i;u++)E(t,u*a+e,1,n,o,s,l)}function E(t,e,r,n,i,a,o){a[0]=0,o[0]=-M,o[1]=M,i[0]=t[e];for(let s=1,l=0,u=0;s<n;s++){i[s]=t[e+s*r];let n=s*s;do{let t=a[l];u=(i[s]-i[t]+n-t*t)/(s-t)/2}while(u<=o[l]&&--l>-1);l++,a[l]=s,o[l]=u,o[l+1]=M}for(let s=0,l=0;s<n;s++){for(;o[l+1]<s;)l++;let n=a[l],u=s-n;t[e+s*r]=i[n]+u*u}}class C{constructor(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}}setURL(t){this.url=t}getGlyphs(t){return e._(this,void 0,void 0,function*(){let e=[];for(let r in t)for(let n of t[r])e.push(this._getAndCacheGlyphsPromise(r,n));let r=yield Promise.all(e),n={};for(let{stack:t,id:e,glyph:i}of r)n[t]||(n[t]={}),n[t][e]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics};return n})}_getAndCacheGlyphsPromise(t,r){return e._(this,void 0,void 0,function*(){let e=this.entries[t];e||(e=this.entries[t]={glyphs:{},requests:{},ranges:{}});let n=e.glyphs[r];if(void 0!==n)return{stack:t,id:r,glyph:n};if(n=this._tinySDF(e,t,r),n)return e.glyphs[r]=n,{stack:t,id:r,glyph:n};let i=Math.floor(r/256);if(256*i>65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[i])return{stack:t,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[i]){let r=C.loadGlyphRange(t,i,this.url,this.requestManager);e.requests[i]=r}let a=yield e.requests[i];for(let t in a)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=a[+t]);return e.ranges[i]=!0,{stack:t,id:r,glyph:a[r]||null}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(t))}_tinySDF(t,r,n){let i=this.localIdeographFontFamily;if(!i||!this._doesCharSupportLocalGlyph(n))return;let a=t.tinySDF;if(!a){let e="400";/bold/i.test(r)?e="900":/medium/i.test(r)?e="500":/light/i.test(r)&&(e="200"),a=t.tinySDF=new C.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:e})}let o=a.draw(String.fromCharCode(n));return{id:n,bitmap:new e.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}C.loadGlyphRange=function(t,r,n,i){return e._(this,void 0,void 0,function*(){let a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",t).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield e.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);let u={};for(let t of e.n(l.data))u[t.id]=t;return u})},C.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=r;let s=this.size=t+4*e,l=this._createCanvas(s),u=this.ctx=l.getContext("2d",{willReadFrequently:!0});u.font=`${o} ${a} ${t}px ${i}`,u.textBaseline="alphabetic",u.textAlign="left",u.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(t){let e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){let{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(t),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),u=s+2*this.buffer,c=l+2*this.buffer,h=Math.max(u*c,0),f=new Uint8ClampedArray(h),p={data:f,width:u,height:c,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;let{ctx:d,buffer:m,gridInner:g,gridOuter:y}=this;d.clearRect(m,m,s,l),d.fillText(t,m,m+o);let v=d.getImageData(m,m,s,l);y.fill(M,0,h),g.fill(0,0,h);for(let t=0;t<l;t++)for(let e=0;e<s;e++){let r=v.data[4*(t*s+e)+3]/255;if(0===r)continue;let n=(t+m)*u+e+m;if(1===r)y[n]=0,g[n]=M;else{let t=.5-r;y[n]=t>0?t*t:0,g[n]=t<0?t*t:0}}S(y,0,0,u,c,u,this.f,this.v,this.z),S(g,m,m,s,l,u,this.f,this.v,this.z);for(let t=0;t<h;t++){let e=Math.sqrt(y[t])-Math.sqrt(g[t]);f[t]=Math.round(255-255*(e/this.radius+this.cutoff))}return p}};class I{constructor(){this.specification=e.v.light.position}possiblyEvaluate(t,r){return e.x(t.expression.evaluate(r))}interpolate(t,r,n){return{x:e.y.number(t.x,r.x,n),y:e.y.number(t.y,r.y,n),z:e.y.number(t.z,r.z,n)}}}class L extends e.E{constructor(t){super(),A=A||new e.q({anchor:new e.D(e.v.light.anchor),position:new I,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this._transitionable=new e.T(A),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,r={}){if(!this._validate(e.r,t,r))for(let e in t){let r=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),r):this._transitionable.setValue(e,r)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r,n){return(!n||!1!==n.validate)&&e.t(this,t.call(e.u,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}let P=new e.q({"sky-color":new e.D(e.v.sky["sky-color"]),"horizon-color":new e.D(e.v.sky["horizon-color"]),"fog-color":new e.D(e.v.sky["fog-color"]),"fog-ground-blend":new e.D(e.v.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.v.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.v.sky["atmosphere-blend"])});class z extends e.E{constructor(t){super(),this._transitionable=new e.T(P),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.z(0))}setSky(t,r={}){if(!this._validate(e.B,t,r)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let e in t){let r=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),r):this._transitionable.setValue(e,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r,n={}){return!1!==(null==n?void 0:n.validate)&&e.t(this,t.call(e.u,e.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class O{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){let r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]}getDashRanges(t,e,r){let n=[],i=t.length%2==1?-t[t.length-1]*r:0,a=t[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===t[0]});let s=t[0];for(let e=1;e<t.length;e++){o=!o;let l=t[e];i=s*r,s+=l,a=s*r,n.push({left:i,right:a,isDash:o,zeroLength:0===l})}return n}addRoundDash(t,e,r){let n=e/2;for(let e=-r;e<=r;e++){let i=this.width*(this.nextRow+r+e),a=0,o=t[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=t[++a]);let l,u=Math.abs(s-o.left),c=Math.abs(s-o.right),h=Math.min(u,c),f=e/r*(n+1);if(o.isDash){let t=n-Math.abs(f);l=Math.sqrt(h*h+t*t)}else l=n-Math.sqrt(h*h+f*f);this.data[i+s]=Math.max(0,Math.min(255,l+128))}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){let r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}let e=t[0],r=t[t.length-1];e.isDash===r.isDash&&(e.left=r.left-this.width,r.right=e.right+this.width);let n=this.width*this.nextRow,i=0,a=t[i];for(let e=0;e<this.width;e++){e/a.right>1&&(a=t[++i]);let r=Math.abs(e-a.left),o=Math.abs(e-a.right),s=Math.min(r,o);this.data[n+e]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(t,r){let n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.w("LineAtlas out of space"),null;let a=0;for(let e=0;e<t.length;e++)a+=t[e];if(0!==a){let e=this.width/a,i=this.getDashRanges(t,this.width,e);r?this.addRoundDash(i,e,n):this.addRegularDash(i)}let o={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,o}bind(t){let e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}}let D="maplibre_preloaded_worker_pool";class R{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<R.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach(t=>{t.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[D]}numActive(){return Object.keys(this.active).length}}let F,B,N=Math.floor(a.hardwareConcurrency/2);function j(){return F||(F=new R),F}R.workerCount=e.C(globalThis)?Math.max(Math.min(N,3),1):1;class U{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=r;let n=this.workerPool.acquire(r);for(let t=0;t<n.length;t++){let i=new e.F(n[t],r);i.name=`Worker ${t}`,this.actors.push(i)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,e){let r=[];for(let n of this.actors)r.push(n.sendAsync({type:t,data:e}));return Promise.all(r)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(t=>{t.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(let r of this.actors)r.registerMessageHandler(t,e)}}function V(){return B||(B=new U(j(),e.G),B.registerMessageHandler("GR",(t,r,n)=>e.m(r,n))),B}function q(t,r){let n=e.H();return e.J(n,n,[1,1,0]),e.K(n,n,[.5*t.width,.5*t.height,1]),e.L(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function H(t,e,r,n,i,a){let o=function(t,e,r){if(t)for(let n of t){let t=e[n];if(t&&t.source===r&&"fill-extrusion"===t.type)return!0}else for(let t in e){let n=e[t];if(n.source===r&&"fill-extrusion"===n.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort(G);let u=[];for(let n of l)u.push({wrappedTileID:n.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,r,t._state,n.queryGeometry,n.cameraQueryGeometry,n.scale,i,a,s,q(t.transform,n.tileID))});let c=function(t){let e={},r={};for(let n of t){let t=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(let r in t){let n=t[r],i=a[r]=a[r]||{},o=e[r]=e[r]||[];for(let t of n)i[t.featureIndex]||(i[t.featureIndex]=!0,o.push(t))}}return e}(u);for(let e in c)c[e].forEach(e=>{let r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n});return c}function G(t,e){let r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function Z(t,r,n){return e._(this,void 0,void 0,function*(){let i=t;if(t.url?i=(yield e.h(r.transformRequest(t.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;let o=e.M(e.e(i,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map(t=>t.id)),o})}class W{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}extend(t){let r,n,i=this._sw,a=this._ne;if(t instanceof e.N)r=t,n=t;else{if(!(t instanceof W))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(W.convert(t)):this.extend(e.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.N.convert(t)):this;if(r=t._sw,n=t._ne,!r||!n)return this}return i||a?(i.lng=Math.min(r.lng,i.lng),i.lat=Math.min(r.lat,i.lat),a.lng=Math.max(n.lng,a.lng),a.lat=Math.max(n.lat,a.lat)):(this._sw=new e.N(r.lng,r.lat),this._ne=new e.N(n.lng,n.lat)),this}getCenter(){return new e.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){let{lng:r,lat:n}=e.N.convert(t),i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(t){return t instanceof W?t:t&&new W(t)}static fromLngLat(t,r=0){let n=360*r/40075017,i=n/Math.cos(Math.PI/180*t.lat);return new W(new e.N(t.lng-i,t.lat-n),new e.N(t.lng+i,t.lat+n))}adjustAntiMeridian(){let t=new e.N(this._sw.lng,this._sw.lat),r=new e.N(this._ne.lng,this._ne.lat);return new W(t,t.lng>r.lng?new e.N(r.lng+360,r.lat):r)}}class Y{constructor(t,e,r){this.bounds=W.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let r=Math.pow(2,t.z),n=Math.floor(e.O(this.bounds.getWest())*r),i=Math.floor(e.Q(this.bounds.getNorth())*r),a=Math.ceil(e.O(this.bounds.getEast())*r),o=Math.ceil(e.Q(this.bounds.getSouth())*r);return t.x>=n&&t.x<a&&t.y>=i&&t.y<o}}class X extends e.E{constructor(t,r,n,i){if(super(),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.M(r,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let t=yield Z(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t&&(e.e(this,t),t.bounds&&(this.tileBounds=new Y(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,function*(){let e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(e,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise((e,r)=>{t.reloadPromise={resolve:e,reject:r}})}else t.actor=this.dispatcher.getActor(),n="LT";t.abortController=new AbortController;try{let e=yield t.actor.sendAsync({type:n,data:r},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}})}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){let e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class $ extends e.E{constructor(t,r,n,i){super(),this.id=t,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},r),e.e(this,e.M(r,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let t=yield Z(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(e.e(this,t),t.bounds&&(this.tileBounds=new Y(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,function*(){let e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{let r=yield p.getImage(this.map._requestManager.transformRequest(e,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let e=this.map.painter.context,n=e.gl,i=r.data;t.texture=this.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new w(e,i,n.RGBA,{useMipmap:!0}),t.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}})}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class J extends ${constructor(t,r,n,i){super(t,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(t){return e._(this,void 0,void 0,function*(){let r=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let r=yield p.getImage(n,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){let n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let i=e.b(n)&&e.U()?n:yield this.readImageNow(n),a={type:this.type,uid:t.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();let e=yield t.actor.sendAsync({type:"LDT",data:a});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}})}readImageNow(t){return e._(this,void 0,void 0,function*(){if("undefined"!=typeof VideoFrame&&e.V()){let r=t.width+2,n=t.height+2;try{return new e.R({width:r,height:n},yield e.W(t,-1,-1,r,n))}catch(t){}}return a.getImageData(t,1)})}_getNeighboringTiles(t){let r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.S(t.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.S(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new e.S(t.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l}unloadTile(t){return e._(this,void 0,void 0,function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))})}}class K extends e.E{constructor(t,r,n,i){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=e.e({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;let a=e.X/this.tileSize;void 0!==r.clusterMaxZoom&&this.maxzoom<=r.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:e.X,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:e.X,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}getData(){return e._(this,void 0,void 0,function*(){let t=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})})}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,e,r){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:r}})}_updateWorkerData(t){return e._(this,void 0,void 0,function*(){let r=e.e({type:this.type},this.workerOptions);t?r.dataDiff=t:"string"==typeof this._data?(r.request=this.map._requestManager.transformRequest(a.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.k("dataloading",{dataType:"source"}));try{let t=yield this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||t.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}));let n=null;t.resourceTiming&&t.resourceTiming[this.id]&&(n=t.resourceTiming[this.id].slice(0));let i={dataType:"source"};this._collectResourceTiming&&n&&n.length>0&&e.e(i,{resourceTiming:n}),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(t){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(t))}})}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,function*(){let e=t.actor?"RT":"LT";t.actor=this.actor;let r={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;let n=yield this.actor.sendAsync({type:e,data:r},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(n,this.map.painter,"RT"===e)})}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Q=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class tt extends e.E{constructor(t,e,r,n){super(),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e}load(t){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let e=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,this.fire(new e.j(t))}})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;let r=t.map(e.Z.fromLngLat);this.tileID=function(t){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(let e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);let o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new e.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;let n=r.map(t=>this.tileID.getTilePoint(t)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,e.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,e.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new w(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let t in this.tiles){let e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class et extends tt{constructor(t,e,r,n){super(t,e,r,n),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;let t=this.options;this.urls=[];for(let e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{let t=yield e.a3(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.j(t))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new w(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let t in this.tiles){let e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class rt extends tt{constructor(t,r,n,i){super(t,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some(t=>!Array.isArray(t)||2!==t.length||t.some(t=>"number"!=typeof t))||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.j(new e.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return e._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new w(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(let t in this.tiles){let e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,i=!0)}i&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let nt={},it=t=>{switch(t){case"geojson":return K;case"image":return tt;case"raster":return $;case"raster-dem":return J;case"vector":return X;case"video":return et;case"canvas":return rt}return nt[t]},at="RTLPluginLoaded";class ot extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=V()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch(t=>{throw this.status="error",t})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,function*(t,e=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=a.resolveURL(t),!this.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()})}_requestImport(){return e._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(at))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let st=null;function lt(){return st||(st=new ot),st}class ut{constructor(t,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a4(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){let e=t+this.timeAdded;e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,r,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){let r={};if(!e)return r;for(let n of t){let t=n.layerIds.map(t=>e.getLayer(t)).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map(e=>t.filter(t=>t.id===e)[0]));for(let e of t)r[e.id]=n}}return r}(t.buckets,r.style),this.hasSymbolBuckets=!1;for(let t in this.buckets){let r=this.buckets[t];if(r instanceof e.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let t in this.buckets){let r=this.buckets[t];if(r instanceof e.a6&&r.hasRTLText){this.hasRTLText=!0,lt().lazyLoad();break}}this.queryPadding=0;for(let t in this.buckets){let e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let e in this.buckets){let r=this.buckets[e];r.uploadPending()&&r.upload(t)}let e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new w(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new w(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,r,n,i,a,o,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}}querySourceFeatures(t,r){let n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;let i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;let s=e.a7(r&&r.filter),{z:l,x:u,y:c}=this.tileID.canonical,h={z:l,x:u,y:c};for(let r=0;r<o.length;r++){let i=o.feature(r);if(s.needGeometry){let t=e.a8(i,!0);if(!s.filter(new e.z(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new e.z(this.tileID.overscaledZ),i))continue;let f=n.getId(i,a),p=new e.a9(i,l,u,c,f);p.tile=h,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){let r=this.expirationTime;if(t.cacheControl){let r=e.aa(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let t=Date.now(),e=!1;if(this.expirationTime>t)e=!1;else if(r)if(this.expirationTime<r)e=!0;else{let n=this.expirationTime-r;n?this.expirationTime=t+Math.max(n,3e4):e=!0}else e=!0;e?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;let r=this.latestFeatureIndex.loadVTLayers();for(let n in this.buckets){if(!e.style.hasLayer(n))continue;let i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(!o||!s||0===Object.keys(s).length)continue;i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});let l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=a.now()+t}setDependencies(t,e){let r={};for(let t of e)r[t]=!0;this.dependencies[t]=r}hasDependency(t,e){for(let r of t){let t=this.dependencies[r];if(t)for(let r of e)if(t[r])return!0}return!1}}class ct{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(let t in this.data)for(let e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,r){let n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);let i={value:e,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout(()=>{this.remove(t,i)},r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){let e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){let e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;let r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){let e=[];for(let r in this.data)for(let n of this.data[r])t(n.value)||e.push(n);for(let t of e)this.remove(t.value.tileID,t)}}class ht{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,r,n){let i=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},e.e(this.stateChanges[t][i],n),null===this.deletedStates[t]){this.deletedStates[t]={};for(let e in this.state[t])e!==i&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][i]){this.deletedStates[t][i]={};for(let e in this.state[t][i])n[e]||(this.deletedStates[t][i][e]=null)}else for(let e in n)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][e]&&delete this.deletedStates[t][i][e]}removeFeatureState(t,e,r){if(null===this.deletedStates[t])return;let n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,r){let n=String(r),i=e.e({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){let e=this.deletedStates[t][r];if(null===e)return{};for(let t in e)delete i[t]}return i}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,r){let n={};for(let t in this.stateChanges){this.state[t]=this.state[t]||{};let r={};for(let n in this.stateChanges[t])this.state[t][n]||(this.state[t][n]={}),e.e(this.state[t][n],this.stateChanges[t][n]),r[n]=this.state[t][n];n[t]=r}for(let t in this.deletedStates){this.state[t]=this.state[t]||{};let r={};if(null===this.deletedStates[t])for(let e in this.state[t])r[e]={},this.state[t][e]={};else for(let e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(let r of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][r];r[e]=this.state[t][e]}n[t]=n[t]||{},e.e(n[t],r)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(let e in t)t[e].setFeatureState(n,r)}}class ft extends e.E{constructor(t,e,r){super(),this.id=t,this.dispatcher=r,this.on("data",t=>this._dataHandler(t)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((t,e,r,n)=>{let i=new(it(e.type))(t,e,r,n);if(i.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${i.id}`);return i})(t,e,r,this),this._tiles={},this._cache=new ct(0,t=>this._unloadTile(t)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ht,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let t in this._tiles){let e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,r,n){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,r,n)}catch(r){t.state="errored",404!==r.status?this._source.fire(new e.j(r,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let e in this._tiles){let r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(pt).map(t=>t.key)}getRenderableIds(t){let r=[];for(let e in this._tiles)this._isIdRenderable(e,t)&&r.push(this._tiles[e]);return t?r.sort((t,r)=>{let n=t.tileID,i=r.tileID,a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new e.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x}).map(t=>t.tileID.key):r.map(t=>t.tileID).sort(pt).map(t=>t.key)}hasRenderableParent(t){let e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(t,r){return e._(this,void 0,void 0,function*(){let e=this._tiles[t];e&&("loading"!==e.state&&(e.state=r),yield this._loadTile(e,t,r))})}_tileLoaded(t,r,n){t.timeAdded=a.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){let e=this.getRenderableIds();for(let n=0;n<e.length;n++){let i=e[n];if(t.neighboringTiles&&t.neighboringTiles[i]){let e=this.getTileByID(i);r(t,e),r(e,t)}}function r(t,e){t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0;let r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,r,n){for(let i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>e+1;){let t=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[t.key],a&&a.hasData()&&(o=t)}let s=o;for(;s.overscaledZ>e;)if(s=s.scaledTo(s.overscaledZ-1),t[s.key]){n[o.key]=o;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){let r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(let r=t.overscaledZ-1;r>=e;r--){let e=t.scaledTo(r),n=this._getLoadedTile(e);if(n)return n}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){let e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){let r=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(t){let e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){let t={};for(let r in this._tiles){let n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(t,e,r,n,i,o){let s={},l={},u=Object.keys(t),c=a.now();for(let r of u){let n=t[r],i=this._tiles[r];if(!i||0!==i.fadeEndTime&&i.fadeEndTime<=c)continue;let a=this.findLoadedParent(n,e),o=this.findLoadedSibling(n),u=a||o||null;u&&(this._addTile(u.tileID),s[u.tileID.key]=u.tileID),l[r]=n}this._retainLoadedChildren(l,n,r,t);for(let e in s)t[e]||(this._coveredTiles[e]=!0,t[e]=s[e]);if(o){let e={},r={};for(let t of i)this._tiles[t.key].hasData()?e[t.key]=t:r[t.key]=t;for(let n in r){let i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(e[i[0].key]=t[i[0].key]=i[0],e[i[1].key]=t[i[1].key]=i[1],e[i[2].key]=t[i[2].key]=i[2],e[i[3].key]=t[i[3].key]=i[3],delete r[n])}for(let n in r){let i=r[n],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){e[s.tileID.key]=t[s.tileID.key]=s.tileID;for(let t in e)e[t].isChildOf(s.tileID)&&delete e[t]}}for(let t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}update(t,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=t,this.terrain=r,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new e.S(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)):(n=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(n=n.filter(t=>this._source.hasTile(t)))):n=[];let i=t.coveringZoomLevel(this._source),a=Math.max(i-ft.maxOverzooming,this._source.minzoom),o=Math.max(i+ft.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let t={};for(let e of n)if(e.canonical.z>this._source.minzoom){let r=e.scaledTo(e.canonical.z-1);t[r.key]=r;let n=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[n.key]=n}n=n.concat(Object.values(t))}let s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let l=this._updateRetainedTiles(n,i);dt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(let t in l)this._tiles[t].clearFadeHold();let u=e.ab(this._tiles,l);for(let t of u){let e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var r;let n={},i={},a=Math.max(e-ft.maxOverzooming,this._source.minzoom),o=Math.max(e+ft.maxUnderzooming,this._source.minzoom),s={};for(let r of t){let t=this._addTile(r);n[r.key]=r,t.hasData()||e<this._source.maxzoom&&(s[r.key]=r)}this._retainLoadedChildren(s,e,o,n);for(let o of t){let t=this._tiles[o.key];if(t.hasData())continue;if(e+1>this._source.maxzoom){let t=o.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){n[t.key]=t;continue}}else{let t=o.children(this._source.maxzoom);if(n[t[0].key]&&n[t[1].key]&&n[t[2].key]&&n[t[3].key])continue}let s=t.wasRequested();for(let e=o.overscaledZ-1;e>=a;--e){let a=o.scaledTo(e);if(i[a.key])break;if(i[a.key]=!0,t=this.getTile(a),!t&&s&&(t=this._addTile(a)),t){let e=t.hasData();if((e||!(null!==(r=this.map)&&void 0!==r&&r.cancelPendingTileRequestsWhileZooming)||s)&&(n[a.key]=a),s=t.wasRequested(),e)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let t in this._tiles){let e,r=[],n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){e=this._loadedParentTiles[n.key];break}r.push(n.key);let t=n.scaledTo(n.overscaledZ-1);if(e=this._getLoadedTile(t),e)break;n=t}for(let t of r)this._loadedParentTiles[t]=e}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let t in this._tiles){let e=this._tiles[t].tileID,r=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=r}}_addTile(t){let r=this._tiles[t.key];if(r)return r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));let n=r;return r||(r=new ut(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,t.key,r.state)),r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);let r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},r))}_removeTile(t){let e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){let e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,r,n){let i=[],a=this.transform;if(!a)return i;let o=n?a.getCameraQueryGeometry(t):t,s=t.map(t=>a.pointCoordinate(t,this.terrain)),l=o.map(t=>a.pointCoordinate(t,this.terrain)),u=this.getIds(),c=1/0,h=1/0,f=-1/0,p=-1/0;for(let t of l)c=Math.min(c,t.x),h=Math.min(h,t.y),f=Math.max(f,t.x),p=Math.max(p,t.y);for(let t=0;t<u.length;t++){let n=this._tiles[u[t]];if(n.holdingForFade())continue;let o=n.tileID,d=Math.pow(2,a.zoom-n.tileID.overscaledZ),m=r*n.queryPadding*e.X/n.tileSize/d,g=[o.getTilePoint(new e.Z(c,h)),o.getTilePoint(new e.Z(f,p))];if(g[0].x-m<e.X&&g[0].y-m<e.X&&g[1].x+m>=0&&g[1].y+m>=0){let t=s.map(t=>o.getTilePoint(t)),e=l.map(t=>o.getTilePoint(t));i.push({tile:n,tileID:o,queryGeometry:t,cameraQueryGeometry:e,scale:d})}}return i}getVisibleCoordinates(t){let e=this.getRenderableIds(t).map(t=>this._tiles[t].tileID);for(let t of e)t.posMatrix=this.transform.calculatePosMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(dt(this._source.type)){let t=a.now();for(let e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)}removeFeatureState(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,r){let n=this._tiles[t];n&&n.setDependencies(e,r)}reloadTilesForDependencies(t,e){for(let r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter(r=>!r.hasDependency(t,e))}}function pt(t,e){let r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function dt(t){return"raster"===t||"image"===t||"video"===t}ft.maxOverzooming=10,ft.maxUnderzooming=3;class mt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ac(t,0,1);let r=1,n=this._distances[r],i=t*this.paddedLength+this.padding;for(;n<i&&r<this._distances.length;)n=this._distances[++r];let a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function gt(t,e){let r=!0;return"always"===t||"never"!==t&&"never"!==e||(r=!1),r}class yt{constructor(t,e,r){let n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(let t=0;t<this.xCellCount*this.yCellCount;t++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}insertCircle(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)}_insertBoxCell(t,e,r,n,i,a){this.boxCells[i].push(a)}_insertCircleCell(t,e,r,n,i,a){this.circleCells[i].push(a)}_query(t,e,r,n,i,a,o){if(r<0||t>this.width||n<0||e>this.height)return[];let s=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:t,y1:e,x2:r,y2:n}];for(let t=0;t<this.boxKeys.length;t++)s.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){let e=this.circles[3*t],r=this.circles[3*t+1],n=this.circles[3*t+2];s.push({key:this.circleKeys[t],x1:e-n,y1:r-n,x2:e+n,y2:r+n})}}else this._forEachCell(t,e,r,n,this._queryCell,s,{hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}query(t,e,r,n){return this._query(t,e,r,n,!1,null)}hitTest(t,e,r,n,i,a){return this._query(t,e,r,n,!0,i,a).length>0}hitTestCircle(t,e,r,n,i){let a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!1;let u=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,u,{hitTest:!0,overlapMode:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),u.length>0}_queryCell(t,e,r,n,i,a,o,s){let{seenUids:l,hitTest:u,overlapMode:c}=o,h=this.boxCells[i];if(null!==h){let i=this.bboxes;for(let o of h)if(!l.box[o]){l.box[o]=!0;let h=4*o,f=this.boxKeys[o];if(t<=i[h+2]&&e<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(f))&&(!u||!gt(c,f.overlapMode))&&(a.push({key:f,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),u))return!0}}let f=this.circleCells[i];if(null!==f){let i=this.circles;for(let o of f)if(!l.circle[o]){l.circle[o]=!0;let h=3*o,f=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],t,e,r,n)&&(!s||s(f))&&(!u||!gt(c,f.overlapMode))){let t=i[h],e=i[h+1],r=i[h+2];if(a.push({key:f,x1:t-r,y1:e-r,x2:t+r,y2:e+r}),u)return!0}}}return!1}_queryCellCircle(t,e,r,n,i,a,o,s){let{circle:l,seenUids:u,overlapMode:c}=o,h=this.boxCells[i];if(null!==h){let t=this.bboxes;for(let e of h)if(!u.box[e]){u.box[e]=!0;let r=4*e,n=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[r+0],t[r+1],t[r+2],t[r+3])&&(!s||s(n))&&!gt(c,n.overlapMode))return a.push(!0),!0}}let f=this.circleCells[i];if(null!==f){let t=this.circles;for(let e of f)if(!u.circle[e]){u.circle[e]=!0;let r=3*e,n=this.circleKeys[e];if(this._circlesCollide(t[r],t[r+1],t[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!gt(c,n.overlapMode))return a.push(!0),!0}}}_forEachCell(t,e,r,n,i,a,o,s){let l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let f=l;f<=c;f++)for(let l=u;l<=h;l++)if(i.call(this,t,e,r,n,this.xCellCount*l+f,a,o,s))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,r,n,i,a){let o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(t,e,r,n,i,a,o){let s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;let u=(o-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;let h=l-s,f=c-u;return h*h+f*f<=r*r}}function vt(t,r,n,i,a){let o=e.H();return r?(e.K(o,o,[1/a,1/a,1]),n||e.ad(o,o,i.angle)):e.L(o,i.labelPlaneMatrix,t),o}function xt(t,r,n,i,a){if(r){let r=e.ae(t);return e.K(r,r,[a,a,1]),n||e.ad(r,r,-i.angle),r}return i.glCoordMatrix}function _t(t,r,n,i){let a;i?(a=[t,r,i(t,r),1],e.af(a,a,n)):(a=[t,r,0,1],Dt(a,a,n));let o=a[3];return{point:new e.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function bt(t,e){return.5+t/e*.5}function wt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function Tt(t,r,n,i,a,o,s,l,u,c,h,f,p,d,m){let g=i?t.textSizeData:t.iconSizeData,y=e.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();let _=t.lineVertexArray,b=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=n.transform.width/n.transform.height,T=!1;for(let i=0;i<b.length;i++){let k=b.get(i);if(k.hidden||k.writingMode===e.ah.vertical&&!T){Ot(k.numGlyphs,x);continue}T=!1;let A=_t(k.anchorX,k.anchorY,r,m);if(!wt(A.point,v)){Ot(k.numGlyphs,x);continue}let M=bt(n.transform.cameraToCenterDistance,A.signedDistanceFromCamera),S=e.ai(g,y,k),E=s?S/M:S*M,C={getElevation:m,labelPlaneMatrix:a,lineVertexArray:_,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:c,tileAnchorPoint:new e.P(k.anchorX,k.anchorY),unwrappedTileID:h,width:f,height:p,translation:d},I=Mt(C,k,E,!1,l,r,o,t.glyphOffsetArray,x,w,u);T=I.useVertical,(I.notEnoughRoom||T||I.needsFlipping&&Mt(C,k,E,!0,l,r,o,t.glyphOffsetArray,x,w,u).notEnoughRoom)&&Ot(k.numGlyphs,x)}i?t.text.dynamicLayoutVertexBuffer.updateData(x):t.icon.dynamicLayoutVertexBuffer.updateData(x)}function kt(t,e,r,n,i,a,o,s){let l=a.glyphStartIndex+a.numGlyphs,u=a.lineStartIndex,c=a.lineStartIndex+a.lineLength,h=e.getoffsetX(a.glyphStartIndex),f=e.getoffsetX(l-1),p=Pt(t*h,r,n,i,a.segment,u,c,s,o);if(!p)return null;let d=Pt(t*f,r,n,i,a.segment,u,c,s,o);return d?s.projectionCache.anyProjectionOccluded?null:{first:p,last:d}:null}function At(t,r,n,i){return t===e.ah.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.ah.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function Mt(t,r,n,i,a,o,s,l,u,c,h){let f,p=n/24,d=r.lineOffsetX*p,m=r.lineOffsetY*p;if(r.numGlyphs>1){let e=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,u=kt(p,l,d,m,i,r,h,t);if(!u)return{notEnoughRoom:!0};let g=_t(u.first.point.x,u.first.point.y,s,t.getElevation).point,y=_t(u.last.point.x,u.last.point.y,s,t.getElevation).point;if(a&&!i){let t=At(r.writingMode,g,y,c);if(t)return t}f=[u.first];for(let a=r.glyphStartIndex+1;a<e-1;a++)f.push(Pt(p*l.getoffsetX(a),d,m,i,r.segment,n,o,t,h));f.push(u.last)}else{if(a&&!i){let n=_t(t.tileAnchorPoint.x,t.tileAnchorPoint.y,o,t.getElevation).point,i=r.lineStartIndex+r.segment+1,a=new e.P(t.lineVertexArray.getx(i),t.lineVertexArray.gety(i)),s=_t(a.x,a.y,o,t.getElevation),l=s.signedDistanceFromCamera>0?s.point:St(t.tileAnchorPoint,a,n,1,o,t),u=At(r.writingMode,n,l,c);if(u)return u}let n=Pt(p*l.getoffsetX(r.glyphStartIndex),d,m,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,t,h);if(!n||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};f=[n]}for(let t of f)e.aj(u,t.point,t.angle);return{}}function St(t,e,r,n,i,a){let o=t.add(t.sub(e)._unit()),s=void 0!==i?_t(o.x,o.y,i,a.getElevation).point:Ct(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Et(t,r,n){let i=r.projectionCache;if(i.projections[t])return i.projections[t];let a=new e.P(r.lineVertexArray.getx(t),r.lineVertexArray.gety(t)),o=Ct(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[t]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;let s=t-n.direction;return l=0===n.distanceFromAnchor?r.tileAnchorPoint:new e.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),u=a,c=n.previousVertex,h=n.absOffsetX-n.distanceFromAnchor+1,St(l,u,c,h,void 0,r);var l,u,c,h}function Ct(t,e,r){let n,i=t+r.translation[0],a=e+r.translation[1];return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(n=r.projection.projectTileCoordinates(i,a,r.unwrappedTileID,r.getElevation),n.point.x=(.5*n.point.x+.5)*r.width,n.point.y=(.5*-n.point.y+.5)*r.height):(n=_t(i,a,r.labelPlaneMatrix,r.getElevation),n.isOccluded=!1),n}function It(t,e,r){return t._unit()._perp()._mult(e*r)}function Lt(t,r,n,i,a,o,s,l,u){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];let c=n.add(r);if(t+u.direction<i||t+u.direction>=a)return l.projectionCache.offsets[t]=c,c;let h=Et(t+u.direction,l,u),f=It(h.sub(n),s,u.direction),p=n.add(f),d=h.add(f);return l.projectionCache.offsets[t]=e.ak(o,c,p,d)||c,l.projectionCache.offsets[t]}function Pt(t,e,r,n,i,a,o,s,l){let u=n?t-e:t+e,c=u>0?1:-1,h=0;n&&(c*=-1,h=Math.PI),c<0&&(h+=Math.PI);let f,p=c>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?f=s.projectionCache.cachedAnchorPoint:(f=Ct(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=f);let d,m,g,y=f,v=f,x=0,_=0,b=Math.abs(u),w=[];for(;x+_<=b;){if(p+=c,p<a||p>=o)return null;x+=_,v=y,m=d;let t={absOffsetX:b,direction:c,distanceFromAnchor:x,previousVertex:v};if(y=Et(p,s,t),0===r)w.push(v),g=y.sub(v);else{let e,n=y.sub(v);e=0===n.mag()?It(Et(p+c,s,t).sub(y),r,c):It(n,r,c),m||(m=v.add(e)),d=Lt(p,e,y,a,o,m,r,s,t),w.push(m),g=d.sub(m)}_=g.mag()}let T=g._mult((b-x)/_)._add(m||v),k=h+Math.atan2(y.y-v.y,y.x-v.x);return w.push(T),{point:T,angle:l?k:0,path:w}}let zt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ot(t,e){for(let r=0;r<t;r++){let t=e.length;e.resize(t+4),e.float32.set(zt,3*t)}}function Dt(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}let Rt=100;class Ft{constructor(t,e,r=new yt(t.width+200,t.height+200,25),n=new yt(t.width+200,t.height+200,25)){this.transform=t,this.mapProjection=e,this.grid=r,this.ignoredGrid=n,this.pitchFactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Rt,this.screenBottomBoundary=t.height+Rt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,r,n,i,a,o,s,l,u,c){let h,f=t.anchorPointX+s[0],p=t.anchorPointY+s[1],d=this.projectAndGetPerspectiveRatio(n,f,p,i,u),m=r*d.perspectiveRatio;if(a||o)h=this._projectCollisionBox(t,m,n,i,a,o,s,d,u,c);else{let e=d.point.x+(c?c.x*m:0),r=d.point.y+(c?c.y*m:0);h={allPointsOccluded:!1,box:[e+t.x1*m,r+t.y1*m,e+t.x2*m,r+t.y2*m]}}let[g,y,v,x]=h.box;return this.mapProjection.useSpecialProjectionForSymbols&&(a?h.allPointsOccluded:this.mapProjection.isOccluded(f,p,i))||d.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(g,y,v,x)||"always"!==e&&this.grid.hitTest(g,y,v,x,e,l)?{box:[g,y,v,x],placeable:!1,offscreen:!1}:{box:[g,y,v,x],placeable:!0,offscreen:this.isOffscreen(g,y,v,x)}}placeCollisionCircles(t,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g){let y=[],v=new e.P(r.anchorX,r.anchorY),x=this.getPerspectiveRatio(o,v.x,v.y,s,g),_=(h?a/x:a*x)/e.ap,b={getElevation:g,labelPlaneMatrix:l,lineVertexArray:n,pitchWithMap:h,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:v,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:m},w=kt(_,i,r.lineOffsetX*_,r.lineOffsetY*_,!1,r,!1,b),T=!1,k=!1,A=!0;if(w){let r=.5*p*x+d,n=new e.P(-100,-100),i=new e.P(this.screenRightBoundary,this.screenBottomBoundary),a=new mt,o=w.first,s=w.last,l=[];for(let t=o.path.length-1;t>=1;t--)l.push(o.path[t]);for(let t=1;t<s.path.length;t++)l.push(s.path[t]);let h=2.5*r;if(u){let t=this.projectPathToScreenSpace(l,b,u);l=t.some(t=>t.signedDistanceFromCamera<=0)?[]:t.map(t=>t.point)}let m=[];if(l.length>0){let t=l[0].clone(),r=l[0].clone();for(let e=1;e<l.length;e++)t.x=Math.min(t.x,l[e].x),t.y=Math.min(t.y,l[e].y),r.x=Math.max(r.x,l[e].x),r.y=Math.max(r.y,l[e].y);m=t.x>=n.x&&r.x<=i.x&&t.y>=n.y&&r.y<=i.y?[l]:r.x<n.x||t.x>i.x||r.y<n.y||t.y>i.y?[]:e.al([l],n.x,n.y,i.x,i.y)}for(let e of m){a.reset(e,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let e=0;e<n;e++){let i=e/Math.max(n-1,1),o=a.lerp(i),s=o.x+Rt,l=o.y+Rt;y.push(s,l,r,0);let u=s-r,h=l-r,p=s+r,d=l+r;if(A=A&&this.isOffscreen(u,h,p,d),k=k||this.isInsideGrid(u,h,p,d),"always"!==t&&this.grid.hitTestCircle(s,l,r,t,f)&&(T=!0,!c))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!c&&T||!k||x<this.perspectiveRatioCutoff?[]:y,offscreen:A,collisionDetected:T}}projectPathToScreenSpace(t,e,r){return t.map(t=>_t(t.x,t.y,r,e.getElevation))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let r=[],n=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of t){let t=new e.P(s.x+Rt,s.y+Rt);n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y),r.push(t)}let s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},u={};for(let t of s){let n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;let i=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.am(r,i)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===u[n.bucketInstanceId]&&(u[n.bucketInstanceId]=[]),u[n.bucketInstanceId].push(n.featureIndex))}return u}insertCollisionBox(t,e,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,r,n,i,a){let o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e};for(let e=0;e<t.length;e+=4)o.insertCircle(s,t[e],t[e+1],t[e+2])}projectAndGetPerspectiveRatio(t,r,n,i,a){let o;a?(o=[r,n,a(r,n),1],e.af(o,o,t)):(o=[r,n,0,1],Dt(o,o,t));let s=o[3];return{point:new e.P((o[0]/s+1)/2*this.transform.width+Rt,(-o[1]/s+1)/2*this.transform.height+Rt),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}getPerspectiveRatio(t,e,r,n,i){let a=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(e,r,n,i):_t(e,r,t,i);return.5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5}isOffscreen(t,e,r,n){return r<Rt||t>=this.screenRightBoundary||n<Rt||e>this.screenBottomBoundary}isInsideGrid(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary}getViewportMatrix(){let t=e.an([]);return e.J(t,t,[-100,-100,0]),t}_projectCollisionBox(t,r,n,i,a,o,s,l,u,c){let h=new e.P(1,0),f=new e.P(0,1),p=new e.P(t.anchorPointX+s[0],t.anchorPointY+s[1]);if(o&&!a){let t=this.projectAndGetPerspectiveRatio(n,p.x+1,p.y,i,u).point.sub(l.point).unit(),r=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0),a=Math.sin(r),o=Math.cos(r);h=new e.P(o,a),f=new e.P(-a,o)}else if(!o&&a){let t=-this.transform.angle,r=Math.sin(t),n=Math.cos(t);h=new e.P(n,r),f=new e.P(-r,n)}let d=l.point,m=r;if(a){d=p;let t=this.transform.zoom-Math.floor(this.transform.zoom);m=Math.pow(2,-t),m*=this.mapProjection.getPitchedTextCorrection(this.transform,p,i),c||(m*=e.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}c&&(d=d.add(h.mult(c.x*m)).add(f.mult(c.y*m)));let g=t.x1*m,y=t.x2*m,v=(g+y)/2,x=t.y1*m,_=t.y2*m,b=(x+_)/2,w=[{offsetX:g,offsetY:x},{offsetX:v,offsetY:x},{offsetX:y,offsetY:x},{offsetX:y,offsetY:b},{offsetX:y,offsetY:_},{offsetX:v,offsetY:_},{offsetX:g,offsetY:_},{offsetX:g,offsetY:b}],T=[];for(let{offsetX:t,offsetY:r}of w)T.push(new e.P(d.x+h.x*t+f.x*r,d.y+h.y*t+f.y*r));let k=!1;if(a){let t=T.map(t=>this.projectAndGetPerspectiveRatio(n,t.x,t.y,i,u));k=t.some(t=>!t.isOccluded),T=t.map(t=>t.point)}else k=!0;return{box:e.ao(T),allPointsOccluded:!k}}}function Bt(t,r,n){return r*(e.X/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}class Nt{constructor(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class jt{constructor(t,e,r,n,i){this.text=new Nt(t?t.text:null,e,r,i),this.icon=new Nt(t?t.icon:null,e,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ut{constructor(t,e,r){this.text=t,this.icon=e,this.skipFade=r}}class Vt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class qt{constructor(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class Ht{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function Gt(t,r,n,i,a){let{horizontalAlign:o,verticalAlign:s}=e.au(t);return new e.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class Zt{constructor(t,e,r,n,i,a){this.transform=t.clone(),this.terrain=r,this.collisionIndex=new Ft(this.transform,e),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Ht(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let e=this.terrain;return e?(r,n)=>e.getElevation(t,r,n):null}getBucketParts(t,r,n,i){let a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;let s=n.collisionBoxArray,l=a.layers[0].layout,u=a.layers[0].paint,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/e.X,f=n.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(f),d="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=Bt(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,u.get("text-translate"),u.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,u.get("icon-translate"),u.get("icon-translate-anchor")),x=vt(p,d,m,this.transform,g),_=null;if(d){let t=xt(p,d,m,this.transform,g);_=e.L([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[a.bucketInstanceId]=new qt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);let b={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:p,unwrappedTileID:f,textLabelPlaneMatrix:x,labelToScreenMatrix:_,scale:c,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(let e of a.sortKeyRanges){let{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=e;t.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:b})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:b})}attemptAnchorPlacement(t,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y,v,x){let _=e.aq[t.textAnchor],b=[t.textOffset0,t.textOffset1],w=Gt(_,n,i,b,a),T=this.collisionIndex.placeCollisionBox(r,f,l,u,c,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,f,l,u,c,s,o,y,h.predicate,x,w).placeable)&&T.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:b,width:n,height:i,anchor:_,textBoxScale:a,prevAnchor:t},this.markUsedJustification(d,_,p,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,p),this.placedOrientations[p.crossTileID]=m),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(t,r,n){let{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:u,textLabelPlaneMatrix:c,labelToScreenMatrix:h,textPixelRatio:f,holdingForFade:p,collisionBoxArray:d,partiallyEvaluatedTextSize:m,collisionGroup:g}=t.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=e.ar(a,"text-overlap","text-allow-overlap"),_="always"===x,b=e.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===b,T="map"===a.get("text-rotation-alignment"),k="map"===a.get("text-pitch-alignment"),A="none"!==a.get("icon-text-fit"),M="viewport-y"===a.get("symbol-z-order"),S=_&&(w||!i.hasIconData()||v),E=w&&(_||!i.hasTextData()||y);!i.collisionArrays&&d&&i.deserializeCollisionBoxes(d);let C=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),I=(t,d,w)=>{var M,I;if(r[t.crossTileID])return;if(p)return void(this.placements[t.crossTileID]=new Ut(!1,!1,!1));let L=!1,P=!1,z=!0,O=null,D={box:null,placeable:!1,offscreen:null},R={placeable:!1},F=null,B=null,N=null,j=0,U=0,V=0;d.textFeatureIndex?j=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(j=t.featureIndex),d.verticalTextFeatureIndex&&(U=d.verticalTextFeatureIndex);let q=d.textBox;if(q){let r=r=>{let n=e.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){let e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,n=e,this.markUsedOrientation(i,n,t))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&d.verticalTextBox){for(let t of i.writingModes)if(t===e.ah.vertical?(D=n(),R=D):D=r(),D&&D.placeable)break}else D=r()},c=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===c){let n=(e,r)=>{let n=this.collisionIndex.placeCollisionBox(e,x,f,l,u,k,T,o,g.predicate,C);return n&&n.placeable&&(this.markUsedOrientation(i,r,t),this.placedOrientations[t.crossTileID]=r),n};a(()=>n(q,e.ah.horizontal),()=>{let r=d.verticalTextBox;return i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?n(r,e.ah.vertical):{box:null,offscreen:null}}),r(D&&D.placeable)}else{let p=e.aq[null===(I=null===(M=this.prevPlacement)||void 0===M?void 0:M.variableOffsets[t.crossTileID])||void 0===I?void 0:I.anchor],m=(r,a,d)=>{let m=r.x2-r.x1,y=r.y2-r.y1,v=t.textBoxScale,_=A&&"never"===b?a:null,w=null,M="never"===x?1:2,S="never";p&&M++;for(let e=0;e<M;e++){for(let e=c;e<h;e++){let n=i.textAnchorOffsets.get(e);if(p&&n.textAnchor!==p)continue;let a=this.attemptAnchorPlacement(n,r,m,y,v,T,k,f,l,u,g,S,t,i,d,o,s,_,C);if(a&&(w=a.placedGlyphBoxes,w&&w.placeable))return L=!0,O=a.shift,w}p?p=null:S=x}return n&&!w&&(w={box:this.collisionIndex.placeCollisionBox(q,"always",f,l,u,k,T,o,g.predicate,C,new e.P(0,0)).box,offscreen:!1,placeable:!1}),w};a(()=>m(q,d.iconBox,e.ah.horizontal),()=>{let r=d.verticalTextBox;return i.allowVerticalPlacement&&(!D||!D.placeable)&&t.numVerticalGlyphVertices>0&&r?m(r,d.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}),D&&(L=D.placeable,z=D.offscreen);let y=r(D&&D.placeable);if(!L&&this.prevPlacement){let e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(i,e.anchor,t,y))}}}if(F=D,L=F&&F.placeable,z=F&&F.offscreen,t.useRuntimeCollisionCircles){let r=i.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ai(i.textSizeData,m,r),f=a.get("text-padding");B=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,u,c,h,n,k,g.predicate,t.collisionCircleDiameter,f,o,C),B.circles.length&&B.collisionDetected&&!n&&e.w("Collisions detected, but collision boxes are not shown"),L=_||B.circles.length>0&&!B.collisionDetected,z=z&&B.offscreen}if(d.iconFeatureIndex&&(V=d.iconFeatureIndex),d.iconBox){let t=t=>this.collisionIndex.placeCollisionBox(t,b,f,l,u,k,T,s,g.predicate,C,A&&O?O:void 0);R&&R.placeable&&d.verticalIconBox?(N=t(d.verticalIconBox),P=N.placeable):(N=t(d.iconBox),P=N.placeable),z=z&&N.offscreen}let H=y||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=v||0===t.numIconVertices;H||G?G?H||(P=P&&L):L=P&&L:P=L=P&&L;let Z=P&&N.placeable;if(L&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,R&&R.placeable&&U?U:j,g.ID),Z&&this.collisionIndex.insertCollisionBox(N.box,b,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),B&&L&&this.collisionIndex.insertCollisionCircles(B.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,j,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,d,F,N,B),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Ut(L||S,P||E,z||i.justReloaded),r[t.crossTileID]=!0};if(M){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");let e=i.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){let r=e[t];I(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)I(i.symbolInstances.get(e),i.collisionArrays[e],e);if(n&&i.bucketInstanceId in this.collisionCircleArrays){let t=this.collisionCircleArrays[i.bucketInstanceId];e.as(t.invProjMatrix,l),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}i.justReloaded=!1}storeCollisionData(t,e,r,n,i,a){if(r.textBox||r.iconBox){let a,o;this.collisionBoxArrays.has(t)?a=this.collisionBoxArrays.get(t):(a=new Map,this.collisionBoxArrays.set(t,a)),a.has(e)?o=a.get(e):(o={text:null,icon:null},a.set(e,o)),r.textBox&&(o.text=n.box),r.iconBox&&(o.icon=i.box)}if(a){let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new Vt);for(let t=0;t<a.circles.length;t+=4)e.circles.push(a.circles[t+0]),e.circles.push(a.circles[t+1]),e.circles.push(a.circles[t+2]),e.circles.push(a.collisionDetected?1:0)}}markUsedJustification(t,r,n,i){let a;a=i===e.ah.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[e.at(r)];let o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(let e of o)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=a>=0&&e!==a?0:n.crossTileID)}markUsedOrientation(t,r,n){let i=r===e.ah.horizontal||r===e.ah.horizontalOnly?r:0,a=r===e.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(let e of o)t.text.placedSymbolArray.get(e).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;let n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(let t in this.placements){let e=this.placements[t],a=i[t];a?(this.opacities[t]=new jt(a,n,e.text,e.icon),r=r||e.text!==a.text.placed||e.icon!==a.icon.placed):(this.opacities[t]=new jt(null,n,e.text,e.icon,e.skipFade),r=r||e.text||e.icon)}for(let t in i){let e=i[t];if(!this.opacities[t]){let i=new jt(e,n,!1,!1);i.isHidden()||(this.opacities[t]=i,r=r||e.text.placed||e.icon.placed)}}for(let t in a)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=a[t]);for(let t in o)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=o[t]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){let r={};for(let n of e){let e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(t,r,n,i){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();let a=t.layers[0],o=a.layout,s=new jt(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),c=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),f="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),d=new jt(null,0,l&&(u||!t.hasIconData()||o.get("icon-optional")),u&&(l||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);let m=(t,e,r)=>{for(let n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(r);t.hasVisibleVertices=t.hasVisibleVertices||r!==re},g=this.collisionBoxArrays.get(t.bucketInstanceId);for(let r=0;r<t.symbolInstances.length;r++){let i=t.symbolInstances.get(r),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:o,crossTileID:l}=i,u=this.opacities[l];n[l]?u=s:u||(u=d,this.opacities[l]=u),n[l]=!0;let y=i.numIconVertices>0,v=this.placedOrientations[i.crossTileID],x=v===e.ah.vertical,_=v===e.ah.horizontal||v===e.ah.horizontalOnly;if(a>0||o>0){let e=ee(u.text);m(t.text,a,x?re:e),m(t.text,o,_?re:e);let r=u.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach(e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=r||x?1:0)}),i.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=r||_?1:0);let n=this.variableOffsets[i.crossTileID];n&&this.markUsedJustification(t,n.anchor,i,v);let s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(t,"left",i,s),this.markUsedOrientation(t,s,i))}if(y){let e=ee(u.icon),r=!(p&&i.verticalPlacedIconSymbolIndex&&x);i.placedIconSymbolIndex>=0&&(m(t.icon,i.numIconVertices,r?e:re),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=u.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,i.numVerticalIconVertices,r?re:e),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=u.icon.isHidden())}let b=g&&g.has(r)?g.get(r):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let n=t.collisionArrays[r];if(n){let r=new e.P(0,0);if(n.textBox||n.verticalTextBox){let e=!0;if(c){let t=this.variableOffsets[l];t?(r=Gt(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&r._rotate(f?this.transform.angle:-this.transform.angle)):e=!1}if(n.textBox||n.verticalTextBox){let i;n.textBox&&(i=x),n.verticalTextBox&&(i=_),Wt(t.textCollisionBox.collisionVertexArray,u.text.placed,!e||i,b.text,r.x,r.y)}}if(n.iconBox||n.verticalIconBox){let e,i=!(_||!n.verticalIconBox);n.iconBox&&(e=i),n.verticalIconBox&&(e=!i),Wt(t.iconCollisionBox.collisionVertexArray,u.icon.placed,e,b.icon,p?r.x:0,p?r.y:0)}}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){let e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){let r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t}setStale(){this.stale=!0}}function Wt(t,e,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);let o=n[0]-Rt,s=n[1]-Rt,l=n[2]-Rt,u=n[3]-Rt;t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,u),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,u)}let Yt=Math.pow(2,25),Xt=Math.pow(2,24),$t=Math.pow(2,17),Jt=Math.pow(2,16),Kt=Math.pow(2,9),Qt=Math.pow(2,8),te=Math.pow(2,1);function ee(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;let e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Yt+e*Xt+r*$t+e*Jt+r*Kt+e*Qt+r*te+e}let re=0;function ne(){return{isOccluded:(t,e,r)=>!1,getPitchedTextCorrection:(t,e,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(t,e,r,n){throw new Error("Not implemented.")},translatePosition:(t,e,r,n)=>function(t,e,r,n,i=!1){if(!r[0]&&!r[1])return[0,0];let a=i?"map"===n?t.angle:0:"viewport"===n?-t.angle:0;if(a){let t=Math.sin(a),e=Math.cos(a);r=[r[0]*e-r[1]*t,r[0]*t+r[1]*e]}return[i?r[0]:Bt(e,r[0],t.zoom),i?r[1]:Bt(e,r[1],t.zoom)]}(t,e,r,n),getCircleRadiusCorrection:t=>1}}class ie{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,r,n,i){let a=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(a,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((t,e)=>t.sortKey-e.sortKey));this._currentPartIndex<a.length;)if(e.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0;return!1}}class ae{constructor(t,e,r,n,i,a,o,s){this.placement=new Zt(t,ne(),e,a,o,s),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(t,e,r){let n=a.now(),i=()=>!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){let n=e[t[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new ie(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let oe=512/e.X/2;class se{constructor(t,r,n){this.tileID=t,this.bucketInstanceId=n,this._symbolsByKey={};let i=new Map;for(let t=0;t<r.length;t++){let e=r.get(t),n=e.key,a=i.get(n);a?a.push(e):i.set(n,[e])}for(let[t,r]of i){let n={positions:r.map(t=>({x:Math.floor(t.anchorX*oe),y:Math.floor(t.anchorY*oe)})),crossTileIDs:r.map(t=>t.crossTileID)};if(n.positions.length>128){let t=new e.av(n.positions.length,16,Uint16Array);for(let{x:e,y:r}of n.positions)t.add(e,r);t.finish(),delete n.positions,n.index=t}this._symbolsByKey[t]=n}}getScaledCoordinates(t,r){let{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,u=oe/Math.pow(2,l-a),c=(s*e.X+t.anchorY)*u,h=i*e.X*oe;return{x:Math.floor((o*e.X+t.anchorX)*u-n*e.X*oe),y:Math.floor(c-h)}}findMatches(t,e,r){let n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let i=0;i<t.length;i++){let a=t.get(i);if(a.crossTileID)continue;let o=this._symbolsByKey[a.key];if(!o)continue;let s=this.getScaledCoordinates(a,e);if(o.index){let t=o.index.range(s.x-n,s.y-n,s.x+n,s.y+n).sort();for(let e of t){let t=o.crossTileIDs[e];if(!r[t]){r[t]=!0,a.crossTileID=t;break}}}else if(o.positions)for(let t=0;t<o.positions.length;t++){let e=o.positions[t],i=o.crossTileIDs[t];if(Math.abs(e.x-s.x)<=n&&Math.abs(e.y-s.y)<=n&&!r[i]){r[i]=!0,a.crossTileID=i;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class le{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ue{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let e=Math.round((t-this.lng)/360);if(0!==e)for(let t in this.indexes){let r=this.indexes[t],n={};for(let t in r){let i=r[t];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}this.indexes[t]=n}this.lng=t}addBucket(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});let n=this.usedCrossTileIDs[t.overscaledZ];for(let r in this.indexes){let i=this.indexes[r];if(Number(r)>t.overscaledZ)for(let r in i){let a=i[r];a.tileID.isChildOf(t)&&a.findMatches(e.symbolInstances,t,n)}else{let a=i[t.scaledTo(Number(r)).key];a&&a.findMatches(e.symbolInstances,t,n)}}for(let t=0;t<e.symbolInstances.length;t++){let i=e.symbolInstances.get(t);i.crossTileID||(i.crossTileID=r.generate(),n[i.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new se(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(let r of e.getCrossTileIDsLists())for(let e of r)delete this.usedCrossTileIDs[t][e]}removeStaleBuckets(t){let e=!1;for(let r in this.indexes){let n=this.indexes[r];for(let i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e}}class ce{constructor(){this.layerIndexes={},this.crossTileIDs=new le,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,r){let n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new ue);let i=!1,a={};n.handleWrapJump(r);for(let r of e){let e=r.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(r.tileID,e,this.crossTileIDs)&&(i=!0),a[e.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i}pruneUnusedLayers(t){let e={};t.forEach(t=>{e[t]=!0});for(let t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}let he=(t,r)=>e.t(t,r&&r.filter(t=>"source.canvas"!==t.identifier)),fe=e.aw();class pe extends e.E{constructor(t,r={}){super(),this._rtlPluginLoaded=()=>{for(let t in this.sourceCaches){let e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new U(j(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(t,e)=>this.getGlyphs(t,e)),this.dispatcher.registerMessageHandler("GI",(t,e)=>this.getImages(t,e)),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new C(t._requestManager,r.localIdeographFontFamily),this.lineAtlas=new O(256,512),this.crossTileSymbolIndex=new ce,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),lt().on(at,this._rtlPluginLoaded),this.on("data",t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;let e=this.sourceCaches[t.sourceId];if(!e)return;let r=e.getSource();if(r&&r.vectorLayerIds)for(let t in this._layers){let e=this._layers[t];e.source===r.id&&this._validateLayer(e)}})}loadURL(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;let i=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;let a=this._loadStyleRequest;e.h(i,this._loadStyleRequest).then(t=>{this._loadStyleRequest=null,this._load(t.data,r,n)}).catch(t=>{this._loadStyleRequest=null,t&&!a.signal.aborted&&this.fire(new e.j(t))})}loadJSON(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(t,r,n)}).catch(()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(fe,{validate:!1})}_load(t,r,n){var i;let a=r.transformStyle?r.transformStyle(n,t):t;if(!r.validate||!he(this,e.u(a))){this._loaded=!0,this.stylesheet=a;for(let t in a.sources)this.addSource(t,a.sources[t],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new z(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){let t=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map(t=>t.id),this._layers={},this._serializedLayers=null;for(let r of t){let t=e.aA(r);t.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=t}}_loadSprite(t,r=!1,n=void 0){let i;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(t,r,n,i){return e._(this,void 0,void 0,function*(){let o=_(t),s=n>1?"@2x":"",l={},u={};for(let{id:t,url:n}of o){let a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[t]=e.h(a,i);let o=r.transformRequest(b(n,s,".png"),"SpriteImage");u[t]=p.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(u)]),function(t,r){return e._(this,void 0,void 0,function*(){let e={};for(let n in t){e[n]={};let i=a.getImageCanvasContext((yield r[n]).data),o=(yield t[n]).data;for(let t in o){let{width:r,height:a,x:s,y:l,sdf:u,pixelRatio:c,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m}=o[t];e[n][t]={data:null,pixelRatio:c,sdf:u,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return e})}(l,u)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(t=>{if(this._spriteRequest=null,t)for(let e in t){this._spritesImagesIds[e]=[];let n=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter(e=>!(e in t)):[];for(let t of n)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(let n in t[e]){let i="default"===e?n:`${e}:${n}`;this._spritesImagesIds[e].push(i),i in this.imageManager.images?this.imageManager.updateImage(i,t[e][n],!1):this.imageManager.addImage(i,t[e][n]),r&&(this._changedImages[i]=!0)}}}).catch(t=>{this._spriteRequest=null,i=t,this.fire(new e.j(i))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),n&&n(i)})}_unloadSprite(){for(let t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(t){let r=this.sourceCaches[t.source];if(!r)return;let n=t.sourceLayer;if(!n)return;let i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,r=!1){let n=this._serializedAllLayers();if(!t||0===t.length)return Object.values(r?e.aB(n):n);let i=[];for(let a of t)if(n[a]){let t=r?e.aB(n[a]):n[a];i.push(t)}return i}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let e=Object.keys(this._layers);for(let r of e){let e=this._layers[r];"custom"!==e.type&&(t[r]=e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let r=this._changed;if(r){let e=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(e.length||r.length)&&this._updateWorkerLayers(e,r);for(let t in this._updatedSources){let e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}let n={};for(let t in this.sourceCaches){let e=this.sourceCaches[t];n[t]=e.used,e.used=!1}for(let e of this._order){let r=this._layers[e];r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(let t in n){let r=this.sourceCaches[t];!!n[t]!=!!r.used&&r.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,r&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,r={}){var n;this._checkLoaded();let i=this.serialize();if(t=r.transformStyle?r.transformStyle(i,t):t,(null===(n=r.validate)||void 0===n||n)&&he(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers);let a=e.aC(i,t),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(let t of o.operations)t();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){let e=[],r=[];for(let n of t)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":e.push(()=>this.addLayer.apply(this,n.args));break;case"removeLayer":e.push(()=>this.removeLayer.apply(this,n.args));break;case"setPaintProperty":e.push(()=>this.setPaintProperty.apply(this,n.args));break;case"setLayoutProperty":e.push(()=>this.setLayoutProperty.apply(this,n.args));break;case"setFilter":e.push(()=>this.setFilter.apply(this,n.args));break;case"addSource":e.push(()=>this.addSource.apply(this,n.args));break;case"removeSource":e.push(()=>this.removeSource.apply(this,n.args));break;case"setLayerZoomRange":e.push(()=>this.setLayerZoomRange.apply(this,n.args));break;case"setLight":e.push(()=>this.setLight.apply(this,n.args));break;case"setGeoJSONSourceData":e.push(()=>this.setGeoJSONSourceData.apply(this,n.args));break;case"setGlyphs":e.push(()=>this.setGlyphs.apply(this,n.args));break;case"setSprite":e.push(()=>this.setSprite.apply(this,n.args));break;case"setSky":e.push(()=>this.setSky.apply(this,n.args));break;case"setTerrain":e.push(()=>this.map.setTerrain.apply(this,n.args));break;case"setTransition":e.push(()=>{});break;default:r.push(n.command)}return{operations:e,unimplemented:r}}addImage(t,r){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,r),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,r,n={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.u.source,`sources.${t}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);let i=this.sourceCaches[t]=new ft(t,r,this.dispatcher);i.style=this,i.setEventedParent(this,()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:t})),i.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(let r in this._layers)if(this._layers[r].source===t)return this.fire(new e.j(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));let r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);let r=this.sourceCaches[t].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(e),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,r,n={}){this._checkLoaded();let i,a=t.id;if(this.getLayer(a))return void this.fire(new e.j(new Error(`Layer "${a}" already exists on this map.`)));if("custom"===t.type){if(he(this,e.aD(t)))return;i=e.aA(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(a,t.source),t=e.aB(t),t=e.e(t,{source:a})),this._validate(e.u.layer,`layers.${a}`,t,{arrayIndex:-1},n))return;i=e.aA(t),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}})}let o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.j(new Error(`Cannot add layer "${a}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){let t=this._removedLayers[a];delete this._removedLayers[a],t.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;let n=this._order.indexOf(t);this._order.splice(n,1);let i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.j(new Error(`Cannot move layer "${t}" before non-existing layer "${r}".`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let r=this._layers[t];if(!r)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${t}".`)));r.setEventedParent(null);let n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,r,n){this._checkLoaded();let i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,r,n={}){this._checkLoaded();let i=this.getLayer(t);if(i){if(!e.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=e.aB(r),this._updateLayer(i)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.aB(this.getLayer(t).filter)}setLayoutProperty(t,r,n,i={}){this._checkLoaded();let a=this.getLayer(t);a?e.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,r){let n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,r,n,i={}){this._checkLoaded();let a=this.getLayer(t);a?e.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,r){this._checkLoaded();let n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));let o=a.getSource().type;"geojson"===o&&i?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,r){this._checkLoaded();let n=t.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));let a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let t=e.aF(this.sourceCaches,t=>t.serialize()),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return e.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:t,layers:r,terrain:n},t=>void 0!==t)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let e=t=>"fill-extrusion"===this._layers[t].type,r={},n=[];for(let i=this._order.length-1;i>=0;i--){let a=this._order[i];if(e(a)){r[a]=i;for(let e of t){let t=e[a];if(t)for(let e of t)n.push(e)}}}n.sort((t,e)=>e.intersectionZ-t.intersectionZ);let i=[];for(let a=this._order.length-1;a>=0;a--){let o=this._order[a];if(e(o))for(let t=n.length-1;t>=0;t--){let e=n[t].feature;if(r[e.layer.id]<a)break;i.push(e),n.pop()}else for(let e of t){let t=e[o];if(t)for(let e of t)i.push(e.feature)}}return i}queryRenderedFeatures(t,r,n){r&&r.filter&&this._validate(e.u.filter,"queryRenderedFeatures.filter",r.filter,null,r);let i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.j(new Error("parameters.layers must be an Array."))),[];for(let t of r.layers){let r=this._layers[t];if(!r)return this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];i[r.source]=!0}}let a=[];r.availableImages=this._availableImages;let o=this._serializedAllLayers();for(let e in this.sourceCaches)r.layers&&!i[e]||a.push(H(this.sourceCaches[e],this._layers,o,t,r,n));return this.placement&&a.push(function(t,e,r,n,i,a,o){let s={},l=a.queryRenderedSymbols(n),u=[];for(let t of Object.keys(l).map(Number))u.push(o[t]);u.sort(G);for(let r of u){let n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(let t in n){let e=s[t]=s[t]||[],i=n[t];i.sort((t,e)=>{let n=r.featureSortOrder;if(n){let r=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex});for(let t of i)e.push(t)}}for(let e in s)s[e].forEach(n=>{let i=n.feature,a=r[t[e].source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a});return s}(this._layers,o,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,r){r&&r.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",r.filter,null,r);let n=this.sourceCaches[t];return n?function(t,e){let r=t.getRenderableIds().map(e=>t.getTileByID(e)),n=[],i={};for(let t=0;t<r.length;t++){let a=r[t],o=a.tileID.canonical.key;i[o]||(i[o]=!0,a.querySourceFeatures(n,e))}return n}(n,r):[]}getLight(){return this.light.getLight()}setLight(t,r={}){this._checkLoaded();let n=this.light.getLight(),i=!1;for(let r in t)if(!e.aE(t[r],n[r])){i=!0;break}if(!i)return;let o={now:a.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,r),this.light.updateTransitions(o)}getSky(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.sky}setSky(t,r={}){let n=this.getSky(),i=!1;if(!t&&!n)return;if(t&&!n)i=!0;else if(!t&&n)i=!0;else for(let r in t)if(!e.aE(t[r],n[r])){i=!0;break}if(!i)return;let o={now:a.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,r),this.sky.updateTransitions(o)}_validate(t,r,n,i,a={}){return(!a||!1!==a.validate)&&he(this,t.call(e.u,e.e({key:r,style:this.serialize(),value:n,styleSpec:e.v},i)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),lt().off(at,this._rtlPluginLoaded);for(let t in this._layers)this._layers[t].setEventedParent(null);for(let t in this.sourceCaches){let e=this.sourceCaches[t];e.setEventedParent(null),e.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(let e in this.sourceCaches)this.sourceCaches[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,e,r,n,i=!1){let o=!1,s=!1,l={};for(let e of this._order){let r=this._layers[e];if("symbol"!==r.type)continue;if(!l[r.source]){let t=this.sourceCaches[r.source];l[r.source]=t.getRenderableIds(!0).map(e=>t.getTileByID(e)).sort((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1))}let n=this.crossTileSymbolIndex.addLayer(r,l[r.source],t.center.lng);o=o||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),t.zoom))&&(this.pauseablePlacement=new ae(t,this.map.terrain,this._order,i,e,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(let t of this._order){let e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(let t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,r){return e._(this,void 0,void 0,function*(){let t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();let e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,r.icons),t})}getGlyphs(t,r){return e._(this,void 0,void 0,function*(){let t=yield this.glyphManager.getGlyphs(r.stacks),e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,[""]),t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,r={}){this._checkLoaded(),t&&this._validate(e.u.glyphs,"glyphs",t,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,r,n={},i){this._checkLoaded();let a=[{id:t,url:r}],o=[..._(this.stylesheet.sprite),...a];this._validate(e.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(t){this._checkLoaded();let r=_(this.stylesheet.sprite);if(r.find(e=>e.id===t)){if(this._spritesImagesIds[t])for(let e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;r.splice(r.findIndex(e=>e.id===t),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return _(this.stylesheet.sprite)}setSprite(t,r={},n){this._checkLoaded(),t&&this._validate(e.u.sprite,"sprite",t,null,r)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}}var de=e.Y([{name:"a_pos",type:"Int16",components:2}]);let me={prelude:ge("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:ge("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ge("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:ge("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:ge("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ge("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:ge("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:ge("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ge("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:ge("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:ge("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:ge("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:ge("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:ge("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:ge("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:ge("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:ge("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:ge("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:ge("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:ge("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:ge("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:ge("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:ge("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:ge("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:ge("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:ge("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:ge("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function ge(t,e){let r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(t,e,r,n,i)=>(s[i]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`)),vertexSource:e=e.replace(r,(t,e,r,n,i)=>{let a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`}),staticAttributes:n,staticUniforms:o}}class ye{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,r,n,i,a,o,s,l){this.context=t;let u=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!u&&t<n.length;t++)this.boundPaintVertexBuffers[t]!==n[t]&&(u=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||u||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,r,n,i,a,o,s,l):(t.bindVertexArray.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind(),l&&l.bind())}freshBind(t,e,r,n,i,a,o,s){let l=t.numAttributes,u=this.context,c=u.gl;this.vao&&this.destroy(),this.vao=u.createVertexArray(),u.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,e.enableAttributes(c,t);for(let e of r)e.enableAttributes(c,t);a&&a.enableAttributes(c,t),o&&o.enableAttributes(c,t),s&&s.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(let e of r)e.bind(),e.setVertexAttribPointers(c,t,i);a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),s&&(s.bind(),s.setVertexAttribPointers(c,t,i)),u.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let ve=(t,r,n,i,a)=>({u_matrix:t,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function xe(t){let e=[];for(let r=0;r<t.length;r++){if(null===t[r])continue;let n=t[r].split(" ");e.push(n.pop())}return e}class _e{constructor(t,r,n,i,a,o){let s=t.gl;this.program=s.createProgram();let l=xe(r.staticAttributes),u=n?n.getBinderAttributes():[],c=l.concat(u),h=me.prelude.staticUniforms?xe(me.prelude.staticUniforms):[],f=r.staticUniforms?xe(r.staticUniforms):[],p=n?n.getBinderUniforms():[],d=h.concat(f).concat(p),m=[];for(let t of d)m.indexOf(t)<0&&m.push(t);let g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),o&&g.push("#define TERRAIN3D;");let y=g.concat(me.prelude.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(me.prelude.vertexSource,r.vertexSource).join("\n"),x=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(x,y),s.compileShader(x),!s.getShaderParameter(x,s.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${s.getShaderInfoLog(x)}`);s.attachShader(this.program,x);let _=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(_,v),s.compileShader(_),!s.getShaderParameter(_,s.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${s.getShaderInfoLog(_)}`);s.attachShader(this.program,_),this.attributes={};let b={};this.numAttributes=c.length;for(let t=0;t<this.numAttributes;t++)c[t]&&(s.bindAttribLocation(this.program,t,c[t]),this.attributes[c[t]]=t);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw new Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(_),s.deleteShader(x);for(let t=0;t<m.length;t++){let e=m[t];if(e&&!b[e]){let t=s.getUniformLocation(this.program,e);t&&(b[e]=t)}}var w,T;this.fixedUniforms=i(t,b),this.terrainUniforms=(w=t,T=b,{u_depth:new e.aH(w,T.u_depth),u_terrain:new e.aH(w,T.u_terrain),u_terrain_dim:new e.aI(w,T.u_terrain_dim),u_terrain_matrix:new e.aJ(w,T.u_terrain_matrix),u_terrain_unpack:new e.aK(w,T.u_terrain_unpack),u_terrain_exaggeration:new e.aI(w,T.u_terrain_exaggeration)}),this.binderUniforms=n?n.getUniforms(t,b):[]}draw(t,e,r,n,i,a,o,s,l,u,c,h,f,p,d,m,g,y){let v=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),s){t.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),t.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(let t in this.terrainUniforms)this.terrainUniforms[t].set(s[t])}for(let t in this.fixedUniforms)this.fixedUniforms[t].set(o[t]);d&&d.setUniforms(t,this.binderUniforms,f,{zoom:p});let x=0;switch(e){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(let r of h.get()){let n=r.vaos||(r.vaos={});(n[l]||(n[l]=new ye)).bind(t,this,u,d?d.getPaintVertexBuffers():[],c,r.vertexOffset,m,g,y),v.drawElements(e,r.primitiveLength*x,v.UNSIGNED_SHORT,r.primitiveOffset*x*2)}}}function be(t,e,r){let n=1/Bt(r,1,e.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,e.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}let we=(t,r,n,i)=>{let a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=(u=new e.A(9),e.A!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[5]=0,u[6]=0,u[7]=0),u[0]=1,u[4]=1,u[8]=1,u);var u;"viewport"===a.properties.get("anchor")&&function(t,e){var r=Math.sin(e),n=Math.cos(e);t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(l,-r.transform.angle),function(t,e,r){var n=e[0],i=e[1],a=e[2];t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);let c=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},Te=(t,r,n,i,a,o,s)=>e.e(we(t,r,n,i),be(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),ke=t=>({u_matrix:t}),Ae=(t,r,n,i)=>e.e(ke(t),be(n,r,i)),Me=(t,e)=>({u_matrix:t,u_world:e}),Se=(t,r,n,i,a)=>e.e(Ae(t,r,n,i),{u_world:a}),Ee=(t,e,r,n)=>{let i,a,o=t.transform;if("map"===n.paint.get("circle-pitch-alignment")){let t=Bt(r,1,o.zoom);i=!0,a=[t,t]}else i=!1,a=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+i,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:a}},Ce=(t,e,r)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Ie=(t,e,r=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}),Le=t=>({u_matrix:t}),Pe=(t,e,r,n)=>({u_matrix:t,u_extrude_scale:Bt(e,1,r),u_intensity:n}),ze=(t,r,n,i)=>{let a=e.H();e.aP(a,0,t.width,t.height,0,0,1);let o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function Oe(t,r){let n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.Z(0,i/n).toLngLat().lat,new e.Z(0,(i+1)/n).toLngLat().lat]}let De=(t,e,r,n)=>{let i=t.transform;return{u_matrix:je(t,e,r,n),u_ratio:1/Bt(e,1,i.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Re=(t,r,n,i,a)=>e.e(De(t,r,n,a),{u_image:0,u_image_height:i}),Fe=(t,e,r,n,i)=>{let a=t.transform,o=Ne(e,a);return{u_matrix:je(t,e,r,i),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Bt(e,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Be=(t,r,n,i,a,o)=>{let s=t.lineAtlas,l=Ne(r,t.transform),u="round"===n.layout.get("line-cap"),c=s.getDash(i.from,u),h=s.getDash(i.to,u),f=c.width*a.fromScale,p=h.width*a.toScale;return e.e(De(t,r,n,o),{u_patternscale_a:[l/f,-c.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:h.y,u_mix:a.t})};function Ne(t,e){return 1/Bt(t,1,e.tileZoom)}function je(t,e,r,n){return t.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}let Ue=(t,e,r,n,i)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Ve(i.paint.get("raster-hue-rotate"))};var a,o};function Ve(t){t*=Math.PI/180;let e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}let qe=(t,e,r,n,i,a,o,s,l,u,c,h,f,p)=>{let d=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:d.width/d.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:u,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:f,u_texture:0,u_translation:c,u_pitched_scale:p}},He=(t,r,n,i,a,o,s,l,u,c,h,f,p,d,m)=>{let g=s.transform;return e.e(qe(t,r,n,i,a,o,s,l,u,c,h,f,p,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:1})},Ge=(t,r,n,i,a,o,s,l,u,c,h,f,p,d)=>e.e(He(t,r,n,i,a,o,s,l,u,c,h,!0,f,0,d),{u_texsize_icon:p,u_texture_icon:1}),Ze=(t,e,r)=>({u_matrix:t,u_opacity:e,u_color:r}),We=(t,r,n,i,a,o)=>e.e(function(t,e,r,n){let i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,c=u*(n.tileID.canonical.x+n.tileID.wrap*l),h=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Bt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[c>>16,h>>16],u_pixel_coord_lower:[65535&c,65535&h]}}(i,o,n,a),{u_matrix:t,u_opacity:r}),Ye={fillExtrusion:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_opacity:new e.aI(t,r.u_opacity)}),fillExtrusionPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_height_factor:new e.aI(t,r.u_height_factor),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade),u_opacity:new e.aI(t,r.u_opacity)}),fill:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),fillPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),fillOutline:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world)}),fillOutlinePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),circle:(t,r)=>({u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_scale_with_map:new e.aH(t,r.u_scale_with_map),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_extrude_scale:new e.aO(t,r.u_extrude_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_matrix:new e.aJ(t,r.u_matrix)}),collisionBox:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_pixel_extrude_scale:new e.aO(t,r.u_pixel_extrude_scale)}),collisionCircle:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_inv_matrix:new e.aJ(t,r.u_inv_matrix),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_viewport_size:new e.aO(t,r.u_viewport_size)}),debug:(t,r)=>({u_color:new e.aL(t,r.u_color),u_matrix:new e.aJ(t,r.u_matrix),u_overlay:new e.aH(t,r.u_overlay),u_overlay_scale:new e.aI(t,r.u_overlay_scale)}),clippingMask:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),heatmap:(t,r)=>({u_extrude_scale:new e.aI(t,r.u_extrude_scale),u_intensity:new e.aI(t,r.u_intensity),u_matrix:new e.aJ(t,r.u_matrix)}),heatmapTexture:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_color_ramp:new e.aH(t,r.u_color_ramp),u_opacity:new e.aI(t,r.u_opacity)}),hillshade:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_latrange:new e.aO(t,r.u_latrange),u_light:new e.aO(t,r.u_light),u_shadow:new e.aL(t,r.u_shadow),u_highlight:new e.aL(t,r.u_highlight),u_accent:new e.aL(t,r.u_accent)}),hillshadePrepare:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_dimension:new e.aO(t,r.u_dimension),u_zoom:new e.aI(t,r.u_zoom),u_unpack:new e.aK(t,r.u_unpack)}),line:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels)}),lineGradient:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_image:new e.aH(t,r.u_image),u_image_height:new e.aI(t,r.u_image_height)}),linePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texsize:new e.aO(t,r.u_texsize),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_image:new e.aH(t,r.u_image),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),lineSDF:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_patternscale_a:new e.aO(t,r.u_patternscale_a),u_patternscale_b:new e.aO(t,r.u_patternscale_b),u_sdfgamma:new e.aI(t,r.u_sdfgamma),u_image:new e.aH(t,r.u_image),u_tex_y_a:new e.aI(t,r.u_tex_y_a),u_tex_y_b:new e.aI(t,r.u_tex_y_b),u_mix:new e.aI(t,r.u_mix)}),raster:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_tl_parent:new e.aO(t,r.u_tl_parent),u_scale_parent:new e.aI(t,r.u_scale_parent),u_buffer_scale:new e.aI(t,r.u_buffer_scale),u_fade_t:new e.aI(t,r.u_fade_t),u_opacity:new e.aI(t,r.u_opacity),u_image0:new e.aH(t,r.u_image0),u_image1:new e.aH(t,r.u_image1),u_brightness_low:new e.aI(t,r.u_brightness_low),u_brightness_high:new e.aI(t,r.u_brightness_high),u_saturation_factor:new e.aI(t,r.u_saturation_factor),u_contrast_factor:new e.aI(t,r.u_contrast_factor),u_spin_weights:new e.aN(t,r.u_spin_weights)}),symbolIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolSDF:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolTextAndIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texsize_icon:new e.aO(t,r.u_texsize_icon),u_texture:new e.aH(t,r.u_texture),u_texture_icon:new e.aH(t,r.u_texture_icon),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),background:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_color:new e.aL(t,r.u_color)}),backgroundPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_image:new e.aH(t,r.u_image),u_pattern_tl_a:new e.aO(t,r.u_pattern_tl_a),u_pattern_br_a:new e.aO(t,r.u_pattern_br_a),u_pattern_tl_b:new e.aO(t,r.u_pattern_tl_b),u_pattern_br_b:new e.aO(t,r.u_pattern_br_b),u_texsize:new e.aO(t,r.u_texsize),u_mix:new e.aI(t,r.u_mix),u_pattern_size_a:new e.aO(t,r.u_pattern_size_a),u_pattern_size_b:new e.aO(t,r.u_pattern_size_b),u_scale_a:new e.aI(t,r.u_scale_a),u_scale_b:new e.aI(t,r.u_scale_b),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(t,r.u_tile_units_to_pixels)}),terrain:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_ele_delta:new e.aI(t,r.u_ele_delta),u_fog_matrix:new e.aJ(t,r.u_fog_matrix),u_fog_color:new e.aL(t,r.u_fog_color),u_fog_ground_blend:new e.aI(t,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(t,r.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon_fog_blend:new e.aI(t,r.u_horizon_fog_blend)}),terrainDepth:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ele_delta:new e.aI(t,r.u_ele_delta)}),terrainCoords:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_terrain_coords_id:new e.aI(t,r.u_terrain_coords_id),u_ele_delta:new e.aI(t,r.u_ele_delta)}),sky:(t,r)=>({u_sky_color:new e.aL(t,r.u_sky_color),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon:new e.aI(t,r.u_horizon),u_sky_horizon_blend:new e.aI(t,r.u_sky_horizon_blend)})};class Xe{constructor(t,e,r){this.context=t;let n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let $e={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Je{constructor(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;let i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let r=0;r<this.attributes.length;r++){let n=e.attributes[this.attributes[r].name];void 0!==n&&t.enableVertexAttribArray(n)}}setVertexAttribPointers(t,e,r){for(let n=0;n<this.attributes.length;n++){let i=this.attributes[n],a=e.attributes[i.name];void 0!==a&&t.vertexAttribPointer(a,i.components,t[$e[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Ke=new WeakMap;function Qe(t){var e;if(Ke.has(t))return Ke.get(t);{let r=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return Ke.set(t,r),r}}class tr{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class er extends tr{getDefault(){return e.aM.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class rr extends tr{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class nr extends tr{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class ir extends tr{getDefault(){return[!0,!0,!0,!0]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ar extends tr{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class or extends tr{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class sr extends tr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class lr extends tr{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class ur extends tr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class cr extends tr{getDefault(){return[0,1]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class hr extends tr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class fr extends tr{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class pr extends tr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class dr extends tr{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class mr extends tr{getDefault(){return e.aM.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class gr extends tr{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class yr extends tr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class vr extends tr{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class xr extends tr{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class _r extends tr{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class br extends tr{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class wr extends tr{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Tr extends tr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class kr extends tr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Ar extends tr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Mr extends tr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Sr extends tr{getDefault(){return null}set(t){let e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Er extends tr{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;let r=this.gl;Qe(r)?r.bindVertexArray(t):null===(e=r.getExtension("OES_vertex_array_object"))||void 0===e||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Cr extends tr{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Ir extends tr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Lr extends tr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Pr extends tr{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class zr extends Pr{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Or extends Pr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Dr extends Pr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Rr{constructor(t,e,r,n,i){this.context=t,this.width=e,this.height=r;let a=t.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new zr(t,o),n)this.depthAttachment=i?new Dr(t,o):new Or(t,o);else if(i)throw new Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){let e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class Fr{constructor(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r}}Fr.Replace=[1,0],Fr.disabled=new Fr(Fr.Replace,e.aM.transparent,[!1,!1,!1,!1]),Fr.unblended=new Fr(Fr.Replace,e.aM.transparent,[!0,!0,!0,!0]),Fr.alphaBlended=new Fr([1,771],e.aM.transparent,[!0,!0,!0,!0]);class Br{constructor(t){var e,r;if(this.gl=t,this.clearColor=new er(this),this.clearDepth=new rr(this),this.clearStencil=new nr(this),this.colorMask=new ir(this),this.depthMask=new ar(this),this.stencilMask=new or(this),this.stencilFunc=new sr(this),this.stencilOp=new lr(this),this.stencilTest=new ur(this),this.depthRange=new cr(this),this.depthTest=new hr(this),this.depthFunc=new fr(this),this.blend=new pr(this),this.blendFunc=new dr(this),this.blendColor=new mr(this),this.blendEquation=new gr(this),this.cullFace=new yr(this),this.cullFaceSide=new vr(this),this.frontFace=new xr(this),this.program=new _r(this),this.activeTexture=new br(this),this.viewport=new wr(this),this.bindFramebuffer=new Tr(this),this.bindRenderbuffer=new kr(this),this.bindTexture=new Ar(this),this.bindVertexBuffer=new Mr(this),this.bindElementBuffer=new Sr(this),this.bindVertexArray=new Er(this),this.pixelStoreUnpack=new Cr(this),this.pixelStoreUnpackPremultiplyAlpha=new Ir(this),this.pixelStoreUnpackFlipY=new Lr(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Qe(t)){this.HALF_FLOAT=t.HALF_FLOAT;let n=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==n?void 0:n.RGBA16F_EXT,this.RGB16F=null!==(r=t.RGB16F)&&void 0!==r?r:null==n?void 0:n.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e){return new Xe(this,t,e)}createVertexBuffer(t,e,r){return new Je(this,t,e,r)}createRenderbuffer(t,e,r){let n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i}createFramebuffer(t,e,r,n){return new Rr(this,t,e,r,n)}clear({color:t,depth:e,stencil:r}){let n=this.gl,i=0;t&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==r&&(i|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),n.clear(i)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.aE(t.blendFunction,Fr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Qe(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return Qe(this.gl)?this.gl.deleteVertexArray(t):null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class Nr{constructor(t,e,r){this.func=t,this.mask=e,this.range=r}}Nr.ReadOnly=!1,Nr.ReadWrite=!0,Nr.disabled=new Nr(519,Nr.ReadOnly,[0,1]);let jr,Ur=7680;class Vr{constructor(t,e,r,n,i,a){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a}}Vr.disabled=new Vr({func:519,mask:0},0,0,Ur,Ur,Ur);class qr{constructor(t,e,r){this.enable=t,this.mode=e,this.frontFace=r}}function Hr(t,r,n,i,a){let o=t.context,s=o.gl,l=t.useProgram("collisionBox"),u=[],c=0,h=0;for(let p=0;p<i.length;p++){let d=i[p],m=r.getTile(d).getBucket(n);if(!m)continue;let g=a?m.textCollisionBox:m.iconCollisionBox,y=m.collisionCircleArray;if(y.length>0){let r=e.H();e.aQ(r,m.placementInvProjMatrix,t.transform.glCoordMatrix),e.aQ(r,r,m.placementViewportMatrix),u.push({circleArray:y,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),c+=y.length/4,h=c}g&&l.draw(o,s.LINES,Nr.disabled,Vr.disabled,t.colorModeForRenderPass(),qr.disabled,{u_matrix:d.posMatrix,u_pixel_extrude_scale:[1/(f=t.transform).width,1/f.height]},t.style.map.terrain&&t.style.map.terrain.getTerrainData(d),n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,t.transform.zoom,null,null,g.collisionVertexBuffer)}var f;if(!a||!u.length)return;let p=t.useProgram("collisionCircle"),d=new e.aR;d.resize(4*c),d._trim();let m=0;for(let t of u)for(let e=0;e<t.circleArray.length/4;e++){let r=4*e,n=t.circleArray[r+0],i=t.circleArray[r+1],a=t.circleArray[r+2],o=t.circleArray[r+3];d.emplace(m++,n,i,a,o,0),d.emplace(m++,n,i,a,o,1),d.emplace(m++,n,i,a,o,2),d.emplace(m++,n,i,a,o,3)}(!jr||jr.length<2*c)&&(jr=function(t){let r=2*t,n=new e.aT;n.resize(r),n._trim();for(let t=0;t<r;t++){let e=6*t;n.uint16[e+0]=4*t+0,n.uint16[e+1]=4*t+1,n.uint16[e+2]=4*t+2,n.uint16[e+3]=4*t+2,n.uint16[e+4]=4*t+3,n.uint16[e+5]=4*t+0}return n}(c));let g=o.createIndexBuffer(jr,!0),y=o.createVertexBuffer(d,e.aS.members,!0);for(let r of u){let i=Ce(r.transform,r.invTransform,t.transform);p.draw(o,s.TRIANGLES,Nr.disabled,Vr.disabled,t.colorModeForRenderPass(),qr.disabled,i,t.style.map.terrain&&t.style.map.terrain.getTerrainData(r.coord),n.id,y,g,e.a0.simpleSegment(0,2*r.circleOffset,r.circleArray.length,r.circleArray.length/2),null,t.transform.zoom,null,null,null)}y.destroy(),g.destroy()}qr.disabled=new qr(!1,1029,2305),qr.backCCW=new qr(!0,1029,2305);let Gr=e.an(new Float32Array(16));function Zr(t,r,n,i,a,o){let{horizontalAlign:s,verticalAlign:l}=e.au(t);return new e.P((-(s-.5)*r/a+i[0])*o,(-(l-.5)*n/a+i[1])*o)}function Wr(t,r,n,i,a,o){let s=r.tileAnchorPoint.add(new e.P(r.translation[0],r.translation[1]));if(r.pitchWithMap){let t=i.mult(o);n||(t=t.rotate(-a));let e=s.add(t);return _t(e.x,e.y,r.labelPlaneMatrix,r.getElevation).point}if(n){let e=Ct(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(t),n=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0);return t.add(i.rotate(n))}return t.add(i)}function Yr(t,r,n,i,a,o,s,l,u,c,h,f,p,d){let m=t.text.placedSymbolArray,g=t.text.dynamicLayoutVertexArray,y=t.icon.dynamicLayoutVertexArray,v={};g.clear();for(let y=0;y<m.length;y++){let x=m.get(y),_=x.hidden||!x.crossTileID||t.allowVerticalPlacement&&!x.placedOrientation?null:i[x.crossTileID];if(_){let i=new e.P(x.anchorX,x.anchorY),m={getElevation:d,width:a.width,height:a.height,labelPlaneMatrix:o,pitchWithMap:n,projection:h,tileAnchorPoint:i,translation:f,unwrappedTileID:p},y=n?_t(i.x,i.y,s,d):Ct(i.x,i.y,m),b=bt(a.cameraToCenterDistance,y.signedDistanceFromCamera),w=e.ai(t.textSizeData,u,x)*b/e.ap;n&&(w*=t.tilePixelRatio/l);let{width:T,height:k,anchor:A,textOffset:M,textBoxScale:S}=_,E=Zr(A,T,k,M,S,w),C=h.getPitchedTextCorrection(a,i.add(new e.P(f[0],f[1])),p),I=Wr(y.point,m,r,E,a.angle,C),L=t.allowVerticalPlacement&&x.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let t=0;t<x.numGlyphs;t++)e.aj(g,I,L);c&&x.associatedIconIndex>=0&&(v[x.associatedIconIndex]={shiftedAnchor:I,angle:L})}else Ot(x.numGlyphs,g)}if(c){y.clear();let r=t.icon.placedSymbolArray;for(let t=0;t<r.length;t++){let n=r.get(t);if(n.hidden)Ot(n.numGlyphs,y);else{let r=v[t];if(r)for(let t=0;t<n.numGlyphs;t++)e.aj(y,r.shiftedAnchor,r.angle);else Ot(n.numGlyphs,y)}}t.icon.dynamicLayoutVertexBuffer.updateData(y)}t.text.dynamicLayoutVertexBuffer.updateData(g)}function Xr(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function $r(t,r,n,i,a,o,s,l,u,c,h,f){let p=t.context,d=p.gl,m=t.transform,g=ne(),y="map"===l,v="map"===u,x="viewport"!==l&&"point"!==n.layout.get("symbol-placement"),_=y&&!v&&!x,b=!v&&x,w=!n.layout.get("symbol-sort-key").isConstant(),T=!1,k=t.depthModeForSublayer(0,Nr.ReadOnly),A=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),M=[],S=g.getCircleRadiusCorrection(m);for(let l of i){let i=r.getTile(l),u=i.getBucket(n);if(!u)continue;let h=a?u.text:u.icon;if(!h||!h.segments.get().length||!h.hasVisibleVertices)continue;let f,p,k,E,C=h.programConfigurations.get(n.id),I=a||u.sdfIcons,L=a?u.textSizeData:u.iconSizeData,P=v||0!==m.pitch,z=t.useProgram(Xr(I,a,u),C),O=e.ag(L,m.zoom),D=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l),R=[0,0],F=null;if(a)p=i.glyphAtlasTexture,k=d.LINEAR,f=i.glyphAtlasTexture.size,u.iconsInText&&(R=i.imageAtlasTexture.size,F=i.imageAtlasTexture,E=P||t.options.rotating||t.options.zooming||"composite"===L.kind||"camera"===L.kind?d.LINEAR:d.NEAREST);else{let e=1!==n.layout.get("icon-size").constantOr(0)||u.iconsNeedLinear;p=i.imageAtlasTexture,k=I||t.options.rotating||t.options.zooming||e||P?d.LINEAR:d.NEAREST,f=i.imageAtlasTexture.size}let B=Bt(i,1,t.transform.zoom),N=b?l.posMatrix:Gr,j=vt(N,v,y,t.transform,B),U=xt(N,v,y,t.transform,B),V=xt(l.posMatrix,v,y,t.transform,B),q=g.translatePosition(t.transform,i,o,s),H=A&&u.hasTextData(),G="none"!==n.layout.get("icon-text-fit")&&H&&u.hasIconData();if(x){let e=t.style.map.terrain?(e,r)=>t.style.map.terrain.getElevation(l,e,r):null,r="map"===n.layout.get("text-rotation-alignment");Tt(u,l.posMatrix,t,a,j,V,v,c,r,g,l.toUnwrapped(),m.width,m.height,q,e)}let Z,W=l.posMatrix,Y=a&&A||G,X=x||Y?Gr:j,$=U,J=I&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);Z=I?u.iconsInText?Ge(L.kind,O,_,v,x,Y,t,W,X,$,q,f,R,S):He(L.kind,O,_,v,x,Y,t,W,X,$,q,a,f,0,S):qe(L.kind,O,_,v,x,Y,t,W,X,$,q,a,f,S);let K={program:z,buffers:h,uniformValues:Z,atlasTexture:p,atlasTextureIcon:F,atlasInterpolation:k,atlasInterpolationIcon:E,isSDF:I,hasHalo:J};if(w&&u.canOverlap){T=!0;let t=h.segments.get();for(let r of t)M.push({segments:new e.a0([r]),sortKey:r.sortKey,state:K,terrainData:D})}else M.push({segments:h.segments,sortKey:0,state:K,terrainData:D})}T&&M.sort((t,e)=>t.sortKey-e.sortKey);for(let e of M){let r=e.state;if(p.activeTexture.set(d.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,d.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),r.isSDF){let i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Jr(r.buffers,e.segments,n,t,r.program,k,h,f,i,e.terrainData)),i.u_is_halo=0}Jr(r.buffers,e.segments,n,t,r.program,k,h,f,r.uniformValues,e.terrainData)}}function Jr(t,e,r,n,i,a,o,s,l,u){let c=n.context;i.draw(c,c.gl.TRIANGLES,a,o,s,qr.disabled,l,u,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Kr(t,r,n,i){let a=t.context,o=a.gl,s=Vr.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]),u=r.getBucket(n);if(!u)return;let c=i.key,h=n.heatmapFbos.get(c);h||(h=tn(a,r.tileSize,r.tileSize),n.heatmapFbos.set(c,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:e.aM.transparent});let f=u.programConfigurations.get(n.id),p=t.useProgram("heatmap",f),d=t.style.map.terrain.getTerrainData(i);p.draw(a,o.TRIANGLES,Nr.disabled,s,l,qr.disabled,Pe(i.posMatrix,r,t.transform.zoom,n.paint.get("heatmap-intensity")),d,n.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,n.paint,t.transform.zoom,f)}function Qr(t,e,r){let n=t.context,i=n.gl;n.setColorMode(t.colorModeForRenderPass());let a=en(n,e),o=r.key,s=e.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Nr.disabled,Vr.disabled,t.colorModeForRenderPass(),qr.disabled,ze(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),s.destroy(),e.heatmapFbos.delete(o))}function tn(t,e,r){var n,i;let a=t.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);let s=null!==(n=t.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=t.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,e,r,0,a.RGBA,s,null);let u=t.createFramebuffer(e,r,!1,!1);return u.colorAttachment.set(o),u}function en(t,e){return e.colorRampTexture||(e.colorRampTexture=new w(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function rn(t,e,r,n,i){if(!r||!n||!n.imageAtlas)return;let a=n.imageAtlas.patternPositions,o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let t=i.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function nn(t,e,r,n,i,a,o){let s,l,u,c,h,f=t.context.gl,p="fill-pattern",d=r.paint.get(p),m=d&&d.constantOr(1),g=r.getCrossfadeParameters();o?(l=m&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=f.LINES):(l=m?"fillPattern":"fill",s=f.TRIANGLES);let y=d.constantOr(null);for(let d of n){let n=e.getTile(d);if(m&&!n.patternsLoaded())continue;let v=n.getBucket(r);if(!v)continue;let x=v.programConfigurations.get(r.id),_=t.useProgram(l,x),b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(d);m&&(t.context.activeTexture.set(f.TEXTURE0),n.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),x.updatePaintBuffers(g)),rn(x,p,y,n,r);let w=b?d:null,T=t.translatePosMatrix(w?w.posMatrix:d.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){c=v.indexBuffer2,h=v.segments2;let e=[f.drawingBufferWidth,f.drawingBufferHeight];u="fillOutlinePattern"===l&&m?Se(T,t,g,n,e):Me(T,e)}else c=v.indexBuffer,h=v.segments,u=m?Ae(T,t,g,n):ke(T);_.draw(t.context,s,i,t.stencilModeForClipping(d),a,qr.disabled,u,b,r.id,v.layoutVertexBuffer,c,h,r.paint,t.transform.zoom,x)}}function an(t,e,r,n,i,a,o){let s=t.context,l=s.gl,u="fill-extrusion-pattern",c=r.paint.get(u),h=c.constantOr(1),f=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),d=c.constantOr(null);for(let c of n){let n=e.getTile(c),m=n.getBucket(r);if(!m)continue;let g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(c),y=m.programConfigurations.get(r.id),v=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(f)),rn(y,u,d,n,r);let x=t.translatePosMatrix(c.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),_=r.paint.get("fill-extrusion-vertical-gradient"),b=h?Te(x,t,_,p,c,f,n):we(x,t,_,p);v.draw(s,s.gl.TRIANGLES,i,a,o,qr.backCCW,b,g,r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,r.paint,t.transform.zoom,y,t.style.map.terrain&&m.centroidVertexBuffer)}}function on(t,e,r,n,i,a,o){let s=t.context,l=s.gl,u=r.fbo;if(!u)return;let c=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,u.colorAttachment.get()),c.draw(s,l.TRIANGLES,i,a,o,qr.disabled,((t,e,r,n)=>{let i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=t.transform.angle);let l=!t.options.moving;return{u_matrix:n?n.posMatrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:Oe(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(t,r,n,h?e:null),h,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}function sn(t,r,n,i,a,o){let s=t.context,l=s.gl,u=r.dem;if(u&&u.data){let c=u.dim,h=u.stride,f=u.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(h),r.demTexture){let t=r.demTexture;t.update(f,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new w(s,f,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=r.fbo;if(!p){let t=new w(s,{width:c,height:c,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.fbo=s.createFramebuffer(c,c,!0,!1),p.colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,c,c]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,qr.disabled,((t,r)=>{let n=r.stride,i=e.H();return e.aP(i,0,e.X,-e.X,0,0,1),e.J(i,i,[0,-e.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,u),null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function ln(t,r,n,i,o,s){let l=i.paint.get("raster-fade-duration");if(!s&&l>0){let i=a.now(),s=(i-t.timeAdded)/l,u=r?(i-r.timeAdded)/l:-1,c=n.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),p=f&&t.refreshedUponExpiration?1:e.ac(f?s:1-u,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}let un=new e.aM(1,0,0,1),cn=new e.aM(0,1,0,1),hn=new e.aM(0,0,1,1),fn=new e.aM(1,0,1,1),pn=new e.aM(0,1,1,1);function dn(t,e,r,n){gn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){gn(t,e-r/2,0,r,t.transform.height,n)}function gn(t,e,r,n,i,a){let o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio,i*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function yn(t,r,n){let i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Nr.disabled,u=Vr.disabled,c=t.colorModeForRenderPass(),h="$debug",f=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);let p=r.getTileByID(n.key).latestRawTileData,d=Math.floor((p&&p.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();let r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${y} ${d}kB`),s.draw(i,a.TRIANGLES,l,u,Fr.alphaBlended,qr.disabled,Ie(o,e.aM.transparent,g),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(i,a.LINE_STRIP,l,u,c,qr.disabled,Ie(o,e.aM.red),f,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function vn(t,e,r){let n=t.context,i=n.gl,a=t.colorModeForRenderPass(),o=new Nr(i.LEQUAL,Nr.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]);for(let u of r){let r=t.renderToTexture.getTexture(u),c=e.getTerrainData(u.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);let h=t.transform.calculatePosMatrix(u.tileID.toUnwrapped()),f=e.getMeshFrameDelta(t.transform.zoom),p=t.transform.calculateFogMatrix(u.tileID.toUnwrapped()),d=ve(h,f,p,t.style.sky,t.transform.pitch);s.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,d,c,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class xn{constructor(t,e,r){this.vertexBuffer=t,this.indexBuffer=e,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class _n{constructor(t,r){this.context=new Br(t),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ft.maxUnderzooming+ft.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ce}resize(t,e,r){if(this.width=Math.floor(t*r),this.height=Math.floor(e*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,r=new e.aX;r.emplaceBack(0,0),r.emplaceBack(e.X,0),r.emplaceBack(0,e.X),r.emplaceBack(e.X,e.X),this.tileExtentBuffer=t.createVertexBuffer(r,de.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);let n=new e.aX;n.emplaceBack(0,0),n.emplaceBack(e.X,0),n.emplaceBack(0,e.X),n.emplaceBack(e.X,e.X),this.debugBuffer=t.createVertexBuffer(n,de.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);let i=new e.$;i.emplaceBack(0,0,0,0),i.emplaceBack(e.X,0,e.X,0),i.emplaceBack(0,e.X,0,e.X),i.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=t.createVertexBuffer(i,Q.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);let a=new e.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,de.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);let o=new e.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new e.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new Vr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){let t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let n=e.H();e.aP(n,0,this.width,this.height,0,0,1),e.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Nr.disabled,this.stencilClearMode,Fr.disabled,qr.disabled,Le(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;let r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Fr.disabled),r.setDepthMode(Nr.disabled);let i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let t of e){let e=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(t);i.draw(r,n.TRIANGLES,Nr.disabled,new Vr({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),Fr.disabled,qr.disabled,Le(t.posMatrix),a,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,e=this.context.gl;return new Vr({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){let e=this.context.gl;return new Vr({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){let e=this.context.gl,r=t.sort((t,e)=>e.overscaledZ-t.overscaledZ),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();let t={};for(let r=0;r<i;r++)t[r+n]=new Vr({func:e.GEQUAL,mask:255},r+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=i,[t,r]}return[{[n]:Vr.disabled},r]}colorModeForRenderPass(){let t=this.context.gl;return this._showOverdrawInspector?new Fr([t.CONSTANT_COLOR,t.ONE],new e.aM(.125,.125,.125,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Fr.unblended:Fr.alphaBlended}depthModeForSublayer(t,e,r){if(!this.opaquePassEnabledForLayer())return Nr.disabled;let n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Nr(r||this.context.gl.LEQUAL,e,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,r){this.style=t,this.options=r,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(a.now()),this.imageManager.beginFrame();let n=this.style._order,i=this.style.sourceCaches,o={},s={},l={};for(let t in i){let e=i[t];e.used&&e.prepare(this.context),o[t]=e.getVisibleCoordinates(),s[t]=o[t].slice().reverse(),l[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<n.length;t++)if(this.style._layers[n[t]].is3D()){this.opaquePassCutoff=t;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let t of n){let e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;let r=s[e.source];("custom"===e.type||r.length)&&this.renderLayer(this,i[e.source],e,r)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?e.aM.black:e.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,r){let n=t.context,i=n.gl,a=(c=r,h=t.style.map.transform,f=t.pixelRatio,{u_sky_color:c.properties.get("sky-color"),u_horizon_color:c.properties.get("horizon-color"),u_horizon:(h.height/2+h.getHorizon())*f,u_sky_horizon_blend:c.properties.get("sky-horizon-blend")*h.height/2*f}),o=new Nr(i.LEQUAL,Nr.ReadWrite,[0,1]),s=Vr.disabled,l=t.colorModeForRenderPass(),u=t.useProgram("sky");var c,h,f;if(!r.mesh){let t=new e.aX;t.emplaceBack(-1,-1),t.emplaceBack(1,-1),t.emplaceBack(1,1),t.emplaceBack(-1,1);let i=new e.aY;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),r.mesh=new xn(n.createVertexBuffer(t,de.members),n.createIndexBuffer(i),e.a0.simpleSegment(0,0,t.length,i.length))}u.draw(n,i.TRIANGLES,o,s,l,qr.disabled,a,void 0,"sky",r.mesh.vertexBuffer,r.mesh.indexBuffer,r.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){let t=this.style._layers[n[this.currentLayer]],e=i[t.source],r=o[t.source];this._renderTileClippingMasks(t,r),this.renderLayer(this,e,t,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){let t=this.style._layers[n[this.currentLayer]],e=i[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t))continue;let r=("symbol"===t.type?l:s)[t.source];this._renderTileClippingMasks(t,o[t.source]),this.renderLayer(this,e,t,r)}if(this.options.showTileBoundaries){let t=function(t,e){let r=null,n=Object.values(t._layers).flatMap(r=>r.source&&!r.isHidden(e)?[t.sourceCaches[r.source]]:[]),i=n.filter(t=>"vector"===t.getSource().type),a=n.filter(t=>"vector"!==t.getSource().type),o=t=>{(!r||r.getSource().maxzoom<t.getSource().maxzoom)&&(r=t)};return i.forEach(t=>o(t)),r||a.forEach(t=>o(t)),r}(this.style,this.transform.zoom);t&&function(t,e,r){for(let n=0;n<r.length;n++)yn(t,e,r[n])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){let e=t.transform.padding;dn(t,t.transform.height-(e.top||0),3,un),dn(t,e.bottom||0,3,cn),mn(t,e.left||0,3,hn),mn(t,t.transform.width-(e.right||0),3,fn);let r=t.transform.centerPoint;var n,i,a,o;n=t,i=r.x,a=t.transform.height-r.y,gn(n,i-1,a-10,2,20,o=pn),gn(n,i-10,a-1,20,2,o)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;let r=this.terrainFacilitator.matrix,n=this.transform.modelViewProjectionMatrix,i=this.terrainFacilitator.dirty;i||(i=t?!e.a_(r,n):!e.a$(r,n)),i||(i=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),i&&(e.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,r){let n=t.context,i=n.gl,a=Fr.unblended,o=new Nr(i.LEQUAL,Nr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),u=t.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1});for(let e of l){let l=r.getTerrainData(e.tileID),c={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};u.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,c,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,r){let n=t.context,i=n.gl,a=Fr.unblended,o=new Nr(i.LEQUAL,Nr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),u=r.sourceCache.getRenderableTiles(),c=t.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1}),r.coordsIndex=[];for(let e of u){let u=r.getTerrainData(e.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);let h={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};c.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,h,u,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(e.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(t,r,n,i,a){if("translucent"!==t.renderPass)return;let o=Vr.disabled,s=t.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,r,n,i,a,o,s,l,u){let c=r.transform,h=ne(),f="map"===a,p="map"===o;for(let a of t){let t=i.getTile(a),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;let d=e.ag(o.textSizeData,c.zoom),m=Bt(t,1,r.transform.zoom),g=vt(a.posMatrix,p,f,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(d){let e=Math.pow(2,c.zoom-t.tileID.overscaledZ),n=r.style.map.terrain?(t,e)=>r.style.map.terrain.getElevation(a,t,e):null,i=h.translatePosition(c,t,s,l);Yr(o,f,p,u,c,g,a.posMatrix,e,d,y,h,i,a.toUnwrapped(),n)}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&$r(t,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&$r(t,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(Hr(t,r,n,i,!0),Hr(t,r,n,i,!1))}(t,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(t,r,n,i){if("translucent"!==t.renderPass)return;let a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;let u=t.context,c=u.gl,h=t.depthModeForSublayer(0,Nr.ReadOnly),f=Vr.disabled,p=t.colorModeForRenderPass(),d=[];for(let a=0;a<i.length;a++){let o=i[a],s=r.getTile(o),u=s.getBucket(n);if(!u)continue;let c=u.programConfigurations.get(n.id),h=t.useProgram("circle",c),f=u.layoutVertexBuffer,p=u.indexBuffer,m=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),g={programConfiguration:c,program:h,layoutVertexBuffer:f,indexBuffer:p,uniformValues:Ee(t,o,s,n),terrainData:m};if(l){let t=u.segments.get();for(let r of t)d.push({segments:new e.a0([r]),sortKey:r.sortKey,state:g})}else d.push({segments:u.segments,sortKey:0,state:g})}l&&d.sort((t,e)=>t.sortKey-e.sortKey);for(let e of d){let{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=e.state;i.draw(u,c.TRIANGLES,h,f,p,qr.disabled,s,l,n.id,a,o,e.segments,n.paint,t.transform.zoom,r)}}(t,r,n,i);break;case"heatmap":!function(t,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;let a=t.context;if(t.style.map.terrain){for(let e of i){let i=r.getTile(e);r.hasRenderableParent(e)||("offscreen"===t.renderPass?Kr(t,i,n,e):"translucent"===t.renderPass&&Qr(t,n,e))}a.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,r,n,i){let a=t.context,o=a.gl,s=Vr.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(t,r,n){let i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(e.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=tn(t,r.width/4,r.height/4),n.heatmapFbos.set(e.aU,a))})(a,t,n),a.clear({color:e.aM.transparent});for(let e=0;e<i.length;e++){let u=i[e];if(r.hasRenderableParent(u))continue;let c=r.getTile(u),h=c.getBucket(n);if(!h)continue;let f=h.programConfigurations.get(n.id),p=t.useProgram("heatmap",f),{zoom:d}=t.transform;p.draw(a,o.TRIANGLES,Nr.disabled,s,l,qr.disabled,Pe(u.posMatrix,c,d,n.paint.get("heatmap-intensity")),null,n.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,n.paint,t.transform.zoom,f)}a.viewport.set([0,0,t.width,t.height])}(t,r,n,i):"translucent"===t.renderPass&&function(t,r){let n=t.context,i=n.gl;n.setColorMode(t.colorModeForRenderPass());let a=r.heatmapFbos.get(e.aU);a&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),en(n,r).bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Nr.disabled,Vr.disabled,t.colorModeForRenderPass(),qr.disabled,ze(t,r,0,1),null,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom))}(t,n)}(t,r,n,i);break;case"line":!function(t,r,n,i){if("translucent"!==t.renderPass)return;let a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0===a.constantOr(1)||0===o.constantOr(1))return;let s=t.depthModeForSublayer(0,Nr.ReadOnly),l=t.colorModeForRenderPass(),u=n.paint.get("line-dasharray"),c=n.paint.get("line-pattern"),h=c.constantOr(1),f=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),d=h?"linePattern":u?"lineSDF":f?"lineGradient":"line",m=t.context,g=m.gl,y=!0;for(let a of i){let i=r.getTile(a);if(h&&!i.patternsLoaded())continue;let o=i.getBucket(n);if(!o)continue;let v=o.programConfigurations.get(n.id),x=t.context.program.get(),_=t.useProgram(d,v),b=y||_.program!==x,T=t.style.map.terrain&&t.style.map.terrain.getTerrainData(a),k=c.constantOr(null);if(k&&i.imageAtlas){let t=i.imageAtlas,e=t.patternPositions[k.to.toString()],r=t.patternPositions[k.from.toString()];e&&r&&v.setConstantPatternPositions(e,r)}let A=T?a:null,M=h?Fe(t,i,n,p,A):u?Be(t,i,n,u,p,A):f?Re(t,i,n,o.lineClipsArray.length,A):De(t,i,n,A);if(h)m.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),v.updatePaintBuffers(p);else if(u&&(b||t.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(m);else if(f){let i=o.gradients[n.id],s=i.texture;if(n.gradientVersion!==i.version){let l=256;if(n.stepInterpolant){let n=r.getSource().maxzoom,i=a.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-a.canonical.z):1;l=e.ac(e.aV(o.maxLineLength/e.X*1024*i),256,m.maxTextureSize)}i.gradient=e.aW({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:i.gradient||void 0,clips:o.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new w(m,i.gradient,g.RGBA),i.version=n.gradientVersion,s=i.texture}m.activeTexture.set(g.TEXTURE0),s.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}_.draw(m,g.TRIANGLES,s,t.stencilModeForClipping(a),l,qr.disabled,M,T,n.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,n.paint,t.transform.zoom,v,o.layoutVertexBuffer2),y=!1}}(t,r,n,i);break;case"fill":!function(t,r,n,i){let a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0===o.constantOr(1))return;let s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.aM.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===u){let e=t.depthModeForSublayer(1,"opaque"===t.renderPass?Nr.ReadWrite:Nr.ReadOnly);nn(t,r,n,i,e,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){let e=t.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Nr.ReadOnly);nn(t,r,n,i,e,s,!0)}}(t,r,n,i);break;case"fill-extrusion":!function(t,e,r,n){let i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){let a=new Nr(t.context.gl.LEQUAL,Nr.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))an(t,e,r,n,a,Vr.disabled,Fr.disabled),an(t,e,r,n,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{let i=t.colorModeForRenderPass();an(t,e,r,n,a,Vr.disabled,i)}}}(t,r,n,i);break;case"hillshade":!function(t,e,r,n){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;let i=t.context,a=t.depthModeForSublayer(0,Nr.ReadOnly),o=t.colorModeForRenderPass(),[s,l]="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n];for(let n of l){let i=e.getTile(n);void 0!==i.needsHillshadePrepare&&i.needsHillshadePrepare&&"offscreen"===t.renderPass?sn(t,i,r,a,Vr.disabled,o):"translucent"===t.renderPass&&on(t,n,i,r,a,s[n.overscaledZ],o)}i.viewport.set([0,0,t.width,t.height])}(t,r,n,i);break;case"raster":!function(t,e,r,n){if("translucent"!==t.renderPass||0===r.paint.get("raster-opacity")||!n.length)return;let i=t.context,a=i.gl,o=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),[u,c]=o instanceof tt?[{},n]:t.stencilConfigForOverlap(n),h=c[c.length-1].overscaledZ,f=!t.options.moving;for(let n of c){let c=t.depthModeForSublayer(n.overscaledZ-h,1===r.paint.get("raster-opacity")?Nr.ReadWrite:Nr.ReadOnly,a.LESS),p=e.getTile(n);p.registerFadeDuration(r.paint.get("raster-fade-duration"));let d,m,g=e.findLoadedParent(n,0),y=e.findLoadedSibling(n),v=ln(p,g||y||null,e,r,t.transform,t.style.map.terrain),x="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),p.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),g?(g.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),d=Math.pow(2,g.tileID.overscaledZ-p.tileID.overscaledZ),m=[p.tileID.canonical.x*d%1,p.tileID.canonical.y*d%1]):p.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),p.texture.useMipmap&&i.extTextureFilterAnisotropic&&t.transform.pitch>20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);let _=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n),b=_?n:null,w=b?b.posMatrix:t.transform.calculatePosMatrix(n.toUnwrapped(),f),T=Ue(w,m||[0,0],d||1,v,r);o instanceof tt?s.draw(i,a.TRIANGLES,c,Vr.disabled,l,qr.disabled,T,_,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,c,u[n.overscaledZ],l,qr.disabled,T,_,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,r,n,i);break;case"background":!function(t,e,r,n){let i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;let o=t.context,s=o.gl,l=t.transform,u=l.tileSize,c=r.paint.get("background-pattern");if(t.isPatternMissing(c))return;let h=!c&&1===i.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;let f=Vr.disabled,p=t.depthModeForSublayer(0,"opaque"===h?Nr.ReadWrite:Nr.ReadOnly),d=t.colorModeForRenderPass(),m=t.useProgram(c?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:u,terrain:t.style.map.terrain});c&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));let y=r.getCrossfadeParameters();for(let e of g){let l=n?e.posMatrix:t.transform.calculatePosMatrix(e.toUnwrapped()),h=c?We(l,a,t,c,{tileID:e,tileSize:u},y):Ze(l,a,i),g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);m.draw(o,s.TRIANGLES,p,f,d,qr.disabled,h,g,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,n,i);break;case"custom":!function(t,e,r){let n=t.context,i=r.implementation;if("offscreen"===t.renderPass){let e=i.prerender;e&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),e.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Vr.disabled);let e="3d"===i.renderingMode?new Nr(t.context.gl.LEQUAL,Nr.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Nr.ReadOnly);n.setDepthMode(e),i.render(n.gl,t.transform.customLayerMatrix(),{farZ:t.transform.farZ,nearZ:t.transform.nearZ,fov:t.transform._fov,modelViewProjectionMatrix:t.transform.modelViewProjectionMatrix,projectionMatrix:t.transform.projectionMatrix}),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}(t,0,n)}}translatePosMatrix(t,r,n,i,a){if(!n[0]&&!n[1])return t;let o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){let t=Math.sin(o),e=Math.cos(o);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}let s=[a?n[0]:Bt(r,n[0],this.transform.zoom),a?n[1]:Bt(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.J(l,t,s),l}saveTileTexture(t){let e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r}useProgram(t,e){this.cache=this.cache||{};let r=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new _e(this.context,me[t],e,Ye[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new w(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class bn{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,r,n){let i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(n=>{let a=1/(n=e.af([],n,t))[3]/r*i;return e.b1(n,n,[a,a,1/n[3],a])}),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(t=>{let e=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}([],(n=[],i=y([],a[t[0]],a[t[1]]),o=y([],a[t[2]],a[t[1]]),s=i[0],l=i[1],u=i[2],c=o[0],h=o[1],f=o[2],n[0]=l*f-u*h,n[1]=u*c-s*f,n[2]=s*h-l*c,n)),r=-((p=e)[0]*(d=a[t[1]])[0]+p[1]*d[1]+p[2]*d[2]);var n,i,o,s,l,u,c,h,f,p,d;return e.concat(r)});return new bn(a,o)}}class wn{constructor(t,e){var r,n,i;this.min=t,this.max=e,this.center=function(t,e){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(t){let e=[t%2==0,t<2],r=m(this.min),n=m(this.max);for(let t=0;t<e.length;t++)r[t]=e[t]?this.min[t]:this.center[t],n[t]=e[t]?this.center[t]:this.max[t];return n[2]=this.max[2],new wn(r,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){let r=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],n=!0;for(let i=0;i<t.planes.length;i++){let a=t.planes[i],o=0;for(let t=0;t<r.length;t++)e.b2(a,r[t])>=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let e=0;e<3;e++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;i<t.points.length;i++){let a=t.points[i][e]-this.min[e];r=Math.min(r,a),n=Math.max(n,a)}if(n<0||r>this.max[e]-this.min[e])return 0}return 1}}class Tn{constructor(t=0,e=0,r=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n}interpolate(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.y.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.y.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.y.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.y.number(t.right,r.right,n)),this}getCenter(t,r){let n=e.ac((this.left+t-this.right)/2,0,t),i=e.ac((this.top+r-this.bottom)/2,0,r);return new e.P(n,i)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Tn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let kn=85.051129;class An{constructor(t,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let t=new An(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){let r=-e.b3(t,-180,180)*Math.PI/180;var n;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(n=new e.A(4),e.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){let r=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){let e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){let e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){let r=[new e.b4(0,t)];if(this._renderWorldCopies){let n=this.pointCoordinate(new e.P(0,0)),i=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),u=1;for(let n=s-u;n<=l+u;n++)0!==n&&r.push(new e.b4(n,t))}return r}coveringTiles(t){var r,n;let i=this.coveringZoomLevel(t),a=i;if(void 0!==t.minzoom&&i<t.minzoom)return[];void 0!==t.maxzoom&&i>t.maxzoom&&(i=t.maxzoom);let o=this.pointCoordinate(this.getCameraPoint()),s=e.Z.fromLngLat(this.center),l=Math.pow(2,i),u=[l*o.x,l*o.y,0],c=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i),f=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(f=i);let p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,d=t=>({aabb:new wn([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),m=[],g=[],y=i,v=t.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let t=1;t<=3;t++)m.push(d(-t)),m.push(d(t));for(m.push(d(0));m.length>0;){let i=m.pop(),a=i.x,o=i.y,s=i.fullyVisible;if(!s){let t=i.aabb.intersects(h);if(0===t)continue;s=2===t}let l=t.terrain?u:c,d=i.aabb.distanceX(l),_=i.aabb.distanceY(l),b=Math.max(Math.abs(d),Math.abs(_));if(i.zoom===y||b>p+(1<<y-i.zoom)-2&&i.zoom>=f){let t=y-i.zoom,r=u[0]-.5-(a<<t),n=u[1]-.5-(o<<t);g.push({tileID:new e.S(i.zoom===y?v:i.zoom,i.wrap,i.zoom,a,o),distanceSq:x([c[0]-.5-a,c[1]-.5-o]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let l=0;l<4;l++){let u=(a<<1)+l%2,c=(o<<1)+(l>>1),h=i.zoom+1,f=i.aabb.quadrant(l);if(t.terrain){let a=new e.S(h,i.wrap,h,u,c),o=t.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,l=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;f=new wn([f.min[0],f.min[1],s],[f.max[0],f.max[1],l])}m.push({aabb:f,zoom:h,x:u,y:c,wrap:i.wrap,fullyVisible:s})}}return g.sort((t,e)=>t.distanceSq-e.distanceSq).map(t=>t.tileID)}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){let r=e.ac(t.lat,-85.051129,kn);return new e.P(e.O(t.lng)*this.worldSize,e.Q(r)*this.worldSize)}unproject(t){return new e.Z(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){let r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;let o=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/e.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(t,r){let n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,r){if(r){let e=r.pointCoordinate(t);if(null!=e)return e}let n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.af(n,n,this.pixelMatrixInverse),e.af(i,i,this.pixelMatrixInverse);let a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,u=n[2]/a,c=i[2]/o,h=u===c?0:(0-u)/(c-u);return new e.Z(e.y.number(n[0]/a,i[0]/o,h)/this.worldSize,e.y.number(s,l,h)/this.worldSize)}coordinatePoint(t,r=0,n=this.pixelMatrix){let i=[t.x*this.worldSize,t.y*this.worldSize,r,1];return e.af(i,i,n),new e.P(i[0]/i[3],i[1]/i[3])}getBounds(){let t=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,kn])}calculateTileMatrix(t){let r=t.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*t.wrap,a=e.an(new Float64Array(16));return e.J(a,a,[i*n,r.y*n,0]),e.K(a,a,[n/e.X,n/e.X,1]),a}calculatePosMatrix(t,r=!1){let n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];let a=this.calculateTileMatrix(t);return e.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(t){let r=t.key,n=this._fogMatrixCache;if(n[r])return n[r];let i=this.calculateTileMatrix(t);return e.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,r){r=e.ac(+r,this.minZoom,this.maxZoom);let n={center:new e.N(t.lng,t.lat),zoom:r},i=this.lngRange;if(!this._renderWorldCopies&&null===i){let t=179.9999999999;i=[-t,t]}let a=this.tileSize*this.zoomScale(n.zoom),o=0,s=a,l=0,u=a,c=0,h=0,{x:f,y:p}=this.size;if(this.latRange){let t=this.latRange;o=e.Q(t[1])*a,s=e.Q(t[0])*a,s-o<p&&(c=p/(s-o))}i&&(l=e.b3(e.O(i[0])*a,0,a),u=e.b3(e.O(i[1])*a,0,a),u<l&&(u+=a),u-l<f&&(h=f/(u-l)));let d,m,{x:g,y:y}=this.project.call({worldSize:a},t),v=Math.max(h||0,c||0);if(v){let t=new e.P(h?(u+l)/2:g,c?(s+o)/2:y);return n.center=this.unproject.call({worldSize:a},t).wrap(),n.zoom+=this.scaleZoom(v),n}if(this.latRange){let t=p/2;y-t<o&&(m=o+t),y+t>s&&(m=s-t)}if(i){let t=(l+u)/2,r=g;this._renderWorldCopies&&(r=e.b3(g,t-a/2,t+a/2));let n=f/2;r-n<l&&(d=l+n),r+n>u&&(d=u-n)}if(void 0!==d||void 0!==m){let t=new e.P(null!=d?d:g,null!=m?m:y);n.center=this.unproject.call({worldSize:a},t).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:e,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=r,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;let t=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let i=e.an(new Float64Array(16));e.K(i,i,[this.width/2,-this.height/2,1]),e.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=e.an(new Float64Array(16)),e.K(i,i,[1,-1,1]),e.J(i,i,[-1,-1,0]),e.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;let a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,u=Math.PI/2+this._pitch,c=this._fov*(.5+t.y/this.height),h=Math.sin(c)*l/Math.sin(e.ac(Math.PI-u-c,.01,Math.PI-.01)),f=this.getHorizon(),p=2*Math.atan(f/this.cameraToCenterDistance)*(.5+t.y/(2*f)),d=Math.sin(p)*l/Math.sin(e.ac(Math.PI-u-p,.01,Math.PI-.01)),m=Math.min(h,d);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,i=new Float64Array(16),e.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.projectionMatrix=e.ae(i),e.K(i,i,[1,-1,1]),e.J(i,i,[0,0,-this.cameraToCenterDistance]),e.b7(i,i,this._pitch),e.ad(i,i,this.angle),e.J(i,i,[-r,-n,0]),this.mercatorMatrix=e.K([],i,[this.worldSize,this.worldSize,this.worldSize]),e.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,i),e.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=e.as([],i),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,i);let g=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),_=r-Math.round(r)+v*g+x*y,b=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(e.J(w,w,[_>.5?_-1:_,b>.5?b-1:b,0]),this.alignedModelViewProjectionMatrix=w,i=e.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let t=this.pointCoordinate(new e.P(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){let r=this.getCameraPoint();if(1===t.length)return[t[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(let e of t)n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);return[new e.P(n,i),new e.P(a,i),new e.P(a,o),new e.P(n,o),new e.P(n,i)]}}lngLatToCameraDepth(t,r){let n=this.locationCoordinate(t),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return e.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Mn(t,e){let r,n=!1,i=null,a=null,o=()=>{i=null,n&&(t.apply(a,r),i=setTimeout(o,e),n=!1)};return(...t)=>(n=!0,a=this,r=t,i||o(),i)}class Sn{constructor(t){this._getCurrentHash=()=>{let t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map(t=>t.split("=")).forEach(t=>{t[0]===this._hashName&&(e=t)}),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(t.length>=3&&!t.some(t=>isNaN(t))){let e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getCurrentHash();if(0===t.length)return;let e=t.join("/"),r=e;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${e}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Mn(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){let e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=t?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+=`/${Math.round(l)}`),this._hashName){let t=this._hashName,e=!1,r=window.location.hash.slice(1).split("&").map(r=>{let n=r.split("=")[0];return n===t?(e=!0,`${n}=${u}`):r}).filter(t=>t);return e||r.push(`${t}=${u}`),`#${r.join("&")}`}return`#${u}`}}let En={linearity:.3,easing:e.b8(0,0,.3,1)},Cn=e.e({deceleration:2500,maxSpeed:1400},En),In=e.e({deceleration:20,maxSpeed:1400},En),Ln=e.e({deceleration:1e3,maxSpeed:360},En),Pn=e.e({deceleration:1e3,maxSpeed:90},En);class zn{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,e=a.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let r={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of this._inertiaBuffer)r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,t.panDelta&&r.pan._add(t.panDelta),t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);let n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){let a=Dn(r.pan.mag(),n,e.e({},Cn,t||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,On(i,a)}if(r.zoom){let t=Dn(r.zoom,n,In);i.zoom=this._map.transform.zoom+t.amount,On(i,t)}if(r.bearing){let t=Dn(r.bearing,n,Ln);i.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),On(i,t)}if(r.pitch){let t=Dn(r.pitch,n,Pn);i.pitch=this._map.transform.pitch+t.amount,On(i,t)}if(i.zoom||i.bearing){let t=void 0===r.pinchAround?r.around:r.pinchAround;i.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(i,{noMoveStart:!0})}}function On(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Dn(t,r,n){let{maxSpeed:i,linearity:a,deceleration:o}=n,s=e.ac(t*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}class Rn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,n,i={}){let a=o.mousePos(r.getCanvas(),n),s=r.unproject(a);super(t,e.e({point:a,lngLat:s,originalEvent:n},i)),this._defaultPrevented=!1,this.target=r}}class Fn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,n){let i="touchend"===t?n.changedTouches:n.touches,a=o.touchPos(r.getCanvasContainer(),i),s=a.map(t=>r.unproject(t)),l=a.reduce((t,e,r,n)=>t.add(e.div(n.length)),new e.P(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class Bn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,r){super(t,{originalEvent:r}),this._defaultPrevented=!1}}class Nn{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Bn(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Rn(t.type,this._map,t))}mouseup(t){this._map.fire(new Rn(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Rn(t.type,this._map,t))}mouseover(t){this._map.fire(new Rn(t.type,this._map,t))}mouseout(t){this._map.fire(new Rn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Fn(t.type,this._map,t))}touchmove(t){this._map.fire(new Fn(t.type,this._map,t))}touchend(t){this._map.fire(new Fn(t.type,this._map,t))}touchcancel(t){this._map.fire(new Fn(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class jn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Rn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Un{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this._map.terrain)}}class Vn{constructor(t,e){this._map=t,this._tr=new Un(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;let r=e;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;let n=this._startPos;this._lastPos=r,this._box||(this._box=o.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let i=Math.min(n.x,r.x),a=Math.max(n.x,r.x),s=Math.min(n.y,r.y),l=Math.max(n.y,r.y);o.setTransform(this._box,`translate(${i}px,${s}px)`),this._box.style.width=a-i+"px",this._box.style.height=l-s+"px"}mouseupWindow(t,r){if(!this._active||0!==t.button)return;let n=this._startPos,i=r;if(this.reset(),o.suppressClick(),n.x!==i.x||n.y!==i.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.k(t,{originalEvent:r}))}}function qn(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);let r={};for(let n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}class Hn{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){let r=new e.P(0,0);for(let e of t)r._add(e);return r.div(t.length)}(r),this.touches=qn(n,r)))}touchmove(t,e,r){if(this.aborted||!this.centroid)return;let n=qn(r,e);for(let t in this.touches){let e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class Gn{constructor(t){this.singleTap=new Hn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,r){this.singleTap.touchstart(t,e,r)}touchmove(t,e,r){this.singleTap.touchmove(t,e,r)}touchend(t,e,r){let n=this.singleTap.touchend(t,e,r);if(n){let e=t.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(e&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Zn{constructor(t){this._tr=new Un(t),this._zoomIn=new Gn({numTouches:1,numTaps:2}),this._zoomOut=new Gn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)}touchmove(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)}touchend(t,e,r){let n=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:t})}):i?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let n=e.length?e[0]:e;return!this._moved&&n.dist(r)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=n,this._move(r,n))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&o.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let Yn={0:1,2:2};class Xn{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){let e=o.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){let r=Yn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton)}isValidEndEvent(t){return o.mouseButton(t)===this._eventButton}}class $n{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}let Jn=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Kn=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{let n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Jn})},Qn=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{let n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Jn})};class ti{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,r){return this._calculateTransform(t,e,r)}touchmove(t,e,r){if(this._active){if(!this._shouldBePrevented(r.length))return t.preventDefault(),this._calculateTransform(t,e,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,r){this._calculateTransform(t,e,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,n){n.length>0&&(this._active=!0);let i=qn(n,r),a=new e.P(0,0),o=new e.P(0,0),s=0;for(let t in i){let e=i[t],r=this._touches[t];r&&(a._add(e),o._add(e.sub(r)),s++,i[t]=e)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;let l=o.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ei{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,r){if(!this._firstTwoTouches)return;t.preventDefault();let[n,i]=this._firstTwoTouches,a=ri(r,e,n),o=ri(r,e,i);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,t)}touchend(t,e,r){if(!this._firstTwoTouches)return;let[n,i]=this._firstTwoTouches,a=ri(r,e,n),s=ri(r,e,i);a&&s||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ri(t,e,r){for(let n=0;n<t.length;n++)if(t[n].identifier===r)return e[n]}function ni(t,e){return Math.log(t/e)/Math.LN2}class ii extends ei{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){let r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(ni(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ni(this._distance,r),pinchAround:e}}}function ai(t,e){return 180*t.angleWith(e)/Math.PI}class oi extends ei{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e,r){let n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ai(this._vector,n),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let e=25/(Math.PI*this._minDiameter)*360,r=ai(t,this._startVector);return Math.abs(r)<e}}function si(t){return Math.abs(t.y)>Math.abs(t.x)}class li extends ei{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,r){super.touchstart(t,e,r),this._currentTouchCount=r.length}_start(t){this._lastPoints=t,si(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,r){if(void 0!==this._valid)return this._valid;let n=t.mag()>=2,i=e.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=t.y>0==e.y>0;return si(t)&&si(e)&&a}}let ui={panStep:100,bearingStep:15,pitchStep:10};class ci{constructor(t){this._tr=new Un(t);let e=ui;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:hi,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function hi(t){return t*(2-t)}let fi=4.000244140625;class pi{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Un(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%fi==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=o.mousePos(this._map.getCanvas(),t),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?e.N.convert(this._aroundCenter?n.center:n.unproject(r)):e.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if(0!==this._delta){let e="wheel"===this._type&&Math.abs(this._delta)>fi?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);let n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let r,n="number"==typeof this._targetZoom?this._targetZoom:t.zoom,i=this._startZoom,o=this._easing,s=!1,l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&i&&o&&l){let t=Math.min(l/200,1),a=o(t);r=e.y.number(i,n,a),t<1?this._frameId||(this._frameId=!0):s=!0}else r=n,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:r-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.b9;if(this._prevEase){let t=this._prevEase,n=(a.now()-t.start)/t.duration,i=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:t,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class di{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class mi{constructor(t){this._tr=new Un(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{constructor(){this._tap=new Gn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,r){if(!this._swipePoint)if(this._tapTime){let n=e[0],i=t.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(t,e,r)}touchmove(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)}touchend(t,e,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{let n=this._tap.touchend(t,e,r);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yi{constructor(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class vi{constructor(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class xi{constructor(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class _i{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=e,this._container.appendChild(n);let i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,r){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:t,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let bi=t=>t.zoom||t.drag||t.pitch||t.rotate;class wi extends e.k{}function Ti(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class ki{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},i={},a={},s=t.touches,l=s?this._getMapTouches(s):void 0,u=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),t);for(let{handlerName:o,handler:s,allowed:c}of this._handlers){if(!s.isEnabled())continue;let h;this._blockedByActive(a,c,o)?s.reset():s[e||t.type]&&(h=s[e||t.type](t,u,l),this.mergeHandlerResult(n,i,h,o,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||s.isActive())&&(a[o]=s)}let c={};for(let t in this._previousActiveHandlers)a[t]||(c[t]=r);this._previousActiveHandlers=a,(Object.keys(c).length||Ti(n))&&(this._changes.push([n,i,c]),this._triggerRenderFrame()),(Object.keys(a).length||Ti(n))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zn(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);let r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(let[t,e,r]of this._listeners)o.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(let[t,e,r]of this._listeners)o.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(t){let e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Nn(e,t));let n=e.boxZoom=new Vn(e,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();let i=e.cooperativeGestures=new _i(e,t.cooperativeGestures);this._add("cooperativeGestures",i),t.cooperativeGestures&&i.enable();let a=new Zn(e),s=new mi(e);e.doubleClickZoom=new di(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();let l=new gi;this._add("tapDragZoom",l);let u=e.touchPitch=new li(e);this._add("touchPitch",u),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);let c=Kn(t),h=Qn(t);e.dragRotate=new vi(t,c,h),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();let f=(({enable:t,clickTolerance:e})=>{let r=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&!t.ctrlKey});return new Wn({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:r,enable:t,assignEvents:Jn})})(t),p=new ti(t,e);e.dragPan=new yi(r,f,p),this._add("mousePan",f),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);let d=new oi,m=new ii;e.touchZoomRotate=new xi(r,m,d,l),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);let g=e.scrollZoom=new pi(e,()=>this._triggerRenderFrame());this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);let y=e.keyboard=new ci(e);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new jn(e))}_add(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!bi(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,e,r){for(let n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1}_getMapTouches(t){let e=[];for(let r of t)this._el.contains(r.target)&&e.push(r);return e}mergeHandlerResult(t,r,n,i,a){if(!n)return;e.e(t,n);let o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){let t={},r={},n={};for(let[i,a,o]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.e(r,a),e.e(n,o);this._updateMapTransform(t,r,n),this._changes=[]}_updateMapTransform(t,e,r){let n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(Ti(t)||a&&this._terrainMovement))return this._fireEvents(e,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:u,around:c,pinchAround:h}=t;void 0!==h&&(c=h),n._stop(!0),c=c||n.transform.centerPoint;let f=i.pointLocation(o?c.sub(o):c);l&&(i.bearing+=l),u&&(i.pitch+=u),s&&(i.zoom+=s),a?this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(f,c):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(f,c)):i.setLocationAtPoint(f,c),n._applyUpdatedTransform(i),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)}_fireEvents(t,r,n){let i=bi(this._eventsInProgress),o=bi(t),s={};for(let e in t){let{originalEvent:r}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(let t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(let e in t){let{originalEvent:r}=t[e];this._fireEvent(e,r)}let l,u={};for(let t in this._eventsInProgress){let{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],l=r[e]||n,u[`${t}end`]=l)}for(let t in u)this._fireEvent(t,u[t]);let c=bi(this._eventsInProgress),h=(i||o)&&!c;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let t=this._map._getTransformForUpdate();t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(t)}if(n&&h){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;!t||!t.essential&&a.prefersReducedMotion?(this._map.fire(new e.k("moveend",{originalEvent:l})),r(this._map.getBearing())&&this._map.resetNorth()):(r(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:l})),this._updatingCamera=!1}}_fireEvent(t,r){this._map.fire(new e.k(t,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new wi("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Ai extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{let t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,r,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},r),n)}panTo(t,r,n){return this.easeTo(e.e({center:t},r),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,r,n){return this.easeTo(e.e({zoom:t},r),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,r,n){return this.easeTo(e.e({bearing:t},r),n)}resetNorth(t,r){return this.rotateTo(0,e.e({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=W.convert(t).adjustAntiMeridian();let r=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),r,e)}_cameraForBoxAndBearing(t,r,n,i){let a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=e.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){let t=i.padding;i.padding={top:t,bottom:t,right:t,left:t}}i.padding=e.e(a,i.padding);let o=this.transform,s=o.padding,l=new W(t,r),u=o.project(l.getNorthWest()),c=o.project(l.getNorthEast()),h=o.project(l.getSouthEast()),f=o.project(l.getSouthWest()),p=e.ba(-n),d=u.rotate(p),m=c.rotate(p),g=h.rotate(p),y=f.rotate(p),v=new e.P(Math.max(d.x,m.x,y.x,g.x),Math.max(d.y,m.y,y.y,g.y)),x=new e.P(Math.min(d.x,m.x,y.x,g.x),Math.min(d.y,m.y,y.y,g.y)),_=v.sub(x),b=(o.width-(s.left+s.right+i.padding.left+i.padding.right))/_.x,w=(o.height-(s.top+s.bottom+i.padding.top+i.padding.bottom))/_.y;if(w<0||b<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let T=Math.min(o.scaleZoom(o.scale*Math.min(b,w)),i.maxZoom),k=e.P.convert(i.offset),A=new e.P((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(e.ba(n)),M=k.add(A).mult(o.scale/o.zoomScale(T));return{center:o.unproject(u.add(h).div(2).sub(M)),zoom:T,bearing:n}}fitBounds(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)}fitScreenCoordinates(t,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(t)),this.transform.pointLocation(e.P.convert(r)),n,i),i,a)}_fitInternal(t,r,n){return t?(delete(r=e.e(t,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}jumpTo(t,r){this.stop();let n=this._getTransformForUpdate(),i=!1,a=!1,o=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(i=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.N.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(a=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),null==t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this._applyUpdatedTransform(n),this.fire(new e.k("movestart",r)).fire(new e.k("move",r)),i&&this.fire(new e.k("zoomstart",r)).fire(new e.k("zoom",r)).fire(new e.k("zoomend",r)),a&&this.fire(new e.k("rotatestart",r)).fire(new e.k("rotate",r)).fire(new e.k("rotateend",r)),o&&this.fire(new e.k("pitchstart",r)).fire(new e.k("pitch",r)).fire(new e.k("pitchend",r)),this.fire(new e.k("moveend",r))}calculateCameraOptionsFromTo(t,r,n,i=0){let a=e.Z.fromLngLat(t,r),o=e.Z.fromLngLat(n,i),s=o.x-a.x,l=o.y-a.y,u=o.z-a.z,c=Math.hypot(s,l,u);if(0===c)throw new Error("Can't calculate camera options with same From and To");let h=Math.hypot(s,l),f=this.transform.scaleZoom(this.transform.cameraToCenterDistance/c/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI,d=180*Math.acos(h/c)/Math.PI;return d=u<0?90-d:90+d,{center:o.toLngLat(),zoom:f,pitch:d,bearing:p}}easeTo(t,r){var n;this._stop(!1,t.easeId),(!1===(t=e.e({offset:[0,0],duration:500,easing:e.b9},t)).animate||!t.essential&&a.prefersReducedMotion)&&(t.duration=0);let i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,u=i.padding,c="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,f="padding"in t?t.padding:i.padding,p=e.P.convert(t.offset),d=i.centerPoint.add(p),m=i.pointLocation(d),{center:g,zoom:y}=i.getConstrained(e.N.convert(t.center||m),null!==(n=t.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);let v,x,_=i.project(m),b=i.project(g).sub(_),w=i.zoomScale(y-o);t.around&&(v=e.N.convert(t.around),x=i.locationPoint(v));let T={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==o,this._rotating=this._rotating||s!==c,this._pitching=this._pitching||h!==l,this._padding=!i.isPaddingEqual(f),this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,T),this.terrain&&this._prepareElevation(g),this._ease(n=>{if(this._zooming&&(i.zoom=e.y.number(o,y,n)),this._rotating&&(i.bearing=e.y.number(s,c,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(u,f,n),d=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n),v)i.setLocationAtPoint(v,x);else{let t=i.zoomScale(i.zoom-o),e=y>o?Math.min(2,w):Math.max(.5,w),r=Math.pow(e,1-n),a=i.unproject(_.add(b.mult(n*r)).mult(t));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,d)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)},e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r,e)},t),this}_prepareEase(t,r,n={}){this._moving=!0,r||n.moving||this.fire(new e.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&r!==this._elevationTarget){let e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(r-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=r}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){let e=t.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom);if(e.altitude<r){let n=this.calculateCameraOptionsFromTo(e.lngLat,r,t.center,t.elevation);return{pitch:n.pitch,zoom:n.zoom}}return{}}_applyUpdatedTransform(t){let e=[];if(this.terrain&&e.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&e.push(t=>this.transformCameraUpdate(t)),!e.length)return;let r=t.clone();for(let t of e){let e=r.clone(),{center:n,zoom:i,pitch:a,bearing:o,elevation:s}=t(e);n&&(e.center=n),void 0!==i&&(e.zoom=i),void 0!==a&&(e.pitch=a),void 0!==o&&(e.bearing=o),void 0!==s&&(e.elevation=s),r.apply(e)}this.transform.apply(r)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;let n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.k("zoomend",t)),i&&this.fire(new e.k("rotateend",t)),a&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,r){var n;if(!t.essential&&a.prefersReducedMotion){let n=e.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},t);let i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,u=i.padding,c="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,f="padding"in t?t.padding:i.padding,p=e.P.convert(t.offset),d=i.centerPoint.add(p),m=i.pointLocation(d),{center:g,zoom:y}=i.getConstrained(e.N.convert(t.center||m),null!==(n=t.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);let v=i.zoomScale(y-o),x=i.project(m),_=i.project(g).sub(x),b=t.curve,w=Math.max(i.width,i.height),T=w/v,k=_.mag();if("minZoom"in t){let r=e.ac(Math.min(t.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);b=Math.sqrt(n/k*2)}let A=b*b;function M(t){let e=(T*T-w*w+(t?-1:1)*A*A*k*k)/(2*(t?T:w)*A*k);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}let C=M(!1),I=function(t){return E(C)/E(C+b*t)},L=function(t){return w*((E(C)*(S(e=C+b*t)/E(e))-S(C))/A)/k;var e},P=(M(!0)-C)/b;if(Math.abs(k)<1e-6||!isFinite(P)){if(Math.abs(w-T)<1e-6)return this.easeTo(t,r);let e=T<w?-1:1;P=Math.abs(Math.log(T/w))/b,L=()=>0,I=t=>Math.exp(e*b*t)}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==c,this._pitching=h!==l,this._padding=!i.isPaddingEqual(f),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease(n=>{let a=n*P,m=1/I(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=e.y.number(s,c,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(u,f,n),d=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n);let v=1===n?g:i.unproject(x.add(_.mult(L(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,d),this._applyUpdatedTransform(i),this._fireMoveEvents(r)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,r){t=e.b3(t,-180,180);let n=Math.abs(t-r);return Math.abs(t-360-r)<n&&(t-=360),Math.abs(t+360-r)<n&&(t+=360),t}_normalizeCenter(t,e){if(!e.renderWorldCopies||e.lngRange)return;let r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}let Mi={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Si{constructor(t=Mi){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){let r=this._map._getUIString(`AttributionControl.${e}`);t.title=r,t.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"!=typeof t?"":t)):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let e=this._map.style.sourceCaches;for(let r in e){let n=e[r];if(n.used||n.usedForTerrain){let e=n.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter(t=>String(t).trim()),t.sort((t,e)=>t.length-e.length),t=t.filter((e,r)=>{for(let n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0});let r=t.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,t.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ei{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");let e=o.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ci{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){let e=this._currentlyRunning,r=e?this._queue.concat(e):this._queue;for(let e of r)if(e.id===t)return void(e.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let e=this._currentlyRunning=this._queue;this._queue=[];for(let r of e)if(!r.cancelled&&(r.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ii=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Li extends e.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,r){this.sourceCache.update(t,r),this._renderableTilesKeys=[];let n={};for(let i of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),this._tiles[i.key]=new ut(i,this.tileSize));for(let t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(t){for(let e in this._tiles){let r=this._tiles[e];(!t||r.tileID.equals(t)||r.tileID.isChildOf(t)||t.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let r={};for(let n of this._renderableTilesKeys){let i=this._tiles[n].tileID;if(i.canonical.equals(t.canonical)){let i=t.clone();i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),r[n]=i}else if(i.canonical.isChildOf(t.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=i.canonical.z-t.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),l=i.canonical.y-(i.canonical.y>>o<<o),u=e.X>>o;e.aP(a.posMatrix,0,u,0,u,0,1),e.J(a.posMatrix,a.posMatrix,[-s*u,-l*u,0]),r[n]=a}else if(t.canonical.isChildOf(i.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=t.canonical.z-i.canonical.z,s=t.canonical.x-(t.canonical.x>>o<<o),l=t.canonical.y-(t.canonical.y>>o<<o),u=e.X>>o;e.aP(a.posMatrix,0,e.X,0,e.X,0,1),e.J(a.posMatrix,a.posMatrix,[s*u,l*u,0]),e.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(t,e){let r=this.sourceCache._source,n=t.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n<r.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(n).key);let i=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!i||!i.dem)&&e)for(;n>=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(t.scaledTo(n--).key);return i}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(e=>e.timeAdded>=t)}}class Pi{constructor(t,e,r){this.painter=t,this.sourceCache=new Li(e),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,r,n,i=e.X){var a;if(!(r>=0&&r<i&&n>=0&&n<i))return 0;let o=this.getTerrainData(t),s=null===(a=o.tile)||void 0===a?void 0:a.dem;if(!s)return 0;let l=(d=[],m=[r/i*e.X,n/i*e.X],g=o.u_terrain_matrix,y=m[0],v=m[1],d[0]=g[0]*y+g[4]*v+g[12],d[1]=g[1]*y+g[5]*v+g[13],d),u=[l[0]*s.dim,l[1]*s.dim],c=Math.floor(u[0]),h=Math.floor(u[1]),f=u[0]-c,p=u[1]-h;var d,m,g,y,v;return s.get(c,h)*(1-f)*(1-p)+s.get(c+1,h)*f*(1-p)+s.get(c,h+1)*(1-f)*p+s.get(c+1,h+1)*f*p}getElevationForLngLatZoom(t,r){if(!e.bb(r,t.wrap()))return 0;let{tileID:n,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,r);return this.getElevation(n,i%e.X,a%e.X,e.X)}getElevation(t,r,n,i=e.X){return this.getDEMElevation(t,r,n,i)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){let t=this.painter.context,r=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new w(t,r,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new w(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}let r=this.sourceCache.getSourceTile(t,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){let t=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new w(t,r.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),r.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}let n=r&&r+r.tileID.key+t.key;if(n&&!this._demMatrixCache[n]){let n=this.sourceCache.sourceCache._source.maxzoom,i=t.canonical.z-r.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=n?i=t.canonical.z-n:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let a=t.canonical.x-(t.canonical.x>>i<<i),o=t.canonical.y-(t.canonical.y>>i<<i),s=e.bc(new Float64Array(16),[1/(e.X<<i),1/(e.X<<i),0]);e.J(s,s,[a*e.X,o*e.X,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(t){let e=this.painter,r=e.width/devicePixelRatio,n=e.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new w(e.context,{width:r,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new w(e.context,{width:r,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(r,n,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,r,n))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,e=0;t<this._coordsTextureSize;t++)for(let n=0;n<this._coordsTextureSize;n++,e+=4)r[e+0]=255&n,r[e+1]=255&t,r[e+2]=n>>8<<4|t>>8,r[e+3]=0;let n=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new w(t,n,t.gl.RGBA,{premultiply:!1});return i.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);let r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);let l=r[0]+(r[2]>>4<<8),u=r[1]+((15&r[2])<<8),c=this.coordsIndex[255-r[3]],h=c&&this.sourceCache.getTileByID(c);if(!h)return null;let f=this._coordsTextureSize,p=(1<<h.tileID.canonical.z)*f;return new e.Z((h.tileID.canonical.x*f+l)/p+h.tileID.wrap,(h.tileID.canonical.y*f+u)/p,this.getElevation(h.tileID,l,u,f))}depthAtPoint(t){let e=new Uint8Array(4),r=this.painter.context,n=r.gl;return r.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),n.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,e),r.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let t=this.painter.context,r=new e.bd,n=new e.aY,i=this.meshSize,a=e.X/i,o=i*i;for(let t=0;t<=i;t++)for(let e=0;e<=i;e++)r.emplaceBack(e*a,t*a,0);for(let t=0;t<o;t+=i+1)for(let e=0;e<i;e++)n.emplaceBack(e+t,i+e+t+1,i+e+t+2),n.emplaceBack(e+t,i+e+t+2,e+t+1);let s=r.length,l=s+2*(i+1);for(let t of[0,1])for(let n=0;n<=i;n++)for(let i of[0,1])r.emplaceBack(n*a,t*e.X,i);for(let t=0;t<2*i;t+=2)n.emplaceBack(l+t,l+t+1,l+t+3),n.emplaceBack(l+t,l+t+3,l+t+2),n.emplaceBack(s+t,s+t+3,s+t+1),n.emplaceBack(s+t,s+t+2,s+t+3);let u=r.length,c=u+2*(i+1);for(let t of[0,1])for(let n=0;n<=i;n++)for(let i of[0,1])r.emplaceBack(t*e.X,n*a,i);for(let t=0;t<2*i;t+=2)n.emplaceBack(u+t,u+t+1,u+t+3),n.emplaceBack(u+t,u+t+3,u+t+2),n.emplaceBack(c+t,c+t+3,c+t+1),n.emplaceBack(c+t,c+t+2,c+t+3);return this._mesh=new xn(t.createVertexBuffer(r,Ii.members),t.createIndexBuffer(n),e.a0.simpleSegment(0,0,r.length,n.length)),this._mesh}getMeshFrameDelta(t){return 2*Math.PI*e.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,e){var r;let{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(t,e);return null!==(r=this.getMinMaxElevation(n).minElevation)&&void 0!==r?r:0}getMinMaxElevation(t){let e=this.getTerrainData(t).tile,r={minElevation:null,maxElevation:null};return e&&e.dem&&(r.minElevation=e.dem.min*this.exaggeration,r.maxElevation=e.dem.max*this.exaggeration),r}_getOverscaledTileIDFromLngLatZoom(t,r){let n=e.Z.fromLngLat(t.wrap()),i=(1<<r)*e.X,a=n.x*i,o=n.y*i,s=Math.floor(a/e.X),l=Math.floor(o/e.X);return{tileID:new e.S(r,0,r,s,l),mercatorX:a,mercatorY:o}}}class zi{constructor(t,e,r){this._context=t,this._size=e,this._tileSize=r,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let e=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new w(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),e.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),e.colorAttachment.set(r.texture),{id:t,fbo:e,texture:r,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(e=>t.id!==e),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}let Oi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Di{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new zi(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(r=>!t._layers[r].isHidden(e)),this._coordsDescendingInv={};for(let e in t.sourceCaches){this._coordsDescendingInv[e]={};let r=t.sourceCaches[e].getVisibleCoordinates();for(let t of r){let r=this.terrain.sourceCache.getTerrainCoords(t);for(let t in r)this._coordsDescendingInv[e][t]||(this._coordsDescendingInv[e][t]=[]),this._coordsDescendingInv[e][t].push(r[t])}}this._coordsDescendingInvStr={};for(let e of t._order){let r=t._layers[e],n=r.source;if(Oi[r.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(let t in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][t]=this._coordsDescendingInv[n][t].map(t=>t.key).sort().join()}}for(let t of this._renderableTiles)for(let e in this._coordsDescendingInvStr){let r=this._coordsDescendingInvStr[e][t.tileID.key];r&&r!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;let r=t.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Oi[r]&&(this._prevType&&Oi[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!i))return!0;if(Oi[this._prevType]||Oi[r]&&i){this._prevType=r;let t=this._stacks.length-1,i=this._stacks[t]||[];for(let r of this._renderableTiles){if(this.pool.isFull()&&(vn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[t]){let e=this.pool.getObjectForId(r.rtt[t].id);if(e.stamp===r.rtt[t].stamp){this.pool.useObject(e);continue}}let a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[t]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:e.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let t=0;t<i.length;t++){let e=n.style._layers[i[t]],o=e.source?this._coordsDescendingInv[e.source][r.tileID.key]:[r.tileID];n.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),n._renderTileClippingMasks(e,o),n.renderLayer(n,n.style.sourceCaches[e.source],e,o),e.source&&(r.rttCoords[e.source]=this._coordsDescendingInvStr[e.source][r.tileID.key])}}return vn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Oi[r]}return!1}}let Ri,Fi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Bi=r,Ni={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Mi,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},ji=t=>{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},Ui={showCompass:!0,showZoom:!0,visualizePitch:!1};class Vi{constructor(t,r,n=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),o.mousePos(this.element,t)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,o.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let i=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Kn({clickTolerance:i,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{let n=new $n;return new Wn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:ji})})({clickTolerance:i,enable:!0}),this.map=t,n&&(this.mousePitch=Qn({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{let n=new $n;return new Wn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:ji})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),o.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),o.disableDrag()}moveMouse(t,e){let r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){let{pitchDelta:n}=this.mousePitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(t,e){let r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){let{pitchDelta:n}=this.touchPitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}off(){let t=this.element;o.removeEventListener(t,"mousedown",this.mousedown),o.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}function qi(t,r,n){let i=new e.N(t.lng,t.lat);if(t=new e.N(t.lng,t.lat),r){let i=new e.N(t.lng-360,t.lat),a=new e.N(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(i).distSqr(r)<o?t=i:n.locationPoint(a).distSqr(r)<o&&(t=a)}for(;Math.abs(t.lng-n.center.lng)>180;){let e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t.lng!==i.lng&&n.locationPoint(t).y>n.height/2-n.getHorizon()?t:i}let Hi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Gi(t,e,r){let n=t.classList;for(let t in Hi)n.remove(`maplibregl-${r}-anchor-${t}`);n.add(`maplibregl-${r}-anchor-${e}`)}class Zi extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{let e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=t=>{let e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;let r=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${Hi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then(()=>{this._updateOpacity(t&&"moveend"===t.type)}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");let r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);let a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");let s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");let l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");let u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let t of u){let e=o.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}let c=o.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"fill",this._color);let h=o.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),c.appendChild(h);let f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");let p=o.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),f.appendChild(p);let d=o.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");let m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");let g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");let y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(c),s.appendChild(f),s.appendChild(d),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),Gi(this._element,this._anchor,"marker"),t&&t.className)for(let e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let e=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var r,n;if(null===(r=this._map)||void 0===r||!r.terrain)return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);let s=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*s,u=i.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),c=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-u>.006;!(null===(n=this._popup)||void 0===n)&&n.isOpen()&&c&&this._popup.remove(),this._element.style.opacity=c?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}let Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Yi=0,Xi=!1,$i={maxWidth:100,unit:"metric"};function Ji(t,e,r){let n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){let r=3.2808*s;r>5280?Ki(e,n,r/5280,t._getUIString("ScaleControl.Miles")):Ki(e,n,r,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ki(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ki(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ki(t,e,r,n){let i=function(t){let e=Math.pow(10,`${Math.floor(t)}`.length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){let e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r);t.style.width=e*(i/r)+"px",t.innerHTML=`${i}&nbsp;${n}`}let Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ta=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ea(t){if(t){if("number"==typeof t){let r=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(r,r),"top-right":new e.P(-r,r),bottom:new e.P(0,-t),"bottom-left":new e.P(r,-r),"bottom-right":new e.P(-r,-r),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){let r=e.P.convert(t);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return ea(new e.P(0,0))}let ra=r;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Si,t.BoxZoomHandler=Vn,t.CanvasSource=rt,t.CooperativeGesturesHandler=_i,t.DoubleClickZoomHandler=di,t.DragPanHandler=yi,t.DragRotateHandler=vi,t.EdgeInsets=Tn,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null!==(t=null==e?void 0:e.shadowRoot)&&void 0!==t&&t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=K,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{let r=new e.N(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.e({bearing:i},this.options.fitBoundsOptions),o=W.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let r=new e.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Xi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Zi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))})}},this.options=e.e({},Wi,t)}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(t=!1){if(void 0!==Ri&&!t)return Ri;if(void 0===window.navigator.permissions)return Ri=!!window.navigator.geolocation,Ri;try{Ri="denied"!==(yield window.navigator.permissions.query({name:"geolocation"})).state}catch(t){Ri=!!window.navigator.geolocation}return Ri})}().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Yi=0,Xi=!1}_isOutOfMapMaxBounds(t){let e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let t=this._map.getBounds(),e=t.getSouthEast(),r=t.getNorthEast(),n=e.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Yi--,Xi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new e.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Yi++,Yi>1?(t={maximumAge:6e5,timeout:0},Xi=!0):(t=this.options.positionOptions,Xi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.Hash=Sn,t.ImageSource=tt,t.KeyboardHandler=ci,t.LngLatBounds=W,t.LogoControl=Ei,t.Map=class extends Ai{constructor(t){e.bf.mark(e.bg.create);let r=Object.assign(Object.assign({},Ni),t);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new An(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=e.a4(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Fi),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl(()=>this.isMoving()),this._requestManager=new d(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1,e=Mn(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50);this._resizeObserver=new ResizeObserver(r=>{t?e(r):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ki(this,r),this._hash=r.hash&&new Sn("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,e.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Si("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Ei,r.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new e.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=t.onAdd(this);this._controls.push(t);let i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,r,n)}resize(t){var r;let n=this._containerDimensions(),i=n[0],a=n[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let e=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,e),this.painter.resize(i,a,e)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);let s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){let{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=t*i,o=e*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(W.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,r){if("mouseenter"===t||"mouseover"===t){let n=!1;return{layers:e,listener:r,delegates:{mousemove:i=>{let a=e.filter(t=>this.getLayer(t)),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Rn(t,this,i.originalEvent,{features:o}))):n=!1},mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;return{layers:e,listener:r,delegates:{mousemove:i=>{let a=e.filter(t=>this.getLayer(t));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Rn(t,this,i.originalEvent)))},mouseout:e=>{n&&(n=!1,r.call(this,new Rn(t,this,e.originalEvent)))}}}}{let n=t=>{let n=e.filter(t=>this.getLayer(t)),i=0!==n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];i.length&&(t.features=i,r.call(this,t),delete t.features)};return{layers:e,listener:r,delegates:{[t]:n}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,r){if(!this._delegatedListeners||!this._delegatedListeners[t])return;let n=this._delegatedListeners[t];for(let t=0;t<n.length;t++){let i=n[t];if(i.listener===r&&i.layers.length===e.length&&i.layers.every(t=>e.includes(t))){for(let t in i.delegates)this.off(t,i.delegates[t]);return void n.splice(t,1)}}}on(t,e,r){if(void 0===r)return super.on(t,e);let n=this._createDelegatedListener(t,"string"==typeof e?[e]:e,r);this._saveDelegatedListener(t,n);for(let t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,r){if(void 0===r)return super.once(t,e);let n="string"==typeof e?[e]:e,i=this._createDelegatedListener(t,n,r);for(let e in i.delegates){let a=i.delegates[e];i.delegates[e]=(...e)=>{this._removeDelegatedListener(t,n,r),a(...e)}}this._saveDelegatedListener(t,i);for(let t in i.delegates)this.once(t,i.delegates[t]);return this}off(t,e,r){return void 0===r?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,r),this)}queryRenderedFeatures(t,r){if(!this.style)return[];let n,i=t instanceof e.P||Array.isArray(t),a=i?t:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:t)||{},a instanceof e.P||"number"==typeof a[0])n=[e.P.convert(a)];else{let t=e.P.convert(a[0]),r=e.P.convert(a[1]);n=[t,new e.P(r.x,t.y),r,new e.P(t.x,r.y),t]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,r){return!1!==(r=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,e));let r=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new pe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,r):this.style.loadJSON(t,e,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){if("string"==typeof t){let n=this._requestManager.transformRequest(t,"Style");e.h(n,new AbortController).then(t=>{this._updateDiff(t.data,r)}).catch(t=>{t&&this.fire(new e.j(t))})}else"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,r){try{this.style.setState(t,r)&&this._update(!0)}catch(n){e.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){let r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let r=this.style.sourceCaches[t.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&r.reload();for(let r in this.style._layers){let n=this.style._layers[r];"hillshade"===n.type&&n.source===t.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Pi(this.painter,r,t),this.painter.renderToTexture=new Di(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){let t=this.style&&this.style.sourceCaches;for(let e in t){let r=t[e]._tiles;for(let t in r){let e=r[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,r,n={}){let{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:u,textFitWidth:c,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||e.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:n,height:a,data:f}=r,p=r;return this.style.addImage(t,{data:new e.R({width:n,height:a},new Uint8Array(f)),pixelRatio:i,stretchX:s,stretchY:l,content:u,textFitWidth:c,textFitHeight:h,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{let{width:n,height:f,data:p}=a.getImageData(r);this.style.addImage(t,{data:new e.R({width:n,height:f},p),pixelRatio:i,stretchX:s,stretchY:l,content:u,textFitWidth:c,textFitHeight:h,sdf:o,version:0})}}updateImage(t,r){let n=this.style.getImage(t);if(!n)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let i=r instanceof HTMLImageElement||e.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new e.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||s!==n.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let u=!(r instanceof HTMLImageElement||e.b(r));return n.data.replace(l,u),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)}setFilter(t,e,r={}){return this.style.setFilter(t,e,r),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,r,n={}){return this.style.setPaintProperty(t,e,r,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,r,n={}){return this.style.setLayoutProperty(t,e,r,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,r,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,t=>{t||this._update(!0)}),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){return this._lazyInitEmptyStyle(),this.style.setSky(t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let e=this._canvasContainer=o.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);let i=this._controlContainer=o.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{a[t]=o.create("div",`maplibregl-ctrl-${t} `,i)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,r){this._canvas.width=Math.floor(r*t),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){let t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},e=null;this._canvas.addEventListener("webglcontextcreationerror",r=>{e={requestedAttributes:t},r&&(e.statusMessage=r.statusMessage,e.type=r.type)},{once:!0});let r=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!r){let t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new _n(r,this.transform),u.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this.transform.zoom,i=a.now();this.style.zoomHistory.update(t,i);let o=new e.z(t,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!0,this._crossFadingFactor=s),this.style.update(o)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();let r=this.painter.context.gl.getExtension("WEBGL_lose_context");null!=r&&r.loseContext&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then(t=>{e.bf.frame(t),this._frameRequest=null,this._render(t)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return Bi}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Rn,t.MapTouchEvent=Fn,t.MapWheelEvent=Bn,t.Marker=Zi,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,e)=>{let r=this._map._getUIString(`NavigationControl.${e}`);t.title=r,t.setAttribute("aria-label",r)},this.options=e.e({},Ui,t),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Vi(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){let r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var e;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._trackPointer&&!t)return;let r=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor,i=ea(this.options.offset);if(!n){let t,e=this._container.offsetWidth,a=this._container.offsetHeight;t=r.y+i.bottom.y<a?["top"]:r.y>this._map.transform.height-a?["bottom"]:[],r.x<e/2?t.push("left"):r.x>this._map.transform.width-e/2&&t.push("right"),n=0===t.length?"bottom":t.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${Hi[n]} translate(${a.x}px,${a.y}px)`),Gi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Qi),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild,e;)r.appendChild(e);return this.setDOMContent(r)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector(ta);t&&t.focus()}},t.RasterDEMTileSource=J,t.RasterTileSource=$,t.ScaleControl=class{constructor(t){this._onMove=()=>{Ji(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ji(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},$i),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=pi,t.Style=pe,t.TerrainControl=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=li,t.TwoFingersTouchRotateHandler=oi,t.TwoFingersTouchZoomHandler=ii,t.TwoFingersTouchZoomRotateHandler=xi,t.VectorTileSource=X,t.VideoSource=et,t.addSourceType=(t,r)=>e._(void 0,void 0,void 0,function*(){if(it(t))throw new Error(`A source type called "${t}" already exists.`);var e;e=r,nt[t]=e}),t.clearPrewarmedResources=function(){let t=F;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(D),F=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return lt().getRTLTextPluginStatus()},t.getVersion=function(){return ra},t.getWorkerCount=function(){return R.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return V().broadcast("IS",t)},t.prewarm=function(){j().acquire(D)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return lt().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){R.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}}),t},"object"==typeof t&&void 0!==e?e.exports=a():(n="undefined"!=typeof globalThis?globalThis:n||self).maplibregl=a()}),wb=f((t,e)=>{var r=oe(),n=Ae().sanitizeHTML,i=mb(),a=ub();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n<e.length;n++)if("string"!=typeof e[n]||0===e[n].length)return!1;return!0}return r.isPlainObject(e)||"string"==typeof e&&e.length>0}function u(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r<e.length;r++){var n=e[r].id;if("string"==typeof n&&0===n.indexOf(a.traceLayerPrefix)){t=n;break}}return t},s.updateLayer=function(t){var e=this.subplot,r=u(t),n=this.lookupBelow(),i=this.findFollowingMapLayerId(n);this.removeLayer(),l(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=t.type,this.below=n},s.updateStyle=function(t){if(l(t)){var e=u(t);this.subplot.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",e.paint)}},s.removeLayer=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},s.dispose=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer),t.getSource(this.idSource)&&t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new o(t,e);return n.update(r),n}}),Tb=f((t,e)=>{var r=bb(),n=oe(),i=_g(),a=Ut(),o=rr(),s=cr(),l=Pr(),u=zr(),c=u.drawMode,h=u.selectMode,f=Mn().prepSelect,p=Mn().clearOutline,d=Mn().clearSelectionsCache,m=Mn().selectOnClick,g=ub(),y=wb();function v(t,e){this.id=e,this.gd=t;var r=t._fullLayout,n=t._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(t,e,r){var n,i=this;n=i.map?new Promise(function(r,n){i.updateMap(t,e,r,n)}):new Promise(function(r,n){i.createMap(t,e,r,n)}),r.push(n)},x.createMap=function(t,e,n,a){var o=this,s=e[o.id],l=o.styleObj=b(s.style),u=s.bounds,c=u?[[u.west,u.south],[u.east,u.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:w(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:c,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new r.AttributionControl({compact:!0})),f={};h.on("styleimagemissing",function(t){var e=t.id;if(!f[e]&&e.includes("-15")){f[e]=!0;var r=new Image(15,15);r.onload=function(){h.addImage(e,r)},r.crossOrigin="Anonymous",r.src="https://unpkg.com/maki@2.1.0/icons/"+e+".svg"}}),h.setTransformRequest(function(t){return{url:t=(t=(t=t.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular")}}),h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(t,e);var p=[];p.push(new Promise(function(t){h.once("load",t)})),p=p.concat(i.fetchTraceGeoData(t)),Promise.all(p).then(function(){o.fillBelowLookup(t,e),o.updateData(t),o.updateLayout(e),o.resolveOnRender(n)}).catch(a)},x.updateMap=function(t,e,r,n){var a=this,o=a.map,s=e[this.id];a.rejectOnError(n);var l=[],u=b(s.style);JSON.stringify(a.styleObj)!==JSON.stringify(u)&&(a.styleObj=u,o.setStyle(u.style),a.traceHash={},l.push(new Promise(function(t){o.once("styledata",t)}))),l=l.concat(i.fetchTraceGeoData(t)),Promise.all(l).then(function(){a.fillBelowLookup(t,e),a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)}).catch(n)},x.fillBelowLookup=function(t,e){var r,n,i=e[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<t.length;r++){var s=t[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var u=i[r];n="string"==typeof u.below?u.below:o?"traces":"",a["layout-"+r]=n}var c,h,f={};for(c in a)f[n=a[c]]?f[n].push(c):f[n]=[c];for(n in f){var p=f[n];if(p.length>1)for(r=0;r<p.length;r++)0===(c=p[r]).indexOf("trace-")?(h=c.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===c.indexOf("layout-")&&(h=c.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var _={choroplethmap:0,densitymap:1,scattermap:2};function b(t){var e={};return n.isPlainObject(t)?(e.id=t.id,e.style=t):"string"==typeof t?(e.id=t,g.stylesMap[t]?e.style=g.stylesMap[t]:e.style=t):(e.id=g.styleValueDflt,e.style=function(t){return g.styleUrlPrefix+t+"-"+g.styleUrlSuffix}(g.styleValueDflt)),e.transition={duration:0,delay:0},e}function w(t){return[t.lon,t.lat]}x.updateData=function(t){var e,r,n,i,a=this.traceHash,o=t.slice().sort(function(t,e){return _[t[0].trace.type]-_[e[0].trace.type]});for(n=0;n<o.length;n++){var s=o[n],l=!1;(e=a[(r=s[0].trace).uid])&&(e.type===r.type?(e.update(s),l=!0):e.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var u=Object.keys(a);t:for(n=0;n<u.length;n++){var c=u[n];for(i=0;i<t.length;i++)if(c===(r=t[i][0].trace).uid)continue t;(e=a[c]).dispose(),delete a[c]}},x.updateLayout=function(t){var e=this.map,r=t[this.id];!this.dragging&&!this.wheeling&&(e.setCenter(w(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch)),this.updateLayers(t),this.updateFramework(t),this.updateFx(t),this.map.resize(),this.gd._context._scrollZoom.map?e.scrollZoom.enable():e.scrollZoom.disable()},x.resolveOnRender=function(t){var e=this.map;e.on("render",function r(){e.loaded()&&(e.off("render",r),setTimeout(t,10))})},x.rejectOnError=function(t){var e=this.map;function r(){t(new Error(g.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},x.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t),e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(e.mockAxis,t)},x.initFx=function(t,e){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(e._hoverlayer)}function s(){var t=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(t))}i.on("moveend",function(t){if(r.map){var e=n._fullLayout;if(t.originalEvent||r.wheeling){var i=e[r.id];a.call("_storeDirectGUIEdit",n.layout,e._preGUI,r.getViewEdits(i));var o=r.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}t.originalEvent&&"mouseup"===t.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),e&&e._rehover&&e._rehover()}}),i.on("wheel",function(){r.wheeling=!0}),i.on("mousemove",function(t){var e=r.div.getBoundingClientRect(),a=[t.originalEvent.offsetX,t.originalEvent.offsetY];t.target.getBoundingClientRect=function(){return e},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,t,r.id)},l.hover(n,t,r.id),n._fullLayout._hoversubplot=r.id}),i.on("dragstart",function(){r.dragging=!0,o()}),i.on("zoomstart",o),i.on("mouseout",function(){n._fullLayout._hoversubplot=null}),i.on("drag",s),i.on("zoom",s),i.on("dblclick",function(){var t=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(t));var e=r.viewInitial;i.setCenter(w(e.center)),i.setZoom(e.zoom),i.setBearing(e.bearing),i.setPitch(e.pitch);var o=r.getView();t._input.center=t.center=o.center,t._input.zoom=t.zoom=o.zoom,t._input.bearing=t.bearing=o.bearing,t._input.pitch=t.pitch=o.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}),r.clearOutline=function(){d(r.dragOptions),p(r.dragOptions.gd)},r.onClickInPanFn=function(t){return function(e){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(u)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||c(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e<n.length;e++)n[e].dispose();for(n=this.layerList=[],e=0;e<r.length;e++)n.push(y(this,e,r[e]))}else for(e=0;e<r.length;e++)n[e].update(r[e])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(t,e,r){for(var n in r)this.map[e](t,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(t,e){var r=this.map;if("string"==typeof e){if(""===e)return void r.addLayer(t,e);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(e===i[a].id)return void r.addLayer(t,e);n.warn(["Trying to add layer with *below* value",e,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(t)},x.project=function(t){return this.map.project(new r.LngLat(t[0],t[1]))},x.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat},n=t.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),_derived:{coordinates:[t.unproject([0,0]).toArray(),t.unproject([i,0]).toArray(),t.unproject([i,a]).toArray(),t.unproject([0,a]).toArray()]}}},x.getViewEdits=function(t){for(var e=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[e+"."+a]=t[a]}return n},x.getViewEditsWithDerived=function(t){var e=this.id,r=this.getViewEdits(t);return r[e+"._derived"]=t._derived,r},e.exports=v}),kb=f((t,e)=>{var r=oe(),n=Vs(),i=Fe(),a=cb();function o(t,e,r){r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var n=r("bounds.west"),a=r("bounds.east"),o=r("bounds.south"),l=r("bounds.north");(void 0===n||void 0===a||void 0===o||void 0===l)&&delete e.bounds,i(t,e,{name:"layers",handleItemDefaults:s}),e._input=t}function s(t,e){function n(n,i){return r.coerce(t,e,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=e.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}e.exports=function(t,e,r){n(t,e,r,{type:"map",attributes:a,handleDefaults:o,partition:"y"})}}),Ab=f(t=>{var e=oe(),r=e.strTranslate,n=e.strScale,i=_e().getSubplotCalcData,a=Te(),o=v(),s=Je(),l=Ae(),u=Tb(),c="map";t.name=c,t.attr="subplot",t.idRoot=c,t.idRegex=t.attrRegex=e.counterRegex(c),t.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},t.layoutAttributes=cb(),t.supplyLayoutDefaults=kb(),t.plot=function(t){for(var r=t._fullLayout,n=t.calcdata,a=r._subplots[c],o=0;o<a.length;o++){var s=a[o],l=i(n,c,s),h=r[s],f=h._subplot;f||(f=new u(t,s),r[s]._subplot=f),f.viewInitial||(f.viewInitial={center:e.extendFlat({},h.center),zoom:h.zoom,bearing:h.bearing,pitch:h.pitch}),f.plot(l,r,t._promises)}},t.clean=function(t,e,r,n){for(var i=n._subplots[c]||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},t.toSVG=function(t){for(var e=t._fullLayout,i=e._subplots[c],u=e._size,h=0;h<i.length;h++){var f=e[i[h]],p=f.domain,d=f._subplot.toImage("png");e._glimages.append("svg:image").attr({xmlns:a.svg,"xlink:href":d,x:u.l+u.w*p.x[0],y:u.t+u.h*(1-p.y[1]),width:u.w*(p.x[1]-p.x[0]),height:u.h*(p.y[1]-p.y[0]),preserveAspectRatio:"none"});var m=o.select(f._subplot.div).select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),g=e._glimages.append("g"),y=g.append("text");y.text(m).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":m});var v=s.bBox(y.node()),x=u.w*(p.x[1]-p.x[0]);if(v.width>x/2){var _=m.split("|").join("<br>");y.text(_).attr("data-unformatted",_).call(l.convertToTspans,t),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>x&&(b=x/(v.width+6));var w=[u.l+u.w*p.x[1],u.t+u.h*(1-p.y[0])];g.attr("transform",r(w[0],w[1])+n(b))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[c],n=0;n<r.length;n++)e[r[n]]._subplot.updateFx(e)}}),Mb=f((t,e)=>{e.exports={attributes:hb(),supplyDefaults:pb(),colorbar:hi(),formatLabels:db(),calc:ug(),plot:yb(),hoverPoints:vb().hoverPoints,eventData:xb(),selectPoints:_b(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermap",basePlotModule:Ab(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),Sb=f((t,e)=>{e.exports=Mb()}),Eb=f((t,e)=>{var r=Rg(),n=Ie(),i=Ot().hovertemplateAttrs,a=j(),o=D().extendFlat;e.exports=o({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:o({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:o({},r.marker.line.color,{editType:"plot"}),width:o({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:o({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:o({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:o({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),showlegend:o({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}),Cb=f((t,e)=>{var r=oe(),n=Ue(),i=Eb();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("locations"),u=s("z"),c=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(u)&&u.length&&("string"==typeof c&&""!==c||r.isPlainObject(c))?(s("featureidkey"),e._length=Math.min(l.length,u.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(t,e,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}}),Ib=f((t,e)=>{var r=T(),n=oe(),i=Ge(),a=Je(),o=pg().makeBlank,s=_g();function l(t){var e,r=t[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<t.length;s++){var l=t[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}e={type:"identity",property:"mo2"}}else e=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":e}),n.extendFlat(i.line.paint,{"line-opacity":e}),i}e.exports={convert:function(t){var e=t[0].trace,a=!0===e.visible&&0!==e._length,u={layout:{visibility:"none"},paint:{}},c={layout:{visibility:"none"},paint:{}},h=e._opts={fill:u,line:c,geojson:o()};if(!a)return h;var f=s.extractTraceFeature(t);if(!f)return h;var p,d,m,g=i.makeColorScaleFuncFromTrace(e),y=e.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(p=function(t){var e=t.mo;return r(e)?+n.constrain(e,0,1):0}),n.isArrayOrTypedArray(v.color)&&(d=function(t){return t.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(t){return t.mlw});for(var x=0;x<t.length;x++){var _=t[x],b=_.fOut;if(b){var w=b.properties;w.fc=g(_.z),p&&(w.mo=p(_)),d&&(w.mlc=d(_)),m&&(w.mlw=m(_)),_.ct=w.ct,_._polygons=s.feature2polygons(b)}}var T=p?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(u.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":T}),n.extendFlat(c.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":T}),u.layout.visibility="visible",c.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:f},l(t),h},convertOnSelect:l}}),Lb=f((t,e)=>{var r=Ib().convert,n=Ib().convertOnSelect,i=ub().traceLayerPrefix;function a(t,e){this.type="choroplethmap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",i+e+"-fill"],["line",i+e+"-line"]],this.below=null}var o=a.prototype;o.update=function(t){this._update(r(t)),t[0].trace._glTrace=this},o.updateOnSelect=function(t){this._update(n(t))},o._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=t[o];e.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&e.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},o._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}),Pb=f((t,e)=>{e.exports={attributes:Eb(),supplyDefaults:Cb(),colorbar:No(),calc:Bg(),plot:Lb(),hoverPoints:Ug(),eventData:Vg(),selectPoints:qg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"==typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmap",basePlotModule:Ab(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}),zb=f((t,e)=>{e.exports=Pb()}),Ob=f((t,e)=>{var r=Ie(),n=Ot().hovertemplateAttrs,i=j(),a=hb(),o=D().extendFlat;e.exports=o({lon:a.lon,lat:a.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:a.text,hovertext:a.hovertext,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:n(),showlegend:o({},i.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}),Db=f((t,e)=>{var r=oe(),n=Ue(),i=Ob();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("lon")||[],u=s("lat")||[],c=Math.min(l.length,u.length);c?(e._length=c,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}}),Rb=f((t,e)=>{var r=T(),n=oe().isArrayOrTypedArray,i=k().BADNUM,a=He(),o=oe()._;e.exports=function(t,e){for(var s=e._length,l=new Array(s),u=e.z,c=n(u)&&u.length,h=0;h<s;h++){var f=l[h]={},p=e.lon[h],d=e.lat[h];if(f.lonlat=r(p)&&r(d)?[+p,+d]:[i,i],c){var m=u[h];f.z=r(m)?m:i}}return a(t,e,{vals:c?u:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(t,"lat:")+" ",lon:o(t,"lon:")+" "}}),l}}),Fb=f((t,e)=>{var r=T(),n=oe(),i=q(),a=Ge(),o=k().BADNUM,s=pg().makeBlank;e.exports=function(t){var e=t[0].trace,l=!0===e.visible&&0!==e._length,u=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return u;var c,h=[],f=e.z,p=e.radius,d=n.isArrayOrTypedArray(f)&&f.length,m=n.isArrayOrTypedArray(p);for(c=0;c<t.length;c++){var g=t[c],y=g.lonlat;if(y[0]!==o){var v={};if(d){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(p[c])&&p[c]>0?+p[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(c=1;c<b.length;c++)T.push(b[c][0],b[c][1]);var k=["interpolate",["linear"],["get","z"],_.min,0,_.max,1];return n.extendFlat(u.heatmap.paint,{"heatmap-weight":d?k:1/(_.max-_.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),u.geojson={type:"FeatureCollection",features:h},u.heatmap.layout.visibility="visible",u}}),Bb=f((t,e)=>{var r=Fb(),n=ub().traceLayerPrefix;function i(t,e){this.type="densitymap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",n+e+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(t){var e=this.subplot,n=this.layerList,i=r(t),a=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<n.length;o++){var s=n[o],l=s[0],u=s[1],c=i[l];e.setOptions(u,"setLayoutProperty",c.layout),"visible"===c.layout.visibility&&e.setOptions(u,"setPaintProperty",c.paint)}},a._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},a._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}),Nb=f((t,e)=>{var r=rr(),n=vb().hoverPoints,i=vb().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var h=s.subplot.mockAxis;s.z=c.z,s.zLabel=r.tickText(h,h.c2l(c.z),"hover").text}return s.extraText=i(u,c,l[0].t.labels),[s]}}}),jb=f((t,e)=>{e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}),Ub=f((t,e)=>{e.exports={attributes:Ob(),supplyDefaults:Db(),colorbar:No(),formatLabels:db(),calc:Rb(),plot:Bb(),hoverPoints:Nb(),eventData:jb(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"==typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymap",basePlotModule:Ab(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}),Vb=f((t,e)=>{e.exports=Ub()}),qb=f((t,e)=>{var r=R(),n=j(),i=V(),a=N(),o=wa().attributes,s=Ot().hovertemplateAttrs,l=Ie(),u=me().templatedArray,c=Se().descriptionOnlyNumbers,h=D().extendFlat,f=Lt().overrideAll;e.exports=f({hoverinfo:h({},n.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:a.hoverlabel,domain:o({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:c("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:r({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:a.hoverlabel,hovertemplate:s({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:a.hoverlabel,hovertemplate:s({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),Hb=f((t,e)=>{var r=oe(),n=qb(),i=q(),a=O(),o=wa().defaults,s=Ar(),l=me(),u=Fe();function c(t,e){function i(i,a){return r.coerce(t,e,n.link.colorscales,i,a)}i("label"),i("cmin"),i("cmax"),i("colorscale")}e.exports=function(t,e,h,f){function p(i,a){return r.coerce(t,e,n,i,a)}var d=r.extendDeep(f.hoverlabel,t.hoverlabel),m=t.node,g=l.newContainer(e,"node");function y(t,e){return r.coerce(m,g,n.node,t,e)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",t.hoverinfo),s(m,g,y,d),y("hovertemplate"),y("align");var v=f.colorway;y("color",g.label.map(function(t,e){return i.addOpacity(function(t){return v[t%v.length]}(e),.8)})),y("customdata");var x=t.link||{},_=l.newContainer(e,"link");function b(t,e){return r.coerce(x,_,n.link,t,e)}b("label"),b("arrowlen"),b("source"),b("target"),b("value"),b("line.color"),b("line.width"),b("hoverinfo",t.hoverinfo),s(x,_,b,d),b("hovertemplate");var w,T=a(f.paper_bgcolor).getLuminance()<.333,k=b("color",T?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function A(t){var e=a(t);if(!e.isValid())return t;var r=e.getAlpha();return r<=.8?e.setAlpha(r+.2):e=T?e.brighten():e.darken(),e.toRgbString()}b("hovercolor",Array.isArray(k)?k.map(A):A(k)),b("customdata"),u(x,_,{name:"colorscales",handleItemDefaults:c}),o(e,f,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),r.coerceFont(p,"textfont",f.font,{autoShadowDflt:!0}),e._length=null}}),Gb=f((t,e)=>{e.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l<e;++l)r[l]=-1,n[l]=0,i[l]=!1,a[l]=0,o[l]=-1,s[l]=[];var u,c=0,h=[],f=[];function p(e){var l=[e],u=[e];for(r[e]=n[e]=c,i[e]=!0,c+=1;u.length>0;){e=u[u.length-1];var p=t[e];if(a[e]<p.length){for(var d=a[e];d<p.length;++d){var m=p[d];if(r[m]<0){r[m]=n[m]=c,i[m]=!0,c+=1,l.push(m),u.push(m);break}i[m]&&(n[e]=0|Math.min(n[e],n[m])),o[m]>=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(g);var _=new Array(v);for(d=0;d<y.length;d++)for(var b=0;b<y[d].length;b++)_[--v]=y[d][b];f.push(_)}u.pop()}}}for(l=0;l<e;++l)r[l]<0&&p(l);for(l=0;l<f.length;l++){var d=f[l];if(0!==d.length){d.sort(function(t,e){return t-e}),u=[d[0]];for(var m=1;m<d.length;m++)d[m]!==d[m-1]&&u.push(d[m]);f[l]=u}}return{components:h,adjacencyList:f}}}),Zb=f((t,e)=>{var r=Gb(),n=oe(),i=Xx().wrap,a=n.isArrayOrTypedArray,o=n.isIndex,s=Ge();function l(t){var e,i=t.node,l=t.link,u=[],c=a(l.color),h=a(l.hovercolor),f=a(l.customdata),p={},d={},m=l.colorscales.length;for(e=0;e<m;e++){var g=l.colorscales[e],y=s.extractScale(g,{cLetter:"c"}),v=s.makeColorScaleFunc(y);d[g.label]=v}var x=0;for(e=0;e<l.value.length;e++)l.source[e]>x&&(x=l.source[e]),l.target[e]>x&&(x=l.target[e]);var _=x+1;t.node._count=_;var b,w=t.node.groups,T={};for(e=0;e<w.length;e++){var k=w[e];for(b=0;b<k.length;b++){var A=k[b],M=_+e;T.hasOwnProperty(A)?n.warn("Node "+A+" is already part of a group."):T[A]=M}}var S={source:[],target:[]};for(e=0;e<l.value.length;e++){var E=l.value[e],C=l.source[e],I=l.target[e];if(E>0&&o(C,_)&&o(I,_)&&(!T.hasOwnProperty(C)||!T.hasOwnProperty(I)||T[C]!==T[I])){T.hasOwnProperty(I)&&(I=T[I]),T.hasOwnProperty(C)&&(C=T[C]),I=+I,p[C=+C]=p[I]=!0;var L="";l.label&&l.label[e]&&(L=l.label[e]);var P=null;L&&d.hasOwnProperty(L)&&(P=d[L]),u.push({pointNumber:e,label:L,color:c?l.color[e]:l.color,hovercolor:h?l.hovercolor[e]:l.hovercolor,customdata:f?l.customdata[e]:l.customdata,concentrationscale:P,source:C,target:I,value:+E}),S.source.push(C),S.target.push(I)}}var z=_+w.length,O=a(i.color),D=a(i.customdata),R=[];for(e=0;e<z;e++)if(p[e]){var F=i.label[e];R.push({group:e>_-1,childrenNodes:[],pointNumber:e,label:F,color:O?i.color[e]:i.color,customdata:D?i.customdata[e]:i.customdata})}var B=!1;return function(t,e,i){for(var a=n.init2dArray(t,0),o=0;o<Math.min(e.length,i.length);o++)if(n.isIndex(e[o],t)&&n.isIndex(i[o],t)){if(e[o]===i[o])return!0;a[e[o]].push(i[o])}var s=r(a);return s.components.some(function(t){return t.length>1})}(z,S.source,S.target)&&(B=!0),{circular:B,links:u,nodes:R,groups:w,groupLookup:T}}e.exports=function(t,e){var r=l(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}}),Wb=f((t,e)=>{var r,n;r=t,n=function(t){function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,u,c,h,f,p=t._root,d={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((u=e>=(a=(m+y)/2))?m=a:y=a,(c=r>=(o=(g+v)/2))?g=o:v=o,i=p,!(p=p[h=c<<1|u]))return i[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(a=(m+y)/2))?m=a:y=a,(c=r>=(o=(g+v)/2))?g=o:v=o}while((h=c<<1|u)==(f=(l>=o)<<1|s>=a));return i[f]=p,i[h]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),u=1/0,c=1/0,h=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=t[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<u&&(u=i),i>h&&(h=i),a<c&&(c=a),a>f&&(f=a));if(u>h||c>f)return this;for(this.cover(u,c).cover(h,f),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this},l.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,a=(n=Math.floor(e))+1;else{for(var o,s,l=i-r,u=this._root;r>t||t>=i||n>e||e>=a;)switch(s=(e<n)<<1|t<r,o=new Array(4),o[s]=u,u=o,l*=2,s){case 0:i=r+l,a=n+l;break;case 1:r=i-l,a=n+l;break;case 2:i=r+l,n=a-l;break;case 3:r=i-l,n=a-l}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var i,a,o,s,l,u,c,h=this._x0,f=this._y0,p=this._x1,d=this._y1,m=[],g=this._root;for(g&&m.push(new r(g,h,f,p,d)),null==n?n=1/0:(h=t-n,f=e-n,p=t+n,d=e+n,n*=n);u=m.pop();)if(!(!(g=u.node)||(a=u.x0)>p||(o=u.y0)>d||(s=u.x1)<h||(l=u.y1)<f))if(g.length){var y=(a+s)/2,v=(o+l)/2;m.push(new r(g[3],y,v,s,l),new r(g[2],a,v,y,l),new r(g[1],y,o,s,v),new r(g[0],a,o,y,v)),(c=(e>=v)<<1|t>=y)&&(u=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=u)}else{var x=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=x*x+_*_;if(b<n){var w=Math.sqrt(n=b);h=t-w,f=e-w,p=t+w,d=e+w,i=g.data}}return i},l.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,i,a,o,s,l,u,c,h,f,p=this._root,d=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((u=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(l=(m+y)/2))?m=l:y=l,e=p,!(p=p[h=c<<1|u]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this},l.root=function(){return this._root},l.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},l.visit=function(t){var e,n,i,a,o,s,l=[],u=this._root;for(u&&l.push(new r(u,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(u=e.node,i=e.x0,a=e.y0,o=e.x1,s=e.y1)&&u.length){var c=(i+o)/2,h=(a+s)/2;(n=u[3])&&l.push(new r(n,c,h,o,s)),(n=u[2])&&l.push(new r(n,i,h,c,s)),(n=u[1])&&l.push(new r(n,c,a,o,h)),(n=u[0])&&l.push(new r(n,i,a,c,h))}return this},l.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var a=e.node;if(a.length){var o,s=e.x0,l=e.y0,u=e.x1,c=e.y1,h=(s+u)/2,f=(l+c)/2;(o=a[0])&&n.push(new r(o,s,l,h,f)),(o=a[1])&&n.push(new r(o,h,l,u,f)),(o=a[2])&&n.push(new r(o,s,f,h,c)),(o=a[3])&&n.push(new r(o,h,f,u,c))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},l.x=function(t){return arguments.length?(this._x=t,this):this._x},l.y=function(t){return arguments.length?(this._y=t,this):this._y},t.quadtree=a,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}),Yb=f((t,e)=>{var r;r=t,function(t){var e="$";function r(){}function n(t,e){var n=new r;if(t instanceof r)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var i,a=-1,o=t.length;if(null==e)for(;++a<o;)n.set(a,t[a]);else for(;++a<o;)n.set(e(i=t[a],a,t),i)}else if(t)for(var s in t)n.set(s,t[s]);return n}function i(){var t,e,r,i=[],u=[];function c(r,a,o,s){if(a>=i.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var l,u,h,f=-1,p=r.length,d=i[a++],m=n(),g=o();++f<p;)(h=m.get(l=d(u=r[f])+""))?h.push(u):m.set(l,[u]);return m.each(function(t,e){s(g,e,c(t,a,o,s))}),g}function h(t,r){if(++r>i.length)return t;var n,a=u[r-1];return null!=e&&r>=i.length?n=t.entries():(n=[],t.each(function(t,e){n.push({key:e,values:h(t,r)})})),null!=a?n.sort(function(t,e){return a(t.key,e.key)}):n}return r={object:function(t){return c(t,0,a,o)},map:function(t){return c(t,0,s,l)},entries:function(t){return h(c(t,0,s,l),0)},key:function(t){return i.push(t),r},sortKeys:function(t){return u[i.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}}function a(){return{}}function o(t,e,r){t[e]=r}function s(){return n()}function l(t,e,r){t.set(e,r)}function u(){}r.prototype=n.prototype={constructor:r,has:function(t){return e+t in this},get:function(t){return this[e+t]},set:function(t,r){return this[e+t]=r,this},remove:function(t){var r=e+t;return r in this&&delete this[r]},clear:function(){for(var t in this)t[0]===e&&delete this[t]},keys:function(){var t=[];for(var r in this)r[0]===e&&t.push(r.slice(1));return t},values:function(){var t=[];for(var r in this)r[0]===e&&t.push(this[r]);return t},entries:function(){var t=[];for(var r in this)r[0]===e&&t.push({key:r.slice(1),value:this[r]});return t},size:function(){var t=0;for(var r in this)r[0]===e&&++t;return t},empty:function(){for(var t in this)if(t[0]===e)return!1;return!0},each:function(t){for(var r in this)r[0]===e&&t(this[r],r.slice(1),this)}};var c=n.prototype;function h(t,e){var r=new u;if(t instanceof u)t.each(function(t){r.add(t)});else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}function f(t){var e=[];for(var r in t)e.push(r);return e}function p(t){var e=[];for(var r in t)e.push(t[r]);return e}function d(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e}u.prototype=h.prototype={constructor:u,has:c.has,add:function(t){return this[e+(t+="")]=t,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each},t.nest=i,t.set=h,t.map=n,t.keys=f,t.values=p,t.entries=d,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&void 0!==e?t:r.d3=r.d3||{})}),Xb=f((t,e)=>{var r,n;r=t,n=function(t){var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new n(i)}function n(t){this._=t}function i(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function a(t,r,n){for(var i=0,a=t.length;i<a;++i)if(t[i].name===r){t[i]=e,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:r,value:n}),t}n.prototype=r.prototype={constructor:n,on:function(t,e){var r,n=this._,o=function(t,e){return t.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",n),s=-1,l=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<l;)if(r=(t=o[s]).type)n[r]=a(n[r],t.name,e);else if(null==e)for(r in n)n[r]=a(n[r],t.name,null);return this}for(;++s<l;)if((r=(t=o[s]).type)&&(r=i(n[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,r=(n=this._[t]).length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=r,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}),$b=f((t,e)=>{var r,n;r=t,n=function(t){var e,r,n=0,i=0,a=0,o=0,s=0,l=0,u="object"==typeof performance&&performance.now?performance:Date,c="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return s||(c(f),s=u.now()+l)}function f(){s=0}function p(){this._call=this._time=this._next=null}function d(t,e,r){var n=new p;return n.restart(t,e,r),n}function m(){h(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=u.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var t,n,i=e,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,v(a)}(),s=0}}function y(){var t=u.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(g,t-u.now()-l)),a&&(a=clearInterval(a))):(a||(o=u.now(),a=setInterval(y,1e3)),n=1,c(g)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),!this._next&&r!==this&&(r?r._next=this:e=this,r=this),this._call=t,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart(function a(o){o+=i,n.restart(a,i+=e,r),t(o)},e,r),n)},t.now=h,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart(function(r){n.stop(),t(r+e)},e,r),n},t.timer=d,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}),Jb=f((t,e)=>{var r,n;r=t,n=function(t,e,r,n,i){function a(t){return function(){return t}}function o(){return 1e-6*(Math.random()-.5)}function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function u(t){return t.index}function c(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function h(t){return t.x}function f(t){return t.y}var p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-t,s=s/a-e,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},t.forceCollide=function(t){var r,n,i=1,u=1;function c(){for(var t,a,c,f,p,d,m,g=r.length,y=0;y<u;++y)for(a=e.quadtree(r,s,l).visitAfter(h),t=0;t<g;++t)c=r[t],d=n[c.index],m=d*d,f=c.x+c.vx,p=c.y+c.vy,a.visit(v);function v(t,e,r,n,a){var s=t.data,l=t.r,u=d+l;if(!s)return e>f+u||n<f-u||r>p+u||a<p-u;if(s.index>c.index){var h=f-s.x-s.vx,g=p-s.y-s.vy,y=h*h+g*g;y<u*u&&(0===h&&(y+=(h=o())*h),0===g&&(y+=(g=o())*g),y=(u-(y=Math.sqrt(y)))/y*i,c.vx+=(h*=y)*(u=(l*=l)/(m+l)),c.vy+=(g*=y)*u,s.vx-=h*(u=1-u),s.vy-=g*u)}}}function h(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function f(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e<a;++e)i=r[e],n[i.index]=+t(i,e,r)}}return"function"!=typeof t&&(t=a(null==t?1:+t)),c.initialize=function(t){r=t,f()},c.iterations=function(t){return arguments.length?(u=+t,c):u},c.strength=function(t){return arguments.length?(i=+t,c):i},c.radius=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),f(),c):t},c},t.forceLink=function(t){var e,n,i,s,l,h=u,f=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},p=a(30),d=1;function m(r){for(var i=0,a=t.length;i<d;++i)for(var s,u,c,h,f,p,m,g=0;g<a;++g)u=(s=t[g]).source,h=(c=s.target).x+c.vx-u.x-u.vx||o(),f=c.y+c.vy-u.y-u.vy||o(),h*=p=((p=Math.sqrt(h*h+f*f))-n[g])/p*r*e[g],f*=p,c.vx-=h*(m=l[g]),c.vy-=f*m,u.vx+=h*(m=1-m),u.vy+=f*m}function g(){if(i){var a,o,u=i.length,f=t.length,p=r.map(i,h);for(a=0,s=new Array(u);a<f;++a)(o=t[a]).index=a,"object"!=typeof o.source&&(o.source=c(p,o.source)),"object"!=typeof o.target&&(o.target=c(p,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(a=0,l=new Array(f);a<f;++a)o=t[a],l[a]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);e=new Array(f),y(),n=new Array(f),v()}}function y(){if(i)for(var r=0,n=t.length;r<n;++r)e[r]=+f(t[r],r,t)}function v(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+p(t[e],e,t)}return null==t&&(t=[]),m.initialize=function(t){i=t,g()},m.links=function(e){return arguments.length?(t=e,g(),m):t},m.id=function(t){return arguments.length?(h=t,m):h},m.iterations=function(t){return arguments.length?(d=+t,m):d},m.strength=function(t){return arguments.length?(f="function"==typeof t?t:a(+t),y(),m):f},m.distance=function(t){return arguments.length?(p="function"==typeof t?t:a(+t),v(),m):p},m},t.forceManyBody=function(){var t,r,n,i,s=a(-30),l=1,u=1/0,c=.81;function p(i){var a,o=t.length,s=e.quadtree(t,h,f).visitAfter(m);for(n=i,a=0;a<o;++a)r=t[a],s.visit(g)}function d(){if(t){var e,r,n=t.length;for(i=new Array(n),e=0;e<n;++e)r=t[e],i[r.index]=+s(r,e,t)}}function m(t){var e,r,n,a,o,s=0,l=0;if(t.length){for(n=a=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(s+=e.value,l+=r,n+=r*e.x,a+=r*e.y);t.x=n/l,t.y=a/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function g(t,e,a,s){if(!t.value)return!0;var h=t.x-r.x,f=t.y-r.y,p=s-e,d=h*h+f*f;if(p*p/c<d)return d<u&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d<l&&(d=Math.sqrt(l*d)),r.vx+=h*t.value*n/d,r.vy+=f*t.value*n/d),!0;if(!(t.length||d>=u)){(t.data!==r||t.next)&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d<l&&(d=Math.sqrt(l*d)));do{t.data!==r&&(p=i[t.data.index]*n/d,r.vx+=h*p,r.vy+=f*p)}while(t=t.next)}}return p.initialize=function(e){t=e,d()},p.strength=function(t){return arguments.length?(s="function"==typeof t?t:a(+t),d(),p):s},p.distanceMin=function(t){return arguments.length?(l=t*t,p):Math.sqrt(l)},p.distanceMax=function(t){return arguments.length?(u=t*t,p):Math.sqrt(u)},p.theta=function(t){return arguments.length?(c=t*t,p):Math.sqrt(c)},p},t.forceRadial=function(t,e,r){var n,i,o,s=a(.1);function l(t){for(var a=0,s=n.length;a<s;++a){var l=n[a],u=l.x-e||1e-6,c=l.y-r||1e-6,h=Math.sqrt(u*u+c*c),f=(o[a]-h)*i[a]*t/h;l.vx+=u*f,l.vy+=c*f}}function u(){if(n){var e,r=n.length;for(i=new Array(r),o=new Array(r),e=0;e<r;++e)o[e]=+t(n[e],e,n),i[e]=isNaN(o[e])?0:+s(n[e],e,n)}}return"function"!=typeof t&&(t=a(+t)),null==e&&(e=0),null==r&&(r=0),l.initialize=function(t){n=t,u()},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:a(+t),u(),l):s},l.radius=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),u(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(r=+t,l):r},l},t.forceSimulation=function(t){var e,a=1,o=.001,s=1-Math.pow(o,1/300),l=0,u=.6,c=r.map(),h=i.timer(d),f=n.dispatch("tick","end");function d(){m(),f.call("tick",e),a<o&&(h.stop(),f.call("end",e))}function m(r){var n,i,o=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(a+=(l-a)*s,c.each(function(t){t(a)}),n=0;n<o;++n)null==(i=t[n]).fx?i.x+=i.vx*=u:(i.x=i.fx,i.vx=0),null==i.fy?i.y+=i.vy*=u:(i.y=i.fy,i.vy=0);return e}function g(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(r),a=r*p;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function y(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),g(),e={tick:m,restart:function(){return h.restart(d),e},stop:function(){return h.stop(),e},nodes:function(r){return arguments.length?(t=r,g(),c.each(y),e):t},alpha:function(t){return arguments.length?(a=+t,e):a},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(s=+t,e):+s},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(u=1-t,e):1-u},force:function(t,r){return arguments.length>1?(null==r?c.remove(t):c.set(t,y(r)),e):c.get(t)},find:function(e,r,n){var i,a,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u<c;++u)(o=(i=e-(s=t[u]).x)*i+(a=r-s.y)*a)<n&&(l=s,n=o);return l},on:function(t,r){return arguments.length>1?(f.on(t,r),e):f.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(n[a]-i.x)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:a(+t),s(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),s(),o):t},o},t.forceY=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(n[a]-i.y)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:a(+t),s(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),s(),o):t},o},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,Wb(),Yb(),Xb(),$b()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,r.d3)}),Kb=f((t,e)=>{var r,n;r=t,n=function(t){var e=Math.PI,r=2*e,n=1e-6,i=r-n;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function o(){return new a}a.prototype=o.prototype={constructor:a,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,r,i,a,o){t=+t,r=+r,i=+i,a=+a,o=+o;var s=this._x1,l=this._y1,u=i-t,c=a-r,h=s-t,f=l-r,p=h*h+f*f;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=r);else if(p>n)if(Math.abs(f*u-c*h)>n&&o){var d=i-s,m=a-l,g=u*u+c*c,y=d*d+m*m,v=Math.sqrt(g),x=Math.sqrt(p),_=o*Math.tan((e-Math.acos((g+p-y)/(2*v*x)))/2),b=_/x,w=_/v;Math.abs(b-1)>n&&(this._+="L"+(t+b*h)+","+(r+b*f)),this._+="A"+o+","+o+",0,0,"+ +(f*d>h*m)+","+(this._x1=t+w*u)+","+(this._y1=r+w*c)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,o,s,l,u){t=+t,a=+a,u=!!u;var c=(o=+o)*Math.cos(s),h=o*Math.sin(s),f=t+c,p=a+h,d=1^u,m=u?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+f+","+p:(Math.abs(this._x1-f)>n||Math.abs(this._y1-p)>n)&&(this._+="L"+f+","+p),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+d+","+(t-c)+","+(a-h)+"A"+o+","+o+",0,1,"+d+","+(this._x1=f)+","+(this._y1=p):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=e)+","+d+","+(this._x1=t+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}),Qb=f((t,e)=>{var r,n;r=t,n=function(t,e){function r(t){return function(){return t}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,u=Math.sqrt,c=1e-12,h=Math.PI,f=h/2,p=2*h;function d(t){return t>=1?f:t<=-1?-f:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function x(t){return t&&t.padAngle}function _(t,e,r,n,i,a,s){var l=t-r,c=e-n,h=(s?a:-a)/u(l*l+c*c),f=h*c,p=-h*l,d=t+f,m=e+p,g=r+f,y=n+p,v=(d+g)/2,x=(m+y)/2,_=g-d,b=y-m,w=_*_+b*b,T=i-a,k=d*y-g*m,A=(b<0?-1:1)*u(o(0,T*T*w-k*k)),M=(k*b-_*A)/w,S=(-k*_-b*A)/w,E=(k*b+_*A)/w,C=(-k*_+b*A)/w,I=M-v,L=S-x,P=E-v,z=C-x;return I*I+L*L>P*P+z*z&&(M=E,S=C),{cx:M,cy:S,x01:-f,y01:-p,x11:M*(i/T-1),y11:S*(i/T-1)}}function b(t){this._context=t}function w(t){return new b(t)}function T(t){return t[0]}function k(t){return t[1]}function A(){var t=T,n=k,i=r(!0),a=null,o=w,s=null;function l(r){var l,u,c,h=r.length,f=!1;for(null==a&&(s=o(c=e.path())),l=0;l<=h;++l)!(l<h&&i(u=r[l],l,r))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+t(u,l,r),+n(u,l,r));if(c)return s=null,c+""||null}return l.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),l):n},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:r(!!t),l):i},l.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),l):o},l.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),l):a},l}function M(){var t=T,n=null,i=r(0),a=k,o=r(!0),s=null,l=w,u=null;function c(r){var c,h,f,p,d,m=r.length,g=!1,y=new Array(m),v=new Array(m);for(null==s&&(u=l(d=e.path())),c=0;c<=m;++c){if(!(c<m&&o(p=r[c],c,r))===g)if(g=!g)h=c,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),f=c-1;f>=h;--f)u.point(y[f],v[f]);u.lineEnd(),u.areaEnd()}g&&(y[c]=+t(p,c,r),v[c]=+i(p,c,r),u.point(n?+n(p,c,r):y[c],a?+a(p,c,r):v[c]))}if(d)return u=null,d+""||null}function h(){return A().defined(o).curve(l).context(s)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),c):n},c.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,c):i},c.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),c):i},c.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),c):a},c.lineX0=c.lineY0=function(){return h().x(t).y(i)},c.lineY1=function(){return h().x(t).y(a)},c.lineX1=function(){return h().x(n).y(i)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),c):o},c.curve=function(t){return arguments.length?(l=t,null!=s&&(u=l(s)),c):l},c.context=function(t){return arguments.length?(null==t?s=u=null:u=l(s=t),c):s},c}function S(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function E(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var C=L(w);function I(t){this._curve=t}function L(t){function e(e){return new I(t(e))}return e._curve=t,e}function P(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(L(t)):e()._curve},t}function z(){return P(A().curve(C))}function O(){var t=M().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return P(r())},delete t.lineX0,t.lineEndAngle=function(){return P(n())},delete t.lineX1,t.lineInnerRadius=function(){return P(i())},delete t.lineY0,t.lineOuterRadius=function(){return P(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(L(t)):e()._curve},t}function D(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}I.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var R=Array.prototype.slice;function F(t){return t.source}function B(t){return t.target}function N(t){var n=F,i=B,a=T,o=k,s=null;function l(){var r,l=R.call(arguments),u=n.apply(this,l),c=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=u,l)),+o.apply(this,l),+a.apply(this,(l[0]=c,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function j(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function V(t,e,r,n,i){var a=D(e,r),o=D(e,r=(r+i)/2),s=D(n,r),l=D(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(t,e){var r=Math.sqrt(e/h);t.moveTo(r,0),t.arc(0,0,r,0,p)}},H={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},G=Math.sqrt(1/3),Z=2*G,W={draw:function(t,e){var r=Math.sqrt(e/Z),n=r*G;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Y=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(p/10)*Y,$=-Math.cos(p/10)*Y,J={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=X*r,i=$*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=p*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},K={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),it=3*(nt/2+1),at={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,i=r*nt,a=n,o=r*nt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(et*n-rt*i,rt*n+et*i),t.lineTo(et*a-rt*o,rt*a+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*i,et*i-rt*n),t.lineTo(et*a+rt*o,et*o-rt*a),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[q,H,W,K,J,tt,at];function st(){}function lt(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ct(t){this._context=t}function ht(t){this._context=t}function ft(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ct.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var pt=function t(e){function r(t){return 1===e?new ut(t):new ft(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function dt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:dt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>c){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>c){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tt=function t(e){function r(t){return e?new wt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function kt(t,e){this._context=t,this._alpha=e}kt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new kt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var St=function t(e){function r(t){return e?new Mt(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Et(t){this._context=t}function Ct(t){return t<0?-1:1}function It(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Lt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Pt(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function zt(t){this._context=t}function Ot(t){this._context=new Dt(t)}function Dt(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/a[e-1],a[e]-=r,o[e]-=r*o[e-1];for(i[n-1]=o[n-1]/a[n-1],e=n-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function Bt(t,e){this._context=t,this._t=e}function Nt(t,e){if((i=t.length)>1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a<i;++a)for(n=o,o=t[e[a]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function jt(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Ut(t,e){return t[e]}function Vt(t){var e=t.map(qt);return jt(t).sort(function(t,r){return e[t]-e[r]})}function qt(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++r<i;)(e=+t[r][1])>a&&(a=e,n=r);return n}function Ht(t){var e=t.map(Gt);return jt(t).sort(function(t,r){return e[t]-e[r]})}function Gt(t){for(var e,r=0,n=-1,i=t.length;++n<i;)(e=+t[n][1])&&(r+=e);return r}Et.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Pt(this,this._t0,Lt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Pt(this,Lt(this,r=It(this,t,e)),r);break;default:Pt(this,this._t0,r=It(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(Ot.prototype=Object.create(zt.prototype)).point=function(t,e){zt.prototype.point.call(this,e,t)},Dt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}},Rt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var n=Ft(t),i=Ft(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[o],e[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,b=r(0),w=null,T=y,k=v,A=x,M=null;function S(){var r,m,g=+t.apply(this,arguments),y=+o.apply(this,arguments),v=T.apply(this,arguments)-f,x=k.apply(this,arguments)-f,S=n(x-v),E=x>v;if(M||(M=r=e.path()),y<g&&(m=y,y=g,g=m),y>c)if(S>p-c)M.moveTo(y*a(v),y*l(v)),M.arc(0,0,y,v,x,!E),g>c&&(M.moveTo(g*a(x),g*l(x)),M.arc(0,0,g,x,v,E));else{var C,I,L=v,P=x,z=v,O=x,D=S,R=S,F=A.apply(this,arguments)/2,B=F>c&&(w?+w.apply(this,arguments):u(g*g+y*y)),N=s(n(y-g)/2,+b.apply(this,arguments)),j=N,U=N;if(B>c){var V=d(B/g*l(F)),q=d(B/y*l(F));(D-=2*V)>c?(z+=V*=E?1:-1,O-=V):(D=0,z=O=(v+x)/2),(R-=2*q)>c?(L+=q*=E?1:-1,P-=q):(R=0,L=P=(v+x)/2)}var H=y*a(L),G=y*l(L),Z=g*a(O),W=g*l(O);if(N>c){var Y,X=y*a(P),$=y*l(P),J=g*a(z),K=g*l(z);if(S<h&&(Y=function(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,h=o-i,f=s-a,p=f*l-h*u;if(!(p*p<c))return[t+(p=(h*(e-a)-f*(t-i))/p)*l,e+p*u]}(H,G,J,K,X,$,Z,W))){var Q=H-Y[0],tt=G-Y[1],et=X-Y[0],rt=$-Y[1],nt=1/l(function(t){return t>1?0:t<-1?h:Math.acos(t)}((Q*et+tt*rt)/(u(Q*Q+tt*tt)*u(et*et+rt*rt)))/2),it=u(Y[0]*Y[0]+Y[1]*Y[1]);j=s(N,(g-it)/(nt-1)),U=s(N,(y-it)/(nt+1))}}R>c?U>c?(C=_(J,K,H,G,y,U,E),I=_(X,$,Z,W,y,U,E),M.moveTo(C.cx+C.x01,C.cy+C.y01),U<N?M.arc(C.cx,C.cy,U,i(C.y01,C.x01),i(I.y01,I.x01),!E):(M.arc(C.cx,C.cy,U,i(C.y01,C.x01),i(C.y11,C.x11),!E),M.arc(0,0,y,i(C.cy+C.y11,C.cx+C.x11),i(I.cy+I.y11,I.cx+I.x11),!E),M.arc(I.cx,I.cy,U,i(I.y11,I.x11),i(I.y01,I.x01),!E))):(M.moveTo(H,G),M.arc(0,0,y,L,P,!E)):M.moveTo(H,G),g>c&&D>c?j>c?(C=_(Z,W,X,$,g,-j,E),I=_(H,G,J,K,g,-j,E),M.lineTo(C.cx+C.x01,C.cy+C.y01),j<N?M.arc(C.cx,C.cy,j,i(C.y01,C.x01),i(I.y01,I.x01),!E):(M.arc(C.cx,C.cy,j,i(C.y01,C.x01),i(C.y11,C.x11),!E),M.arc(0,0,g,i(C.cy+C.y11,C.cx+C.x11),i(I.cy+I.y11,I.cx+I.x11),E),M.arc(I.cx,I.cy,j,i(I.y11,I.x11),i(I.y01,I.x01),!E))):M.arc(0,0,g,O,z,E):M.lineTo(Z,W)}else M.moveTo(0,0);if(M.closePath(),r)return M=null,r+""||null}return S.centroid=function(){var e=(+t.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+T.apply(this,arguments)+ +k.apply(this,arguments))/2-h/2;return[a(r)*e,l(r)*e]},S.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),S):t},S.outerRadius=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),S):o},S.cornerRadius=function(t){return arguments.length?(b="function"==typeof t?t:r(+t),S):b},S.padRadius=function(t){return arguments.length?(w=null==t?null:"function"==typeof t?t:r(+t),S):w},S.startAngle=function(t){return arguments.length?(T="function"==typeof t?t:r(+t),S):T},S.endAngle=function(t){return arguments.length?(k="function"==typeof t?t:r(+t),S):k},S.padAngle=function(t){return arguments.length?(A="function"==typeof t?t:r(+t),S):A},S.context=function(t){return arguments.length?(M=null==t?null:t,S):M},S},t.area=M,t.areaRadial=O,t.curveBasis=function(t){return new ut(t)},t.curveBasisClosed=function(t){return new ct(t)},t.curveBasisOpen=function(t){return new ht(t)},t.curveBundle=pt,t.curveCardinal=gt,t.curveCardinalClosed=vt,t.curveCardinalOpen=_t,t.curveCatmullRom=Tt,t.curveCatmullRomClosed=At,t.curveCatmullRomOpen=St,t.curveLinear=w,t.curveLinearClosed=function(t){return new Et(t)},t.curveMonotoneX=function(t){return new zt(t)},t.curveMonotoneY=function(t){return new Ot(t)},t.curveNatural=function(t){return new Rt(t)},t.curveStep=function(t){return new Bt(t,.5)},t.curveStepAfter=function(t){return new Bt(t,1)},t.curveStepBefore=function(t){return new Bt(t,0)},t.line=A,t.lineRadial=z,t.linkHorizontal=function(){return N(j)},t.linkRadial=function(){var t=N(V);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return N(U)},t.pie=function(){var t=E,e=S,n=null,i=r(0),a=r(p),o=r(0);function s(r){var s,l,u,c,h,f=r.length,d=0,m=new Array(f),g=new Array(f),y=+i.apply(this,arguments),v=Math.min(p,Math.max(-p,a.apply(this,arguments)-y)),x=Math.min(Math.abs(v)/f,o.apply(this,arguments)),_=x*(v<0?-1:1);for(s=0;s<f;++s)(h=g[m[s]=s]=+t(r[s],s,r))>0&&(d+=h);for(null!=e?m.sort(function(t,r){return e(g[t],g[r])}):null!=n&&m.sort(function(t,e){return n(r[t],r[e])}),s=0,u=d?(v-f*_)/d:0;s<f;++s,y=c)l=m[s],c=y+((h=g[l])>0?h*u:0)+_,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:c,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=D,t.radialArea=O,t.radialLine=z,t.stack=function(){var t=r([]),e=jt,n=Nt,i=Ut;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,u=s.length,c=new Array(u);for(a=0;a<u;++a){for(var h,f=s[a],p=c[a]=new Array(l),d=0;d<l;++d)p[d]=h=[0,+i(r[d],f,d,r)],h.data=r[d];p.key=f}for(a=0,o=e(c);a<u;++a)c[o[a]].index=a;return n(c,o),c}return a.keys=function(e){return arguments.length?(t="function"==typeof e?e:r(R.call(e)),a):t},a.value=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a):i},a.order=function(t){return arguments.length?(e=null==t?jt:"function"==typeof t?t:r(R.call(t)),a):e},a.offset=function(t){return arguments.length?(n=null==t?Nt:t,a):n},a},t.stackOffsetDiverging=function(t,e){if((s=t.length)>0)for(var r,n,i,a,o,s,l=0,u=t[e[0]].length;l<u;++l)for(a=o=0,r=0;r<s;++r)(i=(n=t[e[r]][l])[1]-n[0])>0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a<o;++a){for(i=r=0;r<n;++r)i+=t[r][a][1]||0;if(i)for(r=0;r<n;++r)t[r][a][1]/=i}Nt(t,e)}},t.stackOffsetNone=Nt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){for(var r,n=0,i=t[e[0]],a=i.length;n<a;++n){for(var o=0,s=0;o<r;++o)s+=t[o][n][1]||0;i[n][1]+=i[n][0]=-s/2}Nt(t,e)}},t.stackOffsetWiggle=function(t,e){if((i=t.length)>0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o<n;++o){for(var s=0,l=0,u=0;s<i;++s){for(var c=t[e[s]],h=c[o][1]||0,f=(h-(c[o-1][1]||0))/2,p=0;p<s;++p){var d=t[e[p]];f+=(d[o][1]||0)-(d[o-1][1]||0)}l+=h,u+=f*h}r[o-1][1]+=r[o-1][0]=a,l&&(a-=u/l)}r[o-1][1]+=r[o-1][0]=a,Nt(t,e)}},t.stackOrderAppearance=Vt,t.stackOrderAscending=Ht,t.stackOrderDescending=function(t){return Ht(t).reverse()},t.stackOrderInsideOut=function(t){var e,r,n=t.length,i=t.map(Gt),a=Vt(t),o=0,s=0,l=[],u=[];for(e=0;e<n;++e)r=a[e],o<s?(o+=i[r],l.push(r)):(s+=i[r],u.push(r));return u.reverse().concat(l)},t.stackOrderNone=jt,t.stackOrderReverse=function(t){return jt(t).reverse()},t.symbol=function(){var t=r(q),n=r(64),i=null;function a(){var r;if(i||(i=r=e.path()),t.apply(this,arguments).draw(i,+n.apply(this,arguments)),r)return i=null,r+""||null}return a.type=function(e){return arguments.length?(t="function"==typeof e?e:r(e),a):t},a.size=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),a):n},a.context=function(t){return arguments.length?(i=null==t?null:t,a):i},a},t.symbolCircle=q,t.symbolCross=H,t.symbolDiamond=W,t.symbolSquare=K,t.symbolStar=J,t.symbolTriangle=tt,t.symbolWye=at,t.symbols=ot,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,Kb()):n((r=r||self).d3=r.d3||{},r.d3)}),tw=f((t,e)=>{var r,n;r=t,n=function(t,e,r,n){function i(t){return t.target.depth}function a(t,e){return t.sourceLinks.length?t.depth:e-1}function o(t){return function(){return t}}function s(t,e){return u(t.source,e.source)||t.index-e.index}function l(t,e){return u(t.target,e.target)||t.index-e.index}function u(t,e){return t.y0-e.y0}function c(t){return t.value}function h(t){return(t.y0+t.y1)/2}function f(t){return h(t.source)*t.value}function p(t){return h(t.target)*t.value}function d(t){return t.index}function m(t){return t.nodes}function g(t){return t.links}function y(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function v(t){return[t.source.x1,t.y0]}function x(t){return[t.target.x0,t.y1]}t.sankey=function(){var t=0,n=0,i=1,v=1,x=24,_=8,b=d,w=a,T=m,k=g,A=32,M=2/3;function S(){var a={nodes:T.apply(null,arguments),links:k.apply(null,arguments)};return function(t){t.nodes.forEach(function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]});var e=r.map(t.nodes,b);t.links.forEach(function(t,r){t.index=r;var n=t.source,i=t.target;"object"!=typeof n&&(n=t.source=y(e,n)),"object"!=typeof i&&(i=t.target=y(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)})}(a),function(t){t.nodes.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,c),e.sum(t.targetLinks,c))})}(a),function(e){var r,n,a;for(r=e.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach(function(t){t.depth=a,t.sourceLinks.forEach(function(t){n.indexOf(t.target)<0&&n.push(t.target)})});for(r=e.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach(function(t){t.height=a,t.targetLinks.forEach(function(t){n.indexOf(t.source)<0&&n.push(t.source)})});var o=(i-t-x)/(a-1);e.nodes.forEach(function(e){e.x1=(e.x0=t+Math.max(0,Math.min(a-1,Math.floor(w.call(null,e,a))))*o)+x})}(a),function(t){var i=r.nest().key(function(t){return t.x0}).sortKeys(e.ascending).entries(t.nodes).map(function(t){return t.values});s(),m();for(var a=1,o=A;o>0;--o)d(a*=.99),m(),l(a),m();function s(){var r=e.max(i,function(t){return t.length}),a=M*(v-n)/(r-1);_>a&&(_=a);var o=e.min(i,function(t){return(v-n-(t.length-1)*_)/e.sum(t,c)});i.forEach(function(t){t.forEach(function(t,e){t.y1=(t.y0=e)+t.value*o})}),t.links.forEach(function(t){t.width=t.value*o})}function l(t){i.forEach(function(r){r.forEach(function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,f)/e.sum(r.targetLinks,c)-h(r))*t;r.y0+=n,r.y1+=n}})})}function d(t){i.slice().reverse().forEach(function(r){r.forEach(function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,c)-h(r))*t;r.y0+=n,r.y1+=n}})})}function m(){i.forEach(function(t){var e,r,i,a=n,o=t.length;for(t.sort(u),i=0;i<o;++i)(r=a-(e=t[i]).y0)>0&&(e.y0+=r,e.y1+=r),a=e.y1+_;if((r=a-_-v)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+_-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0})}}(a),E(a),a}function E(t){t.nodes.forEach(function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)}),t.nodes.forEach(function(t){var e=t.y0,r=e;t.sourceLinks.forEach(function(t){t.y0=e+t.width/2,e+=t.width}),t.targetLinks.forEach(function(t){t.y1=r+t.width/2,r+=t.width})})}return S.update=function(t){return E(t),t},S.nodeId=function(t){return arguments.length?(b="function"==typeof t?t:o(t),S):b},S.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),S):w},S.nodeWidth=function(t){return arguments.length?(x=+t,S):x},S.nodePadding=function(t){return arguments.length?(_=+t,S):_},S.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),S):T},S.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),S):k},S.size=function(e){return arguments.length?(t=n=0,i=+e[0],v=+e[1],S):[i-t,v-n]},S.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],v=+e[1][1],S):[[t,n],[i,v]]},S.iterations=function(t){return arguments.length?(A=+t,S):A},S},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,Mg(),Yb(),Qb()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}),ew=f((t,e)=>{var r=Gb();e.exports=function(t,e){var n,i=[],a=[],o=[],s={},l=[];function u(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach(function(e){delete s[t][e],o[e]&&u(e)})}function c(t){var e,r,i=!1;for(a.push(t),o[t]=!0,e=0;e<l[t].length;e++)(r=l[t][e])===n?(h(n,a),i=!0):o[r]||(i=c(r));if(i)u(t);else for(e=0;e<l[t].length;e++){r=l[t][e];var f=s[r];f||(f={},s[r]=f),f[r]=!0}return a.pop(),i}function h(t,r){var n=[].concat(r).concat(t);e?e(c):i.push(n)}function f(e){!function(e){for(var r=0;r<t.length;r++)r<e&&(t[r]=[]),t[r]=t[r].filter(function(t){return t>=e})}(e);for(var n,i=r(t).components.filter(function(t){return t.length>1}),a=1/0,o=0;o<i.length;o++)for(var s=0;s<i[o].length;s++)i[o][s]<a&&(a=i[o][s],n=o);var l=i[n];return!!l&&{leastVertex:a,adjList:t.map(function(t,e){return-1===l.indexOf(e)?[]:t.filter(function(t){return-1!==l.indexOf(t)})})}}n=0;for(var p=t.length;n<p;){var d=f(n);if(n=d.leastVertex,l=d.adjList){for(var m=0;m<l.length;m++)for(var g=0;g<l[m].length;g++){var y=l[m][g];o[+y]=!1,s[y]={}}c(n),n+=1}else n=p}if(!e)return i}}),rw=f((t,e)=>{var r,n;r=t,n=function(t,e,r,n,i){function a(t){return t.target.depth}function o(t,e){return t.sourceLinks.length?t.depth:e-1}function s(t){return function(){return t}}i=i&&i.hasOwnProperty("default")?i.default:i;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function u(t,e){return h(t.source,e.source)||t.index-e.index}function c(t,e){return h(t.target,e.target)||t.index-e.index}function h(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:"top"===t.circularLinkType||"bottom"===e.circularLinkType?-1:1}function f(t){return t.value}function p(t){return(t.y0+t.y1)/2}function d(t){return p(t.source)}function m(t){return p(t.target)}function g(t){return t.index}function y(t){return t.nodes}function v(t){return t.links}function x(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function _(t,e){return e(t)}var b=25,w=10;function T(t,e){var r=0,n=0;t.links.forEach(function(i){i.circular&&(i.source.circularLinkType||i.target.circularLinkType?i.circularLinkType=i.source.circularLinkType?i.source.circularLinkType:i.target.circularLinkType:i.circularLinkType=r<n?"top":"bottom","top"==i.circularLinkType?r+=1:n+=1,t.nodes.forEach(function(t){(_(t,e)==_(i.source,e)||_(t,e)==_(i.target,e))&&(t.circularLinkType=i.circularLinkType)}))}),t.links.forEach(function(t){t.circular&&(t.source.circularLinkType==t.target.circularLinkType&&(t.circularLinkType=t.source.circularLinkType),Z(t,e)&&(t.circularLinkType=t.source.circularLinkType))})}function k(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function A(t,e){return!(t.source.column<e.target.column||t.target.column>e.source.column)}function M(t,e){var r=0;t.sourceLinks.forEach(function(t){r=t.circular&&!Z(t,e)?r+1:r});var n=0;return t.targetLinks.forEach(function(t){n=t.circular&&!Z(t,e)?n+1:n}),r+n}function S(t){var e=t.source.sourceLinks,r=0;e.forEach(function(t){r=t.circular?r+1:r});var n=t.target.targetLinks,i=0;return n.forEach(function(t){i=t.circular?i+1:i}),!(r>1||i>1)}function E(t,e,r){return t.sort(I),t.forEach(function(n,i){var a=0;if(Z(n,r)&&S(n))n.circularPathData.verticalBuffer=a+n.width/2;else{for(var o=0;o<i;o++)if(A(t[i],t[o])){var s=t[o].circularPathData.verticalBuffer+t[o].width/2+e;a=s>a?s:a}n.circularPathData.verticalBuffer=a+n.width/2}}),t}function C(t,r,i,a){var o=e.min(t.links,function(t){return t.source.y0});t.links.forEach(function(t){t.circular&&(t.circularPathData={})}),E(t.links.filter(function(t){return"top"==t.circularLinkType}),r,a),E(t.links.filter(function(t){return"bottom"==t.circularLinkType}),r,a),t.links.forEach(function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,Z(e,a)&&S(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,u=t.links.filter(function(t){return t.source.column==s&&t.circularLinkType==l});"bottom"==e.circularLinkType?u.sort(P):u.sort(L);var c=0;u.forEach(function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+c,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+c),c+=t.width}),s=e.target.column,u=t.links.filter(function(t){return t.target.column==s&&t.circularLinkType==l}),"bottom"==e.circularLinkType?u.sort(O):u.sort(z),c=0,u.forEach(function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+c,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+c),c+=t.width}),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(e);else{var h=n.linkHorizontal().source(function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]}).target(function(t){return[t.target.x0,t.y1]});e.path=h(e)}})}function I(t,e){return D(t)==D(e)?"bottom"==t.circularLinkType?P(t,e):L(t,e):D(e)-D(t)}function L(t,e){return t.y0-e.y0}function P(t,e){return e.y0-t.y0}function z(t,e){return t.y1-e.y1}function O(t,e){return e.y1-t.y1}function D(t){return t.target.column-t.source.column}function R(t){return t.target.x0-t.source.x1}function F(t,e){var r=k(t),n=R(e)/Math.tan(r);return"up"==G(t)?t.y1+n:t.y1-n}function B(t,e){var r=k(t),n=R(e)/Math.tan(r);return"up"==G(t)?t.y1-n:t.y1+n}function N(t,e,r,n){t.links.forEach(function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach(function(o){if(o.column==a){var u,c=s/(l+1),h=Math.pow(1-c,3),f=3*c*Math.pow(1-c,2),p=3*Math.pow(c,2)*(1-c),d=Math.pow(c,3),m=h*i.y0+f*i.y0+p*i.y1+d*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&g<o.y1?(u=o.y1-g+10,u="bottom"==o.circularLinkType?u:-u,o=U(o,u,e,r),t.nodes.forEach(function(t){_(t,n)==_(o,n)||t.column!=o.column||j(o,t)&&U(t,u,e,r)})):(y>o.y0&&y<o.y1||g<o.y0&&y>o.y1)&&(u=y-o.y0+10,o=U(o,u,e,r),t.nodes.forEach(function(t){_(t,n)==_(o,n)||t.column!=o.column||t.y0<o.y1&&t.y1>o.y1&&U(t,u,e,r)}))}})}})}function j(t,e){return t.y0>e.y0&&t.y0<e.y1||t.y1>e.y0&&t.y1<e.y1||t.y0<e.y0&&t.y1>e.y1}function U(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach(function(t){t.y1=t.y1+e}),t.sourceLinks.forEach(function(t){t.y0=t.y0+e})),t}function V(t,e,r,n){t.nodes.forEach(function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter(function(t){return _(t.source,r)==_(i,r)}),o=a.length;o>1&&a.sort(function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!H(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=B(e,t);return t.y1-r}if(e.target.column>t.target.column)return B(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0});var s=i.y0;a.forEach(function(t){t.y0=s+t.width/2,s+=t.width}),a.forEach(function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r<o;r++)n+=a[r].width;t.y0=i.y1-n-t.width/2}})})}function q(t,e,r){t.nodes.forEach(function(e){var n=t.links.filter(function(t){return _(t.target,r)==_(e,r)}),i=n.length;i>1&&n.sort(function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!H(t,e))return t.y0-e.y0;if(e.source.column<t.source.column){var r=F(e,t);return t.y0-r}if(t.source.column<e.source.column)return F(t,e)-e.y0}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:t.source.column-e.source.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:e.source.column-t.source.column:"top"==t.circularLinkType?-1:1:void 0});var a=e.y0;n.forEach(function(t){t.y1=a+t.width/2,a+=t.width}),n.forEach(function(t,r){if("bottom"==t.circularLinkType){for(var a=r+1,o=0;a<i;a++)o+=n[a].width;t.y1=e.y1-o-t.width/2}})})}function H(t,e){return G(t)==G(e)}function G(t){return t.y0-t.y1>0?"up":"down"}function Z(t,e){return _(t.source,e)==_(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,_=0,k=1,A=1,S=24,E=g,I=o,L=y,P=v,z=32,O=2,D=null;function R(){var o={nodes:L.apply(null,arguments),links:P.apply(null,arguments)};(function(t){t.nodes.forEach(function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]});var e=r.map(t.nodes,E);t.links.forEach(function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==(void 0===n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(void 0===i?"undefined":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)})})(o),function(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o<t.links.length;o++){var s=t.links[o],l=s.source.index,u=s.target.index;a[l]||(a[l]=[]),a[u]||(a[u]=[]),-1===a[l].indexOf(u)&&a[l].push(u)}var c=i(a);c.sort(function(t,e){return t.length-e.length});var h={};for(o=0;o<c.length;o++){var f=c[o].slice(-2);h[f[0]]||(h[f[0]]={}),h[f[0]][f[1]]=!0}t.links.forEach(function(t){var e=t.target.index,r=t.source.index;e===r||h[r]&&h[r][e]?(t.circular=!0,t.circularLinkID=n,n+=1):t.circular=!1})}else t.links.forEach(function(t){t.source[r]<t.target[r]?t.circular=!1:(t.circular=!0,t.circularLinkID=n,n+=1)})}(o,0,D),function(t){t.nodes.forEach(function(t){t.partOfCycle=!1,t.value=Math.max(e.sum(t.sourceLinks,f),e.sum(t.targetLinks,f)),t.sourceLinks.forEach(function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)}),t.targetLinks.forEach(function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)})})}(o),function(t){var e,r,n;for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach(function(t){t.depth=n,t.sourceLinks.forEach(function(t){r.indexOf(t.target)<0&&!t.circular&&r.push(t.target)})});for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach(function(t){t.height=n,t.targetLinks.forEach(function(t){r.indexOf(t.source)<0&&!t.circular&&r.push(t.source)})});t.nodes.forEach(function(t){t.column=Math.floor(I.call(null,t,n))})}(o),T(o,E),function(i,o,s){var l=r.nest().key(function(t){return t.column}).sortKeys(e.ascending).entries(i.nodes).map(function(t){return t.values});g(s),v();for(var u=1,c=o;c>0;--c)y(u*=.99,s),v();function g(r){if(n){var o=1/0;l.forEach(function(t){var e=A*n/(t.length+1);o=e<o?e:o}),t=o}var s=e.min(l,function(r){return(A-_-(r.length-1)*t)/e.sum(r,f)});s*=.3,i.links.forEach(function(t){t.width=t.value*s});var u=function(t){var r=0,n=0,i=0,a=0,o=e.max(t.nodes,function(t){return t.column});return t.links.forEach(function(t){t.circular&&("top"==t.circularLinkType?r+=t.width:n+=t.width,0==t.target.column&&(a+=t.width),t.source.column==o&&(i+=t.width))}),{top:r=r>0?r+b+w:r,bottom:n=n>0?n+b+w:n,left:a=a>0?a+b+w:a,right:i=i>0?i+b+w:i}}(i),c=function(t,r){var n=e.max(t.nodes,function(t){return t.column}),i=k-a,o=A-_,s=i+r.right+r.left,l=o+r.top+r.bottom,u=i/s,c=o/l;return a=a*u+r.left,k=0==r.right?k:k*u,_=_*c+r.top,A*=c,t.nodes.forEach(function(t){t.x0=a+t.column*((k-a-S)/n),t.x1=t.x0+S}),c}(i,u);s*=c,i.links.forEach(function(t){t.width=t.value*s}),l.forEach(function(t){var e=t.length;t.forEach(function(t,n){t.depth==l.length-1&&1==e||0==t.depth&&1==e?(t.y0=A/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==M(t,r)?(t.y0=A/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=_+n,t.y1=t.y0+t.value*s):(t.y0=A-t.value*s-n,t.y1=t.y0+t.value*s):0==u.top||0==u.bottom?(t.y0=(A-_)/e*n,t.y1=t.y0+t.value*s):(t.y0=(A-_)/2-e/2+n,t.y1=t.y0+t.value*s)})})}function y(t,r){var n=l.length;l.forEach(function(i){var a=i.length,o=i[0].depth;i.forEach(function(i){var s;if((i.sourceLinks.length||i.targetLinks.length)&&!(i.partOfCycle&&M(i,r)>0))if(0==o&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else{var l=e.mean(i.sourceLinks,m),u=e.mean(i.targetLinks,d),c=((l&&u?(l+u)/2:l||u)-p(i))*t;i.y0+=c,i.y1+=c}})})}function v(){l.forEach(function(e){var r,n,i,a=_,o=e.length;for(e.sort(h),i=0;i<o;++i)(n=a-(r=e[i]).y0)>0&&(r.y0+=n,r.y1+=n),a=r.y1+t;if((n=a-t-A)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=e[i]).y1+t-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0})}}(o,z,E),F(o);for(var s=0;s<4;s++)V(o,A,E),q(o,0,E),N(o,_,A,E),V(o,A,E),q(o,0,E);return function(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach(function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)}),0==o||0==s){var l=e.min(i,function(t){return t.y0}),u=e.max(i,function(t){return t.y1}),c=(n-r)/(u-l);i.forEach(function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e}),a.forEach(function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c})}}(o,_,A),C(o,O,A,E),o}function F(t){t.nodes.forEach(function(t){t.sourceLinks.sort(c),t.targetLinks.sort(u)}),t.nodes.forEach(function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach(function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)}),t.targetLinks.forEach(function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)})})}return R.nodeId=function(t){return arguments.length?(E="function"==typeof t?t:s(t),R):E},R.nodeAlign=function(t){return arguments.length?(I="function"==typeof t?t:s(t),R):I},R.nodeWidth=function(t){return arguments.length?(S=+t,R):S},R.nodePadding=function(e){return arguments.length?(t=+e,R):t},R.nodes=function(t){return arguments.length?(L="function"==typeof t?t:s(t),R):L},R.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),R):P},R.size=function(t){return arguments.length?(a=_=0,k=+t[0],A=+t[1],R):[k-a,A-_]},R.extent=function(t){return arguments.length?(a=+t[0][0],k=+t[1][0],_=+t[0][1],A=+t[1][1],R):[[a,_],[k,A]]},R.iterations=function(t){return arguments.length?(z=+t,R):z},R.circularLinkGap=function(t){return arguments.length?(O=+t,R):O},R.nodePaddingRatio=function(t){return arguments.length?(n=+t,R):n},R.sortNodes=function(t){return arguments.length?(D=t,R):D},R.update=function(t){return T(t,E),F(t),t.links.forEach(function(t){t.circular&&(t.circularLinkType=t.y0+t.y1<A?"top":"bottom",t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)}),V(t,A,E,!1),q(t,0,E),C(t,O,A,E),t},R},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,a)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=o,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,Mg(),Yb(),Qb(),ew()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,null)}),nw=f((t,e)=>{e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}),iw=f((t,e)=>{var r=Jb(),n=(td(),m(Qp)).interpolateNumber,i=v(),a=tw(),o=rw(),s=nw(),l=O(),u=q(),c=Je(),h=oe(),f=h.strTranslate,p=h.strRotate,d=Xx(),g=d.keyFun,y=d.repeat,x=d.unwrap,_=Ae(),b=Ut(),w=ke(),T=w.CAP_SHIFT,k=w.LINE_SPACING;function A(t,e,r){var n,i=x(e),u=i.trace,c=u.domain,f="h"===u.orientation,p=u.node.pad,d=u.node.thickness,m={justify:a.sankeyJustify,left:a.sankeyLeft,right:a.sankeyRight,center:a.sankeyCenter}[u.node.align],g=t.width*(c.x[1]-c.x[0]),y=t.height*(c.y[1]-c.y[0]),v=i._nodes,_=i._links,b=i.circular;(n=b?o.sankeyCircular().circularLinkGap(0):a.sankey()).iterations(s.sankeyIterations).size(f?[g,y]:[y,g]).nodeWidth(d).nodePadding(p).nodeId(function(t){return t.pointNumber}).nodeAlign(m).nodes(v).links(_);var w,T,k,A=n();for(var M in n.nodePadding()<p&&h.warn("node.pad was reduced to ",n.nodePadding()," to fit within the figure."),i._groupLookup){var S,E=parseInt(i._groupLookup[M]);for(w=0;w<A.nodes.length;w++)if(A.nodes[w].pointNumber===E){S=A.nodes[w];break}if(S){var C={pointNumber:parseInt(M),x0:S.x0,x1:S.x1,y0:S.y0,y1:S.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};A.nodes.unshift(C),S.childrenNodes.unshift(C)}}if(function(){for(w=0;w<A.nodes.length;w++){var t,e,r=A.nodes[w],n={};for(T=0;T<r.targetLinks.length;T++)t=(e=r.targetLinks[T]).source.pointNumber+":"+e.target.pointNumber,n.hasOwnProperty(t)||(n[t]=[]),n[t].push(e);var i=Object.keys(n);for(T=0;T<i.length;T++){var a=n[t=i[T]],o=0,s={};for(k=0;k<a.length;k++)s[(e=a[k]).label]||(s[e.label]=0),s[e.label]+=e.value,o+=e.value;for(k=0;k<a.length;k++)(e=a[k]).flow={value:o,labelConcentration:s[e.label]/o,concentration:e.value/o,links:a},e.concentrationscale&&(e.color=l(e.concentrationscale(e.flow.labelConcentration)))}var u=0;for(T=0;T<r.sourceLinks.length;T++)u+=r.sourceLinks[T].value;for(T=0;T<r.sourceLinks.length;T++)(e=r.sourceLinks[T]).concentrationOut=e.value/u;var c=0;for(T=0;T<r.targetLinks.length;T++)c+=r.targetLinks[T].value;for(T=0;T<r.targetLinks.length;T++)(e=r.targetLinks[T]).concenrationIn=e.value/c}}(),u.node.x.length&&u.node.y.length){for(w=0;w<Math.min(u.node.x.length,u.node.y.length,A.nodes.length);w++)if(u.node.x[w]&&u.node.y[w]){var I=[u.node.x[w]*g,u.node.y[w]*y];A.nodes[w].x0=I[0]-d/2,A.nodes[w].x1=I[0]+d/2;var L=A.nodes[w].y1-A.nodes[w].y0;A.nodes[w].y0=I[1]-L/2,A.nodes[w].y1=I[1]+L/2}if("snap"===u.arrangement){var P=function(t){var e,r,n=t.map(function(t,e){return{x0:t.x0,index:e}}).sort(function(t,e){return t.x0-e.x0}),i=[],a=-1,o=-1/0;for(w=0;w<n.length;w++){var s=t[n[w].index];s.x0>o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=A.nodes);P.forEach(function(t){var e,r,n,i=0,a=t.length;for(t.sort(function(t,e){return t.y0-e.y0}),n=0;n<a;++n)(e=t[n]).y0>=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p})}n.update(A)}return{circular:b,key:r,trace:u,guid:h.randstr(),horizontal:f,width:g,height:y,nodePad:u.node.pad,nodeLineColor:u.node.line.color,nodeLineWidth:u.node.line.width,linkLineColor:u.link.line.color,linkLineWidth:u.link.line.width,linkArrowLength:u.link.arrowlen,valueFormat:u.valueformat,valueSuffix:u.valuesuffix,textFont:u.textfont,translateX:c.x[0]*t.width+t.margin.l,translateY:t.height-c.y[1]*t.height+t.margin.t,dragParallel:f?y:g,dragPerpendicular:f?g:y,arrangement:u.arrangement,sankey:n,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,e,r){var n=l(e.color),i=l(e.hovercolor),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:u.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:S,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function S(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r="",n=t.width/2,i=t.circularPathData,a=i.sourceX+i.verticalBuffer<i.targetX,o=i.rightFullExtent-i.rightLargeArcRadius-e<=i.leftFullExtent-n;return Math.abs(i.rightFullExtent-i.leftFullExtent-n),"top"===t.circularLinkType?(r="M "+(i.targetX-e)+" "+(i.targetY+n)+" L "+(i.rightInnerExtent-e)+" "+(i.targetY+n)+"A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent-n-e)+" "+(i.targetY-i.rightSmallArcRadius)+"L "+(i.rightFullExtent-n-e)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" L "+(i.rightFullExtent+n-(i.rightLargeArcRadius-n)-e)+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent-n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent-n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY-i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.leftInnerExtent+" "+(i.sourceY-n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.sourceY-i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.verticalFullExtent+n)+"L"+(i.rightFullExtent+n-e)+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:a?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent-n-e)+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" L "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-e)+" "+(i.targetY-i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 0 "+(i.rightInnerExtent-e)+" "+(i.targetY-n)+" L "+(i.targetX-e)+" "+(i.targetY-n)+(e>0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-e)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-e)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-e)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-e)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-e-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-e+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-e-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-e)+" "+(i.targetY+n)+" L "+(i.targetX-e)+" "+(i.targetY+n)+(e>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var i=t.link.source.x1,a=t.link.target.x0-e,o=n(i,a),s=o(.5),l=o(.5),u=t.link.y0-t.link.width/2,c=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,f=t.link.y1+t.link.width/2,p="M"+i+","+u,d="C"+s+","+u+" "+l+","+h+" "+a+","+h,m="C"+l+","+f+" "+s+","+c+" "+i+","+c,g=e>0?"L"+(a+e)+","+(h+t.link.width/2):"";return p+d+(g+="L"+a+","+f)+m+"Z"}}function E(t,e){var r=l(e.color),n=s.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),c="node_"+e.pointNumber;return e.group&&(c=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:c,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,c].join("_"),interactionState:t.interactionState,figure:t}}function C(t){t.attr("transform",function(t){return f(t.node.x0.toFixed(3),t.node.y0.toFixed(3))})}function I(t){t.call(C)}function L(t,e){t.call(I),e.attr("d",S())}function P(t){t.attr("width",function(t){return t.node.x1-t.node.x0}).attr("height",function(t){return t.visibleHeight})}function z(t){return t.link.width>1||t.linkLineWidth>0}function D(t){return f(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function R(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){!t.interactionState.dragInProgress&&!t.partOfGroup&&(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){!t.interactionState.dragInProgress&&!t.partOfGroup&&(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){!t.interactionState.dragInProgress&&!t.partOfGroup&&(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),!t.interactionState.dragInProgress&&!t.partOfGroup&&r.select(this,t,e)})}function F(t,e,n,a){var o=i.behavior.drag().origin(function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}}).on("dragstart",function(i){if("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",function(t){a._fullLayout._dragCover=t}),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,N(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(t,e,n){!function(t){for(var e=0;e<t.length;e++)t[e].y=(t[e].y0+t[e].y1)/2,t[e].x=(t[e].x0+t[e].x1)/2}(n.graph.nodes);var i=n.graph.nodes.filter(function(t){return t.originalX===n.node.originalX}).filter(function(t){return!t.partOfGroup});n.forceLayouts[e]=r.forceSimulation(i).alphaDecay(0).force("collide",r.forceCollide().radius(function(t){return t.dy/2+n.nodePad/2}).strength(1).iterations(s.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i<r.length;i++){var a=r[i];a===n.interactionState.dragInProgress?(a.x=a.lastDraggedX,a.y=a.lastDraggedY):(a.vx=(a.originalX-a.x)/s.forceTicksPerFrame,a.y=Math.min(n.size-a.dy/2,Math.max(a.dy/2,a.y))),t=Math.max(t,Math.abs(a.vx),Math.abs(a.vy))}!n.interactionState.dragInProgress&&t<.1&&n.forceLayouts[e].alpha()>0&&n.forceLayouts[e].alpha(0)}}(0,e,i,n)).stop()}(0,o,i),function(t,e,r,n,i){window.requestAnimationFrame(function a(){var o;for(o=0;o<s.forceTicksPerFrame;o++)r.forceLayouts[n].tick();if(function(t){for(var e=0;e<t.length;e++)t[e].y0=t[e].y-t[e].dy/2,t[e].y1=t[e].y0+t[e].dy,t[e].x0=t[e].x-t[e].dx/2,t[e].x1=t[e].x0+t[e].dx}(r.graph.nodes),r.sankey.update(r.graph),L(t.filter(j(r)),e),r.forceLayouts[n].alpha()>0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,B(r,i)}})}(t,e,i,o,a)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),N(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(t.filter(j(r)),e))}}).on("dragend",function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e<t.node.childrenNodes.length;e++)t.node.childrenNodes[e].x=t.node.x,t.node.childrenNodes[e].y=t.node.y;"snap"!==t.arrangement&&B(t,a)}});t.on(".drag",null).call(o)}function B(t,e){for(var r=[],n=[],i=0;i<t.graph.nodes.length;i++){var a=(t.graph.nodes[i].x0+t.graph.nodes[i].x1)/2,o=(t.graph.nodes[i].y0+t.graph.nodes[i].y1)/2;r.push(a/t.figure.width),n.push(o/t.figure.height)}b.call("_guiRestyle",e,{"node.x":[r],"node.y":[n]},t.trace.index).then(function(){e._fullLayout._dragCover&&e._fullLayout._dragCover.remove()})}function N(t){t.lastDraggedX=t.x0+t.dx/2,t.lastDraggedY=t.y0+t.dy/2}function j(t){return function(e){return e.node.originalX===t.node.originalX}}e.exports=function(t,e,r,n,a){var o=t._context.staticPlot,d=!1;h.ensureSingle(t._fullLayout._infolayer,"g","first-render",function(){d=!0});var m=t._fullLayout._dragCover,v=r.filter(function(t){return x(t).trace.visible}).map(A.bind(null,n)),b=e.selectAll("."+s.cn.sankey).data(v,g);b.exit().remove(),b.enter().append("g").classed(s.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",o?"none":"auto").attr("transform",D),b.each(function(e,r){t._fullData[r]._sankey=e;var n="bgsankey-"+e.trace.uid+"-"+r;h.ensureSingle(t._fullLayout._draggers,"rect",n),t._fullData[r]._bgRect=i.select("."+n),t._fullData[r]._bgRect.style("pointer-events",o?"none":"all").attr("width",e.width).attr("height",e.height).attr("x",e.translateX).attr("y",e.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),b.transition().ease(s.ease).duration(s.duration).attr("transform",D);var w=b.selectAll("."+s.cn.sankeyLinks).data(y,g);w.enter().append("g").classed(s.cn.sankeyLinks,!0).style("fill","none");var I=w.selectAll("."+s.cn.sankeyLink).data(function(t){return t.graph.links.filter(function(t){return t.value}).map(M.bind(null,t))},g);I.enter().append("path").classed(s.cn.sankeyLink,!0).call(R,b,a.linkEvents),I.style("stroke",function(t){return z(t)?u.tinyRGB(l(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return z(t)?u.opacity(t.linkLineColor):t.tinyColorAlpha}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}).style("stroke-width",function(t){return z(t)?t.linkLineWidth:1}).attr("d",S()),I.style("opacity",function(){return t._context.staticPlot||d||m?1:0}).transition().ease(s.ease).duration(s.duration).style("opacity",1),I.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var L=b.selectAll("."+s.cn.sankeyNodeSet).data(y,g);L.enter().append("g").classed(s.cn.sankeyNodeSet,!0),L.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var O=L.selectAll("."+s.cn.sankeyNode).data(function(t){var e=t.graph.nodes;return function(t){var e,r=[];for(e=0;e<t.length;e++)t[e].originalX=(t[e].x0+t[e].x1)/2,t[e].originalY=(t[e].y0+t[e].y1)/2,-1===r.indexOf(t[e].originalX)&&r.push(t[e].originalX);for(r.sort(function(t,e){return t-e}),e=0;e<t.length;e++)t[e].originalLayerIndex=r.indexOf(t[e].originalX),t[e].originalLayer=t[e].originalLayerIndex/(r.length-1)}(e),e.map(E.bind(null,t))},g);O.enter().append("g").classed(s.cn.sankeyNode,!0).call(C).style("opacity",function(e){return!t._context.staticPlot&&!d||e.partOfGroup?0:1}),O.call(R,b,a.nodeEvents).call(F,I,a,t),O.transition().ease(s.ease).duration(s.duration).call(C).style("opacity",function(t){return t.partOfGroup?0:1}),O.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var B=O.selectAll("."+s.cn.nodeRect).data(y);B.enter().append("rect").classed(s.cn.nodeRect,!0).call(P),B.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return u.tinyRGB(l(t.nodeLineColor))}).style("stroke-opacity",function(t){return u.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),B.transition().ease(s.ease).duration(s.duration).call(P);var N=O.selectAll("."+s.cn.nodeLabel).data(y);N.enter().append("text").classed(s.cn.nodeLabel,!0).style("cursor","default"),N.attr("data-notex",1).text(function(t){return t.node.label}).each(function(e){var r=i.select(this);c.font(r,e.textFont),_.convertToTspans(r,t)}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}).attr("transform",function(t){var e=i.select(this),r=_.lineCount(e),n=t.textFont.size*((r-1)*k-T),a=t.nodeLineWidth/2+3,o=((t.horizontal?t.visibleHeight:t.visibleWidth)-n)/2;t.horizontal&&(t.left?a=-a:a+=t.visibleWidth);var s=t.horizontal?"":"scale(-1,1)"+p(90);return f(t.horizontal?a:o,t.horizontal?o:a)+s}),N.transition().ease(s.ease).duration(s.duration)}}),aw=f((t,e)=>{var r=v(),n=oe(),i=n.numberFormat,a=iw(),o=Pr(),s=q(),l=nw().cn,u=n._;function c(t){return""!==t}function h(t,e){return t.filter(function(t){return t.key===e.traceId})}function f(t,e){r.select(t).select("path").style("fill-opacity",e),r.select(t).select("rect").style("fill-opacity",e)}function p(t){r.select(t).select("text.name").style("fill","black")}function d(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function m(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function g(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(x.bind(0,e,r,!1))}function y(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(_.bind(0,e,r,!1))}function x(t,e,r,n){n.style("fill",function(t){if(!t.link.concentrationscale)return t.tinyColorHoverHue}).style("fill-opacity",function(t){if(!t.link.concentrationscale)return t.tinyColorHoverAlpha}),n.each(function(r){var n=r.link.label;""!==n&&h(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===n}).style("fill",function(t){if(!t.link.concentrationscale)return t.tinyColorHoverHue}).style("fill-opacity",function(t){if(!t.link.concentrationscale)return t.tinyColorHoverAlpha})}),r&&h(e,t).selectAll("."+l.sankeyNode).filter(m(t)).call(g)}function _(t,e,r,n){n.style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),n.each(function(r){var n=r.link.label;""!==n&&h(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===n}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha})}),r&&h(e,t).selectAll(l.sankeyNode).filter(m(t)).call(y)}function b(t,e){var r=t.hoverlabel||{},i=n.nestedProperty(r,e).get();return!Array.isArray(i)&&i}e.exports=function(t,e){for(var n=t._fullLayout,h=n._paper,d=n._size,m=0;m<t._fullData.length;m++)if(t._fullData[m].visible&&t._fullData[m].type===l.sankey&&!t._fullData[m]._viewInitial){var v=t._fullData[m].node;t._fullData[m]._viewInitial={node:{groups:v.groups.slice(),x:v.x.slice(),y:v.y.slice()}}}var w=u(t,"source:")+" ",T=u(t,"target:")+" ",k=u(t,"concentration:")+" ",A=u(t,"incoming flow count:")+" ",M=u(t,"outgoing flow count:")+" ";a(t,h,e,{width:d.w,height:d.h,margin:{t:d.t,r:d.r,b:d.b,l:d.l}},{linkEvents:{hover:function(e,n,i){!1!==t._fullLayout.hovermode&&(r.select(e).call(x.bind(0,n,i,!0)),"skip"!==n.link.trace.link.hoverinfo&&(n.link.fullData=n.link.trace,t.emit("plotly_hover",{event:r.event,points:[n.link]})))},follow:function(e,a){if(!1!==t._fullLayout.hovermode){var l=a.link.trace.link;if("none"!==l.hoverinfo&&"skip"!==l.hoverinfo){for(var u=[],h=0,d=0;d<a.flow.links.length;d++){var m=a.flow.links[d];if("closest"!==t._fullLayout.hovermode||a.link.pointNumber===m.pointNumber){a.link.pointNumber===m.pointNumber&&(h=d),m.fullData=m.trace,l=a.link.trace.link;var g=v(m),y={valueLabel:i(a.valueFormat)(m.value)+a.valueSuffix};u.push({x:g[0],y:g[1],name:y.valueLabel,text:[m.label||"",w+m.source.label,T+m.target.label,m.concentrationscale?k+i("%0.2f")(m.flow.labelConcentration):""].filter(c).join("<br>"),color:b(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:b(l,"bordercolor"),fontFamily:b(l,"font.family"),fontSize:b(l,"font.size"),fontColor:b(l,"font.color"),fontWeight:b(l,"font.weight"),fontStyle:b(l,"font.style"),fontVariant:b(l,"font.variant"),fontTextcase:b(l,"font.textcase"),fontLineposition:b(l,"font.lineposition"),fontShadow:b(l,"font.shadow"),nameLength:b(l,"namelength"),textAlign:b(l,"align"),idealAlign:r.event.x<g[0]?"right":"left",hovertemplate:l.hovertemplate,hovertemplateLabels:y,eventData:[m]})}}o.loneHover(u,{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t,anchorIndex:h}).each(function(){a.link.concentrationscale||f(this,.65),p(this)})}}function v(t){var e,r;t.circular?(e=(t.circularPathData.leftInnerExtent+t.circularPathData.rightInnerExtent)/2,r=t.circularPathData.verticalFullExtent):(e=(t.source.x1+t.target.x0)/2,r=(t.y0+t.y1)/2);var n=[e,r];return"v"===t.trace.orientation&&n.reverse(),n[0]+=a.parent.translateX,n[1]+=a.parent.translateY,n}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(r.select(e).call(_.bind(0,i,a,!0)),"skip"!==i.link.trace.link.hoverinfo&&(i.link.fullData=i.link.trace,t.emit("plotly_unhover",{event:r.event,points:[i.link]})),o.loneUnhover(n._hoverlayer.node()))},select:function(e,n){var i=n.link;i.originalEvent=r.event,t._hoverdata=[i],o.click(t,{target:!0})}},nodeEvents:{hover:function(e,n,i){!1!==t._fullLayout.hovermode&&(r.select(e).call(g,n,i),"skip"!==n.node.trace.node.hoverinfo&&(n.node.fullData=n.node.trace,t.emit("plotly_hover",{event:r.event,points:[n.node]})))},follow:function(e,a){if(!1!==t._fullLayout.hovermode){var s=a.node.trace.node;if("none"!==s.hoverinfo&&"skip"!==s.hoverinfo){var u=r.select(e).select("."+l.nodeRect),h=t._fullLayout._paperdiv.node().getBoundingClientRect(),d=u.node().getBoundingClientRect(),m=d.left-2-h.left,g=d.right+2-h.left,y=d.top+d.height/4-h.top,v={valueLabel:i(a.valueFormat)(a.node.value)+a.valueSuffix};a.node.fullData=a.node.trace,t._fullLayout._calcInverseTransform(t);var x=t._fullLayout._invScaleX,_=t._fullLayout._invScaleY,w=o.loneHover({x0:x*m,x1:x*g,y:_*y,name:i(a.valueFormat)(a.node.value)+a.valueSuffix,text:[a.node.label,A+a.node.targetLinks.length,M+a.node.sourceLinks.length].filter(c).join("<br>"),color:b(s,"bgcolor")||a.tinyColorHue,borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),fontWeight:b(s,"font.weight"),fontStyle:b(s,"font.style"),fontVariant:b(s,"font.variant"),fontTextcase:b(s,"font.textcase"),fontLineposition:b(s,"font.lineposition"),fontShadow:b(s,"font.shadow"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});f(w,.85),p(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(r.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(e,n,i){var a=n.node;a.originalEvent=r.event,t._hoverdata=[a],r.select(e).call(y,n,i),o.click(t,{target:!0})}}})}}),ow=f(t=>{var e=Lt().overrideAll,r=_e().getModuleCalcData,n=aw(),i=B(),a=hr(),o=cr(),s=Mn().prepSelect,l=oe(),u=Ut(),c="sankey";function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,c="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,c);var f={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:h.node(),plotinfo:{id:e,xaxis:f,yaxis:p,fillRangeItems:l.noop},subplot:e,xaxes:[f],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;r<e.length;r++)if(e[r].pointNumber===t)return e[r]}for(var l=0;l<r.length;l++){var c=s(r[l].pointNumber);if(c)if(c.group){for(var h=0;h<c.childrenNodes.length;h++)o.push(c.childrenNodes[h].pointNumber);a[c.pointNumber-i.node._count]=!1}else o.push(c.pointNumber)}n=a.filter(Boolean).concat([o]),u.call("_guiRestyle",t,{"node.groups":[n]},e)},prepFn:function(t,e,r){s(t,e,r,d,i)}};o.init(d)}}t.name=c,t.baseLayoutAttrOverrides=e({hoverlabel:i.hoverlabel},"plot","nested"),t.plot=function(e){var i=r(e.calcdata,c)[0];n(e,i),t.updateFx(e)},t.clean=function(t,e,r,n){var i=n._has&&n._has(c),a=e._has&&e._has(c);i&&!a&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())},t.updateFx=function(t){for(var e=0;e<t._fullData.length;e++)h(t,e)}}),sw=f((t,e)=>{e.exports=function(t,e){for(var r=[],n=t.cd[0].trace,i=n._sankey.graph.nodes,a=0;a<i.length;a++){var o=i[a];if(!o.partOfGroup){var s=[(o.x0+o.x1)/2,(o.y0+o.y1)/2];"v"===n.orientation&&s.reverse(),e&&e.contains(s,!1,a,t)&&r.push({pointNumber:o.pointNumber})}}return r}}),lw=f((t,e)=>{e.exports={attributes:qb(),supplyDefaults:Hb(),calc:Zb(),plot:aw(),moduleType:"trace",name:"sankey",basePlotModule:ow(),selectPoints:sw(),categories:["noOpacity"],meta:{}}}),uw=f((t,e)=>{e.exports=lw()}),cw=f(t=>{var e=we();t.name="indicator",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}),hw=f((t,e)=>{var r=D().extendFlat,n=D().extendDeep,i=Lt().overrideAll,a=R(),o=V(),s=wa().attributes,l=Ee(),u=me().templatedArray,c=Tl(),h=Se().descriptionOnlyNumbers,f=a({editType:"plot",colorEditType:"plot"}),p={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:o.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},d={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},m=u("step",n({},p,{range:d}));e.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:s({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:r({},f,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:h("value")},font:r({},f,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:h("value")},increasing:{symbol:{valType:"string",dflt:c.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:c.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:c.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:c.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:r({},f,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:n({},p,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:o.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:i({range:d,visible:r({},l.visible,{dflt:!0}),tickmode:l.minor.tickmode,nticks:l.nticks,tick0:l.tick0,dtick:l.dtick,tickvals:l.tickvals,ticktext:l.ticktext,ticks:r({},l.ticks,{dflt:"outside"}),ticklen:l.ticklen,tickwidth:l.tickwidth,tickcolor:l.tickcolor,ticklabelstep:l.ticklabelstep,showticklabels:l.showticklabels,labelalias:l.labelalias,tickfont:a({}),tickangle:l.tickangle,tickformat:l.tickformat,tickformatstops:l.tickformatstops,tickprefix:l.tickprefix,showtickprefix:l.showtickprefix,ticksuffix:l.ticksuffix,showticksuffix:l.showticksuffix,separatethousands:l.separatethousands,exponentformat:l.exponentformat,minexponent:l.minexponent,showexponent:l.showexponent,editType:"plot"},"plot"),steps:m,threshold:{line:{color:r({},p.line.color,{}),width:r({},p.line.width,{dflt:1}),editType:"plot"},thickness:r({},p.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),fw=f((t,e)=>{e.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),pw=f((t,e)=>{var r=oe(),n=hw(),i=wa().defaults,a=me(),o=Fe(),s=fw(),l=Oe(),u=De(),c=Be(),h=Ne();function f(t,e){function i(i,a){return r.coerce(t,e,n.gauge.steps,i,a)}i("color"),i("line.color"),i("line.width"),i("range"),i("thickness")}e.exports={supplyDefaults:function(t,e,p,d){function m(i,a){return r.coerce(t,e,n,i,a)}i(e,d,m),m("mode"),e._hasNumber=-1!==e.mode.indexOf("number"),e._hasDelta=-1!==e.mode.indexOf("delta"),e._hasGauge=-1!==e.mode.indexOf("gauge");var g=m("value");e._range=[0,"number"==typeof g?1.5*g:1];var y,v,x=new Array(2);if(e._hasNumber){m("number.valueformat");var _=r.extendFlat({},d.font);_.size=void 0,r.coerceFont(m,"number.font",_),void 0===e.number.font.size&&(e.number.font.size=s.defaultNumberFontSize,x[0]=!0),m("number.prefix"),m("number.suffix"),y=e.number.font.size}if(e._hasDelta){var b=r.extendFlat({},d.font);b.size=void 0,r.coerceFont(m,"delta.font",b),void 0===e.delta.font.size&&(e.delta.font.size=(e._hasNumber?.5:1)*(y||s.defaultNumberFontSize),x[1]=!0),m("delta.reference",e.value),m("delta.relative"),m("delta.valueformat",e.delta.relative?"2%":""),m("delta.increasing.symbol"),m("delta.increasing.color"),m("delta.decreasing.symbol"),m("delta.decreasing.color"),m("delta.position"),m("delta.prefix"),m("delta.suffix"),v=e.delta.font.size}e._scaleNumbers=(!e._hasNumber||x[0])&&(!e._hasDelta||x[1])||!1;var w,T,k,A,M=r.extendFlat({},d.font);function S(t,e){return r.coerce(w,T,n.gauge,t,e)}function E(t,e){return r.coerce(k,A,n.gauge.axis,t,e)}if(M.size=.25*(y||v||s.defaultNumberFontSize),r.coerceFont(m,"title.font",M),m("title.text"),e._hasGauge){(w=t.gauge)||(w={}),T=a.newContainer(e,"gauge"),S("shape"),(e._isBullet="bullet"===e.gauge.shape)||m("title.align","center"),(e._isAngular="angular"===e.gauge.shape)||m("align","center"),S("bgcolor",d.paper_bgcolor),S("borderwidth"),S("bordercolor"),S("bar.color"),S("bar.line.color"),S("bar.line.width"),S("bar.thickness",s.valueThickness*("bullet"===e.gauge.shape?.5:1)),o(w,T,{name:"steps",handleItemDefaults:f}),S("threshold.value"),S("threshold.thickness"),S("threshold.line.width"),S("threshold.line.color"),k={},w&&(k=w.axis||{}),A=a.newContainer(T,"axis"),E("visible"),e._range=E("range",e._range);var C={font:d.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};l(k,A,E,"linear"),h(k,A,E,"linear",C),c(k,A,E,"linear",C),u(k,A,E,C)}else m("title.align","center"),m("align","center"),e._isAngular=e._isBullet=!1;e._length=null}}}),dw=f((t,e)=>{e.exports={calc:function(t,e){var r=[],n=e.value;"number"!=typeof e._lastValue&&(e._lastValue=e.value);var i=e._lastValue,a=i;return e._hasDelta&&"number"==typeof e.delta.reference&&(a=e.delta.reference),r[0]={y:n,lastY:i,delta:n-a,relativeDelta:(n-a)/a},r}}}),mw=f((t,e)=>{var r=v(),n=(td(),m(Qp)).interpolate,i=(td(),m(Qp)).interpolateNumber,a=oe(),o=a.strScale,s=a.strTranslate,l=a.rad2deg,u=ke().MID_SHIFT,c=Je(),h=fw(),f=Ae(),p=rr(),d=bi(),g=wi(),y=Ee(),x=q(),_={left:"start",center:"middle",right:"end"},b={left:0,center:.5,right:1},w=/[yzafpnµmkMGTPEZY]/;function T(t){return t&&t.duration>0}function k(t){t.each(function(t){x.stroke(r.select(this),t.line.color)}).each(function(t){x.fill(r.select(this),t.color)}).style("stroke-width",function(t){return t.line.width})}function A(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,y,t,e)}return d(i,o,l,s,n),g(i,o,l,s),o}function M(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function S(t,e,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",t).call(f.convertToTspans,i).call(c.font,e),c.bBox(o.node())}function E(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,d,m){var g,y=t._fullLayout;T(d)&&m&&(g=m()),a.makeTraceGroups(y._indicatorlayer,e,"trace").each(function(e){var m,v,C,I,L,P=e[0].trace,z=r.select(this),O=P._hasGauge,D=P._isAngular,R=P._isBullet,F=P.domain,B={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,q=P.align||"center";if(v=j,O){if(D&&(m=N,v=j+U/2,C=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),n=e/r;return[n,t,e]}(t,.9*V)}),R){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;m=B.l+(G+(1-G)*b[q])*B.w,C=function(t){return M(t,(h.bulletNumberDomainSize-H)*B.w,B.h)}}}else m=B.l+b[q]*B.w,C=function(t){return M(t,B.w,B.h)};!function(t,e,n,l){var u,h,d,m=n[0].trace,g=l.numbersX,y=l.numbersY,v=m.align||"center",k=_[v],M=l.transitionOpts,C=l.onComplete,I=a.ensureSingle(e,"g","numbers"),L=[];m._hasNumber&&L.push("number"),m._hasDelta&&(L.push("delta"),"left"===m.delta.position&&L.reverse());var P=I.selectAll("text").data(L);function z(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=e.slice().replace("s","f").replace(/\d+/,function(t){return parseInt(t)-1}),o=A(t,{tickformat:a});return function(t){return Math.abs(t)<1?p.tickText(o,t).text:r(t)}}function O(){var e=A(t,{tickformat:m.number.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=I.select("text.number");function h(){var e="number"==typeof n[0].y?s+a(n[0].y)+o:"-";l.text(e).call(c.font,m.number.font).call(f.convertToTspans,t)}return T(M)?l.transition().duration(M.duration).ease(M.easing).each("end",function(){h(),C&&C()}).each("interrupt",function(){h(),C&&C()}).attrTween("text",function(){var t=r.select(this),e=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){t.text(s+l(e(r))+o)}}):h(),u=S(s+a(n[0].y)+o,m.number.font,k,t),l}function D(){var e=A(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},u=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},d=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=I.select("text.delta");function y(){g.text(u(l(n[0]),a)).call(x.fill,d(n[0])).call(f.convertToTspans,t)}return g.call(c.font,m.delta.font).call(x.fill,d({delta:m._deltaLastValue})),T(M)?g.transition().duration(M.duration).ease(M.easing).tween("text",function(){var t=r.select(this),e=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,e),c=i(o,e);return m._deltaLastValue=e,function(e){t.text(u(c(e),s)),t.call(x.fill,d({delta:c(e)}))}}).each("end",function(){y(),C&&C()}).each("interrupt",function(){y(),C&&C()}):y(),h=S(u(l(n[0]),a),m.delta.font,k,t),g}P.enter().append("text"),P.attr("text-anchor",function(){return k}).attr("class",function(t){return t}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var R,F=m.mode+m.align;if(m._hasDelta&&(R=D(),F+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,F+=m.delta.increasing.symbol+m.delta.decreasing.symbol,d=h),m._hasNumber&&(O(),F+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,d=u),m._hasDelta&&m._hasNumber){var B,N,j=[(u.left+u.right)/2,(u.top+u.bottom)/2],U=[(h.left+h.right)/2,(h.top+h.bottom)/2],V=.75*m.delta.font.size;"left"===m.delta.position&&(B=E(m,"deltaPos",0,-1*(u.width*b[m.align]+h.width*(1-b[m.align])+V),F,Math.min),N=j[1]-U[1],d={width:u.width+h.width+V,height:Math.max(u.height,h.height),left:h.left+B,right:u.right,top:Math.min(u.top,h.top+N),bottom:Math.max(u.bottom,h.bottom+N)}),"right"===m.delta.position&&(B=E(m,"deltaPos",0,u.width*(1-b[m.align])+h.width*b[m.align]+V,F,Math.max),N=j[1]-U[1],d={width:u.width+h.width+V,height:Math.max(u.height,h.height),left:u.left,right:h.right+B,top:Math.min(u.top,h.top+N),bottom:Math.max(u.bottom,h.bottom+N)}),"bottom"===m.delta.position&&(B=null,N=h.height,d={width:Math.max(u.width,h.width),height:u.height+h.height,left:Math.min(u.left,h.left),right:Math.max(u.right,h.right),top:u.bottom-u.height,bottom:u.bottom+h.height}),"top"===m.delta.position&&(B=null,N=u.top,d={width:Math.max(u.width,h.width),height:u.height+h.height,left:Math.min(u.left,h.left),right:Math.max(u.right,h.right),top:u.bottom-u.height-h.height,bottom:u.bottom}),R.attr({dx:B,dy:N})}(m._hasNumber||m._hasDelta)&&I.attr("transform",function(){var t=l.numbersScaler(d);F+=t[2];var e,r=E(m,"numbersScale",1,t[0],F,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?y-r*d.bottom:y-r*(d.top+d.bottom)/2,m._numbersTop=r*d.top+e;var n=d[v];"center"===v&&(n=(d.left+d.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,F,Math.max),s(i,e)+o(r)})}(t,z,e,{numbersX:m,numbersY:v,numbersScaler:C,transitionOpts:d,onComplete:g}),O&&(I={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},L={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var Z=z.selectAll("g.angular").data(D?e:[]);Z.exit().remove();var W=z.selectAll("g.angularaxis").data(D?e:[]);W.exit().remove(),D&&function(t,e,i,a){var o,c,h,f,d=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,_=[m.l+m.w/2,m.t+m.h/2+g/2],b=a.gauge,w=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function C(t){var e=d.gauge.axis.range[0],r=(t-e)/(d.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function I(t){return r.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-E)}function L(t){t.attr("d",function(t){return I(t.thickness).startAngle(C(t.range[0])).endAngle(C(t.range[1]))()})}b.enter().append("g").classed("angular",!0),b.attr("transform",s(_[0],_[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=A(t,d.gauge.axis)).type="linear",o.range=d.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},O=p.makeLabelFns(o,0),D=O.labelStandoff;z.xFn=function(t){var e=P(t);return Math.cos(e)*D},z.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(D+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},z.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var R=function(t){return s(_[0]+g*Math.cos(t),_[1]-g*Math.sin(t))};h=function(t){return R(P(t))};var F=function(t){var e=P(t);return R(e)+"rotate("+-l(e)+")"};if(c=p.calcTicks(o),f=p.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var B=(o.linewidth||1)/2;p.drawTicks(t,o,{vals:c,layer:w,path:"M"+f*B+",0h"+f*o.ticklen,transFn:F}),p.drawLabels(t,o,{vals:c,layer:w,transFn:h,labelFns:z})}var N=[v].concat(d.gauge.steps),j=b.selectAll("g.bg-arc").data(N);j.enter().append("g").classed("bg-arc",!0).append("path"),j.select("path").call(L).call(k),j.exit().remove();var U=I(d.gauge.bar.thickness),V=b.selectAll("g.value-arc").data([d.gauge.bar]);V.enter().append("g").classed("value-arc",!0).append("path");var q=V.select("path");T(M)?(q.transition().duration(M.duration).ease(M.easing).each("end",function(){S&&S()}).each("interrupt",function(){S&&S()}).attrTween("d",function(t,e,r){return function(){var i=n(e,r);return function(e){return t.endAngle(i(e))()}}}(U,C(i[0].lastY),C(i[0].y))),d._lastValue=i[0].y):q.attr("d","number"==typeof i[0].y?U.endAngle(C(i[0].y)):"M0,0Z"),q.call(k),V.exit().remove(),N=[];var H=d.gauge.threshold.value;(H||0===H)&&N.push({range:[H,H],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var G=b.selectAll("g.threshold-arc").data(N);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(L).call(k),G.exit().remove();var Z=b.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(L).call(k),Z.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Z,layer:W,size:B,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var Y=z.selectAll("g.bullet").data(R?e:[]);Y.exit().remove();var X=z.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,l,u,c=r[0].trace,f=n.gauge,d=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,v=c.domain,_=n.transitionOpts,b=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",s(y.l,y.t)),d.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),d.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,M=c.gauge.bar.thickness*w,S=v.x[0],E=v.x[0]+(v.x[1]-v.x[0])*(c._hasNumber||c._hasDelta?1-h.bulletNumberDomainSize:1);function C(t){t.attr("width",function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))}).attr("x",function(t){return i.c2p(t.range[0])}).attr("y",function(t){return.5*(1-t.thickness)*w}).attr("height",function(t){return t.thickness*w})}(i=A(t,c.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=p.calcTicks(i),o=p.makeTransTickFn(i),l=p.getTickSigns(i)[2],u=y.t+y.h,i.visible&&(p.drawTicks(t,i,{vals:"inside"===i.ticks?p.clipEnds(i,a):a,layer:d,path:p.makeTickPath(i,u,l),transFn:o}),p.drawLabels(t,i,{vals:a,layer:d,transFn:o,labelFns:p.makeLabelFns(i,u)}));var I=[m].concat(c.gauge.steps),L=f.selectAll("g.bg-bullet").data(I);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(C).call(k),L.exit().remove();var P=f.selectAll("g.value-bullet").data([c.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(w-M)/2).call(k),T(_)?P.select("rect").transition().duration(_.duration).ease(_.easing).each("end",function(){b&&b()}).each("interrupt",function(){b&&b()}).attr("width",Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y))):0),P.exit().remove();var z=r.filter(function(){return c.gauge.threshold.value||0===c.gauge.threshold.value}),O=f.selectAll("g.threshold-bullet").data(z);O.enter().append("g").classed("threshold-bullet",!0).append("line"),O.select("line").attr("x1",i.c2p(c.gauge.threshold.value)).attr("x2",i.c2p(c.gauge.threshold.value)).attr("y1",(1-c.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-c.gauge.threshold.thickness)/2)*w).call(x.stroke,c.gauge.threshold.line.color).style("stroke-width",c.gauge.threshold.line.width),O.exit().remove();var D=f.selectAll("g.gauge-outline").data([g]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(C).call(k),D.exit().remove()}(t,0,e,{gauge:Y,layer:X,size:B,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var $=z.selectAll("text.title").data(e);$.exit().remove(),$.enter().append("text").classed("title",!0),$.attr("text-anchor",function(){return R?_.right:_[P.title.align]}).text(P.title.text).call(c.font,P.title.font).call(f.convertToTspans,t),$.attr("transform",function(){var t,e=B.l+B.w*b[P.title.align],r=h.titlePadding,n=c.bBox($.node());return O?(D&&(t=P.gauge.axis.visible?c.bBox(W.node()).top-r-n.bottom:B.t+B.h/2-U/2-n.bottom-r),R&&(t=v-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)):t=P._numbersTop-r-n.bottom,s(e,t)})})}}),gw=f((t,e)=>{e.exports={moduleType:"trace",name:"indicator",basePlotModule:cw(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:hw(),supplyDefaults:pw().supplyDefaults,calc:dw().calc,plot:mw(),meta:{}}}),yw=f((t,e)=>{e.exports=gw()}),vw=f((t,e)=>{var r=vn(),n=D().extendFlat,i=Lt().overrideAll,a=R(),o=wa().attributes,s=Se().descriptionOnlyNumbers;e.exports=i({domain:o({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))}},"calc","from-root")}),xw=f((t,e)=>{var r=oe(),n=vw(),i=wa().defaults;e.exports=function(t,e,a,o){function s(i,a){return r.coerce(t,e,n,i,a)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s<n;s++)o.push(s);e("columnorder",o)}(e,s),s("cells.values"),s("cells.format"),s("cells.align"),s("cells.prefix"),s("cells.suffix"),s("cells.height"),s("cells.line.width"),s("cells.line.color"),s("cells.fill.color"),r.coerceFont(s,"cells.font",o.font),e._length=null}}),_w=f((t,e)=>{var r=Xx().wrap;e.exports=function(){return r({})}}),bw=f((t,e)=>{e.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}),ww=f((t,e)=>{var r=bw(),n=D().extendFlat,i=T(),a=S().isTypedArray,o=S().isArrayOrTypedArray;function s(t){if(o(t)){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,s(t[r]));return e}return t}function l(t,e){return t+e}function u(t){var e,r=t.slice(),n=1/0,i=0;for(e=0;e<r.length;e++)a(r[e])?r[e]=Array.from(r[e]):o(r[e])||(r[e]=[r[e]]),n=Math.min(n,r[e].length),i=Math.max(i,r[e].length);if(n!==i)for(e=0;e<r.length;e++){var s=i-r[e].length;s&&(r[e]=r[e].concat(c(s)))}return r}function c(t){for(var e=new Array(t),r=0;r<t;r++)e[r]="";return e}function h(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex<t.xIndex?e+r.columnWidth:e},0)}function f(t,e){return Object.keys(t).map(function(r){return n({},t[r],{auxiliaryBlocks:e})})}function p(t,e){for(var r,n={},i=0,a=0,o={firstRowIndex:null,lastRowIndex:null,rows:[]},s=0,l=0,u=0;u<t.length;u++)r=t[u],o.rows.push({rowIndex:u,rowHeight:r}),((a+=r)>=e||u===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o=d(),i+=a,s=u+1,a=0);return n}function d(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}e.exports=function(t,e){var a=u(e.cells.values),d=function(t){return t.slice(e.header.values.length,t.length)},m=u(e.header.values);m.length&&!m[0].length&&(m[0]=[""],m=u(m));var g=m.concat(d(a).map(function(){return c((m[0]||[""]).length)})),y=e.domain,v=Math.floor(t._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(t._fullLayout._size.h*(y.y[1]-y.y[0])),_=e.header.values.length?g[0].map(function(){return e.header.height}):[r.emptyHeaderHeight],b=a.length?a[0].map(function(){return e.cells.height}):[],w=_.reduce(l,0),T=p(b,x-w+r.uplift),k=f(p(_,w),[]),A=f(T,k),M={},S=e._fullInput.columnorder;o(S)&&(S=Array.from(S)),S=S.concat(d(a.map(function(t,e){return e})));var E=g.map(function(t,r){var n=o(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1}),C=E.reduce(l,0);E=E.map(function(t){return t/C*v});var I=Math.max(s(e.header.line.width),s(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:y.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-y.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:I,height:x,columnOrder:S,groupHeight:x,rowBlocks:A,headerRowBlocks:k,scrollY:0,cells:n({},e.cells,{values:a}),headerCells:n({},e.header,{values:g}),gdColumns:g.map(function(t){return t[0]}),gdColumnsOriginalOrder:g.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map(function(t,e){var r=M[t];return M[t]=(r||0)+1,{key:t+"__"+M[t],label:t,specIndex:e,xIndex:S[e],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[e]}})};return L.columns.forEach(function(t){t.calcdata=L,t.x=h(t)}),L}}),Tw=f(t=>{var e=D().extendFlat;t.splitToPanels=function(t){var r=[0,0],n=e({},t,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:e({},t.calcdata,{cells:t.calcdata.headerCells})});return[e({},t,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),e({},t,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n]},t.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}}),kw=f((t,e)=>{var r=bw(),n=v(),i=oe(),a=i.numberFormat,o=Xx(),s=Je(),l=Ae(),u=oe().raiseToTop,c=oe().strTranslate,h=oe().cancelTransition,f=ww(),p=Tw(),d=q();function m(t){return Math.ceil(t.calcdata.maxLineWidth/2)}function g(t,e){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+e.key}function y(t,e){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+e.calcdata.key+"_"+e.specIndex}function x(t){return[].concat.apply([],t.map(function(t){return t})).map(function(t){return t.__data__})}function _(t,e,i){var a=t.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each(function(t){var e=t.scrollbarState;e.totalHeight=function(t){var e=t.rowBlocks;return R(e,e.length-1)+(e.length?F(e[e.length-1],1/0):1)}(t),e.scrollableAreaHeight=t.groupHeight-E(t),e.currentlyVisibleHeight=Math.min(e.totalHeight,e.scrollableAreaHeight),e.ratio=e.currentlyVisibleHeight/e.totalHeight,e.barLength=Math.max(e.ratio*e.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),e.barWiggleRoom=e.currentlyVisibleHeight-e.barLength,e.wiggleRoom=Math.max(0,e.totalHeight-e.scrollableAreaHeight),e.topY=0===e.barWiggleRoom?0:t.scrollY/e.wiggleRoom*e.barWiggleRoom,e.bottomY=e.topY+e.barLength,e.dragMultiplier=e.wiggleRoom/e.barWiggleRoom}).attr("transform",function(t){var e=t.width+r.scrollbarWidth/2+r.scrollbarOffset;return c(e,E(t))});var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",function(t){return c(0,t.scrollbarState.topY||0)});var u=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);u.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),u.attr("y2",function(t){return t.scrollbarState.barLength-r.scrollbarWidth/2}).attr("stroke-opacity",function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||i?0:.4}),u.transition().delay(0).duration(0),u.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||I(e,t,null,l(s-o.barLength/2))(r)}).call(n.behavior.drag().origin(function(t){return n.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t}).on("drag",I(e,t)).on("dragend",function(){})),h.attr("y2",function(t){return t.scrollbarState.scrollableAreaHeight}),e._context.staticPlot&&(u.remove(),h.remove())}function b(t,e,i,a){var l=function(t){var e=t.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return e.enter().append("g").classed(r.cn.columnCells,!0),e.exit().remove(),e}(i),u=function(t){var e=t.selectAll("."+r.cn.columnCell).data(p.splitToCells,function(t){return t.keyWithinBlock});return e.enter().append("g").classed(r.cn.columnCell,!0),e.exit().remove(),e}(l);!function(t){t.each(function(t,e){var r=t.calcdata.cells.font,n=t.column.specIndex,i={size:k(r.size,n,e),color:k(r.color,n,e),family:k(r.family,n,e),weight:k(r.weight,n,e),style:k(r.style,n,e),variant:k(r.variant,n,e),textcase:k(r.textcase,n,e),lineposition:k(r.lineposition,n,e),shadow:k(r.shadow,n,e)};t.rowNumber=t.key,t.align=k(t.calcdata.cells.align,n,e),t.cellBorderWidth=k(t.calcdata.cells.line.width,n,e),t.font=i})}(u);var c=function(t){var e=t.selectAll("."+r.cn.cellRect).data(o.repeat,function(t){return t.keyWithinBlock});return e.enter().append("rect").classed(r.cn.cellRect,!0),e}(u);!function(t){t.attr("width",function(t){return t.column.columnWidth}).attr("stroke-width",function(t){return t.cellBorderWidth}).each(function(t){var e=n.select(this);d.stroke(e,k(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),d.fill(e,k(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))})}(c);var h=function(t){var e=t.selectAll("."+r.cn.cellTextHolder).data(o.repeat,function(t){return t.keyWithinBlock});return e.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),e}(u),f=function(t){var e=t.selectAll("."+r.cn.cellText).data(o.repeat,function(t){return t.keyWithinBlock});return e.enter().append("text").classed(r.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){n.event.stopPropagation()}),e}(h);(function(t){t.each(function(t){s.font(n.select(this),t.font)})})(f),w(f,e,a,t),D(u)}function w(t,e,i,o){t.text(function(t){var e=t.column.specIndex,n=t.rowNumber,i=t.value,o="string"==typeof i,s=o&&i.match(/<br>/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var u=function(t){return"string"==typeof t&&t.match(r.latexCheck)}(i);t.latex=u;var c,h,f=u?"":k(t.calcdata.cells.prefix,e,n)||"",p=u?"":k(t.calcdata.cells.suffix,e,n)||"",d=u?null:k(t.calcdata.cells.format,e,n)||null,m=f+(d?a(d)(t.value):t.value)+p;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(c=T(m)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===c?T(m):c),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var g=(" "===r.wrapSplitCharacter?m.replace(/<a href=/gi,"<a_href="):m).split(r.wrapSplitCharacter),y=" "===r.wrapSplitCharacter?g.map(function(t){return t.replace(/<a_href=/gi,"<a href=")}):g;t.fragments=y.map(function(t){return{text:t,width:null}}),t.fragments.push({fragment:r.wrapSpacer,width:null}),h=y.join(r.lineBreaker)+r.lineBreaker+r.wrapSpacer}else delete t.fragments,h=m;return h}).attr("dy",function(t){return t.needsConvertToTspans?0:"0.75em"}).each(function(t){var a=this,s=n.select(a),u=t.wrappingNeeded?P:z;t.needsConvertToTspans?l.convertToTspans(s,o,u(i,a,e,o,t)):n.select(a.parentNode).attr("transform",function(t){return c(O(t),r.cellPad)}).attr("text-anchor",function(t){return{left:"start",center:"middle",right:"end"}[t.align]})})}function T(t){return-1!==t.indexOf(r.wrapSplitCharacter)}function k(t,e,r){if(i.isArrayOrTypedArray(t)){var n=t[Math.min(e,t.length-1)];return i.isArrayOrTypedArray(n)?n[Math.min(r,n.length-1)]:n}return t}function A(t,e,n){t.transition().ease(r.releaseTransitionEase).duration(r.releaseTransitionDuration).attr("transform",c(e.x,n))}function M(t){return"cells"===t.type}function S(t){return"header"===t.type}function E(t){return(t.rowBlocks.length?t.rowBlocks[0].auxiliaryBlocks:[]).reduce(function(t,e){return t+F(e,1/0)},0)}function C(t,e,r){var n=x(e)[0];if(void 0!==n){var i=n.rowBlocks,a=n.calcdata,o=R(i,i.length),s=n.calcdata.groupHeight-E(n),l=a.scrollY=Math.max(0,Math.min(o-s,a.scrollY)),u=function(t,e,r){for(var n=[],i=0,a=0;a<t.length;a++){for(var o=t[a],s=o.rows,l=0,u=0;u<s.length;u++)l+=s[u].rowHeight;o.allRowsHeight=l,e<i+l&&e+r>i&&n.push(a),i+=l}return n}(i,l,s);1===u.length&&(u[0]===i.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),e.each(function(t,e){t.page=u[e],t.scrollY=l}),e.attr("transform",function(t){var e=R(t.rowBlocks,t.page)-t.scrollY;return c(0,e)}),t&&(L(t,r,e,u,n.prevPages,n,0),L(t,r,e,u,n.prevPages,n,1),_(r,t))}}function I(t,e,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter(function(t){return s.key===t.key}),u=i||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+u*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(M);return C(t,h,l),s.scrollY===c}}function L(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});b(t,e,a,r),i[o]=n[o]}))}function P(t,e,i,a){return function(){var o=n.select(e.parentNode);o.each(function(t){var e=t.fragments;o.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var n,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],u=0,c=t.column.columnWidth-2*r.cellPad;for(t.value="";s.length;)u+(i=(n=s.shift()).width+a)>c&&(t.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],u=0),l.push(n.text),u+=i;u&&(t.value+=l.join(r.wrapSpacer)),t.wrapped=!0}),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,t,a),n.select(e.parentNode.parentNode).call(D)}}function z(t,e,i,a,o){return function(){if(!o.settledY){var s=n.select(e.parentNode),l=N(o),u=o.key-l.firstRowIndex,h=l.rows[u].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*r.cellPad:h,p=Math.max(f,h);p-l.rows[u].rowHeight&&(l.rows[u].rowHeight=p,t.selectAll("."+r.cn.columnCell).call(D),C(null,t.filter(M),0),_(i,a,!0)),s.attr("transform",function(){var t=this,e=t.parentNode.getBoundingClientRect(),i=n.select(t.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),s=i.top-e.top+(a?a.matrix.f:r.cellPad);return c(O(o,n.select(t.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)}),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":default:return r.cellPad;case"right":return t.column.columnWidth-(e||0)-r.cellPad;case"center":return(t.column.columnWidth-(e||0))/2}}function D(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+F(e,1/0)},0),r=F(N(t),t.key);return c(0,r+e)}).selectAll("."+r.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(N(t),t.key).rowHeight})}function R(t,e){for(var r=0,n=e-1;n>=0;n--)r+=B(t[n]);return r}function F(t,e){for(var r=0,n=0;n<t.rows.length&&t.rows[n].rowIndex<e;n++)r+=t.rows[n].rowHeight;return r}function B(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n<t.rows.length;n++)r+=t.rows[n].rowHeight;return t.allRowsHeight=r,r}function N(t){return t.rowBlocks[t.page]}e.exports=function(t,e){var i=!t._context.staticPlot,a=t._fullLayout._paper.selectAll("."+r.cn.table).data(e.map(function(e){var r=o.unwrap(e).trace;return f(t,r)}),o.keyFun);a.exit().remove(),a.enter().append("g").classed(r.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),a.attr("width",function(t){return t.width+t.size.l+t.size.r}).attr("height",function(t){return t.height+t.size.t+t.size.b}).attr("transform",function(t){return c(t.translateX,t.translateY)});var l=a.selectAll("."+r.cn.tableControlView).data(o.repeat,o.keyFun),d=l.enter().append("g").classed(r.cn.tableControlView,!0).style("box-sizing","content-box");if(i){var v="onwheel"in document?"wheel":"mousewheel";d.on("mousemove",function(e){l.filter(function(t){return e===t}).call(_,t)}).on(v,function(e){if(!e.scrollbarState.wheeling){e.scrollbarState.wheeling=!0;var r=e.scrollY+n.event.deltaY;I(t,l,null,r)(e)||(n.event.stopPropagation(),n.event.preventDefault()),e.scrollbarState.wheeling=!1}}).call(_,t,!0)}l.attr("transform",function(t){return c(t.size.l,t.size.t)});var w=l.selectAll("."+r.cn.scrollBackground).data(o.repeat,o.keyFun);w.enter().append("rect").classed(r.cn.scrollBackground,!0).attr("fill","none"),w.attr("width",function(t){return t.width}).attr("height",function(t){return t.height}),l.each(function(e){s.setClipUrl(n.select(this),g(t,e),t)});var T=l.selectAll("."+r.cn.yColumn).data(function(t){return t.columns},o.keyFun);T.enter().append("g").classed(r.cn.yColumn,!0),T.exit().remove(),T.attr("transform",function(t){return c(t.x,0)}),i&&T.call(n.behavior.drag().origin(function(e){return A(n.select(this),e,-r.uplift),u(this),e.calcdata.columnDragInProgress=!0,_(l.filter(function(t){return e.calcdata.key===t.key}),t),e}).on("drag",function(t){var e=n.select(this),i=function(e){return(t===e?n.event.x:e.x)+e.columnWidth/2};t.x=Math.max(-r.overdrag,Math.min(t.calcdata.width+r.overdrag-t.columnWidth,n.event.x)),x(T).filter(function(e){return e.calcdata.key===t.calcdata.key}).sort(function(t,e){return i(t)-i(e)}).forEach(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e)}),T.filter(function(e){return t!==e}).transition().ease(r.transitionEase).duration(r.transitionDuration).attr("transform",function(t){return c(t.x,0)}),e.call(h).attr("transform",c(t.x,-r.uplift))}).on("dragend",function(e){var r=n.select(this),i=e.calcdata;e.x=e.xScale(e),e.calcdata.columnDragInProgress=!1,A(r,e,0),function(t,e,r){var n=e.gdColumnsOriginalOrder;e.gdColumns.sort(function(t,e){return r[n.indexOf(t)]-r[n.indexOf(e)]}),e.columnorder=r,t.emit("plotly_restyle")}(t,i,i.columns.map(function(t){return t.xIndex}))})),T.each(function(e){s.setClipUrl(n.select(this),y(t,e),t)});var k=T.selectAll("."+r.cn.columnBlock).data(p.splitToPanels,o.keyFun);k.enter().append("g").classed(r.cn.columnBlock,!0).attr("id",function(t){return t.key}),k.style("cursor",function(t){return t.dragHandle?"ew-resize":t.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var E=k.filter(S),L=k.filter(M);i&&L.call(n.behavior.drag().origin(function(t){return n.event.stopPropagation(),t}).on("drag",I(t,l,-1)).on("dragend",function(){})),b(t,l,E,k),b(t,l,L,k);var P=l.selectAll("."+r.cn.scrollAreaClip).data(o.repeat,o.keyFun);P.enter().append("clipPath").classed(r.cn.scrollAreaClip,!0).attr("id",function(e){return g(t,e)});var z=P.selectAll("."+r.cn.scrollAreaClipRect).data(o.repeat,o.keyFun);z.enter().append("rect").classed(r.cn.scrollAreaClipRect,!0).attr("x",-r.overdrag).attr("y",-r.uplift).attr("fill","none"),z.attr("width",function(t){return t.width+2*r.overdrag}).attr("height",function(t){return t.height+r.uplift}),T.selectAll("."+r.cn.columnBoundary).data(o.repeat,o.keyFun).enter().append("g").classed(r.cn.columnBoundary,!0);var O=T.selectAll("."+r.cn.columnBoundaryClippath).data(o.repeat,o.keyFun);O.enter().append("clipPath").classed(r.cn.columnBoundaryClippath,!0),O.attr("id",function(e){return y(t,e)});var D=O.selectAll("."+r.cn.columnBoundaryRect).data(o.repeat,o.keyFun);D.enter().append("rect").classed(r.cn.columnBoundaryRect,!0).attr("fill","none"),D.attr("width",function(t){return t.columnWidth+2*m(t)}).attr("height",function(t){return t.calcdata.height+2*m(t)+r.uplift}).attr("x",function(t){return-m(t)}).attr("y",function(t){return-m(t)}),C(null,L,l)}}),Aw=f(t=>{var e=_e().getModuleCalcData,r=kw(),n="table";t.name=n,t.plot=function(t){var i=e(t.calcdata,n)[0];i.length&&r(t,i)},t.clean=function(t,e,r,i){var a=i._has&&i._has(n),o=e._has&&e._has(n);a&&!o&&i._paperdiv.selectAll(".table").remove()}}),Mw=f((t,e)=>{e.exports={attributes:vw(),supplyDefaults:xw(),calc:_w(),plot:kw(),moduleType:"trace",name:"table",basePlotModule:Aw(),categories:["noOpacity"],meta:{}}}),Sw=f((t,e)=>{e.exports=Mw()}),Ew=f((t,e)=>{var r=R(),n=V(),i=Ee(),a=Se().descriptionWithDates,o=Lt().overrideAll,s=Pt().dash,l=D().extendFlat;e.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:r({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:i.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:l({},i.labelalias,{editType:"calc"}),tickfont:r({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:a("tick label")},tickformatstops:o(i.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:n.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:l({},s,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:l({},s,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:n.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),Cw=f((t,e)=>{var r=R(),n=Ew(),i=V(),a=r({editType:"calc"}),o=bn().zorder;a.family.dflt='"Open Sans", verdana, arial, sans-serif',a.size.dflt=12,a.color.dflt=i.defaultLine,e.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:n,baxis:n,font:a,color:{valType:"color",dflt:i.defaultLine,editType:"plot"},zorder:o}}),Iw=f((t,e)=>{var r=oe().isArray1D;e.exports=function(t,e,n){var i=n("x"),a=i&&i.length,o=n("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!r(i)||s&&!r(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}}),Lw=f((t,e)=>{var r=Cw(),n=q().addOpacity,i=Ut(),a=oe(),o=Oe(),s=Be(),l=Ne(),u=xi(),c=Qe(),h=tr();e.exports=function(t,e,f){var p=f.letter,d=f.font||{},m=r[p+"axis"];function g(r,n){return a.coerce(t,e,m,r,n)}function y(r,n){return a.coerce2(t,e,m,r,n)}f.name&&(e._name=f.name,e._id=f.name),g("autotypenumbers",f.autotypenumbersDflt);var v=g("type");"-"===v&&(f.data&&function(t,e){if("-"===t.type){var r=t[t._id.charAt(0)+"calendar"];t.type=h(e,r,{autotypenumbers:t.autotypenumbers})}}(e,f.data),"-"===e.type?e.type="linear":v=t.type=e.type),g("smoothing"),g("cheatertype"),g("showticklabels"),g("labelprefix",p+" = "),g("labelsuffix"),g("showtickprefix"),g("showticksuffix"),g("separatethousands"),g("tickformat"),g("exponentformat"),g("minexponent"),g("showexponent"),g("categoryorder"),g("tickmode"),g("tickvals"),g("ticktext"),g("tick0"),g("dtick"),"array"===e.tickmode&&(g("arraytick0"),g("arraydtick")),g("labelpadding"),e._hovertitle=p,"date"===v&&i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",f.calendar),c(e,f.fullLayout),e.c2p=a.identity;var x=g("color",f.dfltColor),_=x===t.color?x:d.color;g("title.text")&&(a.coerceFont(g,"title.font",d,{overrideDflt:{size:a.bigFont(d.size),color:_}}),g("title.offset")),g("tickangle"),g("autorange",!e.isValidRange(t.range))&&g("rangemode"),g("range"),e.cleanRange(),g("fixedrange"),o(t,e,g,v),l(t,e,g,v,f),s(t,e,g,v,f),u(t,e,g,{data:f.data,dataAttr:p});var b=y("gridcolor",n(x,.3)),w=y("gridwidth"),T=y("griddash"),k=g("showgrid");k||(delete e.gridcolor,delete e.gridwidth,delete e.griddash);var A=y("startlinecolor",x),M=y("startlinewidth",w);g("startline",e.showgrid||!!A||!!M)||(delete e.startlinecolor,delete e.startlinewidth);var S=y("endlinecolor",x),E=y("endlinewidth",w);return g("endline",e.showgrid||!!S||!!E)||(delete e.endlinecolor,delete e.endlinewidth),k?(g("minorgridcount"),g("minorgridwidth",w),g("minorgriddash",T),g("minorgridcolor",n(b,.06)),e.minorgridcount||(delete e.minorgridwidth,delete e.minorgriddash,delete e.minorgridcolor)):(delete e.gridcolor,delete e.gridwidth,delete e.griddash),"none"===e.showticklabels&&(delete e.tickfont,delete e.tickangle,delete e.showexponent,delete e.exponentformat,delete e.minexponent,delete e.tickformat,delete e.showticksuffix,delete e.showtickprefix),e.showticksuffix||delete e.ticksuffix,e.showtickprefix||delete e.tickprefix,g("tickmode"),e}}),Pw=f((t,e)=>{var r=Lw(),n=me();e.exports=function(t,e,i,a,o){a("a")||(a("da"),a("a0")),a("b")||(a("db"),a("b0")),function(t,e,i,a){var o=["aaxis","baxis"];o.forEach(function(o){var s=o.charAt(0),l=t[o]||{},u=n.newContainer(e,o),c={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:s+"axis",letter:s,font:e.font,name:o,data:t[s],calendar:e.calendar,dfltColor:a,bgColor:i.paper_bgcolor,autotypenumbersDflt:i.autotypenumbers,fullLayout:i};r(l,u,c),u._categories=u._categories||[],!t[o]&&"-"!==l.type&&(t[o]={type:l.type})})}(t,e,i,o)}}),zw=f((t,e)=>{var r=oe(),n=Iw(),i=Pw(),a=Cw(),o=V();e.exports=function(t,e,s,l){function u(n,i){return r.coerce(t,e,a,n,i)}e._clipPathId="clip"+e.uid+"carpet";var c=u("color",o.defaultLine);r.coerceFont(u,"font",l.font),u("carpet"),i(t,e,l,u,c),e.a&&e.b?(e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0),n(t,e,u)||(e.visible=!1),e._cheater&&u("cheaterslope"),u("zorder")):e.visible=!1}}),Ow=f((t,e)=>{var r=oe().isArrayOrTypedArray;e.exports=function(t,e,n){var i;for(r(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],i=0;i<e.length;i++)t[i]=n(e[i]);return t}}),Dw=f((t,e)=>{e.exports=function(t,e,r){if(0===t.length)return"";var n,i=[],a=r?3:1;for(n=0;n<t.length;n+=a)i.push(t[n]+","+e[n]),r&&n<t.length-a&&(i.push("C"),i.push([t[n+1]+","+e[n+1],t[n+2]+","+e[n+2]+" "].join(" ")));return i.join(r?"":"L")}}),Rw=f((t,e)=>{e.exports=function(t,e,r,n,i,a){var o=i[0]*t.dpdx(e),s=i[1]*t.dpdy(r),l=1,u=1;if(a){var c=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=(i[0]*a[0]+i[1]*a[1])/c/h;u=Math.max(0,f)}var p=180*Math.atan2(s,o)/Math.PI;return p<-90?(p+=180,l=-l):p>90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}}),Fw=f((t,e)=>{var r=v(),n=Je(),i=Ow(),a=Dw(),o=Rw(),s=Ae(),l=oe(),u=l.strRotate,c=l.strTranslate,h=ke();function f(t,e,o,s,l,u,c){var h="const-"+l+"-lines",f=o.selectAll("."+h).data(u);f.enter().append("path").classed(h,!0).style("vector-effect",c?"none":"non-scaling-stroke"),f.each(function(o){var s=o,l=s.x,u=s.y,c=i([],l,t.c2p),h=i([],u,e.c2p),f="M"+a(c,h,s.smoothing);r.select(this).attr("d",f).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")}),f.exit().remove()}function p(t,e,i,a,l,h,f,p){var d=h.selectAll("text."+p).data(f);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each(function(l,h){var f;if("auto"===l.axis.tickangle)f=o(a,e,i,l.xy,l.dxy);else{var p=(l.axis.tickangle+180)*Math.PI/180;f=o(a,e,i,l.xy,[Math.cos(p),Math.sin(p)])}h||(g={angle:f.angle,flip:f.flip});var d=(l.endAnchor?-1:1)*f.flip,y=r.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,t),v=n.bBox(this);y.attr("transform",c(f.p[0],f.p[1])+u(f.angle)+c(l.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)}),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,n,s){var u=t._context.staticPlot,c=e.xaxis,h=e.yaxis,d=t._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each(function(e){var n=r.select(this),s=e[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),_=l.ensureSingle(n,"g","majorlayer"),b=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),f(c,h,_,0,"a",y._gridlines,!0),f(c,h,_,0,"b",v._gridlines,!0),f(c,h,x,0,"a",y._minorgridlines,!0),f(c,h,x,0,"b",v._minorgridlines,!0),f(c,h,b,0,"a-boundary",y._boundarylines,u),f(c,h,b,0,"b-boundary",v._boundarylines,u);var T=p(t,c,h,m,0,w,y._labels,"a-label"),k=p(t,c,h,m,0,w,v._labels,"b-label");(function(t,e,r,n,i,a,s,u){var c,h,f,p,d=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);c=.5*(d+m),h=y,f=r.ab2xy(c,h,!0),p=r.dxyda_rough(c,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,f,r.dxydb_rough(c,h))),g(t,e,r,0,f,p,r.aaxis,i,a,s,"a-title"),c=d,h=.5*(y+v),f=r.ab2xy(c,h,!0),p=r.dxydb_rough(c,h),void 0===u.angle&&l.extendFlat(u,o(r,i,a,f,r.dxyda_rough(c,h))),g(t,e,r,0,f,p,r.baxis,i,a,u,"b-title")})(t,w,m,0,c,h,T,k),function(t,e,r,n,o){var s,u,c,h,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=l.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,m=[];for(h=0;h<d.length;h++)s=d[h],u=i([],s.x,n.c2p),c=i([],s.y,o.c2p),m.push(a(u,c,s.bicubic));var g="M"+m.join("L")+"Z";f.attr("id",t._clipPathId),p.attr("d",g)}(m,s,d,c,h)})};var d=h.LINE_SPACING,m=(1-h.MID_SHIFT)/d+1;function g(t,e,i,a,l,h,f,p,g,y,v){var x=[];f.title.text&&x.push(f.title.text);var _=e.selectAll("text."+v).data(x),b=y.maxExtent;_.enter().append("text").classed(v,!0),_.each(function(){var e=o(i,p,g,l,h);-1===["start","both"].indexOf(f.showticklabels)&&(b=0);var a=f.title.font.size;b+=a+f.title.offset;var v=(y.angle+(y.flip<0?180:0)-e.angle+450)%360,x=v>90&&v<270,_=r.select(this);_.text(f.title.text).call(s.convertToTspans,t),x&&(b=(-s.lineCount(_)+m)*d*a-b),_.attr("transform",c(e.p[0],e.p[1])+u(e.angle)+c(0,b)).attr("text-anchor","middle").call(n.font,f.title.font)}),_.exit().remove()}}),Bw=f((t,e)=>{var r=oe().isArrayOrTypedArray;e.exports=function(t,e,n){var i,a,o,s,l,u=[],c=r(t)?t.length:t,h=r(e)?e.length:e,f=r(t)?t:null,p=r(e)?e:null;f&&(o=(f.length-1)/(f[f.length-1]-f[0])/(c-1)),p&&(s=(p.length-1)/(p[p.length-1]-p[0])/(h-1));var d,m=1/0,g=-1/0;for(a=0;a<h;a++)for(u[a]=[],l=p?(p[a]-p[0])*s:a/(h-1),i=0;i<c;i++)d=(f?(f[i]-f[0])*o:i/(c-1))-l*n,m=Math.min(d,m),g=Math.max(d,g),u[a][i]=d;var y=1/(g-m),v=-m*y;for(a=0;a<h;a++)for(i=0;i<c;i++)u[a][i]=y*u[a][i]+v;return u}}),Nw=f((t,e)=>{var r=oe().isArrayOrTypedArray;function n(t,e){if(!r(t)||e>=10)return null;for(var i=1/0,a=-1/0,o=t.length,s=0;s<o;s++){var l=t[s];if(r(l)){var u=n(l,e+1);u&&(i=Math.min(u[0],i),a=Math.max(u[1],a))}else i=Math.min(l,i),a=Math.max(l,a)}return[i,a]}e.exports=function(t){return n(t,0)}}),jw=f((t,e)=>{var r=rr(),n=D().extendFlat;e.exports=function(t,e,i){var a,o,s,l,u,c,h,f,p,d,m,g,y,v,x=t["_"+e],_=t[e+"axis"],b=_._gridlines=[],w=_._minorgridlines=[],T=_._boundarylines=[],k=t["_"+i],A=t[i+"axis"];"array"===_.tickmode&&(_.tickvals=x.slice());var M=t._xctrl,S=t._yctrl,E=M[0].length,C=M.length,I=t._a.length,L=t._b.length;r.prepTicks(_),"array"===_.tickmode&&delete _.tickvals;var P=_.smoothing?3:1;function z(r){var n,a,o,s,l,u,c,h,p,d,m,g,y=[],v=[],x={};if("b"===e)for(a=t.b2j(r),o=Math.floor(Math.max(0,Math.min(L-2,a))),s=a-o,x.length=L,x.crossLength=I,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n<I;n++)u=Math.min(I-2,n),c=n-u,h=t.evalxy([],n,a),A.smoothing&&n>0&&(p=t.dxydi([],n-1,o,0,s),y.push(l[0]+p[0]/3),v.push(l[1]+p[1]/3),d=t.dxydi([],n-1,o,1,s),y.push(h[0]-d[0]/3),v.push(h[1]-d[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=t.a2i(r),u=Math.floor(Math.max(0,Math.min(I-2,n))),c=n-u,x.length=I,x.crossLength=L,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],u,e,c,r)},a=0;a<L;a++)o=Math.min(L-2,a),s=a-o,h=t.evalxy([],n,a),A.smoothing&&a>0&&(m=t.dxydj([],u,a-1,c,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],u,a-1,c,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=e,x.axis=_,x.crossAxis=A,x.value=r,x.constvar=i,x.index=f,x.x=y,x.y=v,x.smoothing=A.smoothing,x}function O(r){var n,a,o,s,l,u=[],c=[],h={};if(h.length=x.length,h.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(L-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(e){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;n<E;n++)u[n]=M[r*P][n],c[n]=S[r*P][n];else for(a=Math.max(0,Math.min(I-2,r)),s=Math.min(1,Math.max(0,r-a)),h.xy=function(e){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydj([],a,e,s,r)},n=0;n<C;n++)u[n]=M[n][r*P],c[n]=S[n][r*P];return h.axisLetter=e,h.axis=_,h.crossAxis=A,h.value=x[r],h.constvar=i,h.index=r,h.x=u,h.y=c,h.smoothing=A.smoothing,h}if("array"===_.tickmode){for(l=5e-15,c=(u=[Math.floor((x.length-1-_.arraytick0)/_.arraydtick*(1+l)),Math.ceil(-_.arraytick0/_.arraydtick/(1+l))].sort(function(t,e){return t-e}))[0]-1,h=u[1]+1,f=c;f<h;f++)!((o=_.arraytick0+_.arraydtick*f)<0||o>x.length-1)&&b.push(n(O(o),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=c;f<h;f++)if(s=_.arraytick0+_.arraydtick*f,m=Math.min(s+_.arraydtick,x.length-1),!(s<0||s>x.length-1||m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;a<_.minorgridcount;a++)!((v=m-s)<=0)&&!((d=g+(y-g)*(a+1)/(_.minorgridcount+1)*(_.arraydtick/v))<x[0]||d>x[x.length-1])&&w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(O(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(O(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(l=5e-15,c=(u=[Math.floor((x[x.length-1]-_.tick0)/_.dtick*(1+l)),Math.ceil((x[0]-_.tick0)/_.dtick/(1+l))].sort(function(t,e){return t-e}))[0],h=u[1],f=c;f<=h;f++)p=_.tick0+_.dtick*f,b.push(n(z(p),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=c-1;f<h+1;f++)for(p=_.tick0+_.dtick*f,a=0;a<_.minorgridcount;a++)!((d=p+_.dtick*(a+1)/(_.minorgridcount+1))<x[0]||d>x[x.length-1])&&w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(z(x[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(z(x[x.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}}),Uw=f((t,e)=>{var r=rr(),n=D().extendFlat;e.exports=function(t,e){var i,a,o,s=e._labels=[],l=e._gridlines;for(i=0;i<l.length;i++)o=l[i],-1!==["start","both"].indexOf(e.showticklabels)&&(a=r.tickText(e,o.value),n(a,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:o.xy(0),dxy:o.dxy(0,0),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a)),-1!==["end","both"].indexOf(e.showticklabels)&&(a=r.tickText(e,o.value),n(a,{endAnchor:!1,xy:o.xy(o.crossLength-1),dxy:o.dxy(o.crossLength-2,1),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a))}}),Vw=f((t,e)=>{e.exports=function(t,e,r,n){var i,a,o,s=[],l=!!r.smoothing,u=!!n.smoothing,c=t[0].length-1,h=t.length-1;for(i=0,a=[],o=[];i<=c;i++)a[i]=t[0][i],o[i]=e[0][i];for(s.push({x:a,y:o,bicubic:l}),i=0,a=[],o=[];i<=h;i++)a[i]=t[i][c],o[i]=e[i][c];for(s.push({x:a,y:o,bicubic:u}),i=c,a=[],o=[];i>=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}}),qw=f((t,e)=>{var r=oe();e.exports=function(t,e,n){var i,a,o,s=[],l=[],u=t[0].length,c=t.length;function h(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e<u-1&&void 0!==(n=t[r][e+1])&&(a++,i+=n),r>0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r<c-1&&void 0!==(n=t[r+1][e])&&(a++,i+=n),i/Math.max(1,a)}var f=0;for(i=0;i<u;i++)for(a=0;a<c;a++)void 0===t[a][i]&&(s.push(i),l.push(a),t[a][i]=h(i,a)),f=Math.max(f,Math.abs(t[a][i]));if(!s.length)return t;var p,d,m,g,y,v,x,_,b,w,T,k=0,A=0,M=s.length;do{for(k=0,o=0;o<M;o++){i=s[o],a=l[o];var S,E,C,I,L,P,z=0,O=0;0===i?(C=e[L=Math.min(u-1,2)],I=e[1],S=t[a][L],O+=(E=t[a][1])+(E-S)*(e[0]-I)/(I-C),z++):i===u-1&&(C=e[L=Math.max(0,u-3)],I=e[u-2],S=t[a][L],O+=(E=t[a][u-2])+(E-S)*(e[u-1]-I)/(I-C),z++),(0===i||i===u-1)&&a>0&&a<c-1&&(p=n[a+1]-n[a],O+=((d=n[a]-n[a-1])*t[a+1][i]+p*t[a-1][i])/(d+p),z++),0===a?(C=n[P=Math.min(c-1,2)],I=n[1],S=t[P][i],O+=(E=t[1][i])+(E-S)*(n[0]-I)/(I-C),z++):a===c-1&&(C=n[P=Math.max(0,c-3)],I=n[c-2],S=t[P][i],O+=(E=t[c-2][i])+(E-S)*(n[c-1]-I)/(I-C),z++),(0===a||a===c-1)&&i>0&&i<u-1&&(p=e[i+1]-e[i],O+=((d=e[i]-e[i-1])*t[a][i+1]+p*t[a][i-1])/(d+p),z++),z?O/=z:(m=e[i+1]-e[i],g=e[i]-e[i-1],_=(y=n[a+1]-n[a])*(v=n[a]-n[a-1])*(y+v),O=((x=m*g*(m+g))*(v*t[a+1][i]+y*t[a-1][i])+_*(g*t[a][i+1]+m*t[a][i-1]))/(_*(g+m)+x*(v+y))),k+=(w=(b=O-t[a][i])/f)*w,T=z?0:.85,t[a][i]+=b*(1+T)}k=Math.sqrt(k)}while(A++<100&&k>1e-5);return r.log("Smoother converged to",k,"after",A,"iterations"),t}}),Hw=f((t,e)=>{e.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),Gw=f((t,e)=>{e.exports=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,h=(u*u*a-l*l*s)*n,f=u*(l+u)*3,p=l*(l+u)*3;return[[e[0]+(f&&c/f),e[1]+(f&&h/f)],[e[0]-(p&&c/p),e[1]-(p&&h/p)]]}}),Zw=f((t,e)=>{var r=Gw(),n=oe().ensureArray;function i(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}e.exports=function(t,e,a,o,s,l){var u,c,h,f,p,d,m,g,y,v,x=a[0].length,_=a.length,b=s?3*x-2:x,w=l?3*_-2:_;for(t=n(t,w),e=n(e,w),h=0;h<w;h++)t[h]=n(t[h],b),e[h]=n(e[h],b);for(c=0,f=0;c<_;c++,f+=l?3:1)for(p=t[f],d=e[f],m=a[c],g=o[c],u=0,h=0;u<x;u++,h+=s?3:1)p[h]=m[u],d[h]=g[u];if(s)for(c=0,f=0;c<_;c++,f+=l?3:1){for(u=1,h=3;u<x-1;u++,h+=3)y=r([a[c][u-1],o[c][u-1]],[a[c][u],o[c][u]],[a[c][u+1],o[c][u+1]],s),t[f][h-1]=y[0][0],e[f][h-1]=y[0][1],t[f][h+1]=y[1][0],e[f][h+1]=y[1][1];v=i([t[f][0],e[f][0]],[t[f][2],e[f][2]],[t[f][3],e[f][3]]),t[f][1]=v[0],e[f][1]=v[1],v=i([t[f][b-1],e[f][b-1]],[t[f][b-3],e[f][b-3]],[t[f][b-4],e[f][b-4]]),t[f][b-2]=v[0],e[f][b-2]=v[1]}if(l)for(h=0;h<b;h++){for(f=3;f<w-3;f+=3)y=r([t[f-3][h],e[f-3][h]],[t[f][h],e[f][h]],[t[f+3][h],e[f+3][h]],l),t[f-1][h]=y[0][0],e[f-1][h]=y[0][1],t[f+1][h]=y[1][0],e[f+1][h]=y[1][1];v=i([t[0][h],e[0][h]],[t[2][h],e[2][h]],[t[3][h],e[3][h]]),t[1][h]=v[0],e[1][h]=v[1],v=i([t[w-1][h],e[w-1][h]],[t[w-3][h],e[w-3][h]],[t[w-4][h],e[w-4][h]]),t[w-2][h]=v[0],e[w-2][h]=v[1]}if(s&&l)for(f=1;f<w;f+=(f+1)%3==0?2:1){for(h=3;h<b-3;h+=3)y=r([t[f][h-3],e[f][h-3]],[t[f][h],e[f][h]],[t[f][h+3],e[f][h+3]],s),t[f][h-1]=.5*(t[f][h-1]+y[0][0]),e[f][h-1]=.5*(e[f][h-1]+y[0][1]),t[f][h+1]=.5*(t[f][h+1]+y[1][0]),e[f][h+1]=.5*(e[f][h+1]+y[1][1]);v=i([t[f][0],e[f][0]],[t[f][2],e[f][2]],[t[f][3],e[f][3]]),t[f][1]=.5*(t[f][1]+v[0]),e[f][1]=.5*(e[f][1]+v[1]),v=i([t[f][b-1],e[f][b-1]],[t[f][b-3],e[f][b-3]],[t[f][b-4],e[f][b-4]]),t[f][b-2]=.5*(t[f][b-2]+v[0]),e[f][b-2]=.5*(e[f][b-2]+v[1])}return[t,e]}}),Ww=f((t,e)=>{e.exports=function(t,e,r,n,i){var a=e-2,o=r-2;return n&&i?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-p));f*=3,p*=3;var g=d*d,y=g*d,v=1-d,x=v*v,_=x*v,b=m*m,w=b*m,T=1-m,k=T*T,A=k*T;for(h=0;h<t.length;h++)i=_*(c=t[h])[p][f]+3*(x*d*c[p][f+1]+v*g*c[p][f+2])+y*c[p][f+3],s=_*c[p+1][f]+3*(x*d*c[p+1][f+1]+v*g*c[p+1][f+2])+y*c[p+1][f+3],l=_*c[p+2][f]+3*(x*d*c[p+2][f+1]+v*g*c[p+2][f+2])+y*c[p+2][f+3],u=_*c[p+3][f]+3*(x*d*c[p+3][f+1]+v*g*c[p+3][f+2])+y*c[p+3][f+3],e[h]=A*i+3*(k*m*s+T*b*l)+w*u;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-p));f*=3;var g=d*d,y=g*d,v=1-d,x=v*v,_=x*v,b=1-m;for(c=0;c<t.length;c++)i=b*(h=t[c])[p][f]+m*h[p+1][f],s=b*h[p][f+1]+m*h[p+1][f+1],l=b*h[p][f+2]+m*h[p+1][f+1],u=b*h[p][f+3]+m*h[p+1][f+1],e[c]=_*i+3*(x*d*s+v*g*l)+y*u;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-p));p*=3;var g=m*m,y=g*m,v=1-m,x=v*v,_=x*v,b=1-d;for(c=0;c<t.length;c++)i=b*(h=t[c])[p][f]+d*h[p][f+1],s=b*h[p+1][f]+d*h[p+1][f+1],l=b*h[p+2][f]+d*h[p+2][f+1],u=b*h[p+3][f]+d*h[p+3][f+1],e[c]=_*i+3*(x*m*s+v*g*l)+y*u;return e}:function(e,r,n){e||(e=[]);var i,s,l,u,c=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-c)),p=Math.max(0,Math.min(1,n-h)),d=1-p,m=1-f;for(l=0;l<t.length;l++)i=m*(u=t[l])[h][c]+f*u[h][c+1],s=m*u[h+1][c]+f*u[h+1][c+1],e[l]=d*i+p*s;return e}}}),Yw=f((t,e)=>{e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,u,c,h;e||(e=[]),r*=3,n*=3;var f=i*i,p=1-i,d=p*p,m=p*i*2,g=-3*d,y=3*(d-m),v=3*(m-f),x=3*f,_=a*a,b=_*a,w=1-a,T=w*w,k=T*w;for(h=0;h<t.length;h++)o=g*(c=t[h])[n][r]+y*c[n][r+1]+v*c[n][r+2]+x*c[n][r+3],s=g*c[n+1][r]+y*c[n+1][r+1]+v*c[n+1][r+2]+x*c[n+1][r+3],l=g*c[n+2][r]+y*c[n+2][r+1]+v*c[n+2][r+2]+x*c[n+2][r+3],u=g*c[n+3][r]+y*c[n+3][r+1]+v*c[n+3][r+2]+x*c[n+3][r+3],e[h]=k*o+3*(T*a*s+w*_*l)+b*u;return e}:e?function(e,r,n,i,a){var o,s,l,u;e||(e=[]),r*=3;var c=i*i,h=1-i,f=h*h,p=h*i*2,d=-3*f,m=3*(f-p),g=3*(p-c),y=3*c,v=1-a;for(l=0;l<t.length;l++)o=d*(u=t[l])[n][r]+m*u[n][r+1]+g*u[n][r+2]+y*u[n][r+3],s=d*u[n+1][r]+m*u[n+1][r+1]+g*u[n+1][r+2]+y*u[n+1][r+3],e[l]=v*o+a*s;return e}:r?function(e,r,n,i,a){var o,s,l,u,c,h;e||(e=[]),n*=3;var f=a*a,p=f*a,d=1-a,m=d*d,g=m*d;for(c=0;c<t.length;c++)o=(h=t[c])[n][r+1]-h[n][r],s=h[n+1][r+1]-h[n+1][r],l=h[n+2][r+1]-h[n+2][r],u=h[n+3][r+1]-h[n+3][r],e[c]=g*o+3*(m*a*s+d*f*l)+p*u;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c=1-a;for(l=0;l<t.length;l++)o=(u=t[l])[n][r+1]-u[n][r],s=u[n+1][r+1]-u[n+1][r],e[l]=c*o+a*s;return e}}}),Xw=f((t,e)=>{e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,u,c,h;e||(e=[]),r*=3,n*=3;var f=i*i,p=f*i,d=1-i,m=d*d,g=m*d,y=a*a,v=1-a,x=v*v,_=v*a*2,b=-3*x,w=3*(x-_),T=3*(_-y),k=3*y;for(h=0;h<t.length;h++)o=b*(c=t[h])[n][r]+w*c[n+1][r]+T*c[n+2][r]+k*c[n+3][r],s=b*c[n][r+1]+w*c[n+1][r+1]+T*c[n+2][r+1]+k*c[n+3][r+1],l=b*c[n][r+2]+w*c[n+1][r+2]+T*c[n+2][r+2]+k*c[n+3][r+2],u=b*c[n][r+3]+w*c[n+1][r+3]+T*c[n+2][r+3]+k*c[n+3][r+3],e[h]=g*o+3*(m*i*s+d*f*l)+p*u;return e}:e?function(e,r,n,i,a){var o,s,l,u,c,h;e||(e=[]),r*=3;var f=a*a,p=f*a,d=1-a,m=d*d,g=m*d;for(c=0;c<t.length;c++)o=(h=t[c])[n+1][r]-h[n][r],s=h[n+1][r+1]-h[n][r+1],l=h[n+1][r+2]-h[n][r+2],u=h[n+1][r+3]-h[n][r+3],e[c]=g*o+3*(m*a*s+d*f*l)+p*u;return e}:r?function(e,r,n,i,a){var o,s,l,u;e||(e=[]),n*=3;var c=1-i,h=a*a,f=1-a,p=f*f,d=f*a*2,m=-3*p,g=3*(p-d),y=3*(d-h),v=3*h;for(l=0;l<t.length;l++)o=m*(u=t[l])[n][r]+g*u[n+1][r]+y*u[n+2][r]+v*u[n+3][r],s=m*u[n][r+1]+g*u[n+1][r+1]+y*u[n+2][r+1]+v*u[n+3][r+1],e[l]=c*o+i*s;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c=1-i;for(l=0;l<t.length;l++)o=(u=t[l])[n+1][r]-u[n][r],s=u[n+1][r+1]-u[n][r+1],e[l]=c*o+i*s;return e}}}),$w=f((t,e)=>{var r=Hw(),n=Ht().findBin,i=Zw(),a=Ww(),o=Yw(),s=Xw();e.exports=function(t){var e=t._a,l=t._b,u=e.length,c=l.length,h=t.aaxis,f=t.baxis,p=e[0],d=e[u-1],m=l[0],g=l[c-1],y=e[e.length-1]-e[0],v=l[l.length-1]-l[0],x=y*r.RELATIVE_CULL_TOLERANCE,_=v*r.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,m-=_,g+=_,t.isVisible=function(t,e){return t>p&&t<d&&e>m&&e<g},t.isOccluded=function(t,e){return t<p||t>d||e<m||e>g},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=a([t._xctrl,t._yctrl],u,c,h.smoothing,f.smoothing),t.dxydi=o([t._xctrl,t._yctrl],h.smoothing,f.smoothing),t.dxydj=s([t._xctrl,t._yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),r=t[1]-e;return(1-r)*l[e]+r*l[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(n(t,e),u-2)),i=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-i)/(a-i)))},t.b2j=function(t){var e=Math.max(0,Math.min(n(t,l),c-2)),r=l[e],i=l[e+1];return Math.max(0,Math.min(c-1,e+(t-r)/(i-r)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(r,n,i){if(!i&&(r<e[0]||r>e[u-1]|n<l[0]||n>l[c-1]))return[!1,!1];var a=t.a2i(r),o=t.b2j(n),s=t.evalxy([],a,o);if(i){var h,f,p,d,m=0,g=0,y=[];r<e[0]?(h=0,f=0,m=(r-e[0])/(e[1]-e[0])):r>e[u-1]?(h=u-2,f=1,m=(r-e[u-1])/(e[u-1]-e[u-2])):f=a-(h=Math.max(0,Math.min(u-2,Math.floor(a)))),n<l[0]?(p=0,d=0,g=(n-l[0])/(l[1]-l[0])):n>l[c-1]?(p=c-2,d=1,g=(n-l[c-1])/(l[c-1]-l[c-2])):d=o-(p=Math.max(0,Math.min(c-2,Math.floor(o)))),m&&(t.dxydi(y,h,p,f,d),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(t.dxydj(y,h,p,f,d),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(l.length-2,t));return l[e+1]-l[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}}),Jw=f((t,e)=>{var r=rr(),n=oe().isArray1D,i=Bw(),a=Nw(),o=jw(),s=Uw(),l=Vw(),u=Lo(),c=qw(),h=Io(),f=$w();e.exports=function(t,e){var p=r.getFromId(t,e.xaxis),d=r.getFromId(t,e.yaxis),m=e.aaxis,g=e.baxis,y=e.x,v=e.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(e,m,g,"a","b",x);var _=e._a=e._a||e.a,b=e._b=e._b||e.b;y=e._x||e.x,v=e._y||e.y;var w={};if(e._cheater){var T="index"===m.cheatertype?_.length:_,k="index"===g.cheatertype?b.length:b;y=i(T,k,e.cheaterslope)}e._x=y=u(y),e._y=v=u(v),c(y,_,b),c(v,_,b),f(e),e.setScale();var A=a(y),M=a(v),S=.5*(A[1]-A[0]),E=.5*(A[1]+A[0]),C=.5*(M[1]-M[0]),I=.5*(M[1]+M[0]),L=1.3;return A=[E-S*L,E+S*L],M=[I-C*L,I+C*L],e._extremes[p._id]=r.findExtremes(p,A,{padded:!0}),e._extremes[d._id]=r.findExtremes(d,M,{padded:!0}),o(e,"a","b"),o(e,"b","a"),s(e,m),s(e,g),w.clipsegments=l(e._xctrl,e._yctrl,m,g),w.x=y,w.y=v,w.a=_,w.b=b,[w]}}),Kw=f((t,e)=>{e.exports={attributes:Cw(),supplyDefaults:zw(),plot:Fw(),calc:Jw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Ai(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),Qw=f((t,e)=>{e.exports=Kw()}),tT=f((t,e)=>{var r=_n(),n=bn(),i=j(),a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=Ie(),l=D().extendFlat,u=n.marker,c=n.line,h=u.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,angle:u.angle,angleref:u.angleref,standoff:u.standoff,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),zorder:n.zorder}}),eT=f((t,e)=>{var r=oe(),n=xn(),i=Ze(),a=Gn(),o=Zn(),s=Wn(),l=Yn(),u=Xn(),c=tT();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,c,n,i)}p("carpet"),e.xaxis="x",e.yaxis="y";var d=p("a"),m=p("b"),g=Math.min(d.length,m.length);if(g){e._length=g,p("text"),p("texttemplate"),p("hovertext"),p("mode",g<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(e)&&a(t,e,h,f,p,{gradient:!0}),i.hasLines(e)&&(o(t,e,h,f,p,{backoff:!0}),s(t,e,p),p("connectgaps")),i.hasText(e)&&l(t,e,f,p);var y=[];(i.hasMarkers(e)||i.hasText(e))&&(p("marker.maxdisplayed"),y.push("points")),p("fill"),"none"!==e.fill&&(u(t,e,h,p),i.hasLines(e)||s(t,e,p)),("tonext"===e.fill||"toself"===e.fill)&&y.push("fills"),"fills"!==p("hoveron",y.join("+")||"points")&&p("hovertemplate"),p("zorder"),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}),rT=f((t,e)=>{e.exports=function(t,e){var r={},n=e._carpet,i=n.ab2ij([t.a,t.b]),a=Math.floor(i[0]),o=i[0]-a,s=Math.floor(i[1]),l=i[1]-s,u=n.evalxy([],a,s,o,l);return r.yLabel=u[1].toFixed(3),r}}),nT=f((t,e)=>{e.exports=function(t,e){for(var r,n=t._fullData.length,i=0;i<n;i++){var a=t._fullData[i];if(a.index!==e.index&&"carpet"===a.type&&(r||(r=a),a.carpet===e.carpet))return a}return r}}),iT=f((t,e)=>{var r=T(),n=ei(),i=ri(),a=ni(),o=ii().calcMarkerSize,s=nT();e.exports=function(t,e){var l=e._carpetTrace=s(t,e);if(l&&l.visible&&"legendonly"!==l.visible){var u;e.xaxis=l.xaxis,e.yaxis=l.yaxis;var c,h,f=e._length,p=new Array(f),d=!1;for(u=0;u<f;u++)if(c=e.a[u],h=e.b[u],r(c)&&r(h)){var m=l.ab2xy(+c,+h,!0),g=l.isVisible(+c,+h);g||(d=!0),p[u]={x:m[0],y:m[1],a:c,b:h,vis:g}}else p[u]={x:!1,y:!1};return e._needsCull=d,p[0].carpet=l,p[0].trace=e,o(e,f),n(t,e),i(p,e),a(p,e),p}}}),aT=f((t,e)=>{var r=ci(),n=rr(),i=Je();e.exports=function(t,e,a,o){var s,l,u,c=a[0][0].carpet,h=n.getFromId(t,c.xaxis||"x"),f=n.getFromId(t,c.yaxis||"y"),p={xaxis:h,yaxis:f,plot:e.plot};for(s=0;s<a.length;s++)(l=a[s][0].trace)._xA=h,l._yA=f;for(r(t,p,a,o),s=0;s<a.length;s++)l=a[s][0].trace,u=o.selectAll("g.trace"+l.uid+" .js-line"),i.setClipUrl(u,a[s][0].carpet._clipPathId,t)}}),oT=f((t,e)=>{var r=mi(),n=oe().fillText;e.exports=function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,h=u-c;return s.x0=Math.max(Math.min(s.x0,h),c),s.x1=Math.max(Math.min(s.x1,h),c),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var p=s.trace,d=p._carpet,m=p._module.formatLabels(f,p);s.yLabel=m.yLabel,delete s.text;var g=[];if(!p.hovertemplate){var y=(f.hi||p.hoverinfo).split("+");-1!==y.indexOf("all")&&(y=["a","b","text"]),-1!==y.indexOf("a")&&v(d.aaxis,f.a),-1!==y.indexOf("b")&&v(d.baxis,f.b),g.push("y: "+s.yLabel),-1!==y.indexOf("text")&&n(f,p,g),s.extraText=g.join("<br>")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}}),sT=f((t,e)=>{e.exports=function(t,e,r,n,i){var a=n[i];return t.a=a.a,t.b=a.b,t.y=a.y,t}}),lT=f((t,e)=>{e.exports={attributes:tT(),supplyDefaults:eT(),colorbar:hi(),formatLabels:rT(),calc:iT(),plot:aT(),style:pi().style,styleOnSelect:pi().styleOnSelect,hoverPoints:oT(),selectPoints:gi(),eventData:sT(),moduleType:"trace",name:"scattercarpet",basePlotModule:Ai(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),uT=f((t,e)=>{e.exports=lT()}),cT=f((t,e)=>{var r=xo(),n=os(),i=Ie(),a=D().extendFlat,o=n.contours;e.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}),hT=f((t,e)=>{var r=oe(),n=_o(),i=cT(),a=Cs(),o=ls(),s=cs();e.exports=function(t,e,l,u){function c(n,a){return r.coerce(t,e,i,n,a)}if(c("carpet"),t.a&&t.b){if(!n(t,e,c,u,"a","b"))return void(e.visible=!1);c("text"),"constraint"===c("contours.type")?a(t,e,c,u,l,{hasHover:!1}):(o(t,e,c,function(n){return r.coerce2(t,e,i,n)}),s(t,e,c,u,{hasHover:!1}))}else e._defaultColor=l,e._length=null;c("zorder")}}),fT=f((t,e)=>{var r=He(),n=oe(),i=Io(),a=Lo(),o=Po(),s=zo(),l=Oo(),u=hT(),c=nT(),h=fs();e.exports=function(t,e){var f=e._carpetTrace=c(t,e);if(f&&f.visible&&"legendonly"!==f.visible){if(!e.a||!e.b){var p=t.data[f.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var u,c,h,f,p,d,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(e.z)&&i(e,y,v,"a","b",["z"]),u=e._a=e._a||e.a,f=e._b=e._b||e.b,u=u?y.makeCalcdata(e,"_a"):[],f=f?v.makeCalcdata(e,"_b"):[],c=e.a0||0,h=e.da||1,p=e.b0||0,d=e.db||1,m=e._z=a(e._z||e.z,e.transpose),e._emptypoints=s(m),o(m,e._emptypoints);var x=n.maxRowLength(m),_="scaled"===e.xtype?"":u,b=l(e,_,c,h,x,y),w="scaled"===e.ytype?"":f,T=l(e,w,p,d,m.length,v),k={a:b,b:T,z:m};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&r(t,e,{vals:m,containerStr:"",cLetter:"z"}),[k]}(t,e);return h(e,e._z),m}}}),pT=f((t,e)=>{var r=oe().isArrayOrTypedArray;e.exports=function(t,e,n,i){var a,o,s,l,u,c,h,f,p,d,m,g,y,v=r(n)?"a":"b",x=("a"===v?t.aaxis:t.baxis).smoothing,_="a"===v?t.a2i:t.b2j,b="a"===v?n:i,w="a"===v?i:n,T="a"===v?e.a.length:e.b.length,k="a"===v?e.b.length:e.a.length,A=Math.floor("a"===v?t.b2j(w):t.a2i(w)),M="a"===v?function(e){return t.evalxy([],e,A)}:function(e){return t.evalxy([],A,e)};x&&(s=Math.max(0,Math.min(k-2,A)),l=A-s,o="a"===v?function(e,r){return t.dxydi([],e,s,r,l)}:function(e,r){return t.dxydj([],s,e,l,r)});var S=_(b[0]),E=_(b[1]),C=S<E?1:-1,I=1e-8*(E-S),L=C>0?Math.floor:Math.ceil,P=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,O=C>0?Math.max:Math.min,D=L(S+I),R=P(E-I),F=[[h=M(S)]];for(a=D;a*C<R*C;a+=C)u=[],m=O(S,a),y=(g=z(E,a+C))-m,c=Math.max(0,Math.min(T-2,Math.floor(.5*(m+g)))),f=M(g),x&&(p=o(c,m-c),d=o(c,g-c),u.push([h[0]+p[0]/3*y,h[1]+p[1]/3*y]),u.push([f[0]-d[0]/3*y,f[1]-d[1]/3*y])),u.push(f),F.push(u),h=f;return F}}),dT=f((t,e)=>{var r=v(),n=Ow(),i=Dw(),a=Je(),o=oe(),s=gs(),l=ys(),u=ws(),c=ms(),h=_s(),f=xs(),p=bs(),d=nT(),m=pT();function g(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,v,_){var b=e.xaxis,w=e.yaxis;o.makeTraceGroups(_,v,"contour").each(function(v){var _=r.select(this),T=v[0],k=T.trace,A=k._carpetTrace=d(t,k),M=t.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var S=T.a,E=T.b,C=k.contours,I=f(C,e,T),L="constraint"===C.type,P=C._operation,z=L?"="===P?"lines":"fill":C.coloring,O=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];s(I);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);l(I,D,R);var F=I;"constraint"===C.type&&(F=h(I,P)),function(t,e){var r,n,i,a,o,s,l,u,c;for(r=0;r<t.length;r++){for(o=(a=t[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(c=a.edgepaths[n],l=[],i=0;i<c.length;i++)l[i]=e(c[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(c=a.paths[n],u=[],i=0;i<c.length;i++)u[i]=e(c[i]);s.push(u)}}}(I,H);var B,N,j,U,V=[];for(U=M.clipsegments.length-1;U>=0;U--)B=M.clipsegments[U],N=n([],B.x,b.c2p),j=n([],B.y,w.c2p),N.reverse(),j.reverse(),V.push(i(N,j,B.bicubic));var q="M"+V.join("L")+"Z";(function(t,e,r,a,s,l){var u,c,h,f,p=o.ensureSingle(t,"g","contourbg"),d=p.selectAll("path").data("fill"!==l||s?[]:[0]);d.enter().append("path"),d.exit().remove();var m=[];for(f=0;f<e.length;f++)u=e[f],c=n([],u.x,r.c2p),h=n([],u.y,a.c2p),m.push(i(c,h,u.bicubic));d.attr("d","M"+m.join("L")+"Z").style("stroke","none")})(_,M.clipsegments,b,w,L,z),function(t,e,n,i,s,l,u,c,h,f,d){var g="fill"===f;g&&p(s,t.contours);var y=o.ensureSingle(e,"g","contourfill"),v=y.selectAll("path").data(g?s:[]);v.enter().append("path"),v.exit().remove(),v.each(function(t){var e=(t.prefixBoundary?d:"")+function(t,e,r,n,i,s,l,u){var c,h,f,p,d,g,y,v="",x=e.edgepaths.map(function(t,e){return e}),_=!0,b=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function T(t){return Math.abs(t[1]-r[0][1])<w}function k(t){return Math.abs(t[1]-r[2][1])<w}function A(t){return Math.abs(t[0]-r[0][0])<b}function M(t){return Math.abs(t[0]-r[2][0])<b}function S(t,e){var r,n,a,o,c="";for(T(t)&&!M(t)||k(t)&&!A(t)?(o=i.aaxis,a=m(i,s,[t[0],e[0]],.5*(t[1]+e[1]))):(o=i.baxis,a=m(i,s,.5*(t[0]+e[0]),[t[1],e[1]])),r=1;r<a.length;r++)for(c+=o.smoothing?"C":"L",n=0;n<a[r].length;n++){var h=a[r][n];c+=[l.c2p(h[0]),u.c2p(h[1])]+" "}return c}for(c=0,h=null;x.length;){var E=e.edgepaths[c][0];for(h&&(v+=S(h,E)),y=a.smoothopen(e.edgepaths[c].map(n),e.smoothing),v+=_?y:y.replace(/^M/,"L"),x.splice(x.indexOf(c),1),h=e.edgepaths[c][e.edgepaths[c].length-1],d=-1,p=0;p<4;p++){if(!h){o.log("Missing end?",c,e);break}for(T(h)&&!M(h)?f=r[1]:A(h)?f=r[0]:k(h)?f=r[3]:M(h)&&(f=r[2]),g=0;g<e.edgepaths.length;g++){var C=e.edgepaths[g][0];Math.abs(h[0]-f[0])<b?Math.abs(h[0]-C[0])<b&&(C[1]-h[1])*(f[1]-C[1])>=0&&(f=C,d=g):Math.abs(h[1]-f[1])<w?Math.abs(h[1]-C[1])<w&&(C[0]-h[0])*(f[0]-C[0])>=0&&(f=C,d=g):o.log("endpt to newendpt is not vert. or horz.",h,f,C)}if(d>=0)break;v+=S(h,f),h=f}if(d===e.edgepaths.length){o.log("unclosed perimeter path");break}c=d,(_=-1===x.indexOf(c))&&(c=x[0],v+=S(h,f)+"Z",h=null)}for(c=0;c<e.paths.length;c++)v+=a.smoothclosed(e.paths[c].map(n),e.smoothing);return v}(0,t,l,u,c,h,n,i);e?r.select(this).attr("d",e).style("stroke","none"):r.select(this).remove()})}(k,_,b,w,F,O,H,A,M,z,q),function(t,e,n,i,s,l,h){var f=n._context.staticPlot,p=o.ensureSingle(t,"g","contourlines"),d=!1!==s.showlines,m=s.showlabels,v=d&&m,_=u.createLines(p,d||m,e,f),b=u.createLineClip(p,v,n,i.trace.uid),w=t.selectAll("g.contourlabels").data(m?[0]:[]);if(w.exit().remove(),w.enter().append("g").classed("contourlabels",!0),m){var T=l.xaxis,k=l.yaxis,A=T._length,M=k._length,S=[[[0,0],[A,0],[A,M],[0,M]]],E=[];o.clearLocationCache();var C=u.labelFormatter(n,i),I=a.tester.append("text").attr("data-notex",1).call(a.font,s.labelfont),L={left:0,right:A,center:A/2,top:0,bottom:M,middle:M/2},P=Math.sqrt(A*A+M*M),z=c.LABELDISTANCE*P/Math.max(1,e.length/c.LABELINCREASE);_.each(function(t){var e=u.calcTextOpts(t.level,C,I,n);r.select(this).selectAll("path").each(function(r){var n=this,i=o.getVisibleSegment(n,L,e.height/2);if(i&&(function(t,e,r,n,i,a){for(var o,s=0;s<r.pedgepaths.length;s++)e===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(o){var l=i.a[0],u=i.a[i.a.length-1],c=i.b[0],h=i.b[i.b.length-1],f=g(t,0,1),p=g(t,n.total,n.total-1),d=v(o[0],f),m=n.total-v(o[o.length-1],p);n.min<d&&(n.min=d),n.max>m&&(n.max=m),n.len=n.max-n.min}function v(t,e){var r,n=0,o=.1;return(Math.abs(t[0]-l)<o||Math.abs(t[0]-u)<o)&&(r=y(i.dxydb_rough(t[0],t[1],o)),n=Math.max(n,a*x(e,r)/2)),(Math.abs(t[1]-c)<o||Math.abs(t[1]-h)<o)&&(r=y(i.dxyda_rough(t[0],t[1],o)),n=Math.max(n,a*x(e,r)/2)),n}}(n,r,t,i,h,e.height),!(i.len<(e.width+e.height)*c.LABELMIN)))for(var a=Math.min(Math.ceil(i.len/z),c.LABELMAX),s=0;s<a;s++){var l=u.findBestTextLocation(n,i,e,E,L);if(!l)break;u.addLabelData(l,e,E,S)}})}),I.remove(),u.drawLabels(w,E,n,b,v?S:null)}m&&!d&&_.remove()}(_,I,t,T,C,e,A),a.setClipUrl(_,A._clipPathId,t)}function H(t){var e=A.ab2xy(t[0],t[1],!0);return[b.c2p(e[0]),w.c2p(e[1])]}})}}),mT=f((t,e)=>{e.exports={attributes:cT(),supplyDefaults:hT(),colorbar:As(),calc:fT(),plot:dT(),style:ks(),moduleType:"trace",name:"contourcarpet",basePlotModule:Ai(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),gT=f((t,e)=>{e.exports=mT()}),yT=f((t,e)=>{var r=oe().extendFlat,n=bn(),i=Se().axisHoverFormat,a=Pt().dash,o=N(),s=Tl(),l=s.INCREASING.COLOR,u=s.DECREASING.COLOR,c=n.line;function h(t){return{line:{color:r({},c.color,{dflt:t}),width:c.width,dash:a,editType:"style"},editType:"style"}}e.exports={xperiod:n.xperiod,xperiod0:n.xperiod0,xperiodalignment:n.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:r({},c.width,{}),dash:r({},a,{}),editType:"style"},increasing:h(l),decreasing:h(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:r({},o.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:n.zorder}}),vT=f((t,e)=>{var r=Ut(),n=oe();e.exports=function(t,e,i,a){var o=i("x"),s=i("open"),l=i("high"),u=i("low"),c=i("close");if(i("hoverlabel.split"),r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&u&&c){var h=Math.min(s.length,l.length,u.length,c.length);return o&&(h=Math.min(h,n.minRowLength(o))),e._length=h,h}}}),xT=f((t,e)=>{var r=oe(),n=vT(),i=qn(),a=yT();function o(t,e,r,n){r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}e.exports=function(t,e,s,l){function u(n,i){return r.coerce(t,e,a,n,i)}n(t,e,u,l)?(i(t,e,l,u,{x:!0}),u("xhoverformat"),u("yhoverformat"),u("line.width"),u("line.dash"),o(0,e,u,"increasing"),o(0,e,u,"decreasing"),u("text"),u("hovertext"),u("tickwidth"),l._requestRangeslider[e.xaxis]=!0,u("zorder")):e.visible=!1}}),_T=f((t,e)=>{var r=oe(),n=r._,i=rr(),a=ti(),o=k().BADNUM;function s(t,e,r,n){return{o:t,h:e,l:r,c:n}}function l(t,e,a,s,l,u){for(var c=l.makeCalcdata(e,"open"),h=l.makeCalcdata(e,"high"),f=l.makeCalcdata(e,"low"),p=l.makeCalcdata(e,"close"),d=r.isArrayOrTypedArray(e.text),m=r.isArrayOrTypedArray(e.hovertext),g=!0,y=null,v=!!e.xperiodalignment,x=[],_=0;_<s.length;_++){var b=s[_],w=c[_],T=h[_],k=f[_],A=p[_];if(b!==o&&w!==o&&T!==o&&k!==o&&A!==o){A===w?null!==y&&A!==y&&(g=A>y):g=A>w,y=A;var M=u(w,T,k,A);M.pos=b,M.yc=(w+A)/2,M.i=_,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,T],v&&(M.orig_p=a[_]),d&&(M.tx=e.text[_]),m&&(M.htx=e.hovertext[_]),x.push(M)}else x.push({pos:b,empty:!0})}return e._extremes[l._id]=i.findExtremes(l,r.concat(f,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(t,"open:")+" ",high:n(t,"high:")+" ",low:n(t,"low:")+" ",close:n(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var n=i.getFromId(t,e.xaxis),o=i.getFromId(t,e.yaxis),u=function(t,e,n){var i=n._minDiff;if(!i){var o,s=t._fullData,l=[];for(i=1/0,o=0;o<s.length;o++){var u=s[o];if("ohlc"===u.type&&!0===u.visible&&u.xaxis===e._id){l.push(u);var c=e.makeCalcdata(u,"x");u._origX=c;var h=a(n,e,"x",c).vals;u._xcalc=h;var f=r.distinctVals(h).minDiff;f&&isFinite(f)&&(i=Math.min(i,f))}}for(i===1/0&&(i=1),o=0;o<l.length;o++)l[o]._minDiff=i}return i*n.tickwidth}(t,n,e),c=e._minDiff;e._minDiff=null;var h=e._origX;e._origX=null;var f=e._xcalc;e._xcalc=null;var p=l(t,e,h,f,o,s);return e._extremes[n._id]=i.findExtremes(n,f,{vpad:c/2}),p.length?(r.extendFlat(p[0].t,{wHover:c/2,tickLen:u}),p):[{t:{empty:!0}}]},calcCommon:l}}),bT=f((t,e)=>{var r=v(),n=oe();e.exports=function(t,e,i,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;n.makeTraceGroups(a,i,"trace ohlc").each(function(t){var e=r.select(this),i=t[0],a=i.t;if(!0!==i.trace.visible||a.empty)e.remove();else{var u=a.tickLen,c=e.selectAll("path").data(n.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-u,!0),r=s.c2p(t.pos+u,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n})}})}}),wT=f((t,e)=>{var r=v(),n=Je(),i=q();e.exports=function(t,e,a){var o=a||r.select(t).selectAll("g.ohlclayer").selectAll("g.trace");o.style("opacity",function(t){return t[0].trace.opacity}),o.each(function(t){var e=t[0].trace;r.select(this).selectAll("path").each(function(t){if(!t.empty){var a=e[t.dir].line;r.select(this).style("fill","none").call(i.stroke,a.color).call(n.dashLine,a.dash,a.width).style("opacity",e.selectedpoints&&!t.selected?.3:1)}})})}}),TT=f((t,e)=>{var r=rr(),n=oe(),i=Pr(),a=q(),o=oe().fillText,s=Tl(),l={increasing:s.INCREASING.SYMBOL,decreasing:s.DECREASING.SYMBOL};function u(t,e,r,n){var o,s,l=t.cd,u=t.xa,c=l[0].trace,h=l[0].t,f=c.type,p="ohlc"===f?"l":"min",d="ohlc"===f?"h":"max",m=h.bPos||0,g=h.bdPos||h.tickLen,y=h.wHover,v=Math.min(1,g/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function x(t){var r=function(t){return t.pos+m-e}(t);return i.inbox(r-y,r+y,o)}function _(t){var e=t[p],n=t[d];return e===n||i.inbox(e-r,n-r,o)}function b(t){return(x(t)+_(t))/2}o=t.maxHoverDistance-v,s=t.maxSpikeDistance-v;var w=i.getDistanceFunction(n,x,_,b);if(i.getClosest(l,w,t),!1===t.index)return null;var T=l[t.index];if(T.empty)return null;var k=c[T.dir],A=k.line.color;return a.opacity(A)&&k.line.width?t.color=A:t.color=k.fillcolor,t.x0=u.c2p(T.pos+m-g,!0),t.x1=u.c2p(T.pos+m+g,!0),t.xLabelVal=void 0!==T.orig_p?T.orig_p:T.pos,t.spikeDistance=b(T)*s/o,t.xSpike=u.c2p(T.pos,!0),t}function c(t,e,i,a){var o=t.cd,s=t.ya,l=o[0].trace,c=o[0].t,h=[],f=u(t,e,i,a);if(!f)return[];var p=o[f.index].hi||l.hoverinfo,d=p.split("+");if("all"!==p&&-1===d.indexOf("y"))return[];for(var m=["high","open","close","low"],g={},y=0;y<m.length;y++){var v,x=m[y],_=l[x][f.index],b=s.c2p(_,!0);_ in g?(v=g[_]).yLabel+="<br>"+c.labels[x]+r.hoverLabelText(s,_,l.yhoverformat):((v=n.extendFlat({},f)).y0=v.y1=b,v.yLabelVal=_,v.yLabel=c.labels[x]+r.hoverLabelText(s,_,l.yhoverformat),v.name="",h.push(v),g[_]=v)}return h}function h(t,e,n,i){var a=t.cd,s=t.ya,c=a[0].trace,h=a[0].t,f=u(t,e,n,i);if(!f)return[];var p=a[f.index],d=f.index=p.i,m=p.dir;function g(t){return h.labels[t]+r.hoverLabelText(s,c[t][d],c.yhoverformat)}var y=p.hi||c.hoverinfo,v=y.split("+"),x="all"===y,_=x||-1!==v.indexOf("y"),b=x||-1!==v.indexOf("text"),w=_?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return b&&o(p,c,w),f.extraText=w.join("<br>"),f.y0=f.y1=s.c2p(p.yc,!0),[f]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?c(t,e,r,n):h(t,e,r,n)},hoverSplit:c,hoverOnPoints:h}}),kT=f((t,e)=>{e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var l=n[r];e.contains([i.c2p(l.pos+s),a.c2p(l.yc)],null,l.i,t)?(o.push({pointNumber:l.i,x:i.c2d(l.pos),y:a.c2d(l.yc)}),l.selected=1):l.selected=0}return o}}),AT=f((t,e)=>{e.exports={moduleType:"trace",name:"ohlc",basePlotModule:Ai(),categories:["cartesian","svg","showLegend"],meta:{},attributes:yT(),supplyDefaults:xT(),calc:_T().calc,plot:bT(),style:wT(),hoverPoints:TT().hoverPoints,selectPoints:kT()}}),MT=f((t,e)=>{e.exports=AT()}),ST=f((t,e)=>{var r=oe().extendFlat,n=Se().axisHoverFormat,i=yT(),a=ao();function o(t){return{line:{color:r({},a.line.color,{dflt:t}),width:a.line.width,editType:"style"},fillcolor:a.fillcolor,editType:"style"}}e.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:r({},a.line.width,{}),editType:"style"},increasing:o(i.increasing.line.color.dflt),decreasing:o(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:r({},a.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel,zorder:a.zorder}}),ET=f((t,e)=>{var r=oe(),n=q(),i=vT(),a=qn(),o=ST();function s(t,e,r,i){var a=r(i+".line.color");r(i+".line.width",e.line.width),r(i+".fillcolor",n.addOpacity(a,.5))}e.exports=function(t,e,n,l){function u(n,i){return r.coerce(t,e,o,n,i)}i(t,e,u,l)?(a(t,e,l,u,{x:!0}),u("xhoverformat"),u("yhoverformat"),u("line.width"),s(0,e,u,"increasing"),s(0,e,u,"decreasing"),u("text"),u("hovertext"),u("whiskerwidth"),l._requestRangeslider[e.xaxis]=!0,u("zorder")):e.visible=!1}}),CT=f((t,e)=>{var r=oe(),n=rr(),i=ti(),a=_T().calcCommon;function o(t,e,r,n){return{min:r,q1:Math.min(t,n),med:n,q3:Math.max(t,n),max:e}}e.exports=function(t,e){var s=t._fullLayout,l=n.getFromId(t,e.xaxis),u=n.getFromId(t,e.yaxis),c=l.makeCalcdata(e,"x"),h=i(e,l,"x",c).vals,f=a(t,e,c,h,u,o);return f.length?(r.extendFlat(f[0].t,{num:s._numBoxes,dPos:r.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),s._numBoxes++,f):[{t:{empty:!0}}]}}),IT=f((t,e)=>{e.exports={moduleType:"trace",name:"candlestick",basePlotModule:Ai(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:ST(),layoutAttributes:oo(),supplyLayoutDefaults:lo().supplyLayoutDefaults,crossTraceCalc:co().crossTraceCalc,supplyDefaults:ET(),calc:CT(),plot:ho().plot,layerName:"boxlayer",style:fo().style,hoverPoints:TT().hoverPoints,selectPoints:kT()}}),LT=f((t,e)=>{e.exports=IT()}),PT=f((t,e)=>{var r=oe(),n=Qe(),i=r.deg2rad,a=r.rad2deg;e.exports=function(t,e,o){switch(n(t,o),t._id){case"x":case"radialaxis":!function(t,e){var r=e._subplot;t.setGeometry=function(){var e=t._rl[0],n=t._rl[1],i=r.innerRadius,a=(r.radius-i)/(n-e),o=i/a,s=e>n?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var n=t.type;if("linear"===n){var o=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(o(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?a(t):t}(t,e))}}t.makeCalcdata=function(e,r){var n,i,a=e[r],o=e._length,s=function(r){return t.d2c(r,e.thetaunit)};if(a)for(n=new Array(o),i=0;i<o;i++)n[i]=s(a[i]);else{var l=r+"0",u="d"+r,c=l in e?s(e[l]):0,h=e[u]?s(e[u]):(t.period||2*Math.PI)/o;for(n=new Array(o),i=0;i<o;i++)n[i]=c+i*h}return n},t.setGeometry=function(){var o,s,l,u,c=e.sector,h=c.map(i),f={clockwise:-1,counterclockwise:1}[t.direction],p=i(t.rotation),d=function(t){return f*t+p},m=function(t){return(t-p)/f};switch(n){case"linear":s=o=r.identity,u=i,l=a,t.range=r.isFullCircle(h)?[c[0],c[0]+360]:h.map(m).map(a);break;case"category":var g=t._categories.length,y=t.period?Math.max(t.period,g):g;0===y&&(y=1),s=u=function(t){return 2*t*Math.PI/y},o=l=function(t){return t*y/Math.PI/2},t.range=[0,y]}t.c2g=function(t){return d(s(t))},t.g2c=function(t){return o(m(t))},t.t2g=function(t){return d(u(t))},t.g2t=function(t){return l(m(t))}}}(t,e)}}}),zT=f((t,e)=>{e.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}),OT=f((t,e)=>{var r=oe(),n=pn().tester,i=r.findIndexOfMin,a=r.isAngleInsideSector,o=r.angleDelta,s=r.angleDist;function l(t,e,r,n){var i,a,o=n[0],s=n[1],l=c(Math.sin(e)-Math.sin(t)),u=c(Math.cos(e)-Math.cos(t)),h=Math.tan(r),f=c(1/h),p=l/u,d=s-p*o;return f?l&&u?a=h*(i=d/(h-p)):u?(i=s*f,a=s):(i=o,a=o*h):l&&u?(i=0,a=d):u?(i=0,a=s):i=a=NaN,[i,a]}function u(t,e,n,o){return r.isFullCircle([e,n])?function(t,e){var r,n=e.length,i=new Array(n+1);for(r=0;r<n;r++){var a=e[r];i[r]=[t*Math.cos(a),t*Math.sin(a)]}return i[r]=i[0].slice(),i}(t,o):function(t,e,n,o){var u,c,h=o.length,f=[];function p(e){return[t*Math.cos(e),t*Math.sin(e)]}function d(t,e,r){return l(t,e,r,p(t))}function m(t){return r.mod(t,h)}function g(t){return a(t,[e,n])}var y=i(o,function(t){return g(t)?s(t,e):1/0}),v=d(o[y],o[m(y-1)],e);for(f.push(v),u=y,c=0;c<h;u++,c++){var x=o[m(u)];if(!g(x))break;f.push(p(x))}var _=i(o,function(t){return g(t)?s(t,n):1/0}),b=d(o[_],o[m(_+1)],n);return f.push(b),f.push([0,0]),f.push(f[0].slice()),f}(t,e,n,o)}function c(t){return Math.abs(t)>1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a<n;a++){var o=t[a];i[a]=[e+o[0],r-o[1]]}return i}e.exports={isPtInsidePolygon:function(t,e,r,i,o){if(!a(e,i))return!1;var s,l;r[0]<r[1]?(s=r[0],l=r[1]):(s=r[1],l=r[0]);var c=n(u(s,i[0],i[1],o)),h=n(u(l,i[0],i[1],o)),f=[t*Math.cos(e),t*Math.sin(e)];return h.contains(f)&&!c.contains(f)},findPolygonOffset:function(t,e,r,n){for(var i=1/0,a=1/0,o=u(t,e,r,n),s=0;s<o.length;s++){var l=o[s];i=Math.min(i,l[0]),a=Math.min(a,-l[1])}return[i,a]},findEnclosingVertexAngles:function(t,e){var n=i(e,function(e){var r=o(e,t);return r>0?r:1/0}),a=r.mod(n+1,e.length);return[e[n],e[a]]},findIntersectionXY:l,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),u=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[u,e*u+i+n],[c,e*c+i+n]]},clampTiny:c,pathPolygon:function(t,e,r,n,i,a){return"M"+h(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t<e?(s=t,l=e):(s=e,l=t);var c=h(u(s,r,n,i),a,o);return"M"+h(u(l,r,n,i),a,o).reverse().join("L")+"M"+c.join("L")}}}),DT=f((t,e)=>{function r(t){return t<0?-1:t>0?1:0}function n(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function i(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function a(t,e){return e*t.radius}e.exports={smith:n,reactanceArc:function(t,e,r,o){var s=i(t,n([r,e])),l=s[0],u=s[1],c=i(t,n([o,e])),h=c[0],f=c[1];if(0===e)return["M"+l+","+u,"L"+h+","+f].join(" ");var p=a(t,1/Math.abs(e));return["M"+l+","+u,"A"+p+","+p+" 0 0,"+(e<0?1:0)+" "+h+","+f].join(" ")},resistanceArc:function(t,e,o,s){var l=a(t,1/(e+1)),u=i(t,n([e,o])),c=u[0],h=u[1],f=i(t,n([e,s])),p=f[0],d=f[1];if(r(o)!==r(s)){var m=i(t,n([e,0]));return["M"+c+","+h,"A"+l+","+l+" 0 0,"+(0<o?0:1)+" "+m[0]+","+m[1],"A"+l+","+l+" 0 0,"+(s<0?0:1)+p+","+d].join(" ")}return["M"+c+","+h,"A"+l+","+l+" 0 0,"+(s<o?0:1)+" "+p+","+d].join(" ")},smithTransform:i}}),RT=f((t,e)=>{var r=v(),n=O(),i=Ut(),a=oe(),o=a.strRotate,s=a.strTranslate,l=q(),u=Je(),c=we(),h=rr(),f=Qe(),p=PT(),d=er().doAutoRange,m=Sn(),g=cr(),y=Pr(),x=Ke(),_=Mn().prepSelect,b=Mn().selectOnClick,w=Mn().clearOutline,T=hr(),k=Or(),A=en().redrawReglTraces,M=ke().MID_SHIFT,S=zT(),E=OT(),C=DT(),I=C.smith,L=C.reactanceArc,P=C.resistanceArc,z=C.smithTransform,D=a._,R=a.mod,F=a.deg2rad,B=a.rad2deg;function N(t,e,r){this.isSmith=r||!1,this.id=e,this.gd=t,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var n=t._fullLayout,i="clip"+n._uid+e;this.clipIds.forTraces=i+"-for-traces",this.clipPaths.forTraces=n._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=n["_"+(r?"smith":"polar")+"layer"].append("g").attr("class",e),this.getHole=function(t){return this.isSmith?0:t.hole},this.getSector=function(t){return this.isSmith?[0,360]:t.sector},this.getRadial=function(t){return this.isSmith?t.realaxis:t.radialaxis},this.getAngular=function(t){return this.isSmith?t.imaginaryaxis:t.angularaxis},r||(this.radialTickLayout=null,this.angularTickLayout=null)}var j=N.prototype;function U(t){var e=t.ticks+String(t.ticklen)+String(t.showticklabels);return"side"in t&&(e+=t.side),e}function V(t,e){return e[a.findIndexOfMin(e,function(e){return a.angleDist(t,e)})]}function H(t,e,r){return e?(t.attr("display",null),t.attr(r)):t&&t.attr("display","none"),t}e.exports=function(t,e,r){return new N(t,e,r)},j.plot=function(t,e){for(var r=this,n=e[r.id],i=!1,a=0;a<t.length;a++)if(!1===t[a][0].trace.cliponaxis){i=!0;break}r._hasClipOnAxisFalse=i,r.updateLayers(e,n),r.updateLayout(e,n),c.generalUpdatePerTraceModule(r.gd,r,t,n),r.updateFx(e,n),r.isSmith&&(delete n.realaxis.range,delete n.imaginaryaxis.range)},j.updateLayers=function(t,e){var n=this,i=n.isSmith,a=n.layers,o=n.getRadial(e),s=n.getAngular(e),l=S.layerNames,u=l.indexOf("frontplot"),c=l.slice(0,u),h="below traces"===s.layer,f="below traces"===o.layer;h&&c.push("angular-line"),f&&c.push("radial-line"),h&&c.push("angular-axis"),f&&c.push("radial-axis"),c.push("frontplot"),h||c.push("angular-line"),f||c.push("radial-line"),h||c.push("angular-axis"),f||c.push("radial-axis");var p=(i?"smith":"polar")+"sublayer",d=n.framework.selectAll("."+p).data(c,String);d.enter().append("g").attr("class",function(t){return p+" "+t}).each(function(t){var e=a[t]=r.select(this);switch(t){case"frontplot":i||e.append("g").classed("barlayer",!0),e.append("g").classed("scatterlayer",!0);break;case"backplot":e.append("g").classed("maplayer",!0);break;case"plotbg":a.bg=e.append("path");break;case"radial-grid":case"angular-grid":e.style("fill","none");break;case"radial-line":e.append("line").style("fill","none");break;case"angular-line":e.append("path").style("fill","none")}}),d.order()},j.updateLayout=function(t,e){var r=this,n=r.layers,i=t._size,a=r.getRadial(e),o=r.getAngular(e),c=e.domain.x,h=e.domain.y;r.xOffset=i.l+i.w*c[0],r.yOffset=i.t+i.h*(1-h[1]);var f=r.xLength=i.w*(c[1]-c[0]),p=r.yLength=i.h*(h[1]-h[0]),d=r.getSector(e);r.sectorInRad=d.map(F);var m,g,y,v,x,_=r.sectorBBox=function(t){var e,r,n,i,a=t[0],o=t[1],s=o-a,l=R(a,360),u=l+s,c=Math.cos(F(l)),h=Math.sin(F(l)),f=Math.cos(F(u)),p=Math.sin(F(u));return i=l<=90&&u>=90||l>90&&u>=450?1:h<=0&&p<=0?0:Math.max(h,p),e=l<=180&&u>=180||l>180&&u>=540?-1:c>=0&&f>=0?0:Math.min(c,f),r=l<=270&&u>=270||l>270&&u>=630?-1:h>=0&&p>=0?0:Math.min(h,p),n=u>=360?1:c<=0&&f<=0?0:Math.max(c,f),[e,r,n,i]}(d),b=_[2]-_[0],w=_[3]-_[1],T=p/f,k=Math.abs(w/b);T>k?(m=f,x=(p-(g=f*k))/i.h/2,y=[c[0],c[1]],v=[h[0]+x,h[1]-x]):(g=p,x=(f-(m=p/k))/i.w/2,y=[c[0]+x,c[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var A,M=r.xOffset2=i.l+i.w*y[0],S=r.yOffset2=i.t+i.h*(1-v[1]),E=r.radius=m/b,C=r.innerRadius=r.getHole(e)*E,I=r.cx=M-E*_[0],L=r.cy=S+E*_[3],P=r.cxx=I-M,z=r.cyy=L-S,O=a.side;"counterclockwise"===O?(A=O,O="top"):"clockwise"===O&&(A=O,O="bottom"),r.radialAxis=r.mockAxis(t,e,a,{_id:"x",side:O,_trueSide:A,domain:[C/i.w,E/i.w]}),r.angularAxis=r.mockAxis(t,e,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(t,e),r.updateAngularAxis(t,e),r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.xaxis=r.mockCartesianAxis(t,e,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(t,e,{_id:"y",domain:v});var D=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",D).attr("transform",s(P,z)),n.frontplot.attr("transform",s(M,S)).call(u.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",D).attr("transform",s(I,L)).call(l.fill,e.bgcolor)},j.mockAxis=function(t,e,r,n){var i=a.extendFlat({},r,n);return p(i,e,t),i},j.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);f(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*a,t[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},j.doAutoRange=function(t,e){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(e);d(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]<i._rl[1]?i._rl[1]=Math.min(i._rl[1],l):i._rl[0]=Math.min(i._rl[0],l)}},j.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,u=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,d=r.getRadial(e),m=R(r.getSector(e)[0],360),g=r.radialAxis,y=c<u,v=r.isSmith;v||(r.fillViewInitialKey("radialaxis.angle",d.angle),r.fillViewInitialKey("radialaxis.range",g.range.slice()),g.setGeometry()),"auto"===g.tickangle&&m>90&&m<=270&&(g.tickangle=180);var x=v?function(t){var e=z(r,I([t.x,0]));return s(e[0]-f,e[1]-p)}:function(t){return s(g.l2p(t.x)+c,0)},_=v?function(t){return P(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+c)},b=U(d);if(r.radialTickLayout!==b&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=b),y){g.setScale();var w=0,T=v?(g.tickvals||[]).filter(function(t){return t>=0}).map(function(t){return h.tickText(g,t,!0,!1)}):h.calcTicks(g),k=v?T:h.clipEnds(g,T),A=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(A=-A),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,A),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?B(V(F(d.angle),r.vangles)):d.angle,S=s(f,p),E=S+o(-M);H(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:E}),H(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),H(i["radial-line"].select("line"),y&&d.showline,{x1:v?-u:c,y1:0,x2:u,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},j.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(e),c=n.id+"title",h=0;if(l.title){var f=u.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,d=l.side;h="top"===d?p:"counterclockwise"===d?-(f+.4*p):f+.8*p}var m=void 0!==r?r:n.radialAxisAngle,g=F(m),y=Math.cos(g),v=Math.sin(g),_=o+a/2*y+h*v,b=s-a/2*v+h*y;n.layers["radial-axis-title"]=x.draw(i,c,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:D(i,"Click to enter radial axis title"),attributes:{x:_,y:b,"text-anchor":"middle"},transform:{rotate:-m}})}},j.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,u=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(t){var e=z(r,I([0,t.x]));return Math.atan2(e[0]-f,e[1]-p)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=B(m.tick0),m.dtick=B(m.dtick));var v=function(t){return s(f+u*Math.cos(t),p-u*Math.sin(t))},x=g?function(t){var e=z(r,I([0,t.x]));return s(e[0],e[1])}:function(t){return v(y(t))},_=g?function(t){var e=z(r,I([0,t.x])),n=Math.atan2(e[0]-f,e[1]-p)-Math.PI/2;return s(e[0],e[1])+o(-B(n))}:function(t){var e=y(t);return v(e)+o(-B(e))},b=g?function(t){return L(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+c*r,p-c*n]+"L"+[f+u*r,p-u*n]},w=h.makeLabelFns(m,0).labelStandoff,T={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},k=U(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var A,S=g?[1/0].concat(m.tickvals||[]).map(function(t){return h.tickText(m,t,!0,!1)}):h.calcTicks(m);if(g&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===e.gridshape?(A=S.map(y),a.angleDelta(A[0],A[1])<0&&(A=A.slice().reverse())):A=null,r.vangles=A,"category"===m.type&&(S=S.filter(function(t){return a.isAngleInsideSector(y(t),r.sectorInRad)})),m.visible){var E="inside"===m.ticks?-1:1,C=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+E*C+",0h"+E*m.ticklen,transFn:_,crisp:!1}),h.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}H(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:s(f,p)}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},j.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},j.updateHoverAndMainDrag=function(t){var e,o,l=this,u=l.isSmith,c=l.gd,h=l.layers,f=t._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,v=l.radius,x=l.innerRadius,T=l.cx,k=l.cy,A=l.cxx,M=l.cyy,C=l.sectorInRad,I=l.vangles,L=l.radialAxis,P=E.clampTiny,z=E.findXYatLength,O=E.findEnclosingVertexAngles,D=S.cornerHalfWidth,R=S.cornerLen/2,F=m.makeDragger(h,"path","maindrag",!1===t.dragmode?"none":"crosshair");r.select(F).attr("d",l.pathSubplot()).attr("transform",s(T,k)),F.onmousemove=function(t){y.hover(c,t,l.id),c._fullLayout._lasthover=F,c._fullLayout._hoversubplot=l.id},F.onmouseout=function(t){c._dragging||g.unhover(c,t)};var B,N,j,U,V,q,H,G,Z,W={element:F,gd:c,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Y(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Y(t-A,e-M)}function $(t,e){return Math.atan2(M-e,t-A)}function J(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function K(t,e){if(0===t)return l.pathSector(2*D);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,v)),o=a-D,s=a+D;return"M"+J(o,n)+"A"+[o,o]+" 0,0,0 "+J(o,i)+"L"+J(s,i)+"A"+[s,s]+" 0,0,1 "+J(s,n)+"Z"}function Q(t,e,r){if(0===t)return l.pathSector(2*D);var n,i,a=J(t,e),o=J(t,r),s=P((a[0]+o[0])/2),u=P((a[1]+o[1])/2);if(s&&u){var c=u/s,h=-1/c,f=z(D,c,s,u);n=z(R,h,f[0][0],f[0][1]),i=z(R,h,f[1][0],f[1][1])}else{var p,d;u?(p=R,d=D):(p=D,d=R),n=[[s-p,u-d],[s+p,u-d]],i=[[s-p,u+d],[s+p,u+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,v),x),t<d?t=0:v-t<d?t=v:e<d?e=0:v-e<d&&(e=v),Math.abs(e-t)>p?(t<e?(j=t,U=e):(j=e,U=t),!0):(j=null,U=null,!1)}function et(t,e){t=t||V,e=e||"M0,0Z",G.attr("d",t),Z.attr("d",e),m.transitionZoombox(G,Z,q,H),q=!0;var r={};ot(r),c.emit("plotly_relayouting",r)}function rt(t,r){var n,i,a=B+(t*=e),s=N+(r*=o),u=X(B,N),c=Math.min(X(a,s),v),h=$(B,N);tt(u,c)&&(n=V+l.pathSector(U),j&&(n+=l.pathSector(j)),i=K(j,h)+K(U,h)),et(n,i)}function nt(t,e,r,n){var i=E.findIntersectionXY(r,n,r,[t-A,M-e]);return Y(i[0],i[1])}function it(t,e){var r,n,i=B+t,a=N+e,o=$(B,N),s=$(i,a),u=O(o,I),c=O(s,I);tt(nt(B,N,u[0],u[1]),Math.min(nt(i,a,c[0],c[1]),v))&&(r=V+l.pathSector(U),j&&(r+=l.pathSector(j)),n=[Q(j,u[0],u[1]),Q(U,u[0],u[1])].join(" ")),et(r,n)}function at(){if(m.removeZoombox(c),null!==j&&null!==U){var t={};ot(t),m.showDoubleClickNotifier(c),i.call("_guiRelayout",c,t)}}function ot(t){var e=L._rl,r=(e[1]-e[0])/(1-x/v)/v,n=[e[0]+(j-x)*r,e[0]+(U-x)*r];t[l.id+".radialaxis.range"]=n}function st(t,e){var r=c._fullLayout.clickmode;if(m.removeZoombox(c),2===t){var n={};for(var a in l.viewInitial)n[l.id+"."+a]=l.viewInitial[a];c.emit("plotly_doubleclick",null),i.call("_guiRelayout",c,n)}r.indexOf("select")>-1&&1===t&&b(e,c,[l.xaxis],[l.yaxis],l.id,W),r.indexOf("event")>-1&&y.click(c,e,l.id)}W.prepFn=function(t,r,i){var s=c._fullLayout.dragmode,h=F.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var p=c._fullLayout._invTransform;e=c._fullLayout._invScaleX,o=c._fullLayout._invScaleY;var d=a.apply3DTransform(p)(r-h.left,i-h.top);if(B=d[0],N=d[1],I){var g=E.findPolygonOffset(v,C[0],C[1],I);B+=A+g[0],N+=M+g[1]}switch(s){case"zoom":W.clickFn=st,u||(W.moveFn=I?it:rt,W.doneFn=at,function(){j=null,U=null,V=l.pathSubplot(),q=!1;var t=c._fullLayout[l.id];H=n(t.bgcolor).getLuminance(),(G=m.makeZoombox(f,H,T,k,V)).attr("fill-rule","evenodd"),Z=m.makeCorners(f,T,k),w(c)}());break;case"select":case"lasso":_(t,r,i,W,s)}},g.init(W)},j.updateRadialDrag=function(t,e,n){var l=this,u=l.gd,c=l.layers,h=l.radius,f=l.innerRadius,p=l.cx,d=l.cy,y=l.radialAxis,v=S.radialDragBoxSize,x=v/2;if(y.visible){var _,b,T,M=F(l.radialAxisAngle),E=y._rl,C=E[0],I=E[1],L=E[n],P=.75*(E[1]-E[0])/(1-l.getHole(e))/h;n?(_=p+(h+x)*Math.cos(M),b=d-(h+x)*Math.sin(M),T="radialdrag"):(_=p+(f-x)*Math.cos(M),b=d-(f-x)*Math.sin(M),T="radialdrag-inner");var z,O,D,R=m.makeRectDragger(c,T,"crosshair",-x,-x,v,v),N={element:R,gd:u};!1===t.dragmode&&(N.dragmode=!1),H(r.select(R),y.visible&&f<h,{transform:s(_,b)}),N.prepFn=function(){z=null,O=null,D=null,N.moveFn=j,N.doneFn=U,w(u)},N.clampFn=function(t,e){return Math.sqrt(t*t+e*e)<S.MINDRAG&&(t=0,e=0),[t,e]},g.init(N)}function j(t,e){if(z)z(t,e);else{var r=[t,-e],i=[Math.cos(M),Math.sin(M)],o=Math.abs(a.dot(r,i)/Math.sqrt(a.dot(r,r)));isNaN(o)||(z=o<.5?q:G)}var s={};(function(t){null!==O?t[l.id+".radialaxis.angle"]=O:null!==D&&(t[l.id+".radialaxis.range["+n+"]"]=D)})(s),u.emit("plotly_relayouting",s)}function U(){null!==O?i.call("_guiRelayout",u,l.id+".radialaxis.angle",O):null!==D&&i.call("_guiRelayout",u,l.id+".radialaxis.range["+n+"]",D)}function q(t,e){if(0!==n){var r=_+t,i=b+e;O=Math.atan2(d-i,r-p),l.vangles&&(O=V(O,l.vangles)),O=B(O);var a=s(p,d)+o(-O);c["radial-axis"].attr("transform",a),c["radial-line"].select("line").attr("transform",a);var u=l.gd._fullLayout,h=u[l.id];l.updateRadialAxisTitle(u,h,O)}}function G(t,e){var r=a.dot([t,-e],[Math.cos(M),Math.sin(M)]);if(D=L-P*r,P>0==(n?D>C:D<I)){var o=u._fullLayout,s=o[l.id];y.range[n]=D,y._rl[n]=D,l.updateRadialAxis(o,s),l.xaxis.setRange(),l.xaxis.setScale(),l.yaxis.setRange(),l.yaxis.setScale();var c=!1;for(var h in l.traceHash){var f=l.traceHash[h],p=a.filterVisible(f);f[0][0].trace._module.plot(u,l,p,s),i.traceIs(h,"gl")&&p.length&&(c=!0)}c&&(k(u),A(u))}else D=null}},j.updateAngularDrag=function(t){var e=this,n=e.gd,l=e.layers,c=e.radius,h=e.angularAxis,f=e.cx,p=e.cy,d=e.cxx,y=e.cyy,v=S.angularDragBoxSize,x=m.makeDragger(l,"path","angulardrag",!1===t.dragmode?"none":"move"),_={element:x,gd:n};function b(t,e){return Math.atan2(y+v-e,t-d-v)}!1===t.dragmode?_.dragmode=!1:r.select(x).attr("d",e.pathAnnulus(c,c+v)).attr("transform",s(f,p)).call(T,"move");var M,E,C,I,L,P,z=l.frontplot.select(".scatterlayer").selectAll(".trace"),O=z.selectAll(".point"),D=z.selectAll(".textpoint");function R(c,m){var g=e.gd._fullLayout,v=g[e.id],x=b(M+c*t._invScaleX,E+m*t._invScaleY),_=B(x-P);if(I=C+_,l.frontplot.attr("transform",s(e.xOffset2,e.yOffset2)+o([-_,d,y])),e.vangles){L=e.radialAxisAngle+_;var w=s(f,p)+o(-_),T=s(f,p)+o(-L);l.bg.attr("transform",w),l["radial-grid"].attr("transform",w),l["radial-axis"].attr("transform",T),l["radial-line"].select("line").attr("transform",T),e.updateRadialAxisTitle(g,v,L)}else e.clipPaths.forTraces.select("path").attr("transform",s(d,y)+o(_));O.each(function(){var t=r.select(this),e=u.getTranslate(t);t.attr("transform",s(e.x,e.y)+o([_]))}),D.each(function(){var t=r.select(this),e=t.select("text"),n=u.getTranslate(t);t.attr("transform",o([_,e.attr("x"),e.attr("y")])+s(n.x,n.y))}),h.rotation=a.modHalf(I,360),e.updateAngularAxis(g,v),e._hasClipOnAxisFalse&&!a.isFullCircle(e.sectorInRad)&&z.call(u.hideOutsideRangePoints,e);var S=!1;for(var R in e.traceHash)if(i.traceIs(R,"gl")){var N=e.traceHash[R],j=a.filterVisible(N);N[0][0].trace._module.plot(n,e,j,v),j.length&&(S=!0)}S&&(k(n),A(n));var U={};F(U),n.emit("plotly_relayouting",U)}function F(t){t[e.id+".angularaxis.rotation"]=I,e.vangles&&(t[e.id+".radialaxis.angle"]=L)}function N(){D.select("text").attr("transform",null);var t={};F(t),i.call("_guiRelayout",n,t)}_.prepFn=function(r,i,o){var s=t[e.id];C=s.angularaxis.rotation;var l=x.getBoundingClientRect();M=i-l.left,E=o-l.top,n._fullLayout._calcInverseTransform(n);var u=a.apply3DTransform(t._invTransform)(M,E);M=u[0],E=u[1],P=b(M,E),_.moveFn=R,_.doneFn=N,w(n)},e.vangles&&!a.isFullCircle(e.sectorInRad)&&(_.prepFn=a.noop,T(r.select(x),null)),g.init(_)},j.isPtInside=function(t){if(this.isSmith)return!0;var e=this.sectorInRad,r=this.vangles,n=this.angularAxis.c2g(t.theta),i=this.radialAxis,o=i.c2l(t.r),s=i._rl;return(r?E.isPtInsidePolygon:a.isPtInsideSector)(o,n,s,e,r)},j.pathArc=function(t){var e=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathArc)(t,e[0],e[1],r)},j.pathSector=function(t){var e=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathSector)(t,e[0],e[1],r)},j.pathAnnulus=function(t,e){var r=this.sectorInRad,n=this.vangles;return(n?E.pathPolygonAnnulus:a.pathAnnulus)(t,e,r[0],r[1],n)},j.pathSubplot=function(){var t=this.innerRadius,e=this.radius;return t?this.pathAnnulus(t,e):this.pathSector(e)},j.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}}),FT=f((t,e)=>{var r=V(),n=Ee(),i=wa().attributes,a=oe().extendFlat,o=Lt().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,ticklabelstep:n.ticklabelstep,showticklabels:n.showticklabels,labelalias:n.labelalias,minorloglabels:n.minorloglabels,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,layer:n.layer},"plot","from-root"),u={visible:a({},n.visible,{dflt:!0}),type:a({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},autorange:a({},n.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:a({},n.minallowed,{editType:"plot"}),maxallowed:a({},n.maxallowed,{editType:"plot"}),range:a({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:n.categoryorder,categoryarray:n.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:n.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:a({},n.title.text,{editType:"plot",dflt:""}),font:a({},n.title.font,{editType:"plot"}),editType:"plot"},hoverformat:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(u,s,l);var c={visible:a({},n.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:n.autotypenumbers,categoryorder:n.categoryorder,categoryarray:n.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(c,s,l),e.exports={domain:i({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:r.background},radialaxis:u,angularaxis:c,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),BT=f((t,e)=>{var r=oe(),n=q(),i=me(),a=Vs(),o=_e().getSubplotData,s=Oe(),l=De(),u=Be(),c=Ne(),h=xi(),f=_i(),p=nr(),d=tr(),m=FT(),g=PT(),y=zT(),v=y.axisNames;function x(t,e,a,d){var x=a("bgcolor");d.bgColor=n.combine(x,d.paper_bgcolor);var b=a("sector");a("hole");var w,T=o(d.fullData,y.name,d.id),k=d.layoutOut;function A(t,e){return a(w+"."+t,e)}for(var M=0;M<v.length;M++){w=v[M],r.isPlainObject(t[w])||(t[w]={});var S=t[w],E=i.newContainer(e,w);E._id=E._name=w,E._attr=d.id+"."+w,E._traceIndices=T.map(function(t){return t.index});var C=y.axisName2dataArray[w],I=_(S,E,A,T,C,d);h(S,E,A,{axData:T,dataAttr:C});var L=A("visible");switch(g(E,e,k),A("uirevision",e.uirevision),E._m=1,w){case"radialaxis":A("minallowed"),A("maxallowed");var P,z=A("range"),O=E.getAutorangeDflt(z),D=A("autorange",O);z&&(null===z[0]&&null===z[1]||(null===z[0]||null===z[1])&&("reversed"===D||!0===D)||null!==z[0]&&("min"===D||"max reversed"===D)||null!==z[1]&&("max"===D||"min reversed"===D))&&(z=void 0,delete E.range,E.autorange=!0,P=!0),P||(D=A("autorange",O=E.getAutorangeDflt(z))),S.autorange=D,D&&(p(A,D,z),("linear"===I||"-"===I)&&A("rangemode"),E.isReversed()&&(E._m=-1)),E.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if("date"===I){r.log("Polar plots do not support date angular axes yet.");for(var R=0;R<T.length;R++)T[R].visible=!1;I=S.type=E.type="linear"}A("linear"===I?"thetaunit":"period");var F=A("direction");A("rotation",{counterclockwise:0,clockwise:90}[F])}if(c(S,E,A,E.type,{tickSuffixDflt:"degrees"===E.thetaunit?"°":void 0}),L){var B,N,j,U,V,q,H,G,Z,W,Y=d.font||{};N=(B=A("color"))===S.color?B:Y.color,j=Y.size,U=Y.family,V=Y.weight,q=Y.style,H=Y.variant,G=Y.textcase,Z=Y.lineposition,W=Y.shadow,s(S,E,A,E.type),u(S,E,A,E.type,{font:{weight:V,style:q,variant:H,textcase:G,lineposition:Z,shadow:W,color:N,size:j,family:U},noAutotickangles:"angularaxis"===w,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(S,E,A,{outerTicks:!0}),f(S,E,A,{dfltColor:B,bgColor:d.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:m[w]}),A("layer"),"radialaxis"===w&&(A("side"),A("angle",b[0]),A("title.text"),r.coerceFont(A,"title.font",{weight:V,style:q,variant:H,textcase:G,lineposition:Z,shadow:W,color:N,size:r.bigFont(j),family:U}))}"category"!==I&&A("hoverformat"),E._input=S}"category"===e.angularaxis.type&&a("gridshape")}function _(t,e,r,n,i,a){var o=r("autotypenumbers",a.autotypenumbersDflt);if("-"===r("type")){for(var s,l=0;l<n.length;l++)if(n[l].visible){s=n[l];break}s&&s[i]&&(e.type=d(s[i],"gregorian",{noMultiCategory:!0,autotypenumbers:o})),"-"===e.type?e.type="linear":t.type=e.type}return e.type}e.exports=function(t,e,r){a(t,e,r,{type:y.name,attributes:m,handleDefaults:x,font:e.font,autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,fullData:r,layoutOut:e})}}),NT=f((t,e)=>{var r=_e().getSubplotCalcData,n=oe().counterRegex,i=RT(),a=zT(),o=a.attr,s=a.name,l=n(s),u={};u[o]={valType:"subplotid",dflt:s,editType:"calc"},e.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:u,layoutAttributes:FT(),supplyLayoutDefaults:BT(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,a=e._subplots[s],o=0;o<a.length;o++){var l=a[o],u=r(n,s,l),c=e[l]._subplot;c||(c=i(t,l),e[l]._subplot=c),c.plot(u,e,t._promises)}},clean:function(t,e,r,n){for(var i=n._subplots[s]||[],a=n._has&&n._has("gl"),o=e._has&&e._has("gl"),l=a&&!o,u=0;u<i.length;u++){var c=i[u],h=n[c]._subplot;if(!e[c]&&h)for(var f in h.framework.remove(),h.layers["radial-axis-title"].remove(),h.clipPaths)h.clipPaths[f].remove();l&&h._scene&&(h._scene.destroy(),h._scene=null)}},toSVG:Ai().toSVG}}),jT=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=D().extendFlat,a=_n(),o=bn(),s=j(),l=o.line;e.exports={mode:o.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:n({editType:"plot"},{keys:["r","theta","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a(),hoverinfo:i({},s.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:o.hoveron,hovertemplate:r(),selected:o.selected,unselected:o.unselected}}),UT=f((t,e)=>{var r=oe(),n=Ze(),i=Gn(),a=Zn(),o=Wn(),s=Yn(),l=Xn(),u=xn().PTS_LINESONLY,c=jT();function h(t,e,n,i){var a,o=i("r"),s=i("theta");if(r.isTypedArray(o)&&(e.r=o=Array.from(o)),r.isTypedArray(s)&&(e.theta=s=Array.from(s)),o)s?a=Math.min(o.length,s.length):(a=o.length,i("theta0"),i("dtheta"));else{if(!s)return 0;a=e.theta.length,i("r0"),i("dr")}return e._length=a,a}e.exports={handleRThetaDefaults:h,supplyDefaults:function(t,e,f,p){function d(n,i){return r.coerce(t,e,c,n,i)}var m=h(0,e,0,d);if(m){d("thetaunit"),d("mode",m<u?"lines+markers":"lines"),d("text"),d("hovertext"),"fills"!==e.hoveron&&d("hovertemplate"),n.hasMarkers(e)&&i(t,e,f,p,d,{gradient:!0}),n.hasLines(e)&&(a(t,e,f,p,d,{backoff:!0}),o(t,e,d),d("connectgaps")),n.hasText(e)&&(d("texttemplate"),s(t,e,p,d));var g=[];(n.hasMarkers(e)||n.hasText(e))&&(d("cliponaxis"),d("marker.maxdisplayed"),g.push("points")),d("fill"),"none"!==e.fill&&(l(t,e,f,d),n.hasLines(e)||o(t,e,d)),("tonext"===e.fill||"toself"===e.fill)&&g.push("fills"),d("hoveron",g.join("+")||"points"),r.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}}}),VT=f((t,e)=>{var r=oe(),n=rr();e.exports=function(t,e,i){var a,o,s={},l=i[e.subplot]._subplot;l?(a=l.radialAxis,o=l.angularAxis):(a=(l=i[e.subplot]).radialaxis,o=l.angularaxis);var u=a.c2l(t.r);s.rLabel=n.tickText(a,u,!0).text;var c="degrees"===o.thetaunit?r.rad2deg(t.theta):t.theta;return s.thetaLabel=n.tickText(o,c,!0).text,s}}),qT=f((t,e)=>{var r=T(),n=k().BADNUM,i=rr(),a=ei(),o=ri(),s=ni(),l=ii().calcMarkerSize;e.exports=function(t,e){for(var u=t._fullLayout,c=e.subplot,h=u[c].radialaxis,f=u[c].angularaxis,p=h.makeCalcdata(e,"r"),d=f.makeCalcdata(e,"theta"),m=e._length,g=new Array(m),y=0;y<m;y++){var v=p[y],x=d[y],_=g[y]={};r(v)&&r(x)?(_.r=v,_.theta=x):_.r=n}var b=l(e,m);return e._extremes.x=i.findExtremes(h,p,{ppad:b}),a(t,e),o(g,e),s(g,e),g}}),HT=f((t,e)=>{var r=ci(),n=k().BADNUM;e.exports=function(t,e,i){for(var a=e.layers.frontplot.select("g.scatterlayer"),o=e.xaxis,s=e.yaxis,l={xaxis:o,yaxis:s,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},u=e.radialAxis,c=e.angularAxis,h=0;h<i.length;h++)for(var f=i[h],p=0;p<f.length;p++){0===p&&(f[0].trace._xA=o,f[0].trace._yA=s);var d=f[p],m=d.r;if(m===n)d.x=d.y=n;else{var g=u.c2g(m),y=c.c2g(d.theta);d.x=g*Math.cos(y),d.y=g*Math.sin(y)}}r(t,l,i,a)}}),GT=f((t,e)=>{var r=mi();function n(t,e,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="r",a._hovertitle="θ";var o={};o[e.subplot]={_subplot:r};var s=e._module.formatLabels(t,e,o);n.rLabel=s.rLabel,n.thetaLabel=s.thetaLabel;var l=t.hi||e.hoverinfo,u=[];function c(t,e){u.push(t._hovertitle+": "+e)}if(!e.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["r","theta","text"]),-1!==h.indexOf("r")&&c(i,n.rLabel),-1!==h.indexOf("theta")&&c(a,n.thetaLabel),-1!==h.indexOf("text")&&n.text&&(u.push(n.text),delete n.text),n.extraText=u.join("<br>")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:n}}),ZT=f((t,e)=>{e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:NT(),categories:["polar","symbols","showLegend","scatter-like"],attributes:jT(),supplyDefaults:UT().supplyDefaults,colorbar:hi(),formatLabels:VT(),calc:qT(),plot:HT(),style:pi().style,styleOnSelect:pi().styleOnSelect,hoverPoints:GT().hoverPoints,selectPoints:gi(),meta:{}}}),WT=f((t,e)=>{e.exports=ZT()}),YT=f((t,e)=>{var r=jT(),n=Yg(),i=Ot().texttemplateAttrs;e.exports={mode:r.mode,r:r.r,theta:r.theta,r0:r.r0,dr:r.dr,theta0:r.theta0,dtheta:r.dtheta,thetaunit:r.thetaunit,text:r.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:r.hovertext,hovertemplate:r.hovertemplate,line:{color:n.line.color,width:n.line.width,dash:n.line.dash,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,fill:n.fill,fillcolor:n.fillcolor,textposition:n.textposition,textfont:n.textfont,hoverinfo:r.hoverinfo,selected:r.selected,unselected:r.unselected}}),XT=f((t,e)=>{var r=oe(),n=Ze(),i=UT().handleRThetaDefaults,a=Gn(),o=Zn(),s=Yn(),l=Xn(),u=xn().PTS_LINESONLY,c=YT();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,c,n,i)}var d=i(t,e,f,p);d?(p("thetaunit"),p("mode",d<u?"lines+markers":"lines"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),n.hasMarkers(e)&&a(t,e,h,f,p,{noAngleRef:!0,noStandOff:!0}),n.hasLines(e)&&(o(t,e,h,f,p),p("connectgaps")),n.hasText(e)&&(p("texttemplate"),s(t,e,f,p,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),p("fill"),"none"!==e.fill&&l(t,e,h,p),r.coerceSelectionMarkerOpacity(e,p)):e.visible=!1}}),$T=f((t,e)=>{var r=VT();e.exports=function(t,e,n){var i=t.i;return"r"in t||(t.r=e._r[i]),"theta"in t||(t.theta=e._theta[i]),r(t,e,n)}}),JT=f((t,e)=>{var r=ei(),n=ii().calcMarkerSize,i=yy(),a=rr(),o=Wg().TOO_MANY_POINTS;e.exports=function(t,e){var s=t._fullLayout,l=e.subplot,u=s[l].radialaxis,c=s[l].angularaxis,h=e._r=u.makeCalcdata(e,"r"),f=e._theta=c.makeCalcdata(e,"theta"),p=e._length,d={};p<h.length&&(h=h.slice(0,p)),p<f.length&&(f=f.slice(0,p)),d.r=h,d.theta=f,r(t,e);var m,g=d.opts=i.style(t,e);return p<o?m=n(e,p):g.marker&&(m=2*(g.marker.sizeAvg||Math.max(g.marker.size,3))),e._extremes.x=a.findExtremes(u,h,{ppad:m}),[{x:!1,y:!1,t:d,trace:e}]}}),KT=f((t,e)=>{var r=Zg(),n=GT().makeHoverPointText;e.exports={hoverPoints:function(t,e,i,a){var o=t.cd[0].t,s=o.r,l=o.theta,u=r.hoverPoints(t,e,i,a);if(u&&!1!==u[0].index){var c=u[0];if(void 0===c.index)return u;var h=t.subplot,f=c.cd[c.index],p=c.trace;if(f.r=s[c.index],f.theta=l[c.index],h.isPtInside(f))return c.xLabelVal=void 0,c.yLabelVal=void 0,n(f,p,h,c),u}}}}),QT=f((t,e)=>{e.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:NT(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:YT(),supplyDefaults:XT(),colorbar:hi(),formatLabels:$T(),calc:JT(),hoverPoints:KT().hoverPoints,selectPoints:by(),meta:{}}}),tk=f((t,e)=>{var r=sy(),n=T(),i=Mx(),a=vy(),o=yy(),s=oe(),l=Wg().TOO_MANY_POINTS;e.exports=function(t,e,u){if(u.length){var c=e.radialAxis,h=e.angularAxis,f=a(t,e);return u.forEach(function(i){if(i&&i[0]&&i[0].trace){var a,u=i[0],p=u.trace,d=u.t,m=p._length,g=d.r,y=d.theta,v=d.opts,x=g.slice(),_=y.slice();for(a=0;a<g.length;a++)e.isPtInside({r:g[a],theta:y[a]})||(x[a]=NaN,_[a]=NaN);var b=new Array(2*m),w=Array(m),T=Array(m);for(a=0;a<m;a++){var k,A,M=x[a];if(n(M)){var S=c.c2g(M),E=h.c2g(_[a],p.thetaunit);k=S*Math.cos(E),A=S*Math.sin(E)}else k=A=NaN;w[a]=b[2*a]=k,T[a]=b[2*a+1]=A}d.tree=r(b),v.marker&&m>=l&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=b),v.line&&b.length>1&&s.extendFlat(v.line,o.linePositions(t,p,b)),v.text&&(s.extendFlat(v.text,{positions:b},o.textPosition(t,p,v.text,v.marker)),s.extendFlat(v.textSel,{positions:b},o.textPosition(t,p,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:b},o.textPosition(t,p,v.text,v.markerUnsel))),v.fill&&!f.fill2d&&(f.fill2d=!0),v.marker&&!f.scatter2d&&(f.scatter2d=!0),v.line&&!f.line2d&&(f.line2d=!0),v.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(v.line),f.fillOptions.push(v.fill),f.markerOptions.push(v.marker),f.markerSelectedOptions.push(v.markerSel),f.markerUnselectedOptions.push(v.markerUnsel),f.textOptions.push(v.text),f.textSelectedOptions.push(v.textSel),f.textUnselectedOptions.push(v.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=y,d.positions=b,d._scene=f,d.index=f.count,f.count++}}),i(t,e,u)}},e.exports.reglPrecompiled={}}),ek=f((t,e)=>{var r=QT();r.plot=tk(),e.exports=r}),rk=f((t,e)=>{e.exports=ek()}),nk=f((t,e)=>{var r,n=Ot().hovertemplateAttrs,i=D().extendFlat,a=jT(),o=qa();e.exports={r:a.r,theta:a.theta,r0:a.r0,dr:a.dr,theta0:a.theta0,dtheta:a.dtheta,thetaunit:a.thetaunit,base:i({},o.base,{}),offset:i({},o.offset,{}),width:i({},o.width,{}),text:i({},o.text,{}),hovertext:i({},o.hovertext,{}),marker:(r=i({},o.marker),delete r.cornerradius,r),hoverinfo:a.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}}),ik=f((t,e)=>{e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),ak=f((t,e)=>{var r=oe(),n=UT().handleRThetaDefaults,i=Ga(),a=nk();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}n(t,e,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(t,e,l,o,s),r.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}}),ok=f((t,e)=>{var r=oe(),n=ik();e.exports=function(t,e,i){var a,o={};function s(i,o){return r.coerce(t[a]||{},e[a],n,i,o)}for(var l=0;l<i.length;l++){var u=i[l];"barpolar"===u.type&&!0===u.visible&&(o[a=u.subplot]||(s("barmode"),s("bargap"),o[a]=1))}}}),sk=f((t,e)=>{var r=Me().hasColorscale,n=He(),i=oe().isArrayOrTypedArray,a=Ya(),o=oi().setGroupPositions,s=ni(),l=Ut().traceIs,u=oe().extendFlat;e.exports={calc:function(t,e){for(var o=t._fullLayout,l=e.subplot,u=o[l].radialaxis,c=o[l].angularaxis,h=u.makeCalcdata(e,"r"),f=c.makeCalcdata(e,"theta"),p=e._length,d=new Array(p),m=h,g=f,y=0;y<p;y++)d[y]={p:g[y],s:m[y]};function v(t){var r=e[t];void 0!==r&&(e["_"+t]=i(r)?c.makeCalcdata(e,t):c.d2c(r,e.thetaunit))}return"linear"===c.type&&(v("width"),v("offset")),r(e,"marker")&&n(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),r(e,"marker.line")&&n(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(d,e),s(d,e),d},crossTraceCalc:function(t,e,r){for(var n=t.calcdata,i=[],a=0;a<n.length;a++){var s=n[a],c=s[0].trace;!0===c.visible&&l(c,"bar")&&c.subplot===r&&i.push(s)}var h=u({},e.radialaxis,{_id:"x"}),f=e.angularaxis;o(t,f,h,i,{mode:e.barmode,norm:e.barnorm,gap:e.bargap,groupgap:e.bargroupgap})}}}),lk=f((t,e)=>{var r=v(),n=T(),i=oe(),a=Je(),o=OT();e.exports=function(t,e,s){var l=t._context.staticPlot,u=e.xaxis,c=e.yaxis,h=e.radialAxis,f=e.angularAxis,p=function(t){var e=t.cxx,r=t.cyy;return t.vangles?function(n,a,s,l){var u,c;i.angleDelta(s,l)>0?(u=s,c=l):(u=l,c=s);var h=[o.findEnclosingVertexAngles(u,t.vangles)[0],(u+c)/2,o.findEnclosingVertexAngles(c,t.vangles)[1]];return o.pathPolygonAnnulus(n,a,u,c,h,e,r)}:function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),d=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(d,s,"trace bars").each(function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each(function(t){var e,a=r.select(this),o=t.rp0=h.c2p(t.s0),s=t.rp1=h.c2p(t.s1),l=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(n(o)&&n(s)&&n(l)&&n(d)&&o!==s&&l!==d){var m=h.c2g(t.s1),g=(l+d)/2;t.ct=[u.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],e=p(o,s,l,d)}else e="M0,0Z";i.ensureSingle(a,"path").attr("d",e)}),a.setClipUrl(o,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)})}}),uk=f((t,e)=>{var r=Pr(),n=oe(),i=to().getTraceColor,a=n.fillText,o=GT().makeHoverPointText,s=OT().isPtInsidePolygon;e.exports=function(t,e,l){var u=t.cd,c=u[0].trace,h=t.subplot,f=h.radialAxis,p=h.angularAxis,d=h.vangles,m=d?s:n.isPtInsideSector,g=t.maxHoverDistance,y=p._period||2*Math.PI,v=Math.abs(f.g2p(Math.sqrt(e*e+l*l))),x=Math.atan2(l,e);if(f.range[0]>f.range[1]&&(x+=Math.PI),r.getClosest(u,function(t){return m(v,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0},t),!1!==t.index){var _=u[t.index];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var b=n.extendFlat({},_,{r:_.s,theta:_.p});return a(_,c,t),o(b,c,h,t),t.hovertemplate=c.hovertemplate,t.color=i(c,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}}),ck=f((t,e)=>{e.exports={moduleType:"trace",name:"barpolar",basePlotModule:NT(),categories:["polar","bar","showLegend"],attributes:nk(),layoutAttributes:ik(),supplyDefaults:ak(),supplyLayoutDefaults:ok(),calc:sk().calc,crossTraceCalc:sk().crossTraceCalc,plot:lk(),colorbar:hi(),formatLabels:VT(),style:Ka().style,styleOnSelect:Ka().styleOnSelect,hoverPoints:uk(),selectPoints:ro(),meta:{}}}),hk=f((t,e)=>{e.exports=ck()}),fk=f((t,e)=>{e.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),pk=f((t,e)=>{var r=V(),n=Ee(),i=wa().attributes,a=oe().extendFlat,o=Lt().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);e.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:u,imaginaryaxis:c,editType:"calc"}}),dk=f((t,e)=>{var r,n,i,a=oe(),o=q(),s=me(),l=Vs(),u=_e().getSubplotData,c=Ne(),h=Be(),f=_i(),p=Qe(),d=pk(),m=fk(),g=m.axisNames,y=(r=function(t){return a.isTypedArray(t)&&(t=Array.from(t)),t.slice().reverse().map(function(t){return-t}).concat([0]).concat(t)},n=String,i={},function(t){var e=n?n(t):t;if(e in i)return i[e];var a=r(t);return i[e]=a,a});function v(t,e,r,n){var i=r("bgcolor");n.bgColor=o.combine(i,n.paper_bgcolor);var l,v=u(n.fullData,m.name,n.id),x=n.layoutOut;function _(t,e){return r(l+"."+t,e)}for(var b=0;b<g.length;b++){l=g[b],a.isPlainObject(t[l])||(t[l]={});var w=t[l],T=s.newContainer(e,l);T._id=T._name=l,T._attr=n.id+"."+l,T._traceIndices=v.map(function(t){return t.index});var k=_("visible");if(T.type="linear",p(T,x),c(w,T,_,T.type),k){var A="realaxis"===l;A&&_("side"),A?_("tickvals"):_("tickvals",y(e.realaxis.tickvals||d.realaxis.tickvals.dflt)),a.isTypedArray(T.tickvals)&&(T.tickvals=Array.from(T.tickvals));var M,S,E,C,I=n.font||{};k&&(S=(M=_("color"))===w.color?M:I.color,E=I.size,C=I.family),h(w,T,_,T.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!A,noExp:!0,font:{color:S,size:E,family:C}}),a.coerce2(t,e,d,l+".ticklen"),a.coerce2(t,e,d,l+".tickwidth"),a.coerce2(t,e,d,l+".tickcolor",e.color),_("ticks")||(delete e[l].ticklen,delete e[l].tickwidth,delete e[l].tickcolor),f(w,T,_,{dfltColor:M,bgColor:n.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:d[l]}),_("layer")}_("hoverformat"),delete T.type,T._input=w}}e.exports=function(t,e,r){l(t,e,r,{noUirevision:!0,type:m.name,attributes:d,handleDefaults:v,font:e.font,paper_bgcolor:e.paper_bgcolor,fullData:r,layoutOut:e})}}),mk=f((t,e)=>{var r=_e().getSubplotCalcData,n=oe().counterRegex,i=RT(),a=fk(),o=a.attr,s=a.name,l=n(s),u={};u[o]={valType:"subplotid",dflt:s,editType:"calc"},e.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:u,layoutAttributes:pk(),supplyLayoutDefaults:dk(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,a=e._subplots[s],o=0;o<a.length;o++){var l=a[o],u=r(n,s,l),c=e[l]._subplot;c||(c=i(t,l,!0),e[l]._subplot=c),c.plot(u,e,t._promises)}},clean:function(t,e,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a],l=n[o]._subplot;if(!e[o]&&l)for(var u in l.framework.remove(),l.clipPaths)l.clipPaths[u].remove()}},toSVG:Ai().toSVG}}),gk=f((t,e)=>{var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=D().extendFlat,a=_n(),o=bn(),s=j(),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:n({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a(),hoverinfo:i({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:r(),selected:o.selected,unselected:o.unselected}}),yk=f((t,e)=>{var r=oe(),n=Ze(),i=Gn(),a=Zn(),o=Wn(),s=Yn(),l=Xn(),u=xn().PTS_LINESONLY,c=gk();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,c,n,i)}var d=function(t,e,n,i){var a,o=i("real"),s=i("imag");return o&&s&&(a=Math.min(o.length,s.length)),r.isTypedArray(o)&&(e.real=o=Array.from(o)),r.isTypedArray(s)&&(e.imag=s=Array.from(s)),e._length=a,a}(0,e,0,p);if(d){p("mode",d<u?"lines+markers":"lines"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),n.hasMarkers(e)&&i(t,e,h,f,p,{gradient:!0}),n.hasLines(e)&&(a(t,e,h,f,p,{backoff:!0}),o(t,e,p),p("connectgaps")),n.hasText(e)&&(p("texttemplate"),s(t,e,f,p));var m=[];(n.hasMarkers(e)||n.hasText(e))&&(p("cliponaxis"),p("marker.maxdisplayed"),m.push("points")),p("fill"),"none"!==e.fill&&(l(t,e,h,p),n.hasLines(e)||o(t,e,p)),("tonext"===e.fill||"toself"===e.fill)&&m.push("fills"),p("hoveron",m.join("+")||"points"),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}),vk=f((t,e)=>{var r=rr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot;return i.realLabel=r.tickText(a.radialAxis,t.real,!0).text,i.imagLabel=r.tickText(a.angularAxis,t.imag,!0).text,i}}),xk=f((t,e)=>{var r=T(),n=k().BADNUM,i=ei(),a=ri(),o=ni(),s=ii().calcMarkerSize;e.exports=function(t,e){for(var l=t._fullLayout,u=e.subplot,c=l[u].realaxis,h=l[u].imaginaryaxis,f=c.makeCalcdata(e,"real"),p=h.makeCalcdata(e,"imag"),d=e._length,m=new Array(d),g=0;g<d;g++){var y=f[g],v=p[g],x=m[g]={};r(y)&&r(v)?(x.real=y,x.imag=v):x.real=n}return s(e,d),i(t,e),a(m,e),o(m,e),m}}),_k=f((t,e)=>{var r=ci(),n=k().BADNUM,i=DT().smith;e.exports=function(t,e,a){for(var o=e.layers.frontplot.select("g.scatterlayer"),s=e.xaxis,l=e.yaxis,u={xaxis:s,yaxis:l,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},c=0;c<a.length;c++)for(var h=a[c],f=0;f<h.length;f++){0===f&&(h[0].trace._xA=s,h[0].trace._yA=l);var p=h[f],d=p.real;if(d===n)p.x=p.y=n;else{var m=i([d,p.imag]);p.x=m[0],p.y=m[1]}}r(t,u,a,o)}}),bk=f((t,e)=>{var r=mi();function n(t,e,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="real",a._hovertitle="imag";var o={};o[e.subplot]={_subplot:r};var s=e._module.formatLabels(t,e,o);n.realLabel=s.realLabel,n.imagLabel=s.imagLabel;var l=t.hi||e.hoverinfo,u=[];function c(t,e){u.push(t._hovertitle+": "+e)}if(!e.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["real","imag","text"]),-1!==h.indexOf("real")&&c(i,n.realLabel),-1!==h.indexOf("imag")&&c(a,n.imagLabel),-1!==h.indexOf("text")&&n.text&&(u.push(n.text),delete n.text),n.extraText=u.join("<br>")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:n}}),wk=f((t,e)=>{e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:mk(),categories:["smith","symbols","showLegend","scatter-like"],attributes:gk(),supplyDefaults:yk(),colorbar:hi(),formatLabels:vk(),calc:xk(),plot:_k(),style:pi().style,styleOnSelect:pi().styleOnSelect,hoverPoints:bk().hoverPoints,selectPoints:gi(),meta:{}}}),Tk=f((t,e)=>{e.exports=wk()}),kk=f((t,e)=>{var r=ky();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}r(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),r(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day(),"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(t){for(;o<t.minMonth;)a--,o+=t.monthsInYear(a);for(var e=t.monthsInYear(a);o>e-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return("y"===r||"m"===r)&&(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return l.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(l.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,t.calendar().local.name);return t}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(t,e,r);return this._validateLevel--,i}catch(t){throw this._validateLevel--,t}}}),s.prototype=new o,r(s.prototype,{name:"Gregorian",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==0&&(t%100!=0||t%400==0)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25),n=1524+(r=e+1+r-Math.floor(r/4)),i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var l=e.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}),Ak=f(()=>{var t=ky(),e=kk();t(e.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),e.local=e.regionalOptions[""],t(e.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),t(e.baseCalendar.prototype,{UNIX_EPOCH:e.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:e.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,r,n){if("string"!=typeof t&&(n=r,r=t,t=""),!r)return"";if(r.calendar()!==this)throw e.local.invalidFormat||e.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var i=(n=n||{}).dayNamesShort||this.local.dayNamesShort,a=n.dayNames||this.local.dayNames,o=n.monthNumbers||this.local.monthNumbers,s=n.monthNamesShort||this.local.monthNamesShort,l=n.monthNames||this.local.monthNames,u=(n.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n<t.length&&t.charAt(x+n)===e;)n++;return x+=n-1,Math.floor(n/(r||1))>1}),c=function(t,e,r,n){var i=""+e;if(u(t,n))for(;i.length<r;)i="0"+i;return i},h=function(t,e,r,n){return u(t)?n[e]:r[e]},f=this,p=function(t){return"function"==typeof o?o.call(f,t,u("m")):g(c("m",t.month(),2))},d=function(t,e){return e?"function"==typeof l?l.call(f,t):l[t.month()-f.minMonth]:"function"==typeof s?s.call(f,t):s[t.month()-f.minMonth]},m=this.local.digits,g=function(t){return n.localNumbers&&m?m(t):t},y="",v=!1,x=0;x<t.length;x++)if(v)"'"!==t.charAt(x)||u("'")?y+=t.charAt(x):v=!1;else switch(t.charAt(x)){case"d":y+=g(c("d",r.day(),2));break;case"D":y+=h("D",r.dayOfWeek(),i,a);break;case"o":y+=c("o",r.dayOfYear(),3);break;case"w":y+=c("w",r.weekOfYear(),2);break;case"m":y+=p(r);break;case"M":y+=d(r,u("M"));break;case"y":y+=u("y",2)?r.year():(r.year()%100<10?"0":"")+r.year()%100;break;case"Y":u("Y",2),y+=r.formatYear();break;case"J":y+=r.toJD();break;case"@":y+=(r.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":y+=(r.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":u("'")?y+="'":v=!0;break;default:y+=t.charAt(x)}return y},parseDate:function(t,r,n){if(null==r)throw e.local.invalidArguments||e.regionalOptions[""].invalidArguments;if(""===(r="object"==typeof r?r.toString():r+""))return null;t=t||this.local.dateFormat;var i=(n=n||{}).shortYearCutoff||this.shortYearCutoff;i="string"!=typeof i?i:this.today().year()%100+parseInt(i,10);for(var a=n.dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,s=n.parseMonth||this.local.parseMonth,l=n.monthNumbers||this.local.monthNumbers,u=n.monthNamesShort||this.local.monthNamesShort,c=n.monthNames||this.local.monthNames,h=-1,f=-1,p=-1,d=-1,m=-1,g=!1,y=!1,v=function(e,r){for(var n=1;M+n<t.length&&t.charAt(M+n)===e;)n++;return M+=n-1,Math.floor(n/(r||1))>1},x=function(t,n){var i=v(t,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(A).match(o);if(!s)throw(e.local.missingNumberAt||e.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},_=this,b=function(){if("function"==typeof l){v("m");var t=l.call(_,r.substring(A));return A+=t.length,t}return x("m")},w=function(t,n,i,a){for(var o=v(t,a)?i:n,s=0;s<o.length;s++)if(r.substr(A,o[s].length).toLowerCase()===o[s].toLowerCase())return A+=o[s].length,s+_.minMonth;throw(e.local.unknownNameAt||e.regionalOptions[""].unknownNameAt).replace(/\{0\}/,A)},T=function(){if("function"==typeof c){var t=v("M")?c.call(_,r.substring(A)):u.call(_,r.substring(A));return A+=t.length,t}return w("M",u,c)},k=function(){if(r.charAt(A)!==t.charAt(M))throw(e.local.unexpectedLiteralAt||e.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,A);A++},A=0,M=0;M<t.length;M++)if(y)"'"!==t.charAt(M)||v("'")?k():y=!1;else switch(t.charAt(M)){case"d":d=x("d");break;case"D":w("D",a,o);break;case"o":m=x("o");break;case"w":x("w");break;case"m":p=b();break;case"M":p=T();break;case"y":var S=M;g=!v("y",2),M=S,f=x("y",2);break;case"Y":f=x("Y",2);break;case"J":h=x("J")+.5,"."===r.charAt(A)&&(A++,x("J"));break;case"@":h=x("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=x("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":A=r.length;break;case"'":v("'")?k():y=!0;break;default:k()}if(A<r.length)throw e.local.unexpectedText||e.regionalOptions[""].unexpectedText;if(-1===f?f=this.today().year():f<100&&g&&(f+=-1===i?1900:this.today().year()-this.today().year()%100-(f<=i?0:100)),"string"==typeof p&&(p=s.call(this,f,p)),m>-1){p=1,d=m;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})}),Mk=f(()=>{var t=kk(),e=ky(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(a);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),o=""+this.toChineseMonth(n,i);return e&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(t){if("string"==typeof t){var e=t.match(o);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(s);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(e,r,n){var i=this.intercalaryMonth(e);if(n&&r!==i||r<1||r>12)throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(e,r){e.year&&(r=(e=e.year()).month());var n=this.intercalaryMonth(e);if(r<0||r>(n?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r<n?r+1:r:r+1},intercalaryMonth:function(t){return t=this._validateYear(t),l[t-l[0]]>>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(e,n,i){var a,o=this._validateYear(e,t.local.invalidyear),s=u[o-u[0]],l=s>>9&4095,c=s>>5&15,h=31&s;(a=r.newDate(l,c,h)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,n,i)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(e,r){e.year&&(r=e.month(),e=e.year()),e=this._validateYear(e);var n=l[e-l[0]];if(r>(n>>13?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,s,i,t.local.invalidDate);e=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(e,n),s=this.toChineseMonth(e,n),c=function(t,e,r,n){var i,a,o;if("object"==typeof t)a=t,i=e||{};else{var s;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i={}),a={year:t,month:e,day:r,isIntercalary:s}}o=a.day-1;var c,h=l[a.year-l[0]],f=h>>13;c=f&&(a.month>f||a.isIntercalary)?a.month:a.month-1;for(var p=0;p<c;p++)o+=h&1<<12-p?30:29;var d=u[a.year-u[0]],m=new Date(d>>9&4095,(d>>5&15)-1,(31&d)+o);return i.year=m.getFullYear(),i.month=1+m.getMonth(),i.day=m.getDate(),i}(e,s,i,o);return r.toJD(c.year,c.month,c.day)},fromJD:function(t){var e=r.fromJD(t),n=function(t,e,r){var n,i;if("object"==typeof t)n=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");n={year:t,month:e,day:r},i={}}var a=u[n.year-u[0]],o=n.year<<9|n.month<<5|n.day;i.year=o>=a?n.year:n.year-1,a=u[i.year-u[0]];var s,c=new Date(a>>9&4095,(a>>5&15)-1,31&a),h=new Date(n.year,n.month-1,n.day);s=Math.round((h-c)/864e5);var f,p=l[i.year-l[0]];for(f=0;f<13;f++){var d=p&1<<12-f?30:29;if(s<d)break;s-=d}var m=p>>13;return!m||f<m?(i.isIntercalary=!1,i.month=1+f):f===m?(i.isIntercalary=!0,i.month=f):(i.isIntercalary=!1,i.month=f),i.day=1+s,i}(e.year(),e.month(),e.day()),i=this.toMonthIndex(n.year,n.month,n.isIntercalary);return this.newDate(n.year,i,n.day)},fromString:function(t){var e=t.match(i),r=this._validateYear(+e[1]),n=+e[2],a=!!e[3],o=this.toMonthIndex(r,n,a),s=+e[4];return this.newDate(r,o,s)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if("y"===r){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),f=o&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);f!==c&&l.month(f)}return l}});var i=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,a=/^\d?\d[iI]?/m,o=/^闰?十?[一二三四五六七八九]?月/m,s=/^闰?十?[一二三四五六七八九]?/m;t.calendars.chinese=n;var l=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],u=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]}),Sk=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()+(r.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),t.calendars.coptic=r}),Ek=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),!1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),13},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(e,r,n){return(this._validate(e,r,n,t.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};t.calendars.discworld=r}),Ck=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()+(r.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),t.calendars.ethiopian=r}),Ik=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(t){return n(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),12===r&&this.leapYear(e)||8===r&&5===n(this.daysInYear(e),10)?30:9===r&&3===n(this.daysInYear(e),10)?29:this.daysPerMonth[r-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s<r;s++)o+=this.daysInMonth(e,s)}else for(s=7;s<r;s++)o+=this.daysInMonth(e,s);return o},_delay1:function(t){var e=Math.floor((235*t-234)/19),r=12084+13753*e,i=29*e+Math.floor(r/25920);return n(3*(i+1),7)<3&&i++,i},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t);return this._delay1(t+1)-r===356?2:r-e===382?1:0},fromJD:function(t){t=Math.floor(t)+.5;for(var e=Math.floor(98496*(t-this.jdEpoch)/35975351)-1;t>=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=t<this.toJD(e,1,1)?7:1;t>this.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.hebrew=r}),Lk=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),e=e<=0?e+1:e,(n=i.day())+Math.ceil(29.5*(r-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.islamic=r}),Pk=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()<0?r.year()+1:r.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),n=i.day(),e<0&&e++,r<=2&&(e--,r+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),t.calendars.julian=r}),zk=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}function i(t,e){return n(t-1,e)+1}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year();var r=Math.floor(e/400);return e%=400,e+=e<0?400:0,r+"."+Math.floor(e/20)+"."+e%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),18},weekOfYear:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),360},daysInMonth:function(e,r){return this._validate(e,r,this.minDay,t.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate).day()},weekDay:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),!0},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=n(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,n(e,20)]},_toTzolkin:function(t){return[i(20+(t-=this.jdEpoch),20),i(t+4,13)]},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),t.calendars.mayan=r}),Ok=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar;var n=t.instance("gregorian");e(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidMonth);(e=a.year())<0&&e++;for(var o=a.day(),s=1;s<a.month();s++)o+=this.daysPerMonth[s-1];return o+n.toJD(e+1468,3,13)},fromJD:function(t){t=Math.floor(t+.5);for(var e=Math.floor((t-(this.jdEpoch-1))/366);t>=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),t.calendars.nanakshahi=r}),Dk=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[e][n];return r},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[e][r]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=t.instance(),o=0,s=r,l=e;this._createMissingCalendarData(e);var u=e-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(e){var r=t.instance().fromJD(e),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)void 0===this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),t.calendars.nepali=r}),Rk=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t){var e=t-475;t<0&&e++;var r=.242197,n=r*e,i=r*(e+1);return n-Math.floor(n)>i-Math.floor(i)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return n(this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);e=a.year(),r=a.month(),i=a.day();var o=0;if(e>0)for(var s=1;s<e;s++)n(s)&&o++;else if(e<0)for(s=e;s<0;s++)n(s)&&o--;return i+(r<=7?31*(r-1):30*(r-1)+6)+365*(e>0?e-1:e)+o+this.jdEpoch-1},fromJD:function(t){var e=475+((t=Math.floor(t)+.5)-this.toJD(475,1,1))/365.242197,r=Math.floor(e);r<=0&&r--,t>this.toJD(r,12,n(r)?30:29)&&0===++r&&r++;var i=t-this.toJD(r,1,1)+1,a=i<=186?Math.ceil(i/31):Math.ceil((i-6)/30),o=t-this.toJD(r,a,1)+1;return this.newDate(r,a,o)}}),t.calendars.persian=r,t.calendars.jalali=r}),Fk=f(()=>{var t=kk(),e=ky(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),t.calendars.taiwan=n}),Bk=f(()=>{var t=kk(),e=ky(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),t.calendars.thai=n}),Nk=f(()=>{var t=kk(),e=ky();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā","Yawm al-Arbaā","Yawm al-Khamīs","Yawm al-Juma","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(e,r){for(var i=this._validate(e,r,this.minDay,t.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;o<n.length;o++){if(n[o]>i)return n[a]-n[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,i=0;i<n.length&&!(n[i]>e);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,u=e-n[r-1]+1;return this.newDate(s,l,u)},isValid:function(e,r,n){var i=t.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,r,n,i){var a=t.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),t.calendars.ummalqura=r;var n=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),jk=f((t,e)=>{e.exports=kk(),Ak(),Mk(),Sk(),Ek(),Ck(),Ik(),Lk(),Pk(),zk(),Ok(),Dk(),Rk(),Fk(),Bk(),Nk()}),Uk=f((t,e)=>{var r=jk(),n=oe(),i=k(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(t,e,r,i){var a={};return a[r]=s,n.coerce(t,e,a,r,i)},u="##",c={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:u,w:u,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function f(t){var e=h[t];return e||(e=h[t]=r.instance(t))}function p(t){return n.extendFlat({},s,{description:t})}function d(t){return"Sets the calendar system to use with `"+t+"` date data."}var m={xcalendar:p(d("x"))},g=n.extendFlat({},m,{ycalendar:p(d("y"))}),y=n.extendFlat({},g,{zcalendar:p(d("z"))}),v=p(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:p(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(t,e,r,n){for(var i=0;i<r.length;i++)l(t,e,r[i]+"calendar",n.calendar)},CANONICAL_SUNDAY:{chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},CANONICAL_TICK:{chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},DFLTRANGE:{chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},getCal:f,worldCalFmt:function(t,e,r){for(var n,i,s,l,h,p=Math.floor((e+.05)/o)+a,d=f(r).fromJD(p),m=0;-1!==(m=t.indexOf("%",m));)"0"===(n=t.charAt(m+1))||"-"===n||"_"===n?(s=3,i=t.charAt(m+2),"_"===n&&(n="-")):(i=n,n="0",s=2),(l=c[i])?(h=l===u?u:d.formatDate(l[n]),t=t.substr(0,m)+h+t.substr(m+s),m+=h.length):m+=s;return t}}}),Vk=f((t,e)=>{e.exports=Uk()});return f((t,e)=>{var r=Ua();r.register([io(),vo(),qo(),Ko(),is(),Es(),Ps(),Zs(),il(),xl(),zl(),Zc(),nh(),sd(),kd(),Rd(),Zd(),Tm(),Cm(),Bm(),qm(),Ym(),tg(),ag(),Dg(),Gg(),Ex(),Zx(),v_(),M_(),G_(),J_(),ob(),Sb(),zb(),Vb(),uw(),yw(),Sw(),Qw(),uT(),gT(),MT(),LT(),WT(),rk(),hk(),Tk(),Vk()]),e.exports=r})()})();
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/*!
* pad-left <https://github.com/jonschlinkert/pad-left>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT license.
*/
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*! Bundled license information:
native-promise-only/lib/npo.src.js:
(*! Native Promise Only
v0.8.1 (c) Kyle Simpson
MIT License: http://getify.mit-license.org
*)
polybooljs/index.js:
(*
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
* @license MIT
* @preserve Project Home: https://github.com/voidqk/polybooljs
*)
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
safe-buffer/index.js:
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
assert/build/internal/util/comparisons.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*)
object-assign/index.js:
(*
object-assign
(c) Sindre Sorhus
@license MIT
*)
maplibre-gl/dist/maplibre-gl.js:
(**
* MapLibre GL JS
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt
*)
*/return window.Plotly=t,t},n.exports?n.exports=a():i.moduleName=a()),r.exports));export{o as Plotly};
//# sourceMappingURL=index.js.map