Files
dash-api/share/jupyter/labextensions/jupyterlab-plotly/static/340.e7c6cfbf008f29878868.js
2025-09-07 22:09:54 +02:00

2 lines
4.5 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.

/*! For license information please see 340.e7c6cfbf008f29878868.js.LICENSE.txt */
(self.webpackChunkjupyterlab_plotly=self.webpackChunkjupyterlab_plotly||[]).push([[340],{340:(t,e,r)=>{"use strict";r.r(e),r.d(e,{MIME_TYPE:()=>Ht,RenderedPlotly:()=>Gt,default:()=>Zt,rendererFactory:()=>Wt});var n,i,a,o,s,l,c=r(606),u=Object.create,h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,d=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),y=(t,e,r)=>(r=null!=t?u(d(t)):{},((t,e,r,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of p(e))!m.call(t,r)&&undefined!==r&&h(t,r,{get:()=>e[r],enumerable:!(n=f(e,r))||n.enumerable});return t})(!e&&t&&t.__esModule?r:h(r,"default",{value:t,enumerable:!0}),t)),v=g(((t,e)=>{var n,i;n=t,i=function(t){function e(t,e){let r=0;for(let n of t)if(!1===e(n,r++))return!1;return!0}var r;t.ArrayExt=void 0,function(t){function e(t,e,r=0,n=-1){let i,a=t.length;if(0===a)return-1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))<r?n+1+(a-r):n-r+1;for(let n=0;n<i;++n){let i=(r+n)%a;if(t[i]===e)return i}return-1}function r(t,e,r=-1,n=0){let i,a=t.length;if(0===a)return-1;i=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(n=n<0?Math.max(0,n+a):Math.min(n,a-1))?r+1+(a-n):r-n+1;for(let n=0;n<i;++n){let i=(r-n+a)%a;if(t[i]===e)return i}return-1}function n(t,e,r=0,n=-1){let i,a=t.length;if(0===a)return-1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))<r?n+1+(a-r):n-r+1;for(let n=0;n<i;++n){let i=(r+n)%a;if(e(t[i],i))return i}return-1}function i(t,e,r=-1,n=0){let i,a=t.length;if(0===a)return-1;i=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(n=n<0?Math.max(0,n+a):Math.min(n,a-1))?r+1+(a-n):r-n+1;for(let n=0;n<i;++n){let i=(r-n+a)%a;if(e(t[i],i))return i}return-1}function a(t,e=0,r=-1){let n=t.length;if(!(n<=1))for(e=e<0?Math.max(0,e+n):Math.min(e,n-1),r=r<0?Math.max(0,r+n):Math.min(r,n-1);e<r;){let n=t[e],i=t[r];t[e++]=i,t[r--]=n}}function o(t,e){let r=t.length;if(e<0&&(e+=r),e<0||e>=r)return;let n=t[e];for(let n=e+1;n<r;++n)t[n-1]=t[n];return t.length=r-1,n}t.firstIndexOf=e,t.lastIndexOf=r,t.findFirstIndex=n,t.findLastIndex=i,t.findFirstValue=function(t,e,r=0,i=-1){let a=n(t,e,r,i);return-1!==a?t[a]:void 0},t.findLastValue=function(t,e,r=-1,n=0){let a=i(t,e,r,n);return-1!==a?t[a]:void 0},t.lowerBound=function(t,e,r,n=0,i=-1){let a=t.length;if(0===a)return 0;let o=n=n<0?Math.max(0,n+a):Math.min(n,a-1),s=(i=i<0?Math.max(0,i+a):Math.min(i,a-1))-n+1;for(;s>0;){let n=s>>1,i=o+n;r(t[i],e)<0?(o=i+1,s-=n+1):s=n}return o},t.upperBound=function(t,e,r,n=0,i=-1){let a=t.length;if(0===a)return 0;let o=n=n<0?Math.max(0,n+a):Math.min(n,a-1),s=(i=i<0?Math.max(0,i+a):Math.min(i,a-1))-n+1;for(;s>0;){let n=s>>1,i=o+n;r(t[i],e)>0?s=n:(o=i+1,s-=n+1)}return o},t.shallowEqual=function(t,e,r){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;++n)if(r?!r(t[n],e[n]):t[n]!==e[n])return!1;return!0},t.slice=function(t,e={}){let{start:r,stop:n,step:i}=e;if(void 0===i&&(i=1),0===i)throw new Error("Slice `step` cannot be zero.");let a,o=t.length;void 0===r?r=i<0?o-1:0:r<0?r=Math.max(r+o,i<0?-1:0):r>=o&&(r=i<0?o-1:o),void 0===n?n=i<0?-1:o:n<0?n=Math.max(n+o,i<0?-1:0):n>=o&&(n=i<0?o-1:o),a=i<0&&n>=r||i>0&&r>=n?0:i<0?Math.floor((n-r+1)/i+1):Math.floor((n-r-1)/i+1);let s=[];for(let e=0;e<a;++e)s[e]=t[r+e*i];return s},t.move=function(t,e,r){let n=t.length;if(n<=1||(e=e<0?Math.max(0,e+n):Math.min(e,n-1))===(r=r<0?Math.max(0,r+n):Math.min(r,n-1)))return;let i=t[e],a=e<r?1:-1;for(let n=e;n!==r;n+=a)t[n]=t[n+a];t[r]=i},t.reverse=a,t.rotate=function(t,e,r=0,n=-1){let i=t.length;if(i<=1||(r=r<0?Math.max(0,r+i):Math.min(r,i-1))>=(n=n<0?Math.max(0,n+i):Math.min(n,i-1)))return;let o=n-r+1;if(e>0?e%=o:e<0&&(e=(e%o+o)%o),0===e)return;let s=r+e;a(t,r,s-1),a(t,s,n),a(t,r,n)},t.fill=function(t,e,r=0,n=-1){let i,a=t.length;if(0!==a){r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))<r?n+1+(a-r):n-r+1;for(let n=0;n<i;++n)t[(r+n)%a]=e}},t.insert=function(t,e,r){let n=t.length;e=e<0?Math.max(0,e+n):Math.min(e,n);for(let r=n;r>e;--r)t[r]=t[r-1];t[e]=r},t.removeAt=o,t.removeFirstOf=function(t,r,n=0,i=-1){let a=e(t,r,n,i);return-1!==a&&o(t,a),a},t.removeLastOf=function(t,e,n=-1,i=0){let a=r(t,e,n,i);return-1!==a&&o(t,a),a},t.removeAllOf=function(t,e,r=0,n=-1){let i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);let a=0;for(let o=0;o<i;++o)r<=n&&o>=r&&o<=n&&t[o]===e||n<r&&(o<=n||o>=r)&&t[o]===e?a++:a>0&&(t[o-a]=t[o]);return a>0&&(t.length=i-a),a},t.removeFirstWhere=function(t,e,r=0,i=-1){let a,s=n(t,e,r,i);return-1!==s&&(a=o(t,s)),{index:s,value:a}},t.removeLastWhere=function(t,e,r=-1,n=0){let a,s=i(t,e,r,n);return-1!==s&&(a=o(t,s)),{index:s,value:a}},t.removeAllWhere=function(t,e,r=0,n=-1){let i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);let a=0;for(let o=0;o<i;++o)r<=n&&o>=r&&o<=n&&e(t[o],o)||n<r&&(o<=n||o>=r)&&e(t[o],o)?a++:a>0&&(t[o-a]=t[o]);return a>0&&(t.length=i-a),a}}(t.ArrayExt||(t.ArrayExt={})),(r||(r={})).rangeLength=function(t,e,r){return 0===r?1/0:t>e&&r>0||t<e&&r<0?0:Math.ceil((e-t)/r)},t.StringExt=void 0,function(t){function e(t,e,r=0){let n=new Array(e.length);for(let i=0,a=r,o=e.length;i<o;++i,++a){if(a=t.indexOf(e[i],a),-1===a)return null;n[i]=a}return n}t.findIndices=e,t.matchSumOfSquares=function(t,r,n=0){let i=e(t,r,n);if(!i)return null;let a=0;for(let t=0,e=i.length;t<e;++t){let e=i[t]-n;a+=e*e}return{score:a,indices:i}},t.matchSumOfDeltas=function(t,r,n=0){let i=e(t,r,n);if(!i)return null;let a=0,o=n-1;for(let t=0,e=i.length;t<e;++t){let e=i[t];a+=e-o-1,o=e}return{score:a,indices:i}},t.highlight=function(t,e,r){let n=[],i=0,a=0,o=e.length;for(;i<o;){let s=e[i],l=e[i];for(;++i<o&&e[i]===l+1;)l++;a<s&&n.push(t.slice(a,s)),s<l+1&&n.push(r(t.slice(s,l+1))),a=l+1}return a<t.length&&n.push(t.slice(a)),n},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(t.StringExt||(t.StringExt={})),t.chain=function*(...t){for(let e of t)yield*e},t.each=function(t,e){let r=0;for(let n of t)if(!1===e(n,r++))return},t.empty=function*(){},t.enumerate=function*(t,e=0){for(let r of t)yield[e++,r]},t.every=e,t.filter=function*(t,e){let r=0;for(let n of t)e(n,r++)&&(yield n)},t.find=function(t,e){let r=0;for(let n of t)if(e(n,r++))return n},t.findIndex=function(t,e){let r=0;for(let n of t)if(e(n,r++))return r-1;return-1},t.map=function*(t,e){let r=0;for(let n of t)yield e(n,r++)},t.max=function(t,e){let r;for(let n of t)void 0!==r?e(n,r)>0&&(r=n):r=n;return r},t.min=function(t,e){let r;for(let n of t)void 0!==r?e(n,r)<0&&(r=n):r=n;return r},t.minmax=function(t,e){let r,n,i=!0;for(let a of t)i?(r=a,n=a,i=!1):e(a,r)<0?r=a:e(a,n)>0&&(n=a);return i?void 0:[r,n]},t.once=function*(t){yield t},t.range=function*(t,e,n){void 0===e?(e=t,t=0,n=1):void 0===n&&(n=1);let i=r.rangeLength(t,e,n);for(let e=0;e<i;e++)yield t+n*e},t.reduce=function(t,e,r){let n=t[Symbol.iterator](),i=0,a=n.next();if(a.done&&void 0===r)throw new TypeError("Reduce of empty iterable with no initial value.");if(a.done)return r;let o,s,l=n.next();if(l.done&&void 0===r)return a.value;if(l.done)return e(r,a.value,i++);for(o=e(void 0===r?a.value:e(r,a.value,i++),l.value,i++);!(s=n.next()).done;)o=e(o,s.value,i++);return o},t.repeat=function*(t,e){for(;0<e--;)yield t},t.retro=function*(t){if("function"==typeof t.retro)yield*t.retro();else for(let e=t.length-1;e>-1;e--)yield t[e]},t.some=function(t,e){let r=0;for(let n of t)if(e(n,r++))return!0;return!1},t.stride=function*(t,e){let r=0;for(let n of t)r++%e==0&&(yield n)},t.take=function*(t,e){if(e<1)return;let r,n=t[Symbol.iterator]();for(;0<e--&&!(r=n.next()).done;)yield r.value},t.toArray=function(t){return Array.from(t)},t.toObject=function(t){let e={};for(let[r,n]of t)e[r]=n;return e},t.topologicSort=function(t){let e=[],r=new Set,n=new Map;for(let e of t)i(e);for(let[t]of n)a(t);return e;function i(t){let[e,r]=t,i=n.get(r);i?i.push(e):n.set(r,[e])}function a(t){if(r.has(t))return;r.add(t);let i=n.get(t);if(i)for(let t of i)a(t);e.push(t)}},t.zip=function*(...t){let r=t.map((t=>t[Symbol.iterator]())),n=r.map((t=>t.next()));for(;e(n,(t=>!t.done));n=r.map((t=>t.next())))yield n.map((t=>t.value))}},"object"==typeof t&&typeof e<"u"?i(t):"function"==typeof define&&r.amdO?define(["exports"],i):i((n=typeof globalThis<"u"?globalThis:n||self).lumino_algorithm={})})),x=g(((t,e)=>{var n,i;n=t,i=function(t,e){var r;function n(t){let e=0;for(let r=0,n=t.length;r<n;++r)r%4==0&&(e=4294967295*Math.random()>>>0),t[r]=255&e,e>>>=8}t.JSONExt=void 0,function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function r(t){return Array.isArray(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=r,t.isObject=function(t){return!e(t)&&!r(t)},t.deepEqual=function t(n,i){if(n===i)return!0;if(e(n)||e(i))return!1;let a=r(n),o=r(i);return a===o&&(a&&o?function(e,r){if(e===r)return!0;if(e.length!==r.length)return!1;for(let n=0,i=e.length;n<i;++n)if(!t(e[n],r[n]))return!1;return!0}(n,i):function(e,r){if(e===r)return!0;for(let t in e)if(void 0!==e[t]&&!(t in r))return!1;for(let t in r)if(void 0!==r[t]&&!(t in e))return!1;for(let n in e){let i=e[n],a=r[n];if(!(void 0===i&&void 0===a||void 0!==i&&void 0!==a&&t(i,a)))return!1}return!0}(n,i))},t.deepCopy=function t(n){return e(n)?n:r(n)?function(e){let r=new Array(e.length);for(let n=0,i=e.length;n<i;++n)r[n]=t(e[n]);return r}(n):function(e){let r={};for(let n in e){let i=e[n];void 0!==i&&(r[n]=t(i))}return r}(n)}}(t.JSONExt||(t.JSONExt={})),function(t){class r{constructor(t){var e,r,n,i;this._activated=!1,this._promise=null,this._service=null,this.id=t.id,this.description=null!==(e=t.description)&&void 0!==e?e:"",this.activate=t.activate,this.deactivate=null!==(r=t.deactivate)&&void 0!==r?r:null,this.provides=null!==(n=t.provides)&&void 0!==n?n:null,this.autoStart=null!==(i=t.autoStart)&&void 0!==i&&i,this.requires=t.requires?t.requires.slice():[],this.optional=t.optional?t.optional.slice():[]}get activated(){return this._activated}set activated(t){this._activated=t}get service(){return this._service}set service(t){this._service=t}get promise(){return this._promise}set promise(t){this._promise=t}}t.createPluginData=function(t){return new r(t)},t.ensureNoCycle=function(t,e,r){let n=[...t.requires,...t.optional],i=n=>{if(n===t.provides)return!0;let o=r.get(n);if(!o)return!1;let s=e.get(o),l=[...s.requires,...s.optional];return 0!==l.length&&(a.push(o),!!l.some(i)||(a.pop(),!1))};if(!t.provides||0===n.length)return;let a=[t.id];if(n.some(i))throw new ReferenceError(`Cycle detected: ${a.join(" -> ")}.`)},t.findDependents=function(t,r,n){let i=new Array,a=t=>{let e=r.get(t),a=[...e.requires,...e.optional];i.push(...a.reduce(((e,r)=>{let i=n.get(r);return i&&e.push([t,i]),e}),[]))};for(let t of r.keys())a(t);let o=i.filter((e=>e[1]===t)),s=0;for(;o.length>s;){let t=o.length,e=new Set(o.map((t=>t[0])));for(let t of e)i.filter((e=>e[1]===t)).forEach((t=>{o.includes(t)||o.push(t)}));s=t}let l=e.topologicSort(o),c=l.findIndex((e=>e===t));return-1===c?[t]:l.slice(0,c+1)},t.collectStartupPlugins=function(t,e){let r=new Set;for(let e of t.keys())!0===t.get(e).autoStart&&r.add(e);if(e.startPlugins)for(let t of e.startPlugins)r.add(t);if(e.ignorePlugins)for(let t of e.ignorePlugins)r.delete(t);return Array.from(r)}}(r||(r={})),t.Random=void 0,(t.Random||(t.Random={})).getRandomValues=(()=>{let t=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return t&&"function"==typeof t.getRandomValues?function(e){return t.getRandomValues(e)}:n})(),t.UUID=void 0,(t.UUID||(t.UUID={})).uuid4=function(t){let e=new Uint8Array(16),r=new Array(256);for(let t=0;t<16;++t)r[t]="0"+t.toString(16);for(let t=16;t<256;++t)r[t]=t.toString(16);return function(){return t(e),e[6]=64|15&e[6],e[8]=128|63&e[8],r[e[0]]+r[e[1]]+r[e[2]]+r[e[3]]+"-"+r[e[4]]+r[e[5]]+"-"+r[e[6]]+r[e[7]]+"-"+r[e[8]]+r[e[9]]+"-"+r[e[10]]+r[e[11]]+r[e[12]]+r[e[13]]+r[e[14]]+r[e[15]]}}(t.Random.getRandomValues),t.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(t){return-1!==this._types.indexOf(t)}getData(t){let e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0}setData(t,e){this.clearData(t),this._types.push(t),this._values.push(e)}clearData(t){let e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))}clear(){this._types.length=0,this._values.length=0}},t.PluginRegistry=class{constructor(t={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,t.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=t.validatePlugin)}get application(){return this._application}set application(t){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=t}get deferredPlugins(){return Array.from(this._plugins).filter((([t,e])=>"defer"===e.autoStart)).map((([t,e])=>t))}getPluginDescription(t){var e,r;return null!==(r=null===(e=this._plugins.get(t))||void 0===e?void 0:e.description)&&void 0!==r?r:""}hasPlugin(t){return this._plugins.has(t)}isPluginActivated(t){var e,r;return null!==(r=null===(e=this._plugins.get(t))||void 0===e?void 0:e.activated)&&void 0!==r&&r}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(t){if(this._plugins.has(t.id))throw new TypeError(`Plugin '${t.id}' is already registered.`);if(!this._validatePlugin(t))throw new Error(`Plugin '${t.id}' is not valid.`);let e=r.createPluginData(t);r.ensureNoCycle(e,this._plugins,this._services),e.provides&&this._services.set(e.provides,e.id),this._plugins.set(e.id,e)}registerPlugins(t){for(let e of t)this.registerPlugin(e)}deregisterPlugin(t,e){let r=this._plugins.get(t);if(r){if(r.activated&&!e)throw new Error(`Plugin '${t}' is still active.`);this._plugins.delete(t)}}async activatePlugin(t){let e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(e.activated)return;if(e.promise)return e.promise;let r=e.requires.map((t=>this.resolveRequiredService(t))),n=e.optional.map((t=>this.resolveOptionalService(t)));return e.promise=Promise.all([...r,...n]).then((t=>e.activate.apply(void 0,[this.application,...t]))).then((t=>{e.service=t,e.activated=!0,e.promise=null})).catch((t=>{throw e.promise=null,t})),e.promise}async activatePlugins(t,e={}){switch(t){case"defer":{let t=this.deferredPlugins.filter((t=>this._plugins.get(t).autoStart)).map((t=>this.activatePlugin(t)));await Promise.all(t);break}case"startUp":{let t=r.collectStartupPlugins(this._plugins,e).map((async t=>{try{return await this.activatePlugin(t)}catch(e){console.error(`Plugin '${t}' failed to activate.`,e)}}));await Promise.all(t);break}}}async deactivatePlugin(t){let e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(!e.activated)return[];if(!e.deactivate)throw new TypeError(`Plugin '${t}'#deactivate() method missing`);let n=r.findDependents(t,this._plugins,this._services),i=n.map((t=>this._plugins.get(t)));for(let e of i)if(!e.deactivate)throw new TypeError(`Plugin ${e.id}#deactivate() method missing (depends on ${t})`);for(let t of i){let e=[...t.requires,...t.optional].map((t=>{let e=this._services.get(t);return e?this._plugins.get(e).service:null}));await t.deactivate(this.application,...e),t.service=null,t.activated=!1}return n.pop(),n}async resolveRequiredService(t){let e=this._services.get(t);if(!e)throw new TypeError(`No provider for: ${t.name}.`);let r=this._plugins.get(e);return r.activated||await this.activatePlugin(e),r.service}async resolveOptionalService(t){let e=this._services.get(t);if(!e)return null;let r=this._plugins.get(e);if(!r.activated)try{await this.activatePlugin(e)}catch(t){return console.error(t),null}return r.service}},t.PromiseDelegate=class{constructor(){this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){(0,this._resolve)(t)}reject(t){(0,this._reject)(t)}},t.Token=class{constructor(t,e){this.name=t,this.description=e??"",this._tokenStructuralPropertyT=null}}},"object"==typeof t&&typeof e<"u"?i(t,v()):"function"==typeof define&&r.amdO?define(["exports","@lumino/algorithm"],i):i((n=typeof globalThis<"u"?globalThis:n||self).lumino_coreutils={},n.lumino_algorithm)})),_=g(((t,e)=>{var r,n;r=typeof self<"u"?self:t,n=()=>{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,h=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,f=(t,e)=>function(){return t&&(e=(0,t[a(t)[0]])(t=0)),e},p=(t,e)=>function(){return e||(0,t[a(t)[0]])((e={exports:{}}).exports,e),e.exports},d=(t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})},m=(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},g=t=>m(e({},"__esModule",{value:!0}),t),y=p({"src/version.js"(t){t.version="3.1.0"}}),v=p({"node_modules/native-promise-only/lib/npo.src.js"(t,e){var r,n;r="Promise",(n=typeof window<"u"?window:t)[r]=n[r]||function(){var t,e,r,n=Object.prototype.toString,i=typeof setImmediate<"u"?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{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 c(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(){c.apply(n,arguments)}),(function(){u.apply(n,arguments)}))}catch(t){u.call(n,t)}})):(r.msg=t,r.state=1,r.chain.length>0&&a(s,r))}catch(t){u.call(new f(r),t)}}}function u(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){c.call(e,t)}),(function(t){u.call(e,t)}))}catch(t){u.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){return t&&"object"==typeof t&&1===t.__NPO__?t:new this((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}(),typeof e<"u"&&e.exports&&(e.exports=n[r])}}),x=p({"node_modules/@plotly/d3/d3.js"(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{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{var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,h=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.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 A(t){return(t=b(t))in this._&&delete this._[t]}function k(){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:A,keys:k,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,c,u,h,f=-1,p=a.length,d=i[s++],m=new _;++f<p;)(h=m.get(l=d(c=a[f])))?h.push(c):m.set(l,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,s))}):(c={},u=function(e,r){c[e]=o(t,r,s)}),m.forEach(u),c}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:A,values:k,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 D(){}function O(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 D,n=0,i=arguments.length;++n<i;)r[arguments[n]]=O(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 D,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=O(t);return t},D.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(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return N(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 W(t){return"function"==typeof t?t:function(){return V(t,this)}}function Z(t){return"function"==typeof t?t:function(){return q(t,this)}}G.select=function(t){var e,r,n,i,a=[];t=W(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(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=Z(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,c=s.length;++l<c;)(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 K(t){return t.trim().replace(/\s+/g," ")}function J(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=J(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",K(i+" "+t))):r.setAttribute("class",K(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 ct(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 ut(t){return N(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(!J(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=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=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=W(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,u=r.length,h=Math.min(o,u),f=new Array(u),p=new Array(u),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<u;)(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<u;++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),c.push(d)}var s=ut([]),l=U([]),c=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 c},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 ct(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 ct(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 c(){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));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c: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=ut,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 c=-1,u=i.length;++c<u;)(a=i[c])?(e.push(n[c]=r=t.call(i.parentNode,a.__data__,c,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,c=this,u=t.event.target.correspondingElement||t.event.target,h=c.parentNode,f=e.of(c,arguments),p=0,d=n(),m=".drag"+(null==d?"":"-"+d),g=t.select(a(u)).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(u),v=i(h,d);l=r?[(l=r.apply(c,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,At=2*Tt,kt=At-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],c=e[2],u=s-i,h=l-a,f=u*u+h*h;if(f<1e-12)n=Math.log(c/o)/Pt,r=function(t){return[i+t*u,a+t*h,o*Math.exp(Pt*t*n)]};else{var p=Math.sqrt(f),d=(c*c-o*o+4*f)/(2*o*2*p),m=(c*c-o*o-4*f)/(2*c*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*u,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,c,u,h,f={x:0,y:0,k:1},p=[960,500],d=Ot,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(Dt+".zoom",z).on("dblclick.zoom",D).on(_,P)}function T(t){return[(t[0]-f.x)/f.k,(t[1]-f.y)/f.k]}function A(t){f.k=Math.max(d[0],Math.min(d[1],t))}function k(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},A(Math.pow(2,a)),k(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-f.x)/f.k})).map(l.invert)),h&&h.domain(u.range().map((function(t){return(t-f.y)/f.k})).map(u.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,k(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,c="touchend"+o,u=[],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(c,v),u.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,c,u,h=t.touches(r);Wi.call(r);for(var f=0,p=h.length;f<p;++f,u=null)if(c=h[f],u=i[c.identifier]){if(l)break;o=c,l=u}if(u){var d=(d=c[0]-o[0])*d+(d=c[1]-o[1])*d,m=a&&Math.sqrt(d/a);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],A(m*e)}s=null,k(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(u).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(),A(Math.pow(2,.002*zt())*f.k),k(r,e),C(i)}function D(){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 Dt||(Dt="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;Xi?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},A(+t),S(),w):f.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?Ot:[+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?(c=t,l=t.copy(),f={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(h=t,u=t.copy(),f={x:0,y:0,k:1},w):h},t.rebind(w,b,"on")};var zt,Dt,Ot=[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):ie(""+t,ae,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 jt(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 Qt(a(t+120),a(t),a(t-120))}function Nt(e,r,n){return this instanceof Nt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Nt?new Nt(e.h,e.c,e.l):function(t,e,r){return t>0?new Nt(Math.atan2(r,e)*Et,Math.sqrt(e*e+r*r),t):new Nt(NaN,NaN,t)}(e instanceof qt?e.l:(e=oe((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Nt(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 jt(this.h,this.s,this.l)},t.hcl=Nt;var Ut=Nt.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 Nt?Vt(t.h,t.c,t.l):oe((t=Qt(t)).r,t.g,t.b):new qt(t,e,r)}Ut.brighter=function(t){return new Nt(this.h,this.c,Math.min(100,this.l+Ht*(arguments.length?t:1)))},Ut.darker=function(t){return new Nt(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,Wt=1,Zt=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 Qt(Jt(3.2404542*(i=$t(i)*Gt)-1.5371385*(n=$t(n)*Wt)-.4985314*(a=$t(a)*Zt)),Jt(-.969266*i+1.8760108*n+.041556*a),Jt(.0556434*i-.2040259*n+1.0572252*a))}function $t(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 Jt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ie(""+t,Qt,jt):new Qt(t,e,r)}function te(t){return new Qt(t>>16,t>>8&255,255&t)}function ee(t){return te(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=Qt;var re=Qt.prototype=new Rt;function ne(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ie(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(le(i[0]),le(i[1]),le(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 ae(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 oe(t,e,r){var n=Kt((.4124564*(t=se(t))+.3575761*(e=se(e))+.1804375*(r=se(r)))/Gt),i=Kt((.2126729*t+.7151522*e+.072175*r)/Wt);return qt(116*i-16,500*(n-i),200*(i-Kt((.0193339*t+.119192*e+.9503041*r)/Zt)))}function se(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function le(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}re.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 Qt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new Qt(i,i,i)},re.darker=function(t){return new Qt((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},re.hsl=function(){return ae(this.r,this.g,this.b)},re.toString=function(){return"#"+ne(this.r)+ne(this.g)+ne(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 ue(t){return"function"==typeof t?t:function(){return t}}function he(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),fe(e,r,t,n)}}function fe(e,r,i,a){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},c=new XMLHttpRequest,u=null;function h(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}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?(u=t,o):u},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),c.open(t,e,!0),null!=r&&!("accept"in l)&&(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(n??null),o},o.abort=function(){return c.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,te(e))})),t.functor=ue,t.xhr=he(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=fe(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,c=0,u=0;function h(){if(c>=l)return o;if(i)return i=!1,a;var e=c;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 c=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++c):10===s&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<l;){var s,u=1;if(10===(s=t.charCodeAt(c++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return t.slice(e,c-u)}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,u++))||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 pe,de,me,ge,ye=this[L(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function ve(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 de?de.n=i:pe=i,de=i,me||(ge=clearTimeout(ge),me=1,ye(xe)),i}function xe(){var t=_e(),e=be()-t;e>24?(isFinite(e)&&(clearTimeout(ge),ge=setTimeout(xe,e)),me=0):(me=1,ye(xe))}function _e(){for(var t=Date.now(),e=pe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function be(){for(var t,e=pe,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:pe=e.n;return de=t,r}function we(t){return t[0]}function Te(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 ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ve.apply(this,arguments)},t.timer.flush=function(){_e(),be()},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=we,r=Te;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ue(e),a=ue(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(ke),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=Ae(s),u=Ae(l),h=u[0]===c[0],f=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[s[c[n]][2]]);for(n=+h;n<u.length-f;++n)p.push(t[s[u[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 N(t,Me),t};var Me=t.geom.polygon.prototype=[];function Se(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Ee(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,h=n[1]-c,f=(s*(l-c)-h*(i-a))/(h*o-s*u);return[i+f*o,l+f*u]}function Ce(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}Me.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},Me.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]},Me.clip=function(t){for(var e,r,n,i,a,o,s=Ce(t),l=-1,c=this.length-Ce(this),u=this[c-1];++l<c;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)Se(o=e[r],u,i)?(Se(a,u,i)||t.push(Ee(a,o,u,i)),t.push(o)):Se(a,u,i)&&t.push(Ee(a,o,u,i)),a=o;s&&t.push(t[0]),u=i}return t};var Ie,Le,Pe,ze,De,Oe=[],Re=[];function Fe(){rr(this),this.edge=this.site=this.circle=null}function Be(t){var e=Oe.pop()||new Fe;return e.site=t,e}function je(t){Ye(t),Pe.remove(t),Oe.push(t),rr(t)}function Ne(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),Ye(l);for(var c=o;c.circle&&v(r-c.circle.x)<wt&&v(n-c.circle.cy)<wt;)o=c.N,s.push(c),je(c),c=o;s.push(c),Ye(c);var u,h=s.length;for(u=1;u<h;++u)c=s[u],l=s[u-1],Qe(c.edge,l.site,c.site,i);l=s[0],(c=s[h-1]).edge=Ke(l.site,c.site,null,i),Ze(l),Ze(c)}function Ue(t){for(var e,r,n,i,a=t.x,o=t.y,s=Pe._;s;)if((n=Ve(s,o)-a)>wt)s=s.L;else{if(!((i=a-qe(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=Be(t);if(Pe.insert(e,l),e||r){if(e===r)return Ye(e),r=Be(e.site),Pe.insert(l,r),l.edge=r.edge=Ke(e.site,l.site),Ze(e),void Ze(r);if(!r)return void(l.edge=Ke(e.site,l.site));Ye(e),Ye(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,p=t.y-h,d=r.site,m=d.x-u,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+u,y:(f*x-m*v)/y+h};Qe(r.edge,c,d,_),l.edge=Ke(c,t,null,_),r.edge=Ke(t,d,null,_),Ze(e),Ze(r)}}function Ve(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,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function qe(t,e){var r=t.N;if(r)return Ve(r,e);var n=t.site;return n.y===e?n.x:1/0}function He(t){this.site=t,this.edges=[]}function Ge(t,e){return e.angle-t.angle}function We(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ze(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,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-1e-12)){var f=l*l+c*c,p=u*u+g*g,d=(g*f-c*p)/h,m=(l*p-u*f)/h,g=m+s,y=Re.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||(ze=y)}}}}function Ye(t){var e=t.circle;e&&(e.P||(ze=e.N),De.remove(e),Re.push(e),rr(e),t.circle=null)}function Xe(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],c=e[1][1],u=t.l,h=t.r,f=u.x,p=u.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>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y<l)return}else a={x:g,y:c};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>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y<l)return}else a={x:(c-i)/n,y:c};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 $e(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ke(t,e,r,n){var i=new $e(t,e);return Ie.push(i),r&&Qe(i,t,e,r),n&&Qe(i,e,t,n),Le[t.i].edges.push(new tr(i,t,e)),Le[e.i].edges.push(new tr(i,e,t)),i}function Je(t,e,r){var n=new $e(t,null);return n.a=e,n.b=r,Ie.push(n),n}function Qe(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 tr(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 er(){this._=null}function rr(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function nr(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 ir(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 ar(t){for(;t.L;)t=t.L;return t}function or(t,e){var r,n,i,a=t.sort(sr).pop();for(Ie=[],Le=new Array(t.length),Pe=new er,De=new er;;)if(i=ze,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))(a.x!==r||a.y!==n)&&(Le[a.i]=new He(a),Ue(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Ne(i.arc)}e&&(function(t){for(var e,r=Ie,n=function(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,h=1,f=s.x-l,p=s.y-c;if(a=t-l,f||!(a>0)){if(a/=f,f<0){if(a<u)return;a<h&&(h=a)}else if(f>0){if(a>h)return;a>u&&(u=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>u&&(u=a)}else if(f>0){if(a<u)return;a<h&&(h=a)}if(a=e-c,p||!(a>0)){if(a/=p,p<0){if(a<u)return;a<h&&(h=a)}else if(p>0){if(a>h)return;a>u&&(u=a)}if(a=n-c,p||!(a<0)){if(a/=p,p<0){if(a>h)return;a>u&&(u=a)}else if(p>0){if(a<u)return;a<h&&(h=a)}return u>0&&(i.a={x:l+u*f,y:c+u*p}),h<1&&(i.b={x:l+h*f,y:c+h*p}),i}}}}}}(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!Xe(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,c,u,h=t[0][0],f=t[1][0],p=t[0][1],d=t[1][1],m=Le,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(u=s[o].end()).x,i=u.y,e=(c=s[++o%l].start()).x,r=c.y,(v(n-e)>wt||v(i-r)>wt)&&(s.splice(o,0,new tr(Je(a.site,u,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:Le,edges:Ie};return Pe=De=Ie=Le=null,o}function sr(t,e){return e.y-t.y||e.x-t.x}He.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(Ge),e.length},tr.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}},er.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=ar(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&&(nr(this,r),r=(t=r).U),r.C=!1,n.C=!0,ir(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(ir(this,r),r=(t=r).U),r.C=!1,n.C=!0,nr(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?ar(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,nr(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,ir(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,nr(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,ir(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,nr(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,ir(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=we,r=Te,n=e,i=r,a=lr;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 or(s(t),a).cells.forEach((function(a,s){var l=a.edges,c=a.site;(e[s]=l.length?l.map((function(t){var e=t.start();return[e.x,e.y]})):c.x>=r&&c.x<=i&&c.y>=n&&c.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 or(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 or(s(t)).cells.forEach((function(r,n){for(var i,a=r.site,o=r.edges.sort(Ge),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s<l;)i=u,u=(c=o[s].edge).l===a?c.r:c.l,n<i.i&&n<u.i&&cr(a,i,u)<0&&e.push([t[n],t[i.i],t[u.i]])})),e},o.x=function(t){return arguments.length?(n=ue(e=t),o):e},o.y=function(t){return arguments.length?(i=ue(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=t??lr,o):a===lr?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===lr?null:a&&a[1]},o};var lr=[[-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 ur(t){return t.x}function hr(t){return t.y}function fr(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]&&fr(t,l[0],r,n,o,s),l[1]&&fr(t,l[1],o,n,i,s),l[2]&&fr(t,l[2],r,s,o,a),l[3]&&fr(t,l[3],o,s,i,a)}}function pr(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"#"+ne(Math.round(n+o*t))+ne(Math.round(i+s*t))+ne(Math.round(a+l*t))}}function dr(t,e){var r,n={},i={};for(r in t)r in e?n[r]=xr(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 mr(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function gr(t,e){var r,n,i,a=yr.lastIndex=vr.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=yr.exec(t))&&(n=vr.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:mr(r,n)})),a=vr.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=we,s=Te;if(a=arguments.length)return o=ur,s=hr,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,c,u,h,f,p,d,m,g,y=ue(o),x=ue(s);if(null!=e)p=e,d=r,m=n,g=i;else if(m=g=-(p=d=1/0),c=[],u=[],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),c.push(l.x),u.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),c.push(_),u.push(b)}var w=m-p,T=g-d;function A(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(v(l-r)+v(c-n)<.01)k(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,k(t,u,l,c,i,a,o,s),k(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else k(t,e,r,n,i,a,o,s)}function k(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,f=h<<1|u;t.leaf=!1,u?i=l:o=l,h?a=c:s=c,A(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){A(M,t,+y(t,++h),+x(t,h),p,d,m,g)},visit:function(t){fr(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(c,u,h,f,p){if(!(u>a||h>o||f<n||p<i)){if(d=c.point){var d,m=e-c.x,g=r-c.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=c.nodes,_=.5*(u+f),b=.5*(h+p),w=(r>=b)<<1|e>=_,T=w+4;w<T;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,h,_,b);break;case 1:t(c,_,h,f,b);break;case 2:t(c,u,b,_,p);break;case 3:t(c,_,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;)A(M,t[h],c[h],u[h],p,d,m,g);--h}else t.forEach(M.add);return c=u=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=pr,t.interpolateObject=dr,t.interpolateNumber=mr,t.interpolateString=gr;var yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vr=new RegExp(yr.source,"g");function xr(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function _r(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(xr(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=xr,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?ce.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?pr:gr:e instanceof Rt?pr:Array.isArray(e)?_r:"object"===r&&isNaN(e)?dr:mr)(t,e)}],t.interpolateArray=_r;var br=function(){return C},wr=t.map({linear:br,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return Mr},cubic:function(){return Sr},sin:function(){return Cr},exp:function(){return Ir},circle:function(){return Lr},elastic:function(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/At*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*At/e)}},back:function(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}},bounce:function(){return Pr}}),Tr=t.map({in:C,out:Ar,"in-out":kr,"out-in":function(t){return kr(Ar(t))}});function Ar(t){return function(e){return 1-t(1-e)}}function kr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Mr(t){return t*t}function Sr(t){return t*t*t}function Er(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 Cr(t){return 1-Math.cos(t*Mt)}function Ir(t){return Math.pow(2,10*(t-1))}function Lr(t){return 1-Math.sqrt(1-t*t)}function Pr(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 zr(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=Rr(e),i=Or(e,r),a=Rr(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 Or(t,e){return t[0]*e[0]+t[1]*e[1]}function Rr(t){var e=Math.sqrt(Or(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=wr.get(n)||br,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}((i=Tr.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 jt(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=zr,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:Fr)})(e)},Dr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(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:mr(t[0],e[0])},{i:i-2,x:mr(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(Br(r)+"rotate(",null,")")-2,x:mr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:mr(t,e)}):e&&r.push(Br(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(Br(r)+"scale(",null,",",null,")");n.push({i:i-4,x:mr(t[0],e[0])},{i:i-2,x:mr(t[1],e[1])})}else(1!==e[0]||1!==e[1])&&r.push(Br(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 Nr(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Ur(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Vr(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;for(var r=qr(t),n=qr(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 qr(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Hr(t){t.fixed|=2}function Gr(t){t.fixed&=-7}function Wr(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Zr(t){t.fixed&=-5}function Yr(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])&&(Yr(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 c=e*r[t.point.index];t.charge+=t.pointCharge=c,n+=c*t.point.x,i+=c*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(Vr(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},c=0;function u(){var l,u,f,p,d,m={},g=[],y=t.range(i),v=[];for(e=[],r=[],l=0,p=-1;++p<i;){for(u=0,d=-1;++d<i;)u+=n[p][d];g.push(u),v.push(t.range(i)),l+=u}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=(At-c*i)/l,u=0,p=-1;++p<i;){for(f=u,d=-1;++d<i;){var x=y[p],_=v[x][d],b=n[x][_],w=u,T=u+=b*l;m[x+"-"+_]={index:x,subindex:_,startAngle:w,endAngle:T,value:b}}r[x]={index:x,startAngle:f,endAngle:u,value:g[x]},u+=c}for(p=-1;++p<i;)for(d=p-1;++d<i;){var A=m[p+"-"+d],k=m[d+"-"+p];(A.value||k.value)&&e.push(A.value<k.value?{source:k,target:A}:{source:A,target:k})}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?(c=t,e=r=null,l):c},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||u(),e},l.groups=function(){return r||u(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch("start","tick","end"),c=[1,1],u=.9,h=Xr,f=$r,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 c=e.charge/l;t.px-=a*c,t.py-=o*c}return!0}e.point&&l&&l<d&&(c=e.pointCharge/l,t.px-=a*c,t.py-=o*c)}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,A=v.length;for(s=0;s<A;++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=c[0]/2,w=c[1]/2,s=-1,_))for(;++s<T;)(h=y[s]).x+=(b-h.x)*_,h.y+=(w-h.y)*_;if(p)for(Yr(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))*u,h.y-=(h.py-(h.py=h.y))*u);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?(c=t,s):c},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?(u=+t,s):u},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=ve(s.tick)),s):n},s.start=function(){var t,e,r,n=y.length,l=v.length,u=c[0],d=c[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",u)),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),c=0;c<n;++c)e[c]=[];for(c=0;c<l;++c){var a=v[c];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][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",Hr).on("drag.force",_).on("dragend.force",Gr)),!arguments.length)return r;this.on("mouseover.force",Wr).on("mouseout.force",Zr).call(r)},t.rebind(s,l,"on")};var Xr=20,$r=1,Kr=1/0;function Jr(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=an,e}function Qr(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 tn(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 en(t){return t.children}function rn(t){return t.value}function nn(t,e){return e.value-t.value}function an(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=nn,e=en,r=rn;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(c=e.call(n,a,a.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return tn(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&&(Qr(t,(function(t){t.children&&(t.value=0)})),tn(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,c=-1;for(r=t.value?r/t.value:0;++c<o;)n(s=a[c],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},Jr(a,e)},t.layout.pie=function(){var e=Number,r=on,n=0,i=At,a=0;function o(s){var l,c=s.length,u=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)/c,+("function"==typeof a?a.apply(this,arguments):a)),d=p*(f<0?-1:1),m=t.sum(u),g=m?(f-c*d)/m:0,y=t.range(c),v=[];return null!=r&&y.sort(r===on?function(t,e){return u[e]-u[t]}:function(t,e){return r(s[t],s[e])}),y.forEach((function(t){v[t]={data:s[t],value:l=u[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 on={};function sn(t){return t.x}function ln(t){return t.y}function cn(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=C,r=fn,n=pn,i=cn,a=sn,o=ln;function s(l,c){if(!(p=l.length))return l;var u=l.map((function(t,r){return e.call(s,t,r)})),h=u.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,c);u=t.permute(u,f),h=t.permute(h,f);var p,d,m,g,y=n.call(s,h,c),v=u[0].length;for(m=0;m<v;++m)for(i.call(s,u[0][m],g=y[m],h[0][m][1]),d=1;d<p;++d)i.call(s,u[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:un.get(t)||fn,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:hn.get(t)||pn,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 un=t.map({"inside-out":function(e){var r,n,i=e.length,a=e.map(dn),o=e.map(mn),s=t.range(i).sort((function(t,e){return a[t]-a[e]})),l=0,c=0,u=[],h=[];for(r=0;r<i;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],h.push(n));return h.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:fn}),hn=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,c,u=t.length,h=t[0],f=h.length,p=[];for(p[0]=l=c=0,r=1;r<f;++r){for(e=0,i=0;e<u;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];e<u;++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<c&&(c=l)}for(r=0;r<f;++r)p[r]-=c;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:pn});function fn(e){return t.range(e.length)}function pn(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function dn(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 mn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function yn(t,e){return vn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vn(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 xn(e){return[t.min(e),t.max(e)]}function _n(t,e){return t.value-e.value}function bn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function wn(t,e){t._pack_next=e,e._pack_prev=t}function Tn(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,c=1/0,u=-1/0,h=1/0,f=-1/0;if(e.forEach(kn),(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(En(r,n,i=e[2]),x(i),bn(r,i),r._pack_prev=i,bn(i,n),n=r._pack_next,a=3;a<l;a++){En(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(Tn(o,i)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!Tn(s,i);s=s._pack_prev,m++);p?(d<m||d==m&&n.r<r.r?wn(r,n=o):wn(r=s,n),a--):(bn(r,i),n=i,x(i))}var g=(c+u)/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(Mn)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),h=Math.min(t.y-t.r,h),f=Math.max(t.y+t.r,f)}}function kn(t){t._pack_next=t._pack_prev=t}function Mn(t){delete t._pack_next,delete t._pack_prev}function Sn(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;)Sn(i[a],e,r,n)}function En(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),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+c*a,r.y=t.y+l*a-c*i}else r.x=t.x+n,r.y=t.y}function Cn(t,e){return t.parent==e.parent?1:2}function In(t){var e=t.children;return e.length?e[0]:t.t}function Ln(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Pn(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 zn(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 On(t){var e,r=t.children;return r&&(e=r.length)?On(r[e-1]):t}function Rn(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Fn(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 Bn(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():Bn(t.range())}function Nn(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 Un(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 Vn(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:qn}t.layout.histogram=function(){var e=!0,r=Number,n=xn,i=yn;function a(a,o){for(var s,l,c=[],u=a.map(r,this),h=n.call(this,u,o),f=i.call(this,h,u,o),p=(o=-1,u.length),d=f.length-1,m=e?1:1/p;++o<d;)(s=c[o]=[]).dx=f[o+1]-(s.x=f[o]),s.y=0;if(d>0)for(o=-1;++o<p;)(l=u[o])>=h[0]&&l<=h[1]&&((s=c[t.bisect(f,l,1,d)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ue(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return vn(e,t)}:ue(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(_n),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,tn(s,(function(t){t.r=+u(t.value)})),tn(s,An),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;tn(s,(function(t){t.r+=h})),tn(s,An),tn(s,(function(t){t.r-=h}))}return Sn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),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},Jr(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=null;function a(t,a){var c=e.call(this,t,a),u=c[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]}(u);if(tn(h,o),h.parent.m=-h.z,Qr(h,s),i)Qr(u,l);else{var f=u,p=u,d=u;Qr(u,(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);Qr(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*y}))}return c}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],c=a.m,u=o.m,h=s.m,f=l.m;s=Ln(s),a=In(a),s&&a;)l=In(l),(o=Ln(o)).a=t,(i=s.z+h-a.z-c+r(s._,a._))>0&&(Pn(zn(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=h-u),a&&!In(l)&&(l.t=a,l.m+=c-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},Jr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;tn(c,(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?u+=r(e,s):0,e.y=0,s=e)}));var h=Dn(c),f=On(c),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return tn(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.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},Jr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Rn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(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=[],c=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(u(c,a.dx*a.dy/t.value),s.area=0;(i=c.length)>0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=f?(c.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(u(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*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++o<s;)(a=t[o]).x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?n(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((i||u>r.dx)&&(u=r.dx);++o<s;)(a=t[o]).x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?n(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}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),u([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)?Rn:"function"==(e=typeof t)?function(e){var r=t.call(m,e,e.depth);return null==r?Rn(e):Fn(e,"number"==typeof r?[r,r,r,r]:r)}:("number"===e&&(t=[t,t,t,t]),function(e){return Fn(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?(c=t,m):c},m.mode=function(t){return arguments.length?(l=t+"",m):l},Jr(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 qn={floor:C,ceil:C};function Hn(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 Gn(t,e,r,n){var i,a;function o(){var o=Math.min(t.length,e.length)>2?Hn:Nn,l=n?Ur:Nr;return i=o(t,e,l,r),a=o(e,t,l,xr),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(zr)},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 Xn(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Zn(t,e),o()},s.copy=function(){return Gn(t,e,r,n)},o()}function Wn(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function Zn(t,e){return Un(t,Vn(Yn(t,e)[2])),Un(t,Vn(Yn(t,e)[2])),t}function Yn(t,e){null==e&&(e=10);var r=Bn(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 Xn(e,r){return t.range.apply(t,Yn(e,r))}function $n(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=Un(n.map(i),r?Math:Kn);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Bn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var f=1;f<h;f++)o.push(a(c)*f);o.push(a(c))}else for(o.push(a(c));c++<u;)for(f=h-1;f>0;f--)o.push(a(c)*f);for(c=0;o[c]<s;c++);for(u=o.length;o[u-1]>l;u--);o=o.slice(c,u)}return o},o.copy=function(){return $n(t.copy(),e,r,n)},Wn(o,t)}t.scale.linear=function(){return Gn([0,1],[0,1],xr,!1)},t.scale.log=function(){return $n(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 Jn(t,e,r){var n=Qn(e),i=Qn(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 Xn(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain(Zn(r,t))},a.exponent=function(o){return arguments.length?(n=Qn(e=o),i=Qn(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return Jn(t.copy(),e,r)},Wn(a,t)}function Qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ti(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],c=t[1],u=e.length<2?(l=(l+c)/2,0):(c-l)/(e.length-1+n);return i=s(l+u*n/2,u),a=0,r={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(t,n){arguments.length<2&&(n=0);var l=t[0],c=t[1],u=e.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(e.length-1+n)|0;return i=s(l+Math.round(u*n/2+(c-l-(e.length-1+n)*u)/2),u),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 c=t[1]<t[0],u=t[c-0],h=(t[1-c]-u)/(e.length-n+2*l);return i=s(u+h*l,h),c&&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 c=t[1]<t[0],u=t[c-0],h=t[1-c],f=Math.floor((h-u)/(e.length-n+2*l));return i=s(u+Math.round((h-u-(e.length-n)*f)/2),f),c&&i.reverse(),a=Math.round(f*(1-n)),r={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return a},o.rangeExtent=function(){return Bn(r.a[0])},o.copy=function(){return ti(e,r)},o.domain(e)}t.scale.pow=function(){return Jn(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return ti([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(ei)},t.scale.category20=function(){return t.scale.ordinal().range(ri)},t.scale.category20b=function(){return t.scale.ordinal().range(ni)},t.scale.category20c=function(){return t.scale.ordinal().range(ii)};var ei=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ee),ri=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ee),ni=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ee),ii=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ee);function ai(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 ai(e,r)},i()}function oi(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 oi(t,e,r)},o()}function si(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 si(e,r)},n}function li(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 Xn(t,e)},e.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},e.copy=function(){return li(t)},e}function ci(){return 0}t.scale.quantile=function(){return ai([],[])},t.scale.quantize=function(){return oi(0,1,[0,1])},t.scale.threshold=function(){return si([.5],[0,1])},t.scale.identity=function(){return li([0,1])},t.svg={},t.svg.arc=function(){var t=hi,e=fi,r=ci,n=ui,i=pi,a=di,o=mi;function s(){var s=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=i.apply(this,arguments)-Mt,h=a.apply(this,arguments)-Mt,f=Math.abs(h-u),p=u>h?0:1;if(c<s&&(d=c,c=s,s=d),f>=kt)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,m,g,y,v,x,_,b,w,T,A,k,M=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===ui?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=It(g/c*Math.sin(y))),s&&(M=It(g/s*Math.sin(y)))),c){v=c*Math.cos(u+S),x=c*Math.sin(u+S),_=c*Math.cos(h-S),b=c*Math.sin(h-S);var C=Math.abs(h-u-2*S)<=Tt?0:1;if(S&&gi(v,x,_,b)===p^C){var I=(u+h)/2;v=c*Math.cos(I),x=c*Math.sin(I),_=b=null}}else v=x=0;if(s){w=s*Math.cos(h-M),T=s*Math.sin(h-M),A=s*Math.cos(u+M),k=s*Math.sin(u+M);var L=Math.abs(u-h+2*M)<=Tt?0:1;if(M&&gi(w,T,A,k)===1-p^L){var P=(u+h)/2;w=s*Math.cos(P),T=s*Math.sin(P),A=k=null}}else w=T=0;if(f>wt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s<c^p?0:1;var z=d,D=d;if(f<Tt){var O=null==A?[w,T]:null==_?[v,x]:Ee([v,x],[A,k],[_,b],[w,T]),R=v-O[0],F=x-O[1],B=_-O[0],j=b-O[1],N=1/Math.sin(Math.acos((R*B+F*j)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+j*j)))/2),U=Math.sqrt(O[0]*O[0]+O[1]*O[1]);D=Math.min(d,(s-U)/(N-1)),z=Math.min(d,(c-U)/(N+1))}if(null!=_){var V=yi(null==A?[w,T]:[A,k],[v,x],c,z,p),q=yi([_,b],[w,T],c,z,p);d===z?E.push("M",V[0],"A",z,",",z," 0 0,",m," ",V[1],"A",c,",",c," 0 ",1-p^gi(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!=A){var H=yi([v,x],[A,k],s,-D,p),G=yi([w,T],null==_?[v,x]:[_,b],s,-D,p);d===D?E.push("L",G[0],"A",D,",",D," 0 0,",m," ",G[1],"A",s,",",s," 0 ",p^gi(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-p," ",H[1],"A",D,",",D," 0 0,",m," ",H[0]):E.push("L",G[0],"A",D,",",D," 0 0,",m," ",H[0])}else E.push("L",w,",",T)}else E.push("M",v,",",x),null!=_&&E.push("A",c,",",c," 0 ",C,",",p," ",_,",",b),E.push("L",w,",",T),null!=A&&E.push("A",s,",",s," 0 ",L,",",1-p," ",A,",",k);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=ue(e),s):t},s.outerRadius=function(t){return arguments.length?(e=ue(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=ue(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==ui?ui:ue(t),s):n},s.startAngle=function(t){return arguments.length?(i=ue(t),s):i},s.endAngle=function(t){return arguments.length?(a=ue(t),s):a},s.padAngle=function(t){return arguments.length?(o=ue(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 ui="auto";function hi(t){return t.innerRadius}function fi(t){return t.outerRadius}function pi(t){return t.startAngle}function di(t){return t.endAngle}function mi(t){return t&&t.padAngle}function gi(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function yi(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,c=-s*a,u=t[0]+l,h=t[1]+c,f=e[0]+l,p=e[1]+c,d=(u+f)/2,m=(h+p)/2,g=f-u,y=p-h,v=g*g+y*y,x=r-n,_=u*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,A=(_*y+g*b)/v,k=(-_*g+y*b)/v,M=w-d,S=T-m,E=A-d,C=k-m;return M*M+S*S>E*E+C*C&&(w=A,T=k),[[w-l,T-c],[w*r/x,T*r/x]]}function vi(){return!0}function xi(t){var e=we,r=Te,n=vi,i=bi,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,f=ue(e),p=ue(r);function d(){l.push("M",i(t(c),o))}for(;++u<h;)n.call(this,s=a[u],u)?c.push([+f.call(this,s,u),+p.call(this,s,u)]):c.length&&(d(),c=[]);return c.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=_i.get(t)||bi).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return xi(C)};var _i=t.map({linear:bi,"linear-closed":wi,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":Ti,"step-after":Ai,basis:Si,"basis-open":function(t){if(t.length<4)return bi(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(Ei(Li,a)+","+Ei(Li,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Pi(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=[Ei(Li,o),",",Ei(Li,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Pi(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,c=-1;++c<=r;)i=c/r,(n=t[c])[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Si(t)},cardinal:function(t,e){return t.length<3?bi(t):t[0]+ki(t,Mi(t,e))},"cardinal-open":function(t,e){return t.length<4?bi(t):t[1]+ki(t.slice(1,-1),Mi(t,e))},"cardinal-closed":function(t,e){return t.length<3?wi(t):t[0]+ki((t.push(t[0]),t),Mi([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?bi(t):t[0]+ki(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]=zi(i,a);++e<r;)n[e]=(o+(o=zi(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;++s<l;)e=zi(t[s],t[s+1]),v(e)<wt?o[s]=o[s+1]=0:(i=(r=o[s]/e)*r+(n=o[s+1]/e)*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 bi(t){return t.length>1?t.join("L"):t+"Z"}function wi(t){return t.join("L")+"Z"}function Ti(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 ki(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return bi(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 c=2;c<e.length;c++,l++)a=t[l],s=e[c],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var u=t[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+u[0]+","+u[1]}return n}function Mi(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 Si(t){if(t.length<3)return bi(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",Ei(Li,o),",",Ei(Li,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Pi(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Ei(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}_i.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var Ci=[0,2/3,1/3,0],Ii=[0,1/3,2/3,0],Li=[0,1/6,2/3,1/6];function Pi(t,e,r){t.push("C",Ei(Ci,e),",",Ei(Ci,r),",",Ei(Ii,e),",",Ei(Ii,r),",",Ei(Li,e),",",Ei(Li,r))}function zi(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 Oi(t){var e=we,r=we,n=0,i=Te,a=vi,o=bi,s=o.key,l=o,c="L",u=.7;function h(s){var h,f,p,d=[],m=[],g=[],y=-1,v=s.length,x=ue(e),_=ue(n),b=e===r?function(){return f}:ue(r),w=n===i?function(){return p}:ue(i);function T(){d.push("M",o(t(g),u),c,l(t(m.reverse()),u),"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=_i.get(t)||bi).key,l=o.reverse||o,c=o.closed?"M":"L",h):s},h.tension=function(t){return arguments.length?(u=t,h):u},h}function Ri(t){return t.source}function Fi(t){return t.target}function Bi(t){return t.radius}function ji(t){return[t.x,t.y]}function Ni(){return 64}function Ui(){return"circle"}function Vi(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=xi(Di);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Ti.reverse=Ai,Ai.reverse=Ti,t.svg.area=function(){return Oi(C)},t.svg.area.radial=function(){var t=Oi(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=Ri,e=Fi,r=Bi,n=pi,i=di;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),c=n.call(t,s,o)-Mt,u=i.call(t,s,o)-Mt;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}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=ue(t),a):r},a.source=function(e){return arguments.length?(t=ue(e),a):t},a.target=function(t){return arguments.length?(e=ue(t),a):e},a.startAngle=function(t){return arguments.length?(n=ue(t),a):n},a.endAngle=function(t){return arguments.length?(i=ue(t),a):i},a},t.svg.diagonal=function(){var t=Ri,e=Fi,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=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(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=Ui,e=Ni;function r(r,n){return(qi.get(t.call(this,r,n))||Vi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var qi=t.map({circle:Vi,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*Gi)),r=e*Gi;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/Hi),r=e*Hi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Hi),r=e*Hi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=qi.keys();var Hi=Math.sqrt(3),Gi=Math.tan(30*St);G.transition=function(t){for(var e,r,n=Xi||++Ji,i=ea(t),a=[],o=$i||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(r=c[u])&&ra(r,u,i,n,o),e.push(r)}return Yi(a,i,n)},G.interrupt=function(t){return this.each(null==t?Wi:Zi(ea(t)))};var Wi=Zi(ea());function Zi(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 Yi(t,e,r){return N(t,Ki),t.namespace=e,t.id=r,t}var Xi,$i,Ki=[],Ji=0;function Qi(t,e,r,n){var i=t.id,a=t.namespace;return ct(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 ta(t){return null==t&&(t=""),function(){this.textContent=t}}function ea(t){return null==t?"__transition__":"__transition_"+t+"__"}function ra(t,e,r,n,i){var a,o,s,l,c,u=t[r]||(t[r]={active:0,count:0}),h=u[n];function f(r){var i=u.active,f=u[i];for(var d in f&&(f.timer.c=null,f.timer.t=NaN,--u.count,delete u[i],f.event&&f.event.interrupt.call(t,t.__data__,f.index)),u)if(+d<n){var m=u[d];m.timer.c=null,m.timer.t=NaN,--u.count,delete u[d]}o.c=p,ve((function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1}),0,a),u.active=n,h.event&&h.event.start.call(t,t.__data__,e),c=[],h.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)})),l=h.ease,s=h.duration}function p(i){for(var a=i/s,o=l(a),f=c.length;f>0;)c[--f].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(a=i.time,o=ve((function(t){var e=h.delay;if(o.t=e+a,e<=t)return f(t-e);o.c=f}),0,a),h=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.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?Xi?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=W(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(n=c[u])&&(r=t.call(n,n.__data__,u,s))?("__data__"in n&&(r.__data__=n.__data__),ra(r,u,a,i,n[a][i]),e.push(r)):e.push(null)}return Yi(o,a,i)},Ki.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=Z(t);for(var c=-1,u=this.length;++c<u;)for(var h=this[c],f=-1,p=h.length;++f<p;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,c),l.push(e=[]);for(var d=-1,m=r.length;++d<m;)(i=r[d])&&ra(i,d,s,o,a),e.push(i)}return Yi(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 Yi(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):ct(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:xr,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return Qi(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 Qi(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=xr(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 Qi(this,"text",t,ta)},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)),ct(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:ct(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:ct(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=$i,o=Xi;try{Xi=n,ct(this,(function(t,r,a){$i=t[i][n],e.call(t,t.__data__,r,a)}))}finally{$i=a,Xi=o}}else ct(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=++Ji,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var c,u=0,h=(c=this[s]).length;u<h;u++)(e=c[u])&&ra(e,u,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return Yi(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=na,a=6,o=6,s=3,l=[10],c=null;function u(n){n.each((function(){var n,u=t.select(this),h=this.__chart__||r,f=this.__chart__=r.copy(),p=c??(f.ticks?f.ticks.apply(f,l):f.domain()),d=e??(f.tickFormat?f.tickFormat.apply(f,l):C),m=u.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=u.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),t.transition(b));g.append("line"),g.append("text");var T,A,k,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=aa,T="x",k="y",A="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=oa,T="y",k="x",A="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(k,z*x),E.attr(A,0).attr(M,z*a),P.attr(T,0).attr(k,z*x),f.rangeBand){var D=f,O=D.rangeBand()/2;h=f=function(t){return D(t)+O}}else h.rangeBand?h=f:y.call(n,f,h);g.call(n,h,f),v.call(n,f,f)}))}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(i=t in ia?t+"":na,u):i},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],u):a},u.innerTickSize=function(t){return arguments.length?(a=+t,u):a},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(s=+t,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var na="bottom",ia={top:1,right:1,bottom:1,left:1};function aa(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"}))}function oa(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],c=!0,u=!0,h=la[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 sa[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,A=v.classed("extent"),k=vt(y),M=t.mouse(y),S=t.select(o(y)).on("keydown.brush",(function(){32==t.event.keyCode&&(A||(h=null,M[0]-=s[1],M[1]-=l[1],A=2),R())})).on("keyup.brush",(function(){32==t.event.keyCode&&2==A&&(M[0]+=s[1],M[1]+=l[1],A=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(),A)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]),A||(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:A?"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(A&&(p-=m,d-=y+m),a=(i?u:c)?Math.max(p,Math.min(d,t[i])):t[i],A?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),k(),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,Xi?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=_r(s,a.x),n=_r(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=la[!(i=t)<<1|!a],f):i},f.y=function(t){return arguments.length?(h=la[!i<<1|!(a=t)],f):a},f.clamp=function(t){return arguments.length?(i&&a?(c=!!t[0],u=!!t[1]):i?c=!!t:a&&(u=!!t),f):i&&a?[c,u]:i?c:a?u:null},f.extent=function(t){var n,o,c,u,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&&(c=t[0],u=t[1],i&&(c=c[1],u=u[1]),r=[c,u],a.invert&&(c=a(c),u=a(u)),u<c&&(h=c,c=u,u=h),(c!=l[0]||u!=l[1])&&(l=[c,u])),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?(c=r[0],u=r[1]):(c=l[0],u=l[1],a.invert&&(c=a.invert(c),u=a.invert(u)),u<c&&(h=c,c=u,u=h))),i&&a?[[n,c],[o,u]]:i?[n,o]:a&&[c,u])},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 sa={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},la=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];function ca(t){return JSON.parse(t.responseText)}function ua(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}t.text=he((function(t){return t.responseText})),t.json=function(t,e){return fe(t,"application/json",ca,e)},t.html=function(t,e){return fe(t,"text/html",ua,e)},t.xml=he((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}).apply(self)}}),_=p({"node_modules/d3-time/dist/d3-time.js"(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,c=864e5,u=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)/c}),(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)/u}))}var _=x(0),b=x(1),w=x(2),T=x(3),A=x(4),k=x(5),M=x(6),S=_.range,E=b.range,C=w.range,I=T.range,L=A.range,P=k.range,z=M.range,D=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()})),O=D.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()})),j=B.range,N=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=N.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)/c}),(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)/u}))}var G=H(0),W=H(1),Z=H(2),Y=H(3),X=H(4),$=H(5),K=H(6),J=G.range,Q=W.range,tt=Z.range,et=Y.range,rt=X.range,nt=$.range,it=K.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=k,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=D,t.timeMonths=O,t.timeSaturday=M,t.timeSaturdays=z,t.timeSecond=h,t.timeSeconds=f,t.timeSunday=_,t.timeSundays=S,t.timeThursday=A,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=N,t.utcHours=U,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=B,t.utcMinutes=j,t.utcMonday=W,t.utcMondays=Q,t.utcMonth=at,t.utcMonths=ot,t.utcSaturday=K,t.utcSaturdays=it,t.utcSecond=h,t.utcSeconds=f,t.utcSunday=G,t.utcSundays=J,t.utcThursday=X,t.utcThursdays=rt,t.utcTuesday=Z,t.utcTuesdays=tt,t.utcWednesday=Y,t.utcWednesdays=et,t.utcWeek=G,t.utcWeeks=J,t.utcYear=st,t.utcYears=lt,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),b=p({"node_modules/d3-time-format/dist/d3-time-format.js"(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,c=t.periods,u=t.days,h=t.shortDays,f=t.months,vt=t.shortMonths,xt=p(c),_t=d(c),bt=p(u),wt=d(u),Tt=p(h),At=d(h),kt=p(f),Mt=d(f),St=p(vt),Et=d(vt),Ct={a:function(t){return h[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return f[t.getMonth()]},c:null,d:O,e:O,f:N,H:R,I:F,j:B,L:j,m:U,M:V,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:yt,S:q,u:H,U:G,V:W,w:Z,W:Y,x:null,X:null,y:X,Y:$,Z:K,"%":mt},It={a:function(t){return h[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return f[t.getUTCMonth()]},c:null,d:J,e:J,f:nt,H:Q,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:yt,S:ot,u:st,U:lt,V:ct,w:ut,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=At[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=kt.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Dt(t,a,e,r)},d:k,e:k,f:L,H:S,I:S,j:M,L:I,m:A,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:D,S:C,u:g,U:y,V:v,w:m,W:x,x:function(t,e,r){return Dt(t,o,e,r)},X:function(t,e,r){return Dt(t,l,e,r)},y:b,Y:_,Z:w,"%":P};function Pt(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l<u;)37===t.charCodeAt(l)&&(o.push(t.slice(c,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),c=l+1);return o.push(t.slice(c,l)),o.join("")}}function zt(t,a){return function(o){var s,l,c=i(1900,void 0,1);if(Dt(c,t,o+="",0)!=o.length)return null;if("Q"in c)return new Date(c.Q);if("s"in c)return new Date(1e3*c.s+("L"in c?c.L:0));if(a&&!("Z"in c)&&(c.Z=0),"p"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m="q"in c?c.q:0),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Dt(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o<l;){if(n>=c)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+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/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(u,"\\$&")}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 A(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 k(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=c.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 D(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(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 j(t,e){return h(t.getMilliseconds(),e,3)}function N(t,e){return j(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 W(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 Z(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 K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+h(e/60|0,"0",2)+h(e%60,"0",2)}function J(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 ct(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 ut(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&&typeof e<"u"?n(t,_()):n((r=r||self).d3=r.d3||{},r.d3)}}),w=p({"node_modules/d3-format/dist/d3-format.js"(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 c(t){return t}var u,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?c: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+"",u=void 0===t.numerals?c: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,c=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&&"="===c)&&(y=!0,r="0",c="=");var T="$"===g?i:"#"===g&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",A="$"===g?o:/[%p]/.test(w)?p:"",k=l[w],M=/[defgprs%]/.test(w);function S(t){var i,a,o,l=T,p=A;if("c"===w)p=k(t)+p,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:k(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=""),c){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 u(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 u=p(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}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&&typeof e<"u"?t:(r=typeof globalThis<"u"?globalThis:r||self).d3=r.d3||{})}}),T=p({"node_modules/is-string-blank/index.js"(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}}}),A=p({"node_modules/fast-isnumeric/index.js"(t,e){var r=T();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=p({"src/constants/numerical.js"(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:""}}}),M=p({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(t,e){var r,n;r=t,n=function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]: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,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);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[c++]=n<<2|i>>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},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&&typeof e<"u"?t:(r=typeof globalThis<"u"?globalThis:r||self)["base64-arraybuffer"]={})}}),S=p({"src/lib/is_plain_object.js"(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")}}}),E=p({"src/lib/array.js"(t){var e=M().decode,r=S(),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:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};function c(t){return t.constructor===ArrayBuffer}function u(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=c,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;c(s)||(s=e(s));var u=void 0===n.shape?[s.byteLength/o]:(""+n.shape).split(",");u.reverse();var h,f,p=u.length,d=+u[0],m=o*d,g=0;if(1===p)r=new a(s);else if(2===p)for(h=+u[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=+u[1];for(var y=+u[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=u.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||c(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,c=[],u=!0,h=0;for(r=0;r<arguments.length;r++)(o=(i=arguments[r]).length)&&(e?c.push(i):(e=i,a=o),n(i)?t=!1:(u=!1,h?t!==i.constructor&&(t=!1):t=i.constructor),h+=o);if(!h)return[];if(!c.length)return e;if(u)return e.concat.apply(e,c);if(t){for((s=new t(h)).set(e),r=0;r<c.length;r++)i=c[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<c.length;r++){for(i=c[r],l=0;l<i.length;l++)s[a+l]=i[l];a+=l}return s},t.maxRowLength=function(t){return u(t,Math.max,0)},t.minRowLength=function(t){return u(t,Math.min,1/0)}}}),C=p({"src/lib/nested_property.js"(t,e){var r=A(),n=E().isArrayOrTypedArray;function i(t,e){return function(r){var a,o,s,l,c,u=t;for(l=0;l<e.length-1;l++){if(-1===(a=e[l])){for(o=!0,s=[],c=0;c<u.length;c++)s[c]=i(u[c],e.slice(l+1))(r),s[c]!==s[0]&&(o=!1);return o?s[0]:s}if("number"==typeof a&&!n(u)||"object"!=typeof(u=u[a])||null===u)return}if("object"==typeof u&&null!==u&&(s=u[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,c=e.split(".");for(l=0;l<c.length;l++)if("__"===String(c[l]).slice(0,2))throw"bad property string";for(l=0;l<c.length;){if(n=String(c[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(n[1])c[l]=n[1];else{if(0!==l)throw"bad property string";c.splice(0,1)}for(a=n[2].substr(1,n[2].length-2).split("]["),o=0;o<a.length;o++)l++,c.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,c):{set:s(t,c,e),get:i(t,c),astr:e,parts:c,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=[[t,f]],d=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(d=!c(h,e.slice(s+1),i,r))break;return}if(!u(h,a,e[s+1],d))break;if("object"!=typeof(h=h[a])||null===h)throw"container is not an object";f=l(f,a),p.push([h,f])}if(d){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 c(t,e,r,i){var a,l=n(r),c=!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&&(c=!1),u(t,a,d,p)&&s(t[a],e,i.replace("-1",a))(h);return c}function u(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}}}),I=p({"src/lib/keyed_container.js"(t,e){var r=C(),n=/^\w*$/;e.exports=function(t,e,i,a){i=i||"name",a=a||"value";var o,s,l,c={};e&&e.length?(l=r(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o<s.length;o++)u[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=u[t];if(void 0===o){if(4===n)return;n|=3,o=s.length,u[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),c[o]=c[o]|n,f},get:function(t){if(s){var e=u[t];if(void 0!==e)return h?s[e][a]:r(s[e],a).get()}},rename:function(t,e){var r=u[t];return void 0===r||(c[r]=1|c[r],u[e]=r,delete u[t],s[r][i]=e),f},remove:function(t){var e=u[t];if(void 0===e)return f;var n=s[e];if(Object.keys(n).length>2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o<s.length;o++)c[o]=3|c[o];for(o=e;o<s.length;o++)u[s[o][i]]--;s.splice(e,1),delete u[t]}else r(n,a).set(null),c[e]=6|c[e];return f},constructUpdate:function(){for(var t,n,o={},l=Object.keys(c),u=0;u<l.length;u++)n=l[u],t=e+"["+n+"]",s[n]?(1&c[n]&&(o[t+"."+i]=s[n][i]),2&c[n]&&(o[t+"."+a]=h?4&c[n]?null:s[n][a]:4&c[n]?null:r(s[n],a).get())):o[t]=null;return o}};return f}}}),L=p({"src/lib/relative_attr.js"(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}}}),P=p({"src/lib/to_log_range.js"(t,e){var r=A();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}}}),z=p({"src/lib/relink_private.js"(t,e){var r=E().isArrayOrTypedArray,n=S();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),c=0;c<l;c++)s[c]!==o[c]&&n(o[c])&&n(s[c])&&t(s[c],o[c])}else n(o)&&n(s)&&(t(s,o),Object.keys(s).length||delete e[a])}}}}),D=p({"src/lib/mod.js"(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=p({"node_modules/tinycolor2/tinycolor.js"(t,e){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=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=N.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=N.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=N.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=N.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=N.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=N.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=N.hex8.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:i?"name":"hex8"}:(e=N.hex6.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:i?"name":"hex"}:(e=N.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=N.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=D(e.s),c=D(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),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),h=!0,f="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=D(e.s),u=D(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,u),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}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.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=u.ok,this._tc_id=i++}function u(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),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:i,l:c}}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),c=a,u=a-l;if(i=0===a?0:u/a,a==l)n=0;else{switch(a){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:i,v:c}}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(O(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=c(t).toHsl();return r.s-=e/100,r.s=L(r.s),c(r)}function m(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s+=e/100,r.s=L(r.s),c(r)}function g(t){return c(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l+=e/100,r.l=L(r.l),c(r)}function v(t,e){e=0===e?0:e||10;var r=c(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))),c(r)}function x(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l-=e/100,r.l=L(r.l),c(r)}function _(t,e){var r=c(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,c(r)}function b(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function w(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+120)%360,s:e.s,l:e.l}),c({h:(r+240)%360,s:e.s,l:e.l})]}function T(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+90)%360,s:e.s,l:e.l}),c({h:(r+180)%360,s:e.s,l:e.l}),c({h:(r+270)%360,s:e.s,l:e.l})]}function A(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+72)%360,s:e.s,l:e.l}),c({h:(r+216)%360,s:e.s,l:e.l})]}function k(t,e,r){e=e||6,r=r||30;var n=c(t).toHsl(),i=360/r,a=[c(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.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=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(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(O(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=c(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 c(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(k,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({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})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,n=function(t){var e,r;return"AA"!==(e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e&&(e="AA"),"small"!==(r=(t.size||"small").toLowerCase())&&"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},c.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 u=0;u<e.length;u++)(n=c.readability(t,e[u]))>l&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.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=c.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 D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,B,j,N=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+j),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!!N.CSS_UNIT.exec(t)}typeof e<"u"&&e.exports?e.exports=c:window.tinycolor=c}(Math)}}),R=p({"src/lib/extend.js"(t){var e=S(),r=Array.isArray;function n(t,i,a,o){var s,l,c,u,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])c=d[l],u=s[l],o&&r(u)?d[l]=u:i&&u&&(e(u)||(h=r(u)))?(h?(h=!1,f=c&&r(c)?c:[]):f=c&&e(c)?c:{},d[l]=n([f,u],i,a,o)):(typeof u<"u"||a)&&(d[l]=u);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)}}}),F=p({"src/plots/font_attributes.js"(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}}}),B=p({"src/components/fx/constants.js"(t,e){e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}}),j=p({"src/components/fx/layout_attributes.js"(t,e){var r=B(),n=F(),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=p({"src/components/fx/attributes.js"(t,e){var r=F(),n=j().hoverlabel,i=R().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"}}}}),U=p({"src/plots/attributes.js"(t,e){var r=F(),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"}}}}),V=p({"src/components/colorscale/scales.js"(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{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)}}}}),q=p({"src/components/color/attributes.js"(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}}),H=p({"src/components/color/index.js"(t,e){var r=O(),n=A(),i=E().isTypedArray,a=e.exports={},o=q();a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function c(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]=c(o[r]);else t[n]=c(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]=c(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)}}}}),G=p({"src/constants/interactions.js"(t,e){e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),W=p({"src/lib/regex.js"(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=p({"src/lib/coerce.js"(t){var e=A(),r=O(),n=R().extendFlat,i=U(),a=V(),o=H(),s=G().DESELECTDIM,l=C(),c=W().counter,u=D().modHalf,h=E().isArrayOrTypedArray,f=E().isTypedArraySpec,p=E().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(u(+t,360)):r.set(n)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||c(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&&!!c(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,c,u,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]:[],u=_?g.length:v?g[o].length:l.length,s=0;s<u;s++)c=_?g[s]:v?g[o][s]:g,void 0!==(d=a(l[s],c,(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),c=l(r,i),u=s.get(),m=r._template;if(void 0===u&&m&&(u=l(m,i).get(),m=0),void 0===a&&(a=o.dflt),o.arrayOk){if(h(u))return c.set(u),u;if(f(u))return u=p(u),c.set(u),u}var g=t.valObjectMeta[o.valType].coerceFunction;g(u,c,a,o);var y=c.get();return m&&y===a&&!d(u,o)&&(g(u=l(m,i).get(),c,a,o),y=c.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 c="all"===l.dflt?l.flags.slice():l.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.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}}),Y=p({"src/plot_api/plot_config.js"(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}}}),X=p({"src/lib/notifier.js"(t,e){var r=x(),n=A(),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()}))}}}}),$=p({"src/lib/loggers.js"(t,e){var r=Y().dfltConfig,n=X(),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")}}}}),K=p({"src/lib/noop.js"(t,e){e.exports=function(){}}}),J=p({"src/lib/push_unique.js"(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}}}),Q=p({"node_modules/gl-mat4/create.js"(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}}}),tt=p({"node_modules/gl-mat4/clone.js"(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}}}),et=p({"node_modules/gl-mat4/copy.js"(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}}}),rt=p({"node_modules/gl-mat4/identity.js"(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}}}),nt=p({"node_modules/gl-mat4/transpose.js"(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}}}),it=p({"node_modules/gl-mat4/invert.js"(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],c=e[7],u=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*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,A=u*m-h*d,k=u*g-f*d,M=u*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*k+T*A;return I?(I=1/I,t[0]=(s*C-l*E+c*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-c*k)*I,t[5]=(r*C-i*M+a*k)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(u*T-f*_+p*x)*I,t[8]=(o*E-s*M+c*A)*I,t[9]=(n*M-r*E-a*A)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-u*w-p*v)*I,t[12]=(s*k-o*S-l*A)*I,t[13]=(r*S-n*k+i*A)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(u*b-h*x+f*v)*I,t):null}}}),at=p({"node_modules/gl-mat4/adjoint.js"(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],c=e[7],u=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-c*g)+m*(l*p-c*f),t[1]=-(n*(f*y-p*g)-h*(i*y-a*g)+m*(i*p-a*f)),t[2]=n*(l*y-c*g)-s*(i*y-a*g)+m*(i*c-a*l),t[3]=-(n*(l*p-c*f)-s*(i*p-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*y-p*g)-u*(l*y-c*g)+d*(l*p-c*f)),t[5]=r*(f*y-p*g)-u*(i*y-a*g)+d*(i*p-a*f),t[6]=-(r*(l*y-c*g)-o*(i*y-a*g)+d*(i*c-a*l)),t[7]=r*(l*p-c*f)-o*(i*p-a*f)+u*(i*c-a*l),t[8]=o*(h*y-p*m)-u*(s*y-c*m)+d*(s*p-c*h),t[9]=-(r*(h*y-p*m)-u*(n*y-a*m)+d*(n*p-a*h)),t[10]=r*(s*y-c*m)-o*(n*y-a*m)+d*(n*c-a*s),t[11]=-(r*(s*p-c*h)-o*(n*p-a*h)+u*(n*c-a*s)),t[12]=-(o*(h*g-f*m)-u*(s*g-l*m)+d*(s*f-l*h)),t[13]=r*(h*g-f*m)-u*(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)+u*(n*l-i*s),t}}}),ot=p({"node_modules/gl-mat4/determinant.js"(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],c=t[8],u=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)*(u*g-f*d)+(e*l-i*a)*(u*m-h*d)+(r*s-n*o)*(c*g-f*p)-(r*l-i*o)*(c*m-h*p)+(n*l-i*s)*(c*d-u*p)}}}),st=p({"node_modules/gl-mat4/multiply.js"(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],c=e[6],u=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+_*c+b*p+w*y,t[3]=x*o+_*u+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+_*c+b*p+w*y,t[7]=x*o+_*u+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+_*c+b*p+w*y,t[11]=x*o+_*u+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+_*c+b*p+w*y,t[15]=x*o+_*u+b*d+w*v,t}}}),lt=p({"node_modules/gl-mat4/translate.js"(t,e){e.exports=function(t,e,r){var n,i,a,o,s,l,c,u,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],c=e[6],u=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]=c,t[7]=u,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+c*g+p*y+e[14],t[15]=o*m+u*g+d*y+e[15]),t}}}),ct=p({"node_modules/gl-mat4/scale.js"(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=p({"node_modules/gl-mat4/rotate.js"(t,e){e.exports=function(t,e,r,n){var i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,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),o=1-(a=Math.cos(r)),s=e[0],l=e[1],c=e[2],u=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,A=I*C*o+E*i,k=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]=c*x+p*_+y*b,t[3]=u*x+d*_+v*b,t[4]=s*w+h*T+m*A,t[5]=l*w+f*T+g*A,t[6]=c*w+p*T+y*A,t[7]=u*w+d*T+v*A,t[8]=s*k+h*M+m*S,t[9]=l*k+f*M+g*S,t[10]=c*k+p*M+y*S,t[11]=u*k+d*M+v*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}}}),ht=p({"node_modules/gl-mat4/rotateX.js"(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],c=e[8],u=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+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}}}),ft=p({"node_modules/gl-mat4/rotateY.js"(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],c=e[8],u=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-c*n,t[1]=o*i-u*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}}}),pt=p({"node_modules/gl-mat4/rotateZ.js"(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],c=e[4],u=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+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}}}),dt=p({"node_modules/gl-mat4/fromRotation.js"(t,e){e.exports=function(t,e,r){var n,i,a,o=r[0],s=r[1],l=r[2],c=Math.sqrt(o*o+s*s+l*l);return Math.abs(c)<1e-6?null:(o*=c=1/c,s*=c,l*=c,n=Math.sin(e),a=1-(i=Math.cos(e)),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)}}}),mt=p({"node_modules/gl-mat4/fromRotationTranslation.js"(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,c=a+a,u=n*s,h=n*l,f=n*c,p=i*l,d=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return t[0]=1-(p+m),t[1]=h+v,t[2]=f-y,t[3]=0,t[4]=h-v,t[5]=1-(u+m),t[6]=d+g,t[7]=0,t[8]=f+y,t[9]=d-g,t[10]=1-(u+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}}}),gt=p({"node_modules/gl-mat4/fromScaling.js"(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}}}),yt=p({"node_modules/gl-mat4/fromTranslation.js"(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}}}),vt=p({"node_modules/gl-mat4/fromXRotation.js"(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}}}),xt=p({"node_modules/gl-mat4/fromYRotation.js"(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}}}),_t=p({"node_modules/gl-mat4/fromZRotation.js"(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}}}),bt=p({"node_modules/gl-mat4/fromQuat.js"(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,c=r*o,u=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]=u+y,t[2]=f-g,t[3]=0,t[4]=u-y,t[5]=1-c-d,t[6]=p+m,t[7]=0,t[8]=f+g,t[9]=p-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),wt=p({"node_modules/gl-mat4/frustum.js"(t,e){e.exports=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=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)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t}}}),Tt=p({"node_modules/gl-mat4/perspective.js"(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}}}),At=p({"node_modules/gl-mat4/perspectiveFromFieldOfView.js"(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),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.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=p({"node_modules/gl-mat4/ortho.js"(t,e){e.exports=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t}}}),Mt=p({"node_modules/gl-mat4/lookAt.js"(t,e){var r=rt();e.exports=function(t,e,n,i){var a,o,s,l,c,u,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,a=x*(p*=d=1/Math.sqrt(h*h+f*f+p*p))-_*(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,c=p*a-h*s,u=h*o-f*a,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=s,t[9]=u,t[10]=p,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(l*m+c*g+u*y),t[14]=-(h*m+f*g+p*y),t[15]=1,t)}}}),St=p({"node_modules/gl-mat4/str.js"(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]+")"}}}),Et=p({"node_modules/gl-mat4/index.js"(t,e){e.exports={create:Q(),clone:tt(),copy:et(),identity:rt(),transpose:nt(),invert:it(),adjoint:at(),determinant:ot(),multiply:st(),translate:lt(),scale:ct(),rotate:ut(),rotateX:ht(),rotateY:ft(),rotateZ:pt(),fromRotation:dt(),fromRotationTranslation:mt(),fromScaling:gt(),fromTranslation:yt(),fromXRotation:vt(),fromYRotation:xt(),fromZRotation:_t(),fromQuat:bt(),frustum:wt(),perspective:Tt(),perspectiveFromFieldOfView:At(),ortho:kt(),lookAt:Mt(),str:St()}}}),Ct=p({"src/lib/matrix.js"(t){var e=Et();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]]]}}}),It=p({"src/lib/dom.js"(t,e){var r=x(),n=$(),i=Ct(),a=Et();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 c(t){for(var e=[];u(t);)e.push(t),t=t.parentNode,"function"==typeof ShadowRoot&&t instanceof ShadowRoot&&(t=t.host);return e}function u(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=c(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:c,equalDomRects:function(t,e){return t&&e&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}}}}),Lt=p({"src/plots/animation_attributes.js"(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"}}}}}),Pt=p({"src/plot_api/edit_types.js"(t,e){var r=R().extendFlat,n=S(),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 c(t,e,i){var a=r({},t);for(var o in a){var s=a[o];n(s)&&(a[o]=u(s,e,0,o))}return"from-root"===i&&(a.editType=e),a}function u(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]=u(t.items[o],e)}return a}return c(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:c}}}),zt=p({"src/components/drawing/attributes.js"(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"}}}),Dt=p({"src/constants/docs.js"(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=p({"src/plots/template_attributes.js"(t){var e=Dt(),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"}}}}),Rt=p({"src/components/shapes/label_texttemplate.js"(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 c(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:c(t,0,r)/l(t,e)},dx:l,dy:c,width:function(t,e){return Math.abs(l(t,e))},height:function(t,e,r){return Math.abs(c(t,0,r))},length:function(t,e,r){return"line"!==t.type?void 0:Math.sqrt(Math.pow(l(t,e),2)+Math.pow(c(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)}}}}),Ft=p({"src/components/shapes/draw_newshape/attributes.js"(t,e){var r=Pt().overrideAll,n=U(),i=F(),a=zt().dash,o=R().extendFlat,s=Ot().shapeTexttemplateAttrs,l=Rt();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")}}),Bt=p({"src/components/selections/draw_newselection/attributes.js"(t,e){var r=zt().dash,n=R().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"}}}}),jt=p({"src/plots/pad_attributes.js"(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=p({"src/plots/layout_attributes.js"(t,e){var r=F(),n=Lt(),i=q(),a=Ft(),o=Bt(),s=jt(),l=R().extendFlat,c=r({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,e.exports={font:c,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"})}}}),Ut=f({"temp_stylePlugin:node_modules/maplibre-gl/dist/maplibre-gl.css"(){}}),Vt=f({"stylePlugin:/home/cam/Development/plotly/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"(){Ut()}}),qt=p({"src/registry.js"(t){var e=$(),r=K(),n=J(),i=S(),a=It().addStyleRule,o=R(),s=U(),l=Nt(),c=o.extendFlat,u=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 u 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(u,n);r.layoutAttributes&&c(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&&Vt(),("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&&u(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,c=l[r];if(c||(l[r]=c={}),n!==r){var u=l[n];u||(l[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=i),s&&u.format===c.format&&(u.format=a)}o&&(c.dictionary=i),s&&(c.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&&u(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&&u(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)}}}),Ht=p({"src/lib/dates.js"(t){var e,r,n=b().timeFormat,i=A(),a=$(),o=D().mod,s=k(),l=s.BADNUM,c=s.ONEDAY,u=s.ONEHOUR,h=s.ONEMIN,f=s.ONESEC,p=s.EPOCHJD,d=qt(),m=b().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 _(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+=c*(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 A=T[1],k=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===A.length)return l;var I;A=Number(A);try{var L=d.getComponentMethod("calendars","getCal")(i);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),I=L.newDate(A,L.toMonthIndex(A,k,P),M)}else I=L.newDate(A,Number(k),M)}catch{return l}return I?(I.toJD()-p)*c+S*u+E*h+C*f:l}A=2===A.length?(Number(A)+2e3-v)%100+v:Number(A),k-=1;var z=new Date(Date.UTC(2e3,k,M,S,E));return z.setUTCFullYear(A),z.getUTCMonth()!==k||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*c,T=3*u,M=5*h;function S(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+_(e,2)+":"+_(r,2),(n||i)&&(t+=":"+_(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+_(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)),A=Math.round(t-b/10);if(x(i)){var k=Math.floor(A/c)+p,E=Math.floor(o(t,c));try{a=d.getComponentMethod("calendars","getCal")(i).fromJD(k).formatDate("yyyy-mm-dd")}catch{a=m("G%Y-%m-%d")(new Date(A))}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/u):0,g=n<w?Math.floor(E%u/h):0,y=n<T?Math.floor(E%h/f):0,v=n<M?E%f*10+b:0}else _=new Date(A),a=m("%Y-%m-%d")(_),s=n<w?_.getUTCHours():0,g=n<w?_.getUTCMinutes():0,y=n<T?_.getUTCSeconds():0,v=n<M?10*_.getUTCMilliseconds()+b:0;return S(a,s,g,y,v)},t.ms2DateTimeLocal=function(t){if(!(t>=e+c&&t<=r-c))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{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,c),n=_(Math.floor(r/u),2)+":"+_(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 z=3*c;t.incrementMonth=function(t,e,r){r=x(r)&&r;var n=o(t,c);if(t=Math.round(t-n),r)try{var i=Math.round(t/c)+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)*c+n}catch{a.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+z);return u.setUTCMonth(u.getUTCMonth()+e)+n-z},t.findExactDates=function(t,e){for(var r,n,a=0,o=0,s=0,l=0,u=x(e)&&d.getComponentMethod("calendars","getCal")(e),h=0;h<t.length;h++)if(n=t[h],i(n)){if(!(n%c))if(u)try{1===(r=u.fromJD(n/c+p)).day()?1===r.month()?a++:o++:s++}catch{}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}}}}),Gt=p({"src/lib/identity.js"(t,e){e.exports=function(t){return t}}}),Wt=p({"src/lib/search.js"(t){var e=A(),r=$(),n=Gt(),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 c(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 u,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?c:l,t+=m*a*(i?-1:1)*(m>=0?1:-1);f<p&&d++<100;)h(n[u=Math.floor((f+p)/2)],t)?f=u+1:p=u;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=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}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,c=r?Math.ceil:Math.floor;i<a&&o++<100;)e[n=c((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}}}),Zt=p({"src/lib/sort_object_keys.js"(t,e){e.exports=function(t){return Object.keys(t).sort()}}}),Yt=p({"src/lib/stats.js"(t){var e=A(),r=E().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)]}}}),Xt=p({"src/lib/angles.js"(t,e){var r=D(),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 c(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 u(t,e,r,n,i,l,c){i=i||0,l=l||0;var u,h,f,p,d,m=s([r,n]);function g(t,e){return[t*Math.cos(e)+i,l-t*Math.sin(e)]}m?(u=0,h=a,f=o):r<n?(u=r,f=n):(u=n,f=r),t<e?(p=t,d=e):(p=e,d=t);var y,v=Math.abs(f-u)<=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,u)+x(d,h,0)+x(d,f,0)+"Z":"M"+g(p,u)+x(p,h,0)+x(p,f,0)+"ZM"+g(d,u)+x(d,h,1)+x(d,f,1)+"Z":null===p?(y="M"+g(d,u)+x(d,f,0),c&&(y+="L0,0Z")):y="M"+g(p,u)+"L"+g(d,u)+x(d,f,0)+"L"+g(p,f)+x(p,u,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:c,isPtInsideSector:function(t,e,r,n){return!!c(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 u(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return u(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return u(t,e,r,n,i,a,1)}}}}),$t=p({"src/lib/anchor_utils.js"(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}}}),Kt=p({"src/lib/geometry2d.js"(t){var e,r,n,i=D().mod;function a(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,h=n-e,f=a-e,p=s-a,d=l*p-u*h;if(0===d)return null;var m=(c*p-u*f)/d,g=(c*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,c){if(a(t,e,r,n,i,s,l,c))return 0;var u=r-t,h=n-e,f=l-i,p=c-s,d=u*u+h*h,m=f*f+p*p,g=Math.min(o(u,h,d,i-t,s-e),o(u,h,d,l-t,c-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)),c=t.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(i(o,a)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};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,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=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(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&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,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h<c;){if(i=(f+p)/2,o=(a=t.getPointAtLength(i))[r]-e,Math.abs(o)<l)return a;u*o>0?p=i:f=i,h++}return a}}}),Jt=p({"src/lib/throttle.js"(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)}}}),Qt=p({"src/lib/clear_responsive.js"(t,e){e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}}}),te=p({"node_modules/is-mobile/index.js"(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&&typeof navigator<"u"&&(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}}}),ee=p({"src/lib/preserve_drawing_buffer.js"(t,e){var r=A(),n=te();e.exports=function(t){var e,i;if(t&&t.hasOwnProperty("userAgent")?e=t.userAgent:(typeof navigator<"u"&&(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 c=o[l];if("Version/"===c.substr(0,8)){var u=c.substr(8).split(".")[0];if(r(u)&&(u=+u),u>=13)return!0}}return a}}}),re=p({"src/lib/make_trace_groups.js"(t,e){var r=x();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}}}),ne=p({"src/lib/localize.js"(t,e){var r=qt();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 c=n.split("-")[0];if(c===n)break;n=c}return e}}}),ie=p({"src/lib/filter_unique.js"(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}}}),ae=p({"src/lib/filter_visible.js"(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}}}),oe=p({"src/lib/increment.js"(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}}}),se=p({"src/lib/clean_number.js"(t,e){var r=A(),n=k().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),r(t)?Number(t):n}}}),le=p({"src/lib/index.js"(t,e){var r=x(),n=b().utcFormat,i=w().format,a=A(),o=k(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=e.exports={};u.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={};u.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,u.warn('encountered bad format: "'+e+'"'))},u.noFormat=function(t){return String(t)},u.numberFormat=function(t){var e;try{e=i(u.adjustFormat(t))}catch{return u.warnBadFormat(t),u.noFormat}return e},u.nestedProperty=C(),u.keyedContainer=I(),u.relativeAttr=L(),u.isPlainObject=S(),u.toLogRange=P(),u.relinkPrivateKeys=z();var f=E();u.isArrayBuffer=f.isArrayBuffer,u.isTypedArray=f.isTypedArray,u.isArrayOrTypedArray=f.isArrayOrTypedArray,u.isArray1D=f.isArray1D,u.ensureArray=f.ensureArray,u.concat=f.concat,u.maxRowLength=f.maxRowLength,u.minRowLength=f.minRowLength;var p=D();u.mod=p.mod,u.modHalf=p.modHalf;var d=Z();u.valObjectMeta=d.valObjectMeta,u.coerce=d.coerce,u.coerce2=d.coerce2,u.coerceFont=d.coerceFont,u.coercePattern=d.coercePattern,u.coerceHoverinfo=d.coerceHoverinfo,u.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,u.validate=d.validate;var m=Ht();u.dateTime2ms=m.dateTime2ms,u.isDateTime=m.isDateTime,u.ms2DateTime=m.ms2DateTime,u.ms2DateTimeLocal=m.ms2DateTimeLocal,u.cleanDate=m.cleanDate,u.isJSDate=m.isJSDate,u.formatDate=m.formatDate,u.incrementMonth=m.incrementMonth,u.dateTick0=m.dateTick0,u.dfltRange=m.dfltRange,u.findExactDates=m.findExactDates,u.MIN_MS=m.MIN_MS,u.MAX_MS=m.MAX_MS;var g=Wt();u.findBin=g.findBin,u.sorterAsc=g.sorterAsc,u.sorterDes=g.sorterDes,u.distinctVals=g.distinctVals,u.roundUp=g.roundUp,u.sort=g.sort,u.findIndexOfMin=g.findIndexOfMin,u.sortObjectKeys=Zt();var y=Yt();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var v=Ct();u.init2dArray=v.init2dArray,u.transposeRagged=v.transposeRagged,u.dot=v.dot,u.translationMatrix=v.translationMatrix,u.rotationMatrix=v.rotationMatrix,u.rotationXYMatrix=v.rotationXYMatrix,u.apply3DTransform=v.apply3DTransform,u.apply2DTransform=v.apply2DTransform,u.apply2DTransform2=v.apply2DTransform2,u.convertCssMatrix=v.convertCssMatrix,u.inverseTransformMatrix=v.inverseTransformMatrix;var _=Xt();u.deg2rad=_.deg2rad,u.rad2deg=_.rad2deg,u.angleDelta=_.angleDelta,u.angleDist=_.angleDist,u.isFullCircle=_.isFullCircle,u.isAngleInsideSector=_.isAngleInsideSector,u.isPtInsideSector=_.isPtInsideSector,u.pathArc=_.pathArc,u.pathSector=_.pathSector,u.pathAnnulus=_.pathAnnulus;var T=$t();u.isLeftAnchor=T.isLeftAnchor,u.isCenterAnchor=T.isCenterAnchor,u.isRightAnchor=T.isRightAnchor,u.isTopAnchor=T.isTopAnchor,u.isMiddleAnchor=T.isMiddleAnchor,u.isBottomAnchor=T.isBottomAnchor;var M=Kt();u.segmentsIntersect=M.segmentsIntersect,u.segmentDistance=M.segmentDistance,u.getTextLocation=M.getTextLocation,u.clearLocationCache=M.clearLocationCache,u.getVisibleSegment=M.getVisibleSegment,u.findPointOnPath=M.findPointOnPath;var O=R();u.extendFlat=O.extendFlat,u.extendDeep=O.extendDeep,u.extendDeepAll=O.extendDeepAll,u.extendDeepNoArrays=O.extendDeepNoArrays;var F=$();u.log=F.log,u.warn=F.warn,u.error=F.error;var B=W();u.counterRegex=B.counter;var j=Jt();u.throttle=j.throttle,u.throttleDone=j.done,u.clearThrottle=j.clear;var N=It();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}u.getGraphDiv=N.getGraphDiv,u.isPlotDiv=N.isPlotDiv,u.removeElement=N.removeElement,u.addStyleRule=N.addStyleRule,u.addRelatedStyleRule=N.addRelatedStyleRule,u.deleteRelatedStyleRule=N.deleteRelatedStyleRule,u.setStyleOnHover=N.setStyleOnHover,u.getFullTransformMatrix=N.getFullTransformMatrix,u.getElementTransformMatrix=N.getElementTransformMatrix,u.getElementAndAncestors=N.getElementAndAncestors,u.equalDomRects=N.equalDomRects,u.clearResponsive=Qt(),u.preserveDrawingBuffer=ee(),u.makeTraceGroups=re(),u._=ne(),u.notifier=X(),u.filterUnique=ie(),u.filterVisible=ae(),u.pushUnique=J(),u.increment=oe(),u.cleanNumber=se(),u.ensureNumber=function(t){return a(t)?(t=Number(t))>s||t<l?c:t:c},u.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&a(t)&&t>=0&&t%1==0},u.noop=K(),u.identity=Gt(),u.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},u.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=u.nestedProperty(t,a.replace("?",r)),s=u.nestedProperty(t,a.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},u.raiseToTop=function(t){t.parentNode.appendChild(t)},u.cancelTransition=function(t){return t.transition().duration(0)},u.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},u.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},u.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},u.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 c=s-Math.floor(s);for(a=0;a<Math.floor(s);a++)l=Math.floor(Math.random()*n).toString(n)+l;c&&(o=Math.pow(n,c),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?(u.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},u.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},u.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,c=new Array(l),u=new Array(o);for(r=0;r<l;r++)c[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]*c[n];u[r]=a}return u},u.syncOrAsync=function(t,e,r){var n;function i(){return u.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)},u.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},u.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]]}},u.mergeArray=function(t,e,r,n){var i="function"==typeof n;if(u.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}},u.mergeArrayCastPositive=function(t,e,r){return u.mergeArray(t,e,r,(function(t){var e=+t;return isFinite(e)&&e>0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=n(t[i])},u.castOption=function(t,e,r,n){n=n||u.identity;var i=u.nestedProperty(t,r).get();return u.isArrayOrTypedArray(i)?Array.isArray(e)&&u.isArrayOrTypedArray(i[e[0]])?n(i[e[0]][e[1]]):n(i[e]):i},u.extractOption=function(t,e,r,n){if(r in t)return t[r];var i=u.nestedProperty(e,n).get();return Array.isArray(i)?void 0:i},u.tagSelected=function(t,e,r){var n,i,a=e.selectedpoints,o=e._indexToPoints;o&&(n=U(o));for(var s=0;s<a.length;s++){var l=a[s];if(u.isIndex(l)||u.isArrayOrTypedArray(l)&&u.isIndex(l[0])&&u.isIndex(l[1])){var c=n?n[l]:l,h=r?r[c]:c;void 0!==(i=h)&&i<t.length&&(t[h].selected=1)}}},u.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(u.isIndex(o)){var s=n[o];u.isIndex(s)&&i.push(s)}}return i}return e},u.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=u.nestedProperty(t,r).get();return!!u.isArrayOrTypedArray(n)&&n}return!!u.isArrayOrTypedArray(r)&&r},u.minExtend=function t(e,r,n){var i={};"object"!=typeof r&&(r={});var a,o,s,l="pieLike"===n?-1:3,c=Object.keys(e);for(a=0;a<c.length;a++)s=e[o=c[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):u.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(c=Object.keys(r),a=0;a<c.length;a++)("object"!=typeof(s=r[o=c[a]])||!(o in i)||"object"!=typeof i[o])&&(i[o]=s);return i},u.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},u.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/;u.isSafari=function(){return V.test(window.navigator.userAgent)};var q=/iPad|iPhone|iPod/;u.isIOS=function(){return q.test(window.navigator.userAgent)};var H=/Macintosh.+AppleWebKit.+Gecko\)$/;u.isMacWKWebView=()=>H.test(window.navigator.userAgent);var G=/Firefox\/(\d+)\.\d+/;u.getFirefoxVersion=function(){var t=G.exec(window.navigator.userAgent);if(t&&2===t.length){var e=parseInt(t[1]);if(!isNaN(e))return e}return null},u.isD3Selection=function(t){return t instanceof r.selection},u.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},u.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},u.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 Y=/^([^\[\.]+)\.(.+)?/,Q=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function tt(t){return"__"===t.slice(0,2)}u.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(Y)){if(i=t[r],tt(n=e[1]))continue;delete t[r],t[n]=u.extendDeepNoArrays(t[n]||{},u.objectFromPath(r,u.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]||{},u.extendDeepNoArrays(o,u.objectFromPath(s,u.expandObjectPaths(i)));else{if(tt(n))continue;t[n][a]=u.expandObjectPaths(i)}}else{if(tt(r))continue;t[r]=u.expandObjectPaths(t[r])}return t},u.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},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var et=/^\w*$/;u.templateString=function(t,e){var r={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,n){var i;return et.test(n)?i=e[n]:(r[n]=r[n]||u.nestedProperty(e,n).get,i=r[n](!0)),void 0!==i?i:""}))};var rt={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return st.apply(rt,arguments)};var nt={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return st.apply(nt,arguments)};var it=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,at={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return st.apply(at,arguments)};var ot=/^[:|\|]/;function st(t,e,r){var i=this,a=arguments;return e||(e={}),t.replace(u.TEMPLATE_STRING_REGEX,(function(t,o,s){var l="_xother"===o||"_yother"===o,c="_xother_"===o||"_yother_"===o,h="xother_"===o||"yother_"===o,f="xother"===o||"yother"===o||l||h||c,p=o;(l||c)&&(p=p.substring(1)),(h||c)&&(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=u.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&&(u.warn("Variable '"+p+"' in "+i.name+" could not be found!"),d=t),i.count===i.max&&u.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,t;if(s){var _;if(":"===s[0]&&(_=r?r.numberFormat:u.numberFormat,""!==d&&(d=_(s.replace(ot,""))(d))),"|"===s[0]){_=r?r.timeFormat:n;var b=u.dateTime2ms(d);d=u.formatDate(b,s.replace(ot,""),!1,_)}}else{var w=p+"Label";e.hasOwnProperty(w)&&(d=e[w])}return f&&(d="("+d+")",(l||c)&&(d=" "+d),(h||c)&&(d+=" ")),d}))}u.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,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var lt=2e9;u.seedPseudoRandom=function(){lt=2e9},u.pseudoRandom=function(){var t=lt;return lt=(69069*lt+1)%4294967296,Math.abs(lt-t)<429496729?u.pseudoRandom():lt/4294967296},u.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=u.extractOption(t,e,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(t,e,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(t){return t||0===t},u.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},u.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},u.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""},u.strRotate=function(t){return t?"rotate("+t+")":""},u.strScale=function(t){return 1!==t?"scale("+t+")":""},u.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,c=t.scale;return c?c>1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(t,e){t.attr("transform",u.getTextTransform(e)),t.style("display",e.scale?null:"none")},u.ensureUniformFontSize=function(t,e){var r=u.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},u.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)},u.bigFont=function(t){return Math.round(1.2*t)};var ct=u.getFirefoxVersion(),ut=null!==ct&&ct<86;u.getPositionFromD3Event=function(){return ut?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),ce=p({"build/plotcss.js"(){var t,e,r=le(),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])}}),ue=p({"node_modules/is-browser/client.js"(t,e){e.exports=!0}}),he=p({"node_modules/has-hover/index.js"(t,e){var r,n=ue();r="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,e.exports=r}}),fe=p({"node_modules/events/events.js"(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){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,i)}))},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 c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(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=c(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 c(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 c=l.length,u=m(l,c);for(r=0;r<c;++r)i(u[r],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(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):[]}}}),pe=p({"src/lib/events.js"(t,e){var r=fe().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",(()=>{})),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}}),de=p({"src/lib/queue.js"(t,e){var r=le(),n=Y().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}}),me=p({"src/plots/frame_attributes.js"(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"}}}}),ge=p({"src/plot_api/plot_schema.js"(t){var e=qt(),r=le(),n=U(),i=Nt(),a=me(),o=Lt(),s=Y().configAttributes,l=Pt(),c=r.extendDeepAll,u=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(!u(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 c(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?c(n,r.layoutAttributes):r.layoutAttributes&&A(n,r.layoutAttributes,r.name)}return{layoutAttributes:w(n)}}function b(){var t={frames:c({},a)};return w(t),t.frames}function w(e){return function(e){t.crawl(e,(function(e,r,n){t.isValObject(e)?(!0===e.arrayOk||"data_array"===e.valType)&&(n[r+"src"]={valType:"string",editType:"none"}):u(e)&&(e.role="object")}))}(e),function(e){t.crawl(e,(function(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")}}))}(e),function(t){!function t(e){for(var r in e)if(u(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(e),e}function T(t,e,r){var n=f(t,r),i=c({},e.layoutAttributes);i[d]=!0,n.set(i)}function A(t,e,r){var n=f(t,r);n.set(c(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;a=(i=e.modules[r]._module).basePlotModule;var o={type:null},s=c({},n),l=c({},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)})),c(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,c(o,l),a.attributes&&c(o,a.attributes),o.type=r;var u={meta:i.meta||{},categories:i.categories||{},animatable:!!i.animatable,type:r,attributes:w(o)};if(i.layoutAttributes){var h={};c(h,i.layoutAttributes),u.layoutAttributes=w(h)}return i.animatable||t.crawl(u,(function(e){t.isValObject(e)&&"anim"in e&&delete e.anim})),u}(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)&&u(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)&&c(r,0,"")}function c(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++)u(n[f])&&c(n[f],e+1,l+"["+f+"].")}else u(n)&&c(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 c;for(n=0;n<l.length;n++){if((o=l[n]).attrRegex&&o.attrRegex.test(r)){if(o.layoutAttrOverrides)return o.layoutAttrOverrides;!c&&o.layoutAttributes&&(c=o.layoutAttributes)}var u=o.baseLayoutAttrOverrides;if(u&&r in u)return u[r]}if(c)return c}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)}}}),ye=p({"src/plot_api/plot_template.js"(t){var e=le(),r=U(),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 c={};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 u=l[o];if(u.name===i)return c[i]=1,e._template=u,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)&&!c[i]){var o={_template:r,name:i,_input:{_templateitemname:i}};o[n]=r[n],t.push(o),c[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,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(t,r){s?e.nestedProperty(l[c],t).set(r):l[c+"."+t]=r}function f(){var t=l;return u(),t}return u(),{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])}}}}}),ve=p({"src/plots/cartesian/constants.js"(t,e){var r=W().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"}}}),xe=p({"src/plots/cartesian/axis_ids.js"(t){var e=qt(),r=ve();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 c=i._subplots.gl3d||[];for(a=0;a<c.length;a++){var u=i[c[a]];r?s.push(u[r+"axis"]):s.push(u.xaxis,u.yaxis,u.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)}}}),_e=p({"src/components/shapes/handle_outline.js"(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}}}}),be=p({"src/traces/scatter/layout_attributes.js"(t,e){e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),we=p({"src/plots/get_data.js"(t){var e=qt();ve().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 c=t[l],u=c[0].trace,h=void 0!==u.zorder;!0!==u.visible||0===u._length||(!u._module||u._module.plot!==i||h&&u.zorder!==s?o.push(c):a.push(c))}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}}}),Te=p({"src/plots/command.js"(t){var e=qt(),r=le();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 c=0;c<s;c++)a[c]=n?n[c]:c}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 u=o;o=[];for(var h=0;h<a.length;h++)o[h]=u}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 c=t.hasSimpleAPICommandBindings(e,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(e,c,s.cache),s.check=function(){if(l){var t=n(e,c,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<u.length;h++)e._internalOn(u[h],s.check);s.remove=function(){for(var t=0;t<u.length;t++)e._removeInternalListener(u[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],c=l.method,u=l.args;if(Array.isArray(u)||(u=[]),!c)return!1;var h=t.computeAPICommandBindings(e,c,u);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}}}),Ae=p({"src/plots/plots.js"(t,e){var r=x(),n=b().timeFormatLocale,i=w().formatLocale,a=A(),o=M(),s=qt(),l=ge(),c=ye(),u=le(),h=H(),f=k().BADNUM,p=xe(),d=_e().clearOutline,m=be(),g=Lt(),y=me(),v=we().getModuleCalcData,_=u.relinkPrivateKeys,T=u._,S=e.exports={};u.extendFlat(S,s),S.attributes=U(),S.attributes.type.values=S.allTypes,S.fontAttrs=F(),S.layoutAttributes=Nt();var E=Te();S.executeAPICommand=E.executeAPICommand,S.computeAPICommandBindings=E.computeAPICommandBindings,S.manageCommandObserver=E.manageCommandObserver,S.hasSimpleAPICommandBindings=E.hasSimpleAPICommandBindings,S.redrawText=function(t){return t=u.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=u.getGraphDiv(t);var e,r=new Promise((function(r,n){(!t||u.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||u.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=u.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,c=0;c<2;c++){var u=(l[r]||{}).format;if(u&&(a(u),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,c=0;c<l.length;c++){var u=l[c],h=n?t._id+u:u+t._id;o||(o=h);var f=p.getFromId(r,u);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 D(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={},c=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:T(t,"Click to enter Plot title"),subtitle:T(t,"Click to enter Plot subtitle"),x:T(t,"Click to enter X axis title"),y:T(t,"Click to enter Y axis title"),colorbar:T(t,"Click to enter Colorscale title"),annotation:T(t,"new text")},l._traceWord=T(t,"trace");var y=L(t,C);if(l._mapboxAccessToken=g.mapboxAccessToken,a._initialAutoSizeIsDone){var v=a.width,x=a.height;S.supplyLayoutGlobalDefaults(c,l,y),c.width||(l.width=v),c.height||(l.height=x),S.sanitizeMargins(l)}else{S.supplyLayoutGlobalDefaults(c,l,y);var b=!c.width||!c.height,w=l.autosize,A=g.autosizable;b&&(w||A)?S.plotAutoSize(t,c,l):b&&S.sanitizeMargins(l),!w&&b&&(c.width=l.width,c.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(u.adjustFormat(e))}catch{return u.warnBadFormat(e),u.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++)u.pushUnique(r,o[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),M=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),c={};function h(t,e){l[e]=t,c[t]=1}function f(t,e){if(t&&"string"==typeof t&&!c[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(u.randstr(c),r))}return l}(h,p),S.supplyDataDefaults(p,f,c,l);var P=Object.keys(M.x),z=Object.keys(M.y);if(P.length>1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<P.length;o++)u.pushUnique(k.xaxis,P[o]);for(o=0;o<z.length;o++)u.pushUnique(k.yaxis,z[o]);for(var O in E)u.pushUnique(k.cartesian,O)}if(l._has=S._hasPlotType.bind(l),h.length===f.length)for(o=0;o<f.length;o++)_(f[o],h[o]);S.supplyLayoutModuleDefaults(c,l,f,t._transitionData);var R=l._visibleModules,F=[];for(o=0;o<R.length;o++){var B=R[o].crossTraceDefaults;B&&u.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 j=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));j&&!N?a._bgLayer.remove():N&&!j&&(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),_(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];D(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,c=a._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],l=u.nestedProperty(a,s).get().slice(),u.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"),c=e._has&&e._has("gl");l&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!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;u&&n._infolayer.select(".cb"+h).remove()}},S.linkSubplots=function(t,e,r,n){var i,a,o=n._plots||{},l=e._plots={},c={_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(c,d,"x"),y=p.getFromId(c,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(c,null,!0);for(i=0;i<_.length;i++){var b=null;(x=_[i]).overlaying&&(b=p.getFromId(c,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(c,x.anchor)}for(i=0;i<_.length;i++)if((x=_[i])._counterAxes.sort(p.idSort),x._subplotsWith.sort(u.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 A=p.getFromId(c,x._counterAxes[a]);w=Math.min(w,A.domain[0]),T=Math.max(T,A.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++)u.nestedProperty(t,"_input."+e[n]).get()||u.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&&(u.pushUnique(l,r),!0===t.visible&&u.pushUnique(h,r),u.pushUnique(f,t._module.basePlotModule),!1!==t._input.visible&&p++)}n._transformModules=[];var m={},g=[],y=(r.template||{}).data||{},v=c.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 u.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 u.coerce(t||{},e,g.frame,r,n)}return r("duration"),r("redraw"),e},S.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return u.coerce(t||{},e,g.transition,r,n)}return r("duration"),r("easing"),e},S.supplyFrameDefaults=function(t){var e={};function r(r,n){return u.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 c(r,n){return u.coerce(t,e,S.attributes,r,n)}var f=c("visible");c("type"),c("name",n._traceWord+" "+i),c("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],_=u.coerce(t,e,g,x);y[x]&&u.pushUnique(y[x],_),v+=_}else v=u.coerce(t,e,g,m);y[d.name]&&u.pushUnique(y[d.name],v)}}if(f&&(c("customdata"),c("ids"),c("meta"),s.traceIs(e,"showLegend")?(u.coerce(t,e,p.attributes.showlegend?p.attributes:S.attributes,"showlegend"),c("legend"),c("legendwidth"),c("legendgroup"),c("legendgrouptitle.text"),c("legendrank"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,p&&p.supplyDefaults(t,e,l,n),s.traceIs(e,"noOpacity")||c("opacity"),s.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),s.traceIs(e,"noHover")||(e.hovertemplate||u.coerceHoverinfo(t,e,n),"parcats"!==e.type&&s.getComponentMethod("fx","supplyDefaults")(t,e,l,n)),p&&p.selectPoints)){var b=c("selectedpoints");u.isTypedArray(b)&&(e.selectedpoints=Array.from(b))}return e},S.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return u.coerce(t,e,S.layoutAttributes,r,n)}var i=t.template;u.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data),n("autotypenumbers");var a=u.coerceFont(n,"font"),o=a.size;u.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 c=n("title.automargin");n("title.x"),n("title.xanchor"),n("title.y"),n("title.yanchor"),n("title.subtitle.text",e._dfltTitle.subtitle),u.coerceFont(n,"title.subtitle.font",a,{overrideDflt:{size:Math.round(.7*e.title.font.size)}}),c&&("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"),u.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),u.coerce(t,e,m,"scattermode")},S.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},s=o.frameMargins,l=u.isPlotDiv(t);if(l&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var c=l?window.getComputedStyle(t):{};if(n=z(c.width)||z(c.maxWidth)||r.width,i=z(c.height)||z(c.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,c=e._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var f in c.length||c.push(h),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(u.subplotSort);for(a=0;a<c.length;a++)(o=c[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)),u.clearThrottle(),u.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&&u.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,c=u.constrain(i-o.l-o.r,2,s),h=u.constrain(a-o.t-o.b,2,l),f=Math.max(0,i-c),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={}),D(e);var i=e._size,o=e.margin,l={t:0,b:0,l:0,r:0},c=u.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 A=b[w][T];l[T]=Math.max(l[T],A)}for(var k 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][k].size)&&(M=g[E][k].size>M?g[E][k].size:M);var C=Math.max(0,o[k]-M);l[k]=Math.max(0,l[k]-C)}for(var I in g){var L=g[I].l||{},P=g[I].b||{},z=L.val,O=L.size,R=P.val,F=P.size,B=r-l.r-l.l,j=n-l.t-l.b;for(var N in g){if(a(O)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(O*U+(V-B)*z)/(U-z),H=(V*(1-z)+(O-B)*(1-U))/(U-z);q+H>h+f&&(h=q,f=H)}}if(a(F)&&g[N].t){var G=g[N].t.val,W=g[N].t.size;if(G>R){var Z=(F*G+(W-j)*R)/(G-R),Y=(W*(1-R)+(F-j)*(1-G))/(G-R);Z+Y>m+d&&(m=Z,d=Y)}}}}}var X=u.constrain(r-o.l-o.r,2,v),$=u.constrain(n-o.t-o.b,2,x),K=Math.max(0,r-X),J=Math.max(0,n-$);if(K){var Q=(h+f)/K;Q>1&&(h/=Q,f/=Q)}if(J){var tt=(m+d)/J;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(c,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=c,u.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 O=["l","r","t","b","p","w","h"];function R(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=u.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<O.length;r++){var n=O[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,c=(t._transitionData||{})._frames;function h(t,e){if("function"==typeof t)return e?"_function_":null;if(u.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&&!u.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=u.isTypedArray(t);if((a||s)&&t.dtype&&t.shape){var l=t.bdata;return h({dtype:t.dtype,shape:t.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},e)}return a?t.map((function(t){return h(t,e)})):s?u.simpleMap(t,u.identity):u.isJSDate(t)?u.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 c&&(f.frames=h(c)),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],c=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===c.indexOf(s.name);)l.push(s),c.push(s.name);for(var u={};s=l.pop();)if(s.layout&&(u.layout=S.extendLayout(u.layout,s.layout)),s.data){if(u.data||(u.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<s.data.length;r++)null!=(i=n[r])&&(-1===(a=u.traces.indexOf(i))&&(a=u.data.length,u.traces[a]=i),u.data[a]=S.extendTrace(u.data[a],s.data[r]))}return u},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,c,h=u.extendDeepNoArrays({},e||{}),f=u.expandObjectPaths(h),p={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=u.nestedProperty(f,r[a])).get())?u.nestedProperty(p,r[a]).set(null):(n.set(null),u.nestedProperty(p,r[a]).set(i));if(t=u.extendDeepNoArrays(t||{},f),r&&r.length)for(a=0;a<r.length;a++)if(l=u.nestedProperty(p,r[a]).get()){for(c=(s=u.nestedProperty(t,r[a])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<l.length;o++){var d=l[o];c[o]=null===d?null:S.extendObjectWithContainers(c[o],d)}s.set(c)}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 c=a[o],h=t._fullData[c]._module;if(h){if(h.animatable){var f=h.basePlotModule.name;s[f]||(s[f]=[]),s[f].push(c)}t.data[a[o]]=S.extendTrace(t.data[a[o]],e[o])}}var p=u.expandObjectPaths(u.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=u.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(),A=null,k=null,M=null,E=null;Array.isArray(g[_._name+".range"])?A=g[_._name+".range"].slice():Array.isArray((g[_._name]||{}).range)&&(A=g[_._name].range.slice()),Array.isArray(g[b._name+".range"])?k=g[b._name+".range"].slice():Array.isArray((g[b._name]||{}).range)&&(k=g[b._name].range.slice()),w&&A&&(_.r2l(w[0])!==_.r2l(A[0])||_.r2l(w[1])!==_.r2l(A[1]))&&(M={xr0:w,xr1:A}),T&&k&&(b.r2l(T[0])!==b.r2l(k[0])||b.r2l(T[1])!==b.r2l(k[1]))&&(E={yr0:T,yr1:k}),(M||E)&&l.push(u.extendFlat({plotinfo:x},M,E))}}return Promise.resolve()},o.runFn=function(e){var n,i,o=t._fullLayout._basePlotModules,c=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 c?((n=u.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)}},R(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],c=l.xaxis,h=l.yaxis,f=n[c._name].range.slice(),p=n[h._name].range.slice(),d=c.range.slice(),m=h.range.slice();c.setScale(),h.setScale();var g=null,y=null;(c.r2l(f[0])!==c.r2l(d[0])||c.r2l(f[1])!==c.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(u.extendFlat({plotinfo:l},g,y))}return Promise.resolve()},o.runFn=function(r){for(var n,i,o,l=t._fullData,c=t._fullLayout._basePlotModules,h=[],f=0;f<l.length;f++)h.push(f);function p(){if(t._fullLayout)for(var e=0;e<c.length;e++)c[e].transitionAxes&&c[e].transitionAxes(t,s,n,r)}function d(){if(t._fullLayout)for(var e=0;e<c.length;e++)c[e].plot(t,o,i,r)}s.length&&e.anim?"traces first"===a.ordering?(n=u.extendFlat({},a,{duration:0}),o=h,i=a,setTimeout(p,a.duration),d()):(n=a,o=null,i=u.extendFlat({},a,{duration:0}),setTimeout(d,n.duration),p()):s.length?(n=a,p()):e.anim&&(o=h,i=a,d())},R(t,a,o)},S.doCalcdata=function(t,e){var r,n,i,a,o=p.list(t),c=t._fullData,h=t._fullLayout,d=new Array(c.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<c.length;i++)if(Array.isArray(e)&&-1===e.indexOf(i)){d[i]=m[i];continue}for(i=0;i<c.length;i++)(r=c[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=c[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=c[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(j(o,c,h),i=0;i<c.length;i++)b(i,!0);for(i=0;i<c.length;i++)_(i);for(x&&j(o,c,h),i=0;i<c.length;i++)b(i,!0);for(i=0;i<c.length;i++)b(i,!1);N(t);var w=function(t,e){var r,n,i,a,o,l=[];function c(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 u.aggNums(Math.min,null,t)},max:function(t){return u.aggNums(Math.max,null,t)},sum:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},total:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},mean:function(t){return u.mean(t)},"geometric mean":function(t){return u.geometricMean(t)},median:function(t){return u.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 A=T.type;s.traceIs(T,"histogram")&&(delete T._xautoBinFinished,delete T._yautoBinFinished);var k="splom"===A,M="scattergl"===A,S=e.calcdata[w];for(i=0;i<S.length;i++){var E,C,I=S[i];if(k){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 D=I.trace.dimensions[o];b[E][1].push(D.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 O=c(T.type,m,C);for(a=0;a<C.length;a++)for(o=0;o<C[a].length;o++)(E=O(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);N(t)}s.getComponentMethod("fx","calc")(t),s.getComponentMethod("errorbars","calc")(t)};var B=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function j(t,e,r){var n={};function i(t){t.clearCalc(),"multicategory"===t.type&&t.setupMultiCategory(e),n[t._id]=1}u.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 N(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 c=s.basePlotModule.name;o[c]?u.pushUnique(o[c],l):o[c]=[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 c in a)if(!o[c]){var h=a[c][0];h[0].trace.visible=!1,o[c]=[h]}for(var f in o){var p=o[f];p[0][0].trace._module.plot(t,e,u.filterVisible(p),n)}e.traceHash=o},S.plotBasePlot=function(t,e,r,n,i){var a=s.getModule(t),o=v(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()}}}),ke=p({"src/constants/xmlns_namespaces.js"(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}}}),Me=p({"src/constants/alignment.js"(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"}}}}),Se=p({"src/lib/svg_text_utils.js"(t){var e=x(),r=le(),n=r.strTranslate,i=ke(),a=Me().LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(d,x,M){var S=d.text(),I=!d.attr("data-notex")&&x&&x._context.typesetMath&&typeof MathJax<"u"&&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?(x&&x._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,u,h,f,p=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])},d=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()};2===a?MathJax.Hub.Queue((function(){return u=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:c},displayAlign:"left"})}),(function(){if("SVG"!==(o=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,d,(function(){if("SVG"!==o)return MathJax.Hub.setRenderer(o)}),(function(){return void 0!==h&&(MathJax.Hub.processSectionDelay=h),MathJax.Hub.Config(u)})):3===a&&(u=r.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=c,"svg"!==(o=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),d(),"svg"!==o&&(MathJax.config.startup.output=o),MathJax.config=u})))}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,c=a.height;o.attr({class:P,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=d.node().style.fill||"black",h=o.select("g");h.attr({fill:u,stroke:u});var f=h.node().getBoundingClientRect(),p=f.width,m=f.height;(p>l||m>c)&&(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}),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=[],c=-1;function d(){c++;var r=document.createElementNS(i.svg,"tspan");e.select(r).attr({class:"line",dy:c*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++)x(n[s])}function x(t){var r,n=t.type,a={};if("a"===n){r="a";var s=t.target,c=t.href,u=t.popup;c&&(a={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":c},u&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");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)}v.test(n)?d():(o=t,l=[{node:t}]);for(var I=n.split(g),L=0;L<I.length;L++){var P=I[L],z=P.match(y),D=z&&z[2].toLowerCase(),O=u[D];if("br"===D)d();else if(void 0===O)M(o,E(P));else if(z[1])S(D);else{var R=z[4],F={type:D},B=A(R,_);if(B?(B=B.replace(k,"$1 fill:"),O&&(B+=";"+O)):O&&(B=O),B&&(F.style=B),"a"===D){s=!0;var j=A(R,b);if(j){var N=C(j);N&&(F.href=N,F.target=A(R,w)||"_blank",F.popup=A(R,T))}}x(F)}}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,c=[["$","$"],["\\(","\\)"]],u={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,v=/<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 A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var k=/(^|;)\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 c=i[l],u=c.match(y),h=u&&u[2].toLowerCase();if(h)-1!==n.indexOf(h)&&(a.push(c),o=h);else{var f=c.length;if(s+f<r)a.push(c),s+=f;else if(s<r){var p=r-s;o&&("br"!==o||p<=3||f<=3)&&a.pop(),r>3?a.push(c.substr(0,p-3)+"..."):a.push(c.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",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.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),c=l&&l[2].toLowerCase();if(c in u)if(l[1])i.length&&(n=i.pop());else{var h=l[4],f=A(h,_),p=f?{style:f}:{};if("a"===c){var d=A(h,b);if(d){var v=C(d);if(v){p.href=v;var x=A(h,w);x&&(p.target=x)}}}var T=document.createElement(c);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).select(".svg-container"),o=i.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12),u=r.text;void 0===u&&(u=t.attr("data-unformatted")),o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:r.fill||s.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(u).call(I(t,i,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===o.node()&&o.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,i,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")}}}),Ee=p({"src/components/colorscale/helpers.js"(t,e){var r=x(),n=O(),i=A(),a=le(),o=H(),s=V().isValid,l=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function u(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<c.length;r++)o[n=c[r]]=a["c"+n];else{var s;for(r=0;r<c.length;r++)((s="c"+(n=c[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!==c.indexOf(t)?e+t:t;a[n]=a["_"+n]=r},o}function h(t){for(var e=u(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 c=i[l];o[l]=r+c[0]*(n-r),s[l]=c[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,c=new Array(l),u=0;u<l;u++){var h=n(s[u]).toRgb();c[u]=[h.r,h.g,h.b,h.a]}var f,p=r.scale.linear().domain(a).range(c).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 c=0;c<o.length;c++)if(i(o[c])){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:u,extractScale:h,flipScale:f,makeColorScaleFunc:p,makeColorScaleFuncFromTrace:function(t,e){return p(h(t),e)}}}}),Ce=p({"src/plots/cartesian/axis_format_attributes.js"(t,e){var r=Dt(),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}}}),Ie=p({"src/plots/cartesian/layout_attributes.js"(t,e){var r=F(),n=q(),i=zt().dash,a=R().extendFlat,o=ye().templatedArray,s=(Ot().templateFormatStringDescription,Ce().descriptionWithDates),l=k().ONEDAY,c=ve(),u=c.HOUR_PATTERN,h=c.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:[c.idRegex.x.toString(),c.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:[c.idRegex.x.toString(),c.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,u,""],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",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.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"}}}),Le=p({"src/components/colorbar/attributes.js"(t,e){var r=Ie(),n=F(),i=R().extendFlat,a=Pt().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")}}),Pe=p({"src/components/colorscale/attributes.js"(t,e){var r=Le(),n=W().counter,i=Zt(),a=V().scales;function o(t){return"`"+t+"`"}i(a),e.exports=function(t,e){t=t||"";var i,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e&&e.onlyIfNumerical,"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===s,u="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,h=e.editTypeOverride||"",f=t?t+".":"";"colorAttr"in e?(i=e.colorAttr,e.colorAttr):o(f+(i={z:"z",c:"color"}[s]));var p=s+"auto",d=s+"min",m=s+"max",g=s+"mid",y=(o(f+p),o(f+d),o(f+m),{});y[d]=y[m]=void 0;var v={};v[p]=!1;var x={};return"color"===i&&(x.color={valType:"color",arrayOk:!0,editType:h||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},x[d]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=r),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:n("coloraxis"),dflt:null,editType:"calc"}),x}}}),ze=p({"src/components/colorscale/layout_attributes.js"(t,e){var r=R().extendFlat,n=Pe(),i=V().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}))}}}),De=p({"src/components/colorbar/has_colorbar.js"(t,e){var r=le();e.exports=function(t){return r.isPlainObject(t.colorbar)}}}),Oe=p({"src/plots/cartesian/clean_ticks.js"(t){var e=A(),r=le(),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),c=t.substr(1);return(c=e(c)?Number(c):0)<=0||!(a&&"M"===l&&c===Math.round(c)||n&&"L"===l||n&&"D"===l&&(1===c||2===c))?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}}}),Re=p({"src/plots/cartesian/tick_value_defaults.js"(t,e){var r=Oe(),n=le().isArrayOrTypedArray,i=E().isTypedArraySpec,a=E().decodeTypedArraySpec;e.exports=function(t,e,o,s,l){l||(l={});var c=l.isMinor,u=c?t.minor||{}:t,h=c?e.minor:e,f=c?"minor.":"";function p(t){var e=u[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":c||o("ticktext"))}}}),Fe=p({"src/plots/cartesian/tick_mark_defaults.js"(t,e){var r=le(),n=Ie();e.exports=function(t,e,i,a){var o=a.isMinor,s=o?t.minor||{}:t,l=o?e.minor:e,c=o?n.minor:n,u=o?"minor.":"",h=r.coerce2(s,l,c,"ticklen",o?.6*(e.ticklen||5):void 0),f=r.coerce2(s,l,c,"tickwidth",o?e.tickwidth||1:void 0),p=r.coerce2(s,l,c,"tickcolor",(o?e.tickcolor:void 0)||l.color);i(u+"ticks",!o&&a.outerTicks||h||f||p?"outside":"")||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)}}}),Be=p({"src/plots/cartesian/show_dflt.js"(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]]}}}),je=p({"src/plots/array_container_defaults.js"(t,e){var r=le(),n=ye();e.exports=function(t,e,i){var a,o,s=i.name,l=i.inclusionAttr||"visible",c=e[s],u=r.isArrayOrTypedArray(t[s])?t[s]:[],h=e[s]=[],f=n.arrayTemplater(e,s,l);for(a=0;a<u.length;a++){var p=u[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(c)){var m=Math.min(c.length,h.length);for(a=0;a<m;a++)r.relinkPrivateKeys(h[a],c[a])}return h}}}),Ne=p({"src/plots/cartesian/tick_label_defaults.js"(t,e){var r=le(),n=H().contrast,i=Ie(),a=Be(),o=je();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,c,u){u||(u={});var h=l("labelalias");r.isPlainObject(h)||delete e.labelalias;var f=a(t);if(l("showticklabels")){u.noTicklabelshift||l("ticklabelshift"),u.noTicklabelstandoff||l("ticklabelstandoff");var p=u.font||{},d=e.color,m=-1!==(e.ticklabelposition||"").indexOf("inside")?n(u.bgColor):d&&d!==i.color.dflt?d:p.color;if(r.coerceFont(l,"tickfont",p,{overrideDflt:{color:m}}),!u.noTicklabelstep&&"multicategory"!==c&&"log"!==c&&l("ticklabelstep"),!u.noAng){var g=l("tickangle");!u.noAutotickangles&&"auto"===g&&l("autotickangles")}if("category"!==c){var y=l("tickformat");o(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),e.tickformatstops.length||delete e.tickformatstops,!u.noExp&&!y&&"date"!==c&&(l("showexponent",f),l("exponentformat"),l("minexponent"),l("separatethousands"))}!u.noMinorloglabels&&"log"===c&&l("minorloglabels")}}}}),Ue=p({"src/plots/cartesian/prefix_suffix_defaults.js"(t,e){var r=Be();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)}}}),Ve=p({"src/components/colorbar/defaults.js"(t,e){var r=le(),n=ye(),i=Re(),a=Fe(),o=Ne(),s=Ue(),l=Le();e.exports=function(t,e,c){var u=n.newContainer(e,"colorbar"),h=t.colorbar||{};function f(t,e){return r.coerce(h,u,l,t,e)}var p=c.margin||{t:0,b:0,l:0,r:0},d=c.width-p.l-p.r,m=c.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"),A="left";g?(b="middle",A=T?"left":"right",x=T?1.02:1,_=.5):(b=w?"bottom":"top",A="center",x=.5,_=w?1.02:1),r.coerce(h,u,{x:{valType:"number",min:T?-2:0,max:T?3:1,dflt:x}},"x"),r.coerce(h,u,{y:{valType:"number",min:w?-2:0,max:w?3:1,dflt:_}},"y"),f("xanchor",A),f("xpad"),f("yanchor",b),f("ypad"),r.noneOrAll(h,u,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var k=r.coerce(h,u,{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!==k.indexOf("inside")?"hide past domain":"hide past div"),i(h,u,f,"linear");var M=c.font,S={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:M};-1!==k.indexOf("inside")&&(S.bgColor="black"),s(h,u,f,"linear",S),o(h,u,f,"linear",S),a(h,u,f,"linear",S),f("title.text",c._dfltTitle.colorbar);var E=u.showticklabels?u.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")}}}),qe=p({"src/components/colorscale/defaults.js"(t,e){var r=A(),n=le(),i=De(),a=Ve(),o=V().isValid,s=qt().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,c,u,h,f){var p=f.prefix,d=f.cLetter,m="_module"in c,g=l(e,p),y=l(c,p),v=l(c._template||{},p)||{},x=function(){return delete e.coloraxis,delete c.coloraxis,t(e,c,u,h,f)};if(m){var _=u._colorAxes||{},b=h(p+"coloraxis");if(b){var w=s(c,"contour")&&n.nestedProperty(c,"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,c,[x]])}}var A=g[d+"min"],k=g[d+"max"],M=r(A)&&r(k)&&A<k;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,u)))}}}),He=p({"src/components/colorscale/layout_defaults.js"(t,e){var r=le(),n=ye(),i=ze(),a=qe();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,c=e._colorAxes;function u(t,e){return r.coerce(s,l,i.coloraxis,t,e)}for(var h in c){var f=c[h];if(f[0])s=t[h]||{},(l=n.newContainer(e,h,"coloraxis"))._name=h,a(s,l,e,u,{prefix:"",cLetter:"c"});else{for(var p=0;p<f[2].length;p++)f[2][p]();delete e._colorAxes[h]}}}}}),Ge=p({"src/components/colorscale/cross_trace_defaults.js"(t,e){var r=le(),n=Ee().hasColorscale,i=Ee().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],c=l._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(l,c[u]);else o(l,c);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"})}}}),We=p({"src/components/colorscale/calc.js"(t,e){var r=A(),n=le(),i=Ee().extractOpts;e.exports=function(t,e,a){var o,s=t._fullLayout,l=a.vals,c=a.containerStr,u=c?n.nestedProperty(e,c).get():e,h=i(u),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=u._colorAx&&r(p)?Math.min(p,g()):g()),void 0===d?d=y():f&&(d=u._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))}}}),Ze=p({"src/components/colorscale/index.js"(t,e){var r=V(),n=Ee();e.exports={moduleType:"component",name:"colorscale",attributes:Pe(),layoutAttributes:ze(),supplyLayoutDefaults:He(),handleDefaults:qe(),crossTraceDefaults:Ge(),calc:We(),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}}}),Ye=p({"src/traces/scatter/subtypes.js"(t,e){var r=le(),n=E().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))}}}}),Xe=p({"src/traces/scatter/make_bubble_size_func.js"(t,e){var r=A();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}}}}),$e=p({"src/components/fx/helpers.js"(t){var e=le();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],c=n(l);if(void 0===t[c]){var u=i(e.nestedProperty(r,l).get(),a);void 0!==u&&(t[c]=u)}}},t.appendArrayMultiPointValues=function(t,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],c=n(l);if(void 0===t[c]){for(var u=e.nestedProperty(r,l).get(),h=new Array(a.length),f=0;f<a.length;f++)h[f]=i(u,a[f]);t[c]=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]}}}),Ke=p({"node_modules/parse-svg-path/index.js"(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}}),Je=p({"src/components/drawing/symbol_defs.js"(t,e){var r,n,i,a,o=Ke(),s=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},l="M0,0Z",c=Math.sqrt(2),u=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 c=t/180*h,u=0,d=0,m=o(s),g="",y=0;y<m.length;y++){var v=m[y],x=v[0],_=u,b=d;if("M"===x||"L"===x)u=+v[1],d=+v[2];else if("m"===x||"l"===x)u+=+v[1],d+=+v[2];else if("H"===x)u=+v[1];else if("h"===x)u+=+v[1];else if("V"===x)d=+v[1];else if("v"===x)d+=+v[1];else if("A"===x){u=+v[1],d=+v[2];var w=l(c,[+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)&&(u-=_,d-=b);var T=l(c,[u,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/c,2),i="l"+n+","+n,a="l"+n+",-"+n,o="l-"+n+",-"+n,u="l-"+n+","+n;return m(e,r,"M0,"+n+i+a+o+a+o+u+o+u+i+u+i+"Z")}},"triangle-up":{n:5,f:function(t,e,r){if(d(e))return l;var n=s(2*t/u,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/u,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/u,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/u,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*u/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*u/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),c=s(.588*n,2),u=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"+c+","+p+"L0,"+s(.382*n,2)+"L-"+c+","+p+"L-"+o+","+f+"L-"+a+","+h+"H-"+i+"L0,"+u+"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*u*.8,2),i=s(.8*t,2),a=s(1.6*t,2),o=s(4*t,2),c="A "+o+","+o+" 0 0 1 ";return m(e,r,"M-"+n+","+i+c+n+","+i+c+"0,-"+a+c+"-"+n+","+i+"Z")}},"star-triangle-down":{n:20,f:function(t,e,r){if(d(e))return l;var n=s(t*u*.8,2),i=s(.8*t,2),a=s(1.6*t,2),o=s(4*t,2),c="A "+o+","+o+" 0 0 1 ";return m(e,r,"M"+n+",-"+i+c+"-"+n+",-"+i+c+"0,"+a+c+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/c,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}}}}),Qe=p({"src/components/drawing/index.js"(t,e){var r=x(),n=le(),i=n.numberFormat,a=A(),o=O(),s=qt(),l=H(),c=Ze(),u=n.strTranslate,h=Se(),f=ke(),p=Me().LINE_SPACING,d=G().DESELECTDIM,m=Ye(),g=Xe(),y=$e().appendArrayPointValue,v=e.exports={};function _(t){return"none"===t?void 0:t}v.font=function(t,e){var r=e.variant,n=e.style,i=e.weight,a=e.color,o=e.size,s=e.family,c=e.shadow,u=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))),c&&t.style("text-shadow","auto"===c?h.makeTextShadow(l.contrast(a)):_(c)),u&&t.style("text-decoration-line",_(function(t){return t.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}(u)))};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=v.getPatternAttr,s=i&&(o(i.shape,0,"")||o(i.path,0,""));if(s){var c=o(i.bgcolor,0,null),u=o(i.fgcolor,0,null),h=i.fgopacity,f=o(i.size,0,8),p=o(i.solidity,0,.3),d=e.uid;v.pattern(t,"point",r,d,s,f,p,void 0,i.fillmode,c,u,h)}else if(a&&"none"!==a.type){var m,g,y=a.type,x="scatterfill-"+e.uid;n&&(x="legendfill-"+e.uid),n||void 0===a.start&&void 0===a.stop?("horizontal"===y&&(y+="reversed"),t.call(v.gradient,r,x,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,x,"linear",a.colorscale,"fill",m,g,!0,!1))}else e.fillcolor&&t.call(l.fill,e.fillcolor)}v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,i){t.call(v.setPosition,e,r).call(v.setSize,n,i)},v.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",u(i,o)),!0)},v.translatePoints=function(t,e,n){t.each((function(t){var i=r.select(this);v.translatePoint(t,i,e,n)}))},v.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},v.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,c=s.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){v.hideOutsideRangePoint(t,r.select(this),n,i,o,l)}))}))}},v.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.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),v.dashLine(e,s,o)},v.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(v.dashLine,s,o)}))},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.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},v.singleFillStyle=function(t,e){var n=r.select(t.node());w(t,((n.data()[0]||[])[0]||{}).trace||{},e,!1)},v.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 T=Je();v.symbolNames=[],v.symbolFuncs=[],v.symbolBackOffs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(T).forEach((function(t){var e=T[t],r=e.n;v.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),v.symbolNames[r]=t,v.symbolFuncs[r]=e.f,v.symbolBackOffs[r]=e.backoff||0,e.needLine&&(v.symbolNeedLines[r]=!0),e.noDot?v.symbolNoDot[r]=!0:v.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(v.symbolNoFill[r]=!0)}));var k=v.symbolNames.length;function M(t,e,r,n){var i=t%100;return v.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}v.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=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=k||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,c,u,h,f,p){var d,m=s.length;"linear"===a?d={node:"linearGradient",attrs:{x1:u.x,y1:u.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(c,Z(x,e)).style(c+"-opacity",null),t.classed("gradient_filled",!0)}v.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)},v.pattern=function(t,e,i,a,s,c,u,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,A,k,M=i._fullLayout,S="p"+M._uid+"-"+a,E={},C=o(d),I=l.tinyRGB(C),L=m*C.getAlpha();switch(s){case"/":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",E={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:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"\\":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",E={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:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"x":y=c*Math.sqrt(2),v=c*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,_=c-c*Math.sqrt(1-u),w="path",E={d:x,opacity:L,stroke:I,"stroke-width":_+"px"};break;case"|":w="path",w="path",E={d:x="M"+(y=c)/2+",0L"+y/2+","+(v=c),opacity:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"-":w="path",w="path",E={d:x="M0,"+(v=c)/2+"L"+(y=c)+","+v/2,opacity:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"+":w="path",x="M"+(y=c)/2+",0L"+y/2+","+(v=c)+"M0,"+v/2+"L"+y+","+v/2,_=c-c*Math.sqrt(1-u),w="path",E={d:x,opacity:L,stroke:I,"stroke-width":_+"px"};break;case".":y=c,v=c,u<Math.PI/4?b=Math.sqrt(u*c*c/Math.PI):(T=u,A=Math.PI/4,b=(k=c/2)+(c/Math.sqrt(2)-k)*(T-A)/(1-A)),w="circle",E={cx:y/2,cy:v/2,r:b,opacity:L,fill:I};break;default:y=c,v=c,w="path",E={d:s,opacity:L,fill:I}}var P=[s||"noSh",p||"noBg",d||"noFg",c,u].join(";"),z=M._defs.select(".patterns").selectAll("#"+S).data([P],n.identity);z.exit().remove(),z.enter().append("pattern").each((function(){var t=r.select(this);if(t.attr({id:S,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(E)})),t.style("fill",Z(S,i)).style("fill-opacity",null),t.classed("pattern_filled",!0)},v.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)},v.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)},v.getPatternAttr=function(t,e,r){return t&&n.isArrayOrTypedArray(t)?e<t.length?t[e]:r:t},v.pointStyle=function(t,e,n,i){if(t.size()){var a=v.makePointStyleFns(e);t.each((function(t){v.singlePointStyle(t,r.select(this),e,a,n,i)}))}},v.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker,c=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 u;u="various"===t.ms||"various"===s.size?3:i.ms2mrc(t.ms),t.mrc=u,i.selectedSizeFn&&(u=t.mrc=i.selectedSizeFn(t));var h=v.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var f=st(t,r),p=$(t,r);e.attr("d",M(h,u,f,p))}var d,m,g,y=!1;if(t.so)g=c.outlierwidth,m=c.outliercolor,d=s.outliercolor;else{var x=(c||{}).width;g=(t.mlw+1||x+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=i.lineScale(t.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.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=v.getPatternAttr,A=w&&(T(w.shape,t.i,"")||T(w.path,t.i,""));if(b&&"none"!==b){var k=t.mgc;k?y=!0:k=_.color;var S=r.uid;y&&(S+="-"+t.i),v.gradient(e,a,S,b,[[0,k],[1,d]],"fill")}else if(A){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,D=T(w.size,t.i,8),O=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),v.pattern(e,"point",a,R,A,D,O,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)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.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,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},i=t.unselected||{},a=t.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,f=void 0!==u,p=void 0!==h;(n.isArrayOrTypedArray(c)||f||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?u: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},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,d))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=v.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(v.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)}))}},v.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 c.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",c=i?i/.8+1:0,f=(h.lineCount(t)-1)*p+1,d=P[l]*c,m=.75*n+P[s]*c+(P[s]-1)*f*n/2;t.attr("text-anchor",l),a||o.attr("transform",u(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 j(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),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=3*c*(l+c),p=3*l*(l+c);return[[F(e[0]+(f&&u/f)),B(e[1]+(f&&h/f))],[F(e[0]-(p&&u/p)),B(e[1]-(p&&h/p))]]}v.textPointStyle=function(t,e,i){if(t.size()){var a;if(e.selectedpoints){var o=v.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=i._fullLayout;t.each((function(t){var o=r.select(this),c=s?n.extractOption(t,e,"txt","texttemplate"):n.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=n.texttemplateString(c,f,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=D(t,e),x=a?a(t):t.tc||e.textfont.color;o.call(v.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:x}).text(c).call(h.convertToTspans,i).call(z,m,g,t.mrc)}else o.remove()}))}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=v.makeSelectedTextStyleFns(e);t.each((function(t){var i=r.select(this),a=n.selectedTextColorFn(t),o=t.tp||e.textposition,c=D(t,e);l.fill(i,a);var u=s.traceIs(e,"bar-like");z(i,o,c,t.mrc2||t.mrc,u)}))}},v.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(j(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]},v.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=[j(t[i],t[0],t[1],e)];for(r=1;r<i;r++)a.push(j(t[r-1],t[r],t[r+1],e));for(a.push(j(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 N={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,c=e?e[0]:I||0,u=e?e[1]:L||0,h=l[0],f=l[1],p=h-c,d=f-u,m=Math.atan2(d,p),g=s?r[o]:r;if("auto"===g){var y=l.i;"scatter"===i.type&&y--;var x=l.marker,_=x.symbol;n.isArrayOrTypedArray(_)&&(_=_[y]);var b=x.size;n.isArrayOrTypedArray(b)&&(b=b[y]),g=x?v.symbolBackOffs[v.symbolNumber(_)]*b:0,g+=v.getMarkerStandoff(a[y],i)||0}var w=h-g*Math.cos(m),T=f-g*Math.sin(m);(w<=h&&w>=c||w>=h&&w<=c)&&(T<=f&&T>=u||T>=f&&T<=u)&&(t=[w,T])}return t}v.steps=function(t){var e=N[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}},v.applyBackoff=V,v.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"})}));v.tester=t,v.testref=e},v.savedBBoxes={};var q=0;function W(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function Z(t,e){if(!t)return null;var r=e._context,n=r._exportedPlot?"":r._baseUrl||"";return n?"url('"+n+"#"+t+"')":"url(#"+t+")"}v.bBox=function(t,e,i){var a,o,s;if(i||(i=W(t)),i){if(a=v.savedBBoxes[i])return n.extendFlat({},a)}else if(1===t.childNodes.length){var l=t.childNodes[0];if(i=W(l)){var c=+l.getAttribute("x")||0,u=+l.getAttribute("y")||0,f=l.getAttribute("transform");if(!f){var p=v.bBox(l,!1,i);return c&&(p.left+=c,p.right+=c),u&&(p.top+=u,p.bottom+=u),p}if(i+="~"+c+"~"+u+"~"+f,a=v.savedBBoxes[i])return n.extendFlat({},a)}}e?o=t:(s=v.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=v.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 q>=1e4&&(v.savedBBoxes={},q=0),i&&(v.savedBBoxes[i]=g),q++,n.extendFlat({},g)},v.setClipUrl=function(t,e,r){t.attr("clip-path",Z(e,r))},v.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}},v.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+=u(e,r)).trim(),t[i]("transform",a),a},v.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}},v.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.*/;v.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}v.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?[]:[u(o,s),"scale("+e+","+n+")",u(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},v.getMarkerStandoff=$;var K,J,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 c=e._xA,u=e._yA;if(!c||!u)return 90;i=c.c2p(t.x),o=u.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,_=K/180*Math.PI,b=J/180*Math.PI,w=_-v,T=it(b)*at(w),A=at(b)*it(x)-it(b)*at(x)*it(w);h=-nt(T,A)-Math.PI,K=f,J=p}var k=ot(g,[it(h),0]),M=ot(y,[at(h),0]);r=nt(k[1]+M[1],k[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}v.getMarkerAngle=st}}),tr=p({"src/components/titles/index.js"(t,e){var r=x(),n=A(),i=Ae(),a=qt(),o=le(),s=o.strTranslate,l=Qe(),c=H(),u=Se(),h=G(),f=Me().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,A=d.containerGroup,k=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,D=C.style,O=C.variant,R=C.textcase,F=C.lineposition,B=C.shadow,j=!!d.subtitlePropName,N=d.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,H=1,G=U.font,W=G.family,Z=G.size,Y=G.color,X=G.weight,$=G.style,K=G.variant,J=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?k=0:rt(S,x)&&(et||(S=""),k=.2,E=!0),j&&(""===V?H=0:rt(V,N)&&(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;A||(A=o.ensureSingle(g._infolayer,"g","g-"+e),nt=g._hColorbarMoveTitle);var at=A.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(j&&lt&&((ot=A.selectAll("text."+st).data(lt?[0]:[])).enter().append("text"),ot.text(V).attr("class",st),ot.exit().remove()),!it)return A;function ct(t,e){o.syncOrAsync([ut,ht],{title:t,subtitle:e})}function ut(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",k*c.opacity(P)).call(l.font,{color:c.rgb(P),size:r.round(L,2),family:I,weight:z,style:D,variant:O,textcase:R,shadow:B,lineposition:F}).attr(w).call(u.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*Z;e.attr("y",i)}}}})),f){var p=A.select("."+e+"-math-group"),d=h.node().getBBox(),m=p.node()?p.node().getBBox():void 0,g=m?m.y+m.height+1.6*Z:d.y+d.height+1.6*Z,y=o.extendFlat({},w,{y:g});f.attr("transform",a),f.style("opacity",H*c.opacity(Y)).call(l.font,{color:c.rgb(Y),size:r.round(Z,2),family:W,weight:X,style:$,variant:K,textcase:J,shadow:tt,lineposition:Q}).attr(y).call(u.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 c=f[b.side],u="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||u*(w[b.side]-p[b.side]),A=0;if(T<0)A=T;else{var k=b.offsetLeft||0,M=b.offsetTop||0;p.left-=k,p.right-=k,p.top-=M,p.bottom-=M,b.selection.each((function(){var t=l.bBox(this);o.bBoxIntersect(p,t,h)&&(A=Math.max(A,u*(t[b.side]-p[c])+h))})),A=Math.min(T,A),y._titleScoot=Math.abs(A)}if(A>0||T<0){var E={left:[-A,0],right:[A,0],top:[0,-A],bottom:[0,A]}[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(ct,ot),et&&(S?at.on(".opacity",null):(ft(at,x),E=!0),at.call(u.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(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),j)){if(j&&!S){var pt=at.node().getBBox(),dt=pt.y+pt.height+1.6*Z;ot.attr("y",dt)}V?ot.on(".opacity",null):(ft(ot,N),q=!0),ot.call(u.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(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,ot.attr("x"),ot.attr("y"))}))}return at.classed("js-placeholder",E),ot&&ot.classed("js-placeholder",q),A},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),er=p({"src/plots/cartesian/set_convert.js"(t,e){var r=x(),n=b().utcFormat,i=le(),a=i.numberFormat,o=A(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,f=k(),p=f.FP_SAFE,d=f.BADNUM,m=f.LOG_CLIP,g=f.ONEWEEK,y=f.ONEDAY,v=f.ONEHOUR,_=f.ONEMIN,w=f.ONESEC,T=xe(),M=ve(),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",x=f.charAt(0);function b(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 A(e,r,n,a){if((a||{}).msUTC&&o(e))return+e;var s=c(e,n||t.calendar);if(s===d){if(!o(e))return d;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);s=c(new Date(u))+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 D(t){var e=z(t);return void 0!==e?e:o(t)?+t:void 0}function O(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},j=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var N="y"===x;B=function(e){if(!o(e))return d;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=N;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 c=i*t._rangebreaks[l].min,u=i*t._rangebreaks[l].max;if(a<c)break;if(!(a>u)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?R(e,t._m2,h):0},j=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?b:u,t.l2c="log"===t.type?C:u,t.l2p=B,t.p2l=j,t.c2p="log"===t.type?function(t,e){return B(b(t,e))}:B,t.p2c="log"===t.type?function(t){return C(j(t))}:j,-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=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=j,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return b(s(t),e)},t.r2d=t.r2c=function(t){return C(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=b,t.l2d=C,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return C(j(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=j,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=A,t.c2d=t.c2r=t.l2d=t.l2r=k,t.d2p=t.r2p=function(e,r,n){return t.l2p(A(e,0,n))},t.p2d=t.p2r=function(t,e,r){return k(j(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=D,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=u,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(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 c=e[T.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],p=[];for(n=0;n<o.length;n++){var d=r[o[n]];if(x in d){var m=d[x],g=d._length||i.minRowLength(m);if(h(m[0])&&h(m[1]))for(a=0;a<g;a++){var y=m[0][a],v=m[1][a];I(y)&&I(v)&&(p.push([y,v]),y in u[0][1]||(u[0][1][y]=u[0][0]++),v in u[1][1]||(u[1][1][v]=u[1][0]++))}}}for(p.sort((function(t,e){var r=u[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var i=u[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 c=t.l2r(r),u=t.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var f=u+1;void 0!==r&&(f=Math.max(f,c)),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"===x?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],c=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 u=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(u-1e3),s[1]=t.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!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=T.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,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),h="y"===x;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/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),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;c>u&&(f=!f),f&&t._rangebreaks.reverse();var p=f?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),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,c=t.rangebreaks||[];c._cachedPatterns||(c._cachedPatterns=c.map((function(e){return e.enabled&&e.bounds?i.simpleMap(e.bounds,e.pattern?s:t.d2c):null}))),c._cachedValues||(c._cachedValues=c.map((function(e){return e.enabled&&e.values?i.simpleMap(e.values,t.d2c).sort(i.sorterAsc):null})));for(var u=0;u<c.length;u++){var h=c[u];if(h.enabled)if(h.bounds){var f=h.pattern;switch(n=(r=c._cachedPatterns[u])[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=c._cachedValues[u],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,c=[];if(!t.rangebreaks)return c;var u=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<c.length;o++){var s=c[o];t<s.max&&n>=s.min&&(t<s.min&&(s.min=t),n>s.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;n<u.length;n++){var f=u[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,x,b=new Date(p);switch(f.pattern){case E:x=g,m=(l-o+(l<o?7:0))*y,p+=o*y-(b.getUTCDay()*y+b.getUTCHours()*v+b.getUTCMinutes()*_+b.getUTCSeconds()*w+b.getUTCMilliseconds());break;case S:x=y,m=(l-o+(l<o?24:0))*v,p+=o*v-(b.getUTCHours()*v+b.getUTCMinutes()*_+b.getUTCSeconds()*w+b.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),m=x=(d=Math.max(a[0],a[1]))-p}for(var T=p;T<d;T+=x)h(T,T+m)}else for(var A=i.simpleMap(f.values,t.d2c),k=0;k<A.length;k++)h(o=A[k],l=o+f.dvalue)}return c.sort((function(t,e){return t.min-e.min})),c},t.makeCalcdata=function(e,r,n){var a,o,s,l,c=t.type,u="date"===c&&e[r+"calendar"];if(r in e){if(a=e[r],l=e._length||i.minRowLength(a),i.isTypedArray(a)&&("linear"===c||"log"===c)){if(l===a.length)return a;if(a.subarray)return a.subarray(0,l)}if("multicategory"===c)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,u,n)}else{var h=r+"0"in e?t.d2c(e[r+"0"],0,u):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[x],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[T.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[T.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}}}),rr=p({"src/plots/cartesian/axis_autotype.js"(t,e){var r=A(),n=le(),i=k().BADNUM,a=n.isArrayOrTypedArray,o=n.isDateTime,s=n.cleanNumber,l=Math.round;function c(t,e){return e?r(t):"number"==typeof t}function u(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=u(n),a=0,s=0,c={},h=0;h<n;h+=i){var f=t[l(h)],p=String(f);c[p]||(c[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=u(r),a=0,o=0,c={},h=0;h<r;h+=n){var f=t[l(h)],p=String(f);if(!c[p]){c[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(c(t[n],e))return!0;return!1}(f,y)?"linear":"-"}}}),nr=p({"src/plots/cartesian/autorange.js"(t,e){var r=x(),n=A(),i=le(),a=k().FP_SAFE,o=qt(),s=Qe(),l=xe(),c=l.getFromId,u=l.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),c=d(t,e),u=c.min,h=c.max;if(0===u.length||0===h.length)return i.simpleMap(e.range,e.r2l);var m=u[0].val,g=h[0].val;for(r=1;r<u.length&&m===g;r++)m=Math.min(m,u[r].val);for(r=1;r<h.length&&m===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,A,k,M,S=e.rangemode,E="tozero"===S,C="nonnegative"===S,I=e._length,L=I/10,P=0;for(r=0;r<u.length;r++)for(_=u[r],n=0;n<h.length;n++)(M=(b=h[n]).val-_.val-f(e,_.val,b.val))>0&&((k=I-s(_)-l(b))>L?M/k>P&&(w=_,A=b,P=M/k):M/I>P&&(w={val:_.val,nopad:1},A={val:b.val,nopad:1},P=M/I));if(m===g){var z=m-1,D=m+1;if(E)if(0===m)a=[0,1];else{var O=(m>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),R=m/(1-Math.min(.5,O/I));a=m>0?[0,R]:[R,0]}else a=C?[Math.max(0,z),Math.max(1,D)]:[z,D]}else E?(w.val>=0&&(w={val:0,nopad:1}),A.val<=0&&(A={val:0,nopad:1})):C&&(w.val-P*s(w)<0&&(w={val:0,nopad:1}),A.val<=0&&(A={val:1,nopad:1})),P=(A.val-w.val-f(e,_.val,b.val))/(I-s(w)-l(A)),a=[w.val-P*s(w),A.val+P*l(A)];return a=T(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 c=i.simpleMap(e.range,e.r2l);l=c[1]<c[0]}l&&(n=!n)}var h=0;return u(t,e._id)||(h=function(t,e,n){var a=0,o="x"===e._id.charAt(0);for(var l in t._plots){var c=t._plots[l];if(e._id===c.xaxis._id||e._id===c.yaxis._id){var u=(o?c.yaxis:c.xaxis)||{};if(-1!==(u.ticklabelposition||"").indexOf("inside")&&(!n&&("left"===u.side||"bottom"===u.side)||n&&("top"===u.side||"right"===u.side))){if(u._vals){var h=i.deg2rad(u._tickAngles[u._id+"tick"]||0),f=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));if(!u._vals[0].bb){var d=u._id+"tick";u._selections[d].each((function(t){var e=r.select(this);e.select(".text-math-group").empty()&&(t.bb=s.bBox(e.node()))}))}for(var m=0;m<u._vals.length;m++){var g=u._vals[m].bb;if(g){var y=6+g.width,v=6+g.height;a=Math.max(a,o?Math.max(y*f,v*p):Math.max(v*f,y*p))}}}"inside"===u.ticks&&"inside"===u.ticklabelposition&&(a+=u.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)}}function d(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,u=[],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],m(u,a.val,a.pad,{extrapad:a.extrapad});for(i=0;i<s.max.length;i++)a=s.max[i],g(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 y=c(t,p),v=d(t,y,!0),x=e._length/y._length;for(i=0;i<v.min.length;i++)a=v.min[i],m(u,a.val,a.pad*x,{extrapad:a.extrapad});for(i=0;i<v.max.length;i++)a=v.max[i],g(h,a.val,a.pad*x,{extrapad:a.extrapad})}return{min:u,max:h}}function m(t,e,r,n){y(t,e,r,n,_)}function g(t,e,r,n){y(t,e,r,n,b)}function y(t,e,r,n,i){for(var a=n.tozero,o=n.extrapad,s=!0,l=0;l<t.length&&s;l++){var c=t[l];if(i(c.val,e)&&c.pad>=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function v(t){return n(t)&&Math.abs(t)<a}function _(t,e){return t<=e}function b(t,e){return t>=e}function w(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))<t.d2l(r)}function T(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 c=e.d2l(a[l]);o>=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&w(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(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&&w(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}e.exports={applyAutorangeOptions:T,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,c,u,h,f,p,d=[],y=[],x=e.length,_=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,A=r.vpadLinearized||!1;function k(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=k((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=k((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=k(r.vpadplus||r.vpad),C=k(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(i=0;i<x;i++)(o=e[i])<f&&o>0&&(f=o),o>p&&o<a&&(p=o);else for(i=0;i<x;i++)(o=e[i])<f&&o>-a&&(f=o),o>p&&o<a&&(p=o);e=[f,p],x=2}var I={tozero:b,extrapad:_};function L(r){s=e[r],n(s)&&(u=M(r),h=S(r),A?(l=t.c2l(s)-C(r),c=t.c2l(s)+E(r)):(f=s-C(r),p=s+E(r),w&&f<p/10&&(f=p/10),l=t.c2l(f),c=t.c2l(p)),b&&(l=Math.min(0,l),c=Math.max(0,c)),v(l)&&m(d,l,h,I),v(c)&&g(y,c,u,I))}var P=Math.min(6,x);for(i=0;i<P;i++)L(i);for(i=x-1;i>=P;i--)L(i);return{min:d,max:y,opts:r}},concatExtremes:d}}}),ir=p({"src/plots/cartesian/axes.js"(t,e){var r=x(),n=A(),i=Ae(),a=qt(),o=le(),s=o.strTranslate,l=Se(),c=tr(),u=H(),h=Qe(),f=Ie(),p=Oe(),d=k(),m=d.ONEMAXYEAR,g=d.ONEAVGYEAR,y=d.ONEMINYEAR,v=d.ONEMAXQUARTER,_=d.ONEAVGQUARTER,b=d.ONEMINQUARTER,w=d.ONEMAXMONTH,T=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,D=d.ONEMICROSEC,O=d.MINUS_SIGN,R=d.BADNUM,F={K:"zeroline"},B={K:"gridline",L:"path"},j={K:"minor-gridline",L:"path"},N={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"]},q=Me(),G=q.MID_SHIFT,W=q.CAP_SHIFT,Z=q.LINE_SPACING,Y=q.OPPOSITE_SIDE,X=e.exports={};X.setConvert=er();var $=rr(),K=xe(),J=K.idSort,Q=K.isLinked;X.id2name=K.id2name,X.name2id=K.name2id,X.cleanId=K.cleanId,X.list=K.list,X.listIds=K.listIds,X.getFromId=K.getFromId,X.getFromTrace=K.getFromTrace;var tt=nr();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"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},o.coerce(t,e,u,c)},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 c=X.getFromId(e,n);l=r(i,a=c.fraction2r(a)),s=c.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),c={},u=0;u<e.length;u++)for(var h=r[X.id2name(e[u])][o],f=0;f<h.length;f++){var p=h[f];if(!c[p]&&(l(t,p),c[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 ct(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 lt(t,r)}function ut(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 c=l?t.minor.tickvals:t.tickvals,u=l?[]:t.ticktext;if(c){o.isArrayOrTypedArray(u)||(u=[]);for(var h=0;h<c.length;h++){var f=a(c[h]);if(f>n&&f<i){var p=X.tickText(t,f,!1,String(u[h]));l&&(p.minor=!0,p.text=""),s.push(p)}}}}return 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,c=o.aggNums(Math.min,null,t),u=o.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(s)||1),_dataSpan:u-c};if(a||(a=e.calendar),l="log"===e.type?{type:"linear",range:[c,u]}:{type:e.type,range:o.simpleMap([c,u],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=(u-c)/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,c=0;function u(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])||c++,u(e[h])&&o++,u(e[h]+r.dtick/2)&&s++;var f=e.length-c;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||u(i)||u(a))){var p=r.dtick/2;t+=t+p<i?p:-p}return t}(v,t,l,c,u),g=v+(1+Math.floor((u-v)/y))*y;else for("M"===l.dtick.charAt(0)&&(v=function(t,e,r,n,i){var a=o.findExactDates(e,i);if(a.exactDays>.8){var s=Number(r.substr(1));a.exactYears>.8&&s%12==0?t=X.tickIncrement(t,"M6","reverse")+1.5*E:a.exactMonths>.8?t=X.tickIncrement(t,"M1","reverse")+15.5*E:t-=C;var l=X.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,y,c,a)),g=v;g<=u;)g=X.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},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 c=n(e.dtick),u=n(t.dtick),h=c?e.dtick:+e.dtick.substring(1),f=u?t.dtick:+t.dtick.substring(1);c&&u?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)?u?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=T,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],c=!t.ticklabelindex||o.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],u=o.simpleMap(t.range,t.r2l,void 0,void 0,e),h=u[1]<u[0],f=Math.min(u[0],u[1]),p=Math.max(u[0],u[1]),d=Math.max(1e3,t._length||0),x=[],A=[],k=[],O=[],F=[],B=t.minor&&(t.minor.ticks||t.minor.showgrid),j=1;j>=(B?0:1);j--){var N=!j;j?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var U=j?t:o.extendFlat({},t,t.minor);if(N?X.prepMinorTicks(U,t,e):X.prepTicks(U,e),"array"!==U.tickmode)if("sync"!==U.tickmode){var V=et(u),q=V[0],H=V[1],G=n(U.dtick),W="log"===r&&!(G||"L"===U.dtick.charAt(0)),Z=X.tickFirst(U,e);if(j){if(t._tmin=Z,Z<q!==h)break;("category"===r||"multicategory"===r)&&(H=h?Math.max(-.5,H):Math.min(t._categories.length-.5,H))}var Y,$,K=null,J=Z;j&&(G?$=t.dtick:"date"===r?"string"==typeof t.dtick&&"M"===t.dtick.charAt(0)&&($=T*t.dtick.substring(1)):$=t._roughDTick,Y=Math.round((t.r2l(J)-t.r2l(t.tick0))/$)-1);var Q=U.dtick;for(U.rangebreaks&&U._tick0Init!==U.tick0&&(J=jt(J,t),h||(J=X.tickIncrement(J,Q,!h,i))),j&&s&&(J=X.tickIncrement(J,Q,!h,i),Y--);h?J>=H:J<=H;J=X.tickIncrement(J,Q,h,i)){if(j&&Y++,U.rangebreaks&&!h){if(J<q)continue;if(U.maskBreaks(J)===R&&jt(J,U)>=p)break}if(k.length>d||J===K)break;K=J;var tt={value:J};j?(W&&J!==(0|J)&&(tt.simpleLabel=!0),a>1&&Y%a&&(tt.skipLabel=!0),k.push(tt)):(tt.minor=!0,O.push(tt))}}else k=[],x=ct(t);else j?(k=[],x=ut(t,!N)):(O=[],A=ut(t,!N))}var rt;if(!O||O.length<2?c=!1:function(t,e){return/%f/.test(e)?t>=D:/%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}((O[1].value-O[0].value)*(l?-1:1),t.tickformat)||(c=!1),c){var nt=k.concat(O);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){c.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<O.length;ot++){var st=O[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)}}O=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,c=t[o].value,u=Math.abs(c-l),h=r||u,f=0;h>=y?f=u>=y&&u<=m?u:g:r===_&&h>=b?f=u>=b&&u<=v?u:_:h>=M?f=u>=M&&u<=w?u:T:r===S&&h>=S?f=S:h>=E?f=E:r===C&&h>=C?f=C:r===I&&h>=I&&(f=I),f>=u&&(f=u,s=!0);var p=i+f;if(e.rangebreaks&&f>0){for(var d=0,x=0;x<84;x++){var A=(x+.5)/84;e.maskBreaks(i*(1-A)+A*p)!==R&&d++}(f*=d/84)||(t[n].drop=!0),s&&u>S&&(f=u)}(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=jt(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(u[1]-u[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(O),rt=0;rt<k.length;rt++){var bt=k[rt].minor,wt=k[rt].value;bt?((vt=c&&-1!==F.indexOf(k[rt])?_t(t,k[rt]):{x:wt}).minor=!0,A.push(vt)):(yt=t._prevDateHead,vt=_t(t,k[rt]),(k[rt].skipLabel||c&&-1===F.indexOf(k[rt]))&&xt(vt),x.push(vt))}return x=x.concat(A),t._inCalcTicks=!1,s&&x.length&&(x[0].noTick=!0),x};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])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(wt(t.exponentformat)&&!Tt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}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>T)e/=T,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),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=o.dateTick0(t.calendar,2):t.tick0=o.dateTick0(t.calendar,1),c&&(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 u=o.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[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),c=s*Number(e.substr(1));if("M"===l)return o.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?gt:mt,h=t+.01*s,f=o.roundUp(o.mod(h,1),u,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,c=et(a)[0],u=t.dtick,h=i(t.tick0);if(n(u)){var f=l((c-h)/u)*u+h;return("category"===t.type||"multicategory"===t.type)&&(f=o.constrain(f,0,t._categories.length-1)),f}var p=u.charAt(0),d=Number(u.substr(1));if("M"===p){for(var m,g,y,v=0,x=h;v<10;){if(((m=X.tickIncrement(x,u,s,t.calendar))-c)*(x-c)<=0)return s?Math.min(x,m):Math.max(x,m);g=(c-(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,c)-h)/d)*d+h)/Math.LN10;if("D"===p){var _="D2"===u?gt:mt,b=o.roundUp(o.mod(c,1),_,s);return Math.floor(c)+Math.log(r.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(u)},X.tickText=function(t,e,r,i){var a,s=_t(t,e),l="array"===t.tickmode,c=r||l,u=t.type,h="category"===u?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"===u?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,c=o.formatDate(e.x,s,a,t._dateFormat,t.calendar,t._extraFormat),u=c.indexOf("\n");if(-1!==u&&(l=c.substr(u+1),c=c.substr(0,u)),i&&(void 0===l||"00:00:00"!==c&&"00:00"!==c?8===c.length&&(c=c.replace(/:00$/,"")):(c=l,l="")),l)if(r)"d"===a?c+=", "+l:c=l+(c?", "+c:"");else if(t._inCalcTicks&&t._prevDateHead===l){var h=Nt(t),f=t._trueSide||t.side;(!h&&"top"===f||h&&"bottom"===f)&&(c+="<br> ")}else t._prevDateHead=l,c+="<br>"+l;e.text=c}(t,s,r,c):"log"===u?function(t,e,r,i,a){var s=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)e.text=At(Math.pow(10,l),t,a,i);else if(n(s)||"D"===u&&("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?"":O)+p+"</sup>"),e.fontSize*=1.25):("e"===d||"E"===d)&&p>2?e.text=h[0]+d+(f>0?"+":O)+p:(e.text=At(Math.pow(10,l),t,"","fakehover"),"D1"===s&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)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,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,s):"multicategory"===u?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=At(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}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(s[1]>=100)e.text=At(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=O+e.text)}}}}(t,s,r,c,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=At(e.x,t,i,n)}(t,s,0,c,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":O+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 At(t,e,r,i){var a=t<0,s=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=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,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,O);var p,d=Math.pow(10,-s)/2;if("none"===l&&(c=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,c&&(t*=Math.pow(10,-c),s+=c),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 c&&"hide"!==l&&(wt(l)&&Tt(c)&&(l="power"),p=c<0?O+-c:"power"!==l?"+"+c:String(c),"e"===l||"E"===l?t+=l+p:"power"===l?t+="×10<sup>"+p+"</sup>":"B"===l&&9===c?t+="B":wt(l)&&(t+=bt[c/3+5])),a?O+t:t}function kt(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*(W+r*Z):r?e*(r+1)*Z: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 Dt(t){return t._id+".rangeslider"}function Ot(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 c=Object.keys(f),u=["anchor","domain","overlaying","position","side","tickangle","editType"],h=["linear","log"];for(n=0;n<c.length;n++){var p=c[n],d=a[0][p],m=s[0][p],g=!0,y=!1,v=!1;if("_"!==p.charAt(0)&&"function"!=typeof d&&-1===u.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(),c=s(t[n[0]._name],e).get();for("title"===e&&(l&&l.text===i.x&&(l.text=i.y),c&&c.text===i.y&&(c.text=i.x)),a=0;a<r.length;a++)s(t,r[a]._name+"."+e).set(c);for(a=0;a<n.length;a++)s(t,n[a]._name+"."+e).set(l)}function Bt(t){return"angularaxis"===t._id}function jt(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 Nt(t){return-1!==(t.ticklabelposition||"").indexOf("inside")}function Ut(t,e){Nt(t._anchorAxis||{})&&t._hideCounterAxisInsideTickLabels&&t._hideCounterAxisInsideTickLabels(e)}function Vt(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,i,a,o,s,l;function c(t){return"string"!=typeof t?t:Number(t.replace("M",""))*T}function u(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 h(t,e){var r=null===e[0],n=null===e[1],i=u(t,e[0])>=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}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&&(i=t.dtick,o=void 0,void 0,void 0,o=c||function(t){return t},s=(a=n.dtickrange)[0],l=a[1],(!s&&"number"!=typeof s||o(s)<=o(i))&&(!l&&"number"!=typeof l||o(l)>=o(i)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&h(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),c=[];for(n=0;n<s.length;n++)for(c.push({x:s[n],y:o}),i=0;i<l.length;i++)0===n&&c.push({x:a,y:l[i]}),c.push({x:s[n],y:l[i]});var u=e._clips.selectAll(".axesclip").data(c,(function(t){return t.x._id+t.y._id}));u.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(t){return"clip"+e._uid+t.x._id+t.y._id})).append("rect"),u.exit().remove(),u.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&&Vt(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),Vt(e,b,p,!0),Vt(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,A=T+=e._shift,k=e._mainMirrorPosition,M=e._vals=X.calcTicks(e),S=[e.mirror,A,k].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,D="outside"===e.ticks;if("boundaries"===e.tickson){var O=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,O),C=z?I:O}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,j={};for(n=0;n<B.length;n++){s=B[n];var N=(f=m._plots[s])[v+"axis"],U=N._mainAxis._id;if(!j[U]){j[U]=1;var V="x"===y?"M0,"+N._offset+"v"+N._length:"M"+N._offset+",0h"+N._length;X.drawGrid(t,e,{vals:R,counterAxis:N,layer:f.gridlayer.select("."+g),minorLayer:f.minorGridlayer.select("."+g),path:V,transFn:L}),X.drawZeroLine(t,e,{counterAxis:N,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 K,J,Q,tt,et=X.makeTickPath(e,A,H[2]),rt=X.makeTickPath(e,A,$[2],{minor:!0});if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(K=X.makeTickPath(e,k,H[3]),J=X.makeTickPath(e,k,$[3],{minor:!0}),Q=et+K,tt=rt+J):(K="",J="",Q=et,tt=rt),e.showdividers&&D&&"boundaries"===e.tickson){var nt={};for(n=0;n<F.length;n++)nt[F[n].x]=1;q=function(t){return nt[t.x]?K: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],ct=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:ct,transFn:L})}}var ut=[];if(ut.push((function(){return X.drawLabels(t,e,{vals:M,layer:w,plotinfo:f,transFn:P,labelFns:X.makeLabelFns(e,A)})})),"multicategory"===e.type){var ht={x:2,y:10}[y];ut.push((function(){var r={x:"height",y:"width"}[y],n=pt()[r]+ht+(e._tickAngles[g+"tick"]?e.tickfont.size*Z: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,A+n*H[4])})})),ut.push((function(){return e._depth=H[4]*(pt("tick2")[e.side]-A),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(u.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,A,H[4],{len:e._depth}),transFn:L})}))}else e.title.hasOwnProperty("standoff")&&ut.push((function(){e._depth=H[4]*(pt()[e.side]-A)}));var ft=a.getComponentMethod("rangeslider","isVisible")(e);return!r.skipTitle&&!(ft&&"bottom"===e.side)&&ut.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*W:("top"===e.side||"left"===e.side)&&(r=e._depth+e.title.standoff+o*(G+s*Z));else{var u=Nt(e);if("multicategory"===e.type)r=e._depth;else{var f=1.5*o;u&&(f=.5*o,"outside"===e.ticks&&(f+=e.ticklen)),r=10+f+(e.linewidth?e.linewidth-1:0)}u||(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,c.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)})),ut.push((function(){var r,n,o,s,l=e.side.charAt(0),c=Y[e.side].charAt(0),u=X.getPxPosition(t,e),h=D?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-u:0,h))));var f=0,p=0;if(e._shiftPusher&&(f=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u: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?u-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?u-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-u: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})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(o[c]+=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&&(kt(n,e.automargin),kt(o,e.automargin)),i.autoMargin(t,Pt(e),n),i.autoMargin(t,zt(e),o),i.autoMargin(t,Dt(e),s)})),o.syncOrAsync(ut)}}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,A)),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"),c="boundaries"!==r&&(s||a||i||o);if(!c&&!l)return[0,0];var u=t.side,h=c?(t.tickwidth||0)/2:0,f=3,p=t.tickfont?t.tickfont.size:12;return(s||i)&&(h+=p*W,f+=(t.linewidth||0)/2),(a||o)&&(h+=(t.linewidth||0)/2,f+=3),l&&"top"===u&&(f-=p*(1-W)),(a||i)&&(h=-h),("bottom"===u||"right"===u)&&(f=-f),[c?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"),c=!l;if(r&&(r*=o?-1:1),n){var u=t.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?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"),c=s("left"),u=s("right"),h=s("bottom"),f="boundaries"!==a&&(h||c||l||u),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,A={labelStandoff:m+=(t.linewidth||1)/2*(p?-1:1),labelShift:g},k=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?W:90===E&&"top"===M?G:.5,k=G/2*(E/90)),A.xFn=function(t){return t.dx+x+k*t.fontSize},A.yFn=function(t){return t.dy+_+t.fontSize*b},A.anchorFn=function(t,e){if(f){if(c)return"end";if(u)return"start"}return n(e)&&0!==e&&180!==e?e*w<0!==p?"end":"start":"middle"},A.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?W:.5),p){var C=n(E)?+E:0;if(0!==C){var I=o.deg2rad(C);k=Math.abs(Math.sin(I))*W*w,b=0}}A.xFn=function(t){return t.dx+e-(x+t.fontSize*b)*w+k*t.fontSize},A.yFn=function(t){return t.dy+_+t.fontSize*G},A.anchorFn=function(t,e){return n(e)&&90===Math.abs(e)?"middle":T?"end":"start"},A.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return A},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 u.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),Ut(e,[N]),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 c="array"===e.tickmode,f=0;f<s.length;f++){var p=s[f].x;if(c?!p:Math.abs(p)<e.dtick/100){if(s=s.slice(0,f).concat(s.slice(f+1)),!c)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 u.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)}}Ut(e,[B,j])}},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 J(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Ut(e,[F])},X.drawLabels=function(t,e,i){i=i||{};var a=t._fullLayout,c=e._id,u="above traces"===e.zerolinelayer,f=i.cls||c+"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),c=o.select(".text-math-group"),u=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=Z*t.fontSize,g=d.heightFn(t,n(a)?+a:0,(p-1)*m);if(g&&(f+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":u}),y.style("display",null),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.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)})),Ut(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,c=s?t._fullLayout.width:t._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),p=Math.max(l,c),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&&Nt(n)&&(t||[F,j,B,N,U]).forEach((function(t){var o="tick"===t.K&&"text"===t.L&&"period"===e.ticklabelmode,s=a._plots[e._mainSubplot];(t.K===F.K?(u?s.zerolinelayerAbove:s.zerolinelayer).selectAll("."+e._id+"zl"):t.K===j.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,c=p.length,u=Math.abs((p[c-1].x-p[0].x)*e._m)/(c-1),f=s?u/2:u,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 A=p[t].xbnd,k=n[t];if(null!==A[0]&&k.left-e.l2p(A[0])<T||null!==A[1]&&e.l2p(A[1])-k.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)&&Nt(e)&&!Q(a,e._id)&&(a._insideTickLabelsUpdaterange||(a._insideTickLabelsUpdaterange={}),T.autorange&&(a._insideTickLabelsUpdaterange[T._name+".autorange"]=T.autorange,b.push(w)),T.insiderange)){var A=w(),k="y"===e._id.charAt(0)?A.labelsMaxW:A.labelsMaxH;k+=6,"inside"===e.ticklabelposition&&(k+=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 D=T.r2p(z[S]),O=T.r2p(z[E]),R=M*("y"===e._id.charAt(0)?1:-1);R*L<R*D&&(L=D,C[S]=I[S]=z[S]),R*P>R*O&&(P=O,C[E]=I[E]=z[E])}var V=Math.abs(P-L);V-k>0?k*=1+k/(V-=k):k=0,"y"!==e._id.charAt(0)&&(k=-k),C[S]=T.p2r(T.r2p(I[S])+M*k),"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),c=a._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return p(r);for(var u=X.list(t,s),h=0;h<u.length;h++){var f=u[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,Dt(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,c=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],Ot(c.x,l.x),Ot(c.y,l.y);Ot(c.x,[o]),Ot(c.y,[s])}}return i}(t,e),n=0;n<r.length;n++)Rt(t,r[n].x,r[n].y)}}}),ar=p({"src/plots/cartesian/autorange_options_defaults.js"(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")}}}),or=p({"src/plots/cartesian/range_defaults.js"(t,e){var r=ar();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 c,u=e.getAutorangeDflt(l,i),h=n("autorange",u);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,c=!0),c||(h=n("autorange",u=e.getAutorangeDflt(l,i))),h&&(r(n,h,l),("linear"===o||"-"===o)&&n("rangemode")),e.cleanRange()}}}),sr=p({"node_modules/mouse-event-offset/index.js"(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}}}),lr=p({"node_modules/has-passive-events/index.js"(t,e){var r=ue();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{t=!1}return t}()}}),cr=p({"src/components/dragelement/align.js"(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}}}),ur=p({"src/components/dragelement/cursor.js"(t,e){var r=le(),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]}}}),hr=p({"src/components/dragelement/unhover.js"(t,e){var r=pe(),n=Jt(),i=It().getGraphDiv,a=B(),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}))}}}),fr=p({"src/components/dragelement/index.js"(t,e){var r=sr(),n=he(),i=lr(),a=le().removeElement,o=ve(),s=e.exports={};s.align=cr(),s.getCursor=ur();var l=hr();function c(){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 u(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=u(i);e=a[0],r=a[1],d=i.target,p=i,m=2===i.buttons||i.ctrlKey,typeof i.clientX>"u"&&typeof i.clientY>"u"&&(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=c()).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=u(n),a=t.minDrag||o.MINDRAG,l=_(i[0]-e,i[1]-r,a),c=l[0],h=l[1];(c||h)&&(g._dragged=!0,s.unhover(g,n)),g._dragged&&t.moveFn&&!m&&(g._dragdata={element:x,dx:c,dy:h},t.moveFn(c,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=c}}),pr=p({"src/lib/setcursor.js"(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)}}}),dr=p({"src/lib/override_cursor.js"(t,e){var r=pr(),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))}}}),mr=p({"src/components/legend/attributes.js"(t,e){var r=F(),n=q();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"}}}),gr=p({"src/components/legend/helpers.js"(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")}}}),yr=p({"src/components/legend/defaults.js"(t,e){var r=qt(),n=le(),i=ye(),a=U(),o=mr(),s=Nt(),l=gr();function c(t,e,c,u){var h=e[t]||{},f=i.newContainer(c,t);function p(t,e){return n.coerce(h,f,o,t,e)}var d=n.coerceFont(p,"font",c.font);if(p("bgcolor",c.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=c.font||{},v=n.coerceFont(p,"grouptitlefont",y,{overrideDflt:{size:Math.round(1.1*y.size)}}),x=0,_=!1,b="normal",w=(c.shapes||[]).filter((function(t){return t.showlegend})),T=u.concat(w).filter((function(e){return t===(e.legend||"legend")})),A=0;A<T.length;A++)if((m=T[A]).visible){var k=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,(!k&&r.traceIs(m,"pie-like")||!0===m._input.showlegend)&&x++),n.coerceFont(g,"legendgrouptitle.font",v)),(!k&&r.traceIs(m,"bar")&&"stack"===c.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,c,s,"showlegend",_&&x>("legend"===t?1:0));if(!1===M&&(c[t]=void 0),(!1!==M||h.uirevision)&&(p("uirevision",c.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(c[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 D=n.extendFlat({},d,{size:n.bigFont(d.size)});n.coerceFont(p,"title.font",D)}}}}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 u=["legend"];for(i=0;i<a.length;i++)n.pushUnique(u,a[i].legend);for(e._legends=[],i=0;i<u.length;i++){var h=u[i];c(h,t,e,a),e[h]&&e[h].visible&&(e[h]._id=h),e._legends.push(h)}}}}),vr=p({"src/components/legend/handle_click.js"(t,e){var r=qt(),n=le(),i=n.pushUnique,a=!0;e.exports=function(t,e,o){var s=e._fullLayout;if(!e._dragged&&!e._editing){var l,c=s.legend.itemclick,u=s.legend.itemdoubleclick,h=s.legend.groupclick;if(1===o&&"toggle"===c&&"toggleothers"===u&&a&&e.data&&e._context.showTips&&n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),a=!1,1===o?l=c:2===o&&(l=u),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,A=v.legendgroup,k={},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,D=A&&A.length,O=[];if(D)for(x=0;x<y.length;x++)(z=y[x]).visible&&z.legendgroup===A&&O.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(D)if(f)for(x=0;x<y.length;x++){var F=y[x];!1!==F.visible&&F.legendgroup===A&&tt(F,R)}else tt(v,R);else tt(v,R)}else if("toggleothers"===l){var B,j,N,U,V,q=!0;for(x=0;x<y.length;x++)if(B=(V=y[x])===v,N=!0!==V.showlegend,!(B||N||(j=D&&V.legendgroup===A,j||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,N=!0!==V.showlegend&&!V.legendgroup,tt(V,!(!(j=B||D&&V.legendgroup===A)&&!N)||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[_],(k[w]=k[w]||[])[E[x]]=H[w]}for(T=Object.keys(k),x=0;x<T.length;x++)for(w=T[x],_=0;_<M.length;_++)k[w].hasOwnProperty(_)||(k[w][_]=void 0);I?r.call("_guiUpdate",e,k,{shapes:C},M):r.call("_guiRestyle",e,k,M)}else{var W=d.label,Z=p.indexOf(W);if("toggle"===l)-1===Z?p.push(W):p.splice(Z,1);else if("toggleothers"===l){var Y=-1!==Z,X=[];for(x=0;x<e.calcdata.length;x++){var $=e.calcdata[x];for(_=0;_<$.length;_++){var K=$[_].label;L===$[0].trace.legend&&W!==K&&(-1===p.indexOf(K)&&(Y=!0),i(p,K),X.push(K))}}if(!Y)for(var J=0;J<X.length;J++){var Q=p.indexOf(X[J]);-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=k.visible;n||(n=k.visible=[]),-1===M.indexOf(t)&&(M.push(t),r=M.length-1),n[r]=e}(i,a)}}}}}),xr=p({"src/components/legend/constants.js"(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}}}),_r=p({"src/components/legend/get_legend_data.js"(t,e){var r=qt(),n=gr();e.exports=function(t,e,i){var a,o,s=e._inHover,l=n.isGrouped(e),c=n.isReversed(e),u={},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,u[r]=[a]):u[r].push(a);else{var o="~~i"+d;h.push(o),u[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,A=[];for(a=0;a<h.length;a++){var k=u[h[a]];T?A.push(k[0]):A.push(k)}for(T&&(A=[A]),a=0;a<A.length;a++){var M=1/0;for(o=0;o<A[a].length;o++){var S=A[a][o].trace.legendrank;M>S&&(M=S)}A[a][0]._groupMinRank=M,A[a][0]._preGroupSort=a}var E=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(A.forEach((function(t,e){t[0]._preGroupSort=e})),A.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),a=0;a<A.length;a++){A[a].forEach((function(t,e){t._preSort=e})),A[a].sort(E);var C=A[a][0].trace,I=null;for(o=0;o<A[a].length;o++){var L=A[a][o].trace.legendgrouptitle;if(L&&L.text){I=L,s&&(L.font=e._groupTitleFont);break}}if(c&&A[a].reverse(),I){var P=!1;for(o=0;o<A[a].length;o++)if(r.traceIs(A[a][o].trace,"pie-like")){P=!0;break}A[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<A[a].length;o++)A[a][o]=[A[a][o]]}return e._lgroupsLength=A.length,e._maxNameLength=m,A}}}),br=p({"src/traces/pie/helpers.js"(t){var e=le();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}}}),wr=p({"src/traces/pie/fill_one.js"(t,e){var r=Qe(),n=H();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)}}}),Tr=p({"src/traces/pie/style_one.js"(t,e){var r=H(),n=br().castOption,i=wr();e.exports=function(t,e,a,o){var s=a.marker.line,l=n(s.color,e.pts)||r.defaultLine,c=n(s.width,e.pts)||0;t.call(i,e,a,o).style("stroke-width",c).call(r.stroke,l)}}}),Ar=p({"src/components/legend/style.js"(t,e){var r=x(),n=qt(),i=le(),a=i.strTranslate,o=Qe(),s=H(),l=Ee().extractOpts,c=Ye(),u=Tr(),h=br().castOption,f=xr();function p(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}function d(t){var e=t[0].trace,r=e.contours,n=c.hasLines(e),i=c.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 c=t[0].trace,u=c.marker||{},h=u.line||{},f=u.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?c.visible&&c.type===a:n.traceIs(c,"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,u.line,5,2);n.style("stroke-width",a+"px");var f=i.mcc;if(!g._inHover&&"mc"in i){var p=l(u),d=p.mid;void 0===d&&(d=(p.max+p.min)/2),f=o.tryColorscale(u,"")(d)}var y=f||i.mc||u.color,v=u.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),A=v.fgopacity,k=m(v.size,8,10),M=m(v.solidity,.5,1),S="legend-"+c.uid;n.call(o.pattern,"legend",e,S,_,k,M,f,v.fillmode,b,T,A)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function A(t,a,o){var s=t[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),f=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[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);u(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,c=t[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}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,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["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":c=[["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":c=[["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":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,c){var u,h=r.select(this),f=l(a),d=f.colorscale,m=f.reversescale;if(d){if(!n){var g=d.length;u=0===c?d[m?g-1:0][1]:1===c?d[m?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",t[0]),u?h.call(s.fill,u):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 c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){A(t,this,"funnelarea")})).each((function(t){A(t,this,"pie")})).each((function(t){var n,a,s=d(t),u=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,A=b.reversescale,k=c.hasMarkers(_)||!g?"M5,0":y?"M5,-2":"M5,-3",M=r.select(this),S=M.select(".legendfill").selectAll("path").data(u||m?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(u)o.fillGroupStyle(t,e,!0);else{var r="legendfill-"+_.uid;o.gradient(t,e,r,p(A),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",k+(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(A),T,"stroke")}})})).each((function(t){var n,a,s=d(t),l=s.anyFill,u=s.anyLine,h=s.showLine,f=s.showMarker,p=t[0],m=p.trace,g=!f&&!u&&!l&&c.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 A=r.select(this).select("g.legendpoints"),k=A.selectAll("path.scatterpts").data(f?n:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),k.exit().remove(),k.call(o.pointStyle,a,e),f&&(n[0].mrc=3);var M=A.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)}))}))}}}),kr=p({"src/components/legend/draw.js"(t,e){var r=x(),n=le(),i=Ae(),a=qt(),o=pe(),s=fr(),l=Qe(),c=H(),u=Se(),h=vr(),f=xr(),p=Me(),d=p.LINE_SPACING,m=p.FROM_TL,g=p.FROM_BR,y=_r(),v=Ar(),_=gr(),b=/^legend[0-9]*$/;function w(t,e){var o,h,p=e||{},x=t._fullLayout,b=L(p),w=p._inHover;if(w?(h=p.layer,o="hover"):(h=x._infolayer,o=b),h){var M;if(o+=x._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),w){if(!p.entries)return;M=y(p.entries,p)}else{for(var P=(t.calcdata||[]).slice(),z=x.shapes,D=0;D<z.length;D++){var O=z[D];if(O.showlegend){var R={_isShape:!0,_fullInput:O,index:O._index,name:O.name||O.label.text||"shape "+O._index,legend:O.legend,legendgroup:O.legendgroup,legendgrouptitle:O.legendgrouptitle,legendrank:O.legendrank,legendwidth:O.legendwidth,showlegend:O.showlegend,visible:O.visible,opacity:O.opacity,mode:"line"===O.type?"lines":"markers",line:O.line,marker:{line:O.line,color:O.fillcolor,size:12,symbol:"rect"===O.type?"square":"circle"===O.type?"circle":"hexagon2"}};P.push([{trace:R}])}}M=x.showlegend&&y(P,p,x._legends.length>1)}var F=x.hiddenlabels||[];if(!(w||x.showlegend&&M.length))return h.selectAll("."+b).remove(),x._topdefs.select("#"+o).remove(),i.autoMargin(t,b);var B=n.ensureSingle(h,"g",b,(function(t){w||t.attr("pointer-events","all")})),j=n.ensureSingleById(x._topdefs,"clipPath",o,(function(t){t.append("rect")})),N=n.ensureSingle(B,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));N.call(c.stroke,p.bordercolor).call(c.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(c.fill,f.scrollBarColor)})),G=V.selectAll("g.groups").data(M);G.enter().append("g").attr("class","groups"),G.exit().remove();var W=G.selectAll("g.traces").data(n.identity);W.enter().append("g").attr("class","traces"),W.exit().remove(),W.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(k,t,p)})).call(v,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,c=_.isVertical(i),u=_.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,A={};let{orientation:k,yref:M}=i,{maxheight:S}=i,E=x||b||"v"!==k||"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 D=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(c)n.each((function(t){var e=t[0].height;l.setTranslate(this,p+D[0],p+D[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,u&&(e.each((function(t,e){l.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var O=C(i),R=i.x<0||0===i.x&&"right"===O,F=i.x>1||1===i.x&&"left"===O,B=b||x,j=a.width/2;i._maxWidth=Math.max(R?B&&"left"===O?s.l+s.w:j:F?B&&"right"===O?s.r+s.w:j:s.w,2*g);var N=0,U=0;n.each((function(t){var e=T(t,i,g);N=Math.max(N,e),U+=e})),z=null;var V=0;if(u){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,D[0],D[1]+p+m+a/2+e),e+=a,t=Math.max(t,n),A[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 W=n.size(),Z=U+d+(W-1)*m<i._maxWidth,Y=0,X=0,$=0,K=0;n.each((function(t){var e=t[0].height,r=T(t,i,g),n=Z?r:N;h||(n+=m),n+p+X-m>=i._maxWidth&&(V=Math.max(V,K),X=0,$+=Y,i._height+=Y,Y=0),l.setTranslate(this,D[0]+p+X,D[1]+p+$+e/2+m),K=X+r+m,X+=n,Y=Math.max(Y,e)})),Z?(i._width=X+d,i._height=Y+y):(i._width=Math.max(V,K)+d,i._height+=Y+y)}}i._width=Math.ceil(Math.max(i._width+D[0],i._titleWidth+2*(p+f.titlePad))),i._height=Math.ceil(Math.max(i._height+D[1],i._titleHeight+2*(p+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var J=t._context.edits,Q=J.legendText||J.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);u&&""!==a&&(s=A[a]);var f=Q?g:z||s;!c&&!h&&(f+=m/2),l.setRect(e,0,-n/2,f,n)}))}(t,G,W,p)},function(){var e,c,y,v,_=x._size,T=p.borderwidth,k="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),u.positionText(t,r+f.titlePad+i,r+n)}}(U,p,T),!w){var S,E;S=k?_.l+_.w*p.x-m[C(p)]*p._width:x.width*p.x-m[C(p)]*p._width,E=M?_.t+_.h*(1-p.y)-m[I(p)]*p._effHeight:x.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),c="paper"===o.xref,u="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(c&&u)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]});c?t._fullLayout._reservedMargin[e][h]=p[h]:u||"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(x.margin.autoexpand){var P=S,z=E;S=k?n.constrain(S,0,x.width-p._width):P,E=M?n.constrain(E,0,x.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 D=p._effHeight;w&&(D=p._height),N.attr({width:p._width-T,height:D-T,x:T/2,y:T/2}),l.setTranslate(V,0,0),j.select("rect").attr({width:p._width-2*T,height:D-2*T,x:T,y:T}),l.setClipUrl(V,o,t),l.setRect(H,0,0,0,0),delete p._scrollY}else{var O=Math.max(f.scrollBarMinHeight,p._effHeight*p._effHeight/p._height),R=p._effHeight-O-2*f.scrollBarMargin,F=p._height-p._effHeight,G=R/F,W=Math.min(p._scrollY||0,F);N.attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-T,x:T/2,y:T/2}),j.select("rect").attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-2*T,x:T,y:T+W}),l.setClipUrl(V,o,t),J(W,O,G),B.on("wheel",(function(){J(W=n.constrain(p._scrollY+r.event.deltaY/R*F,0,F),O,G),0!==W&&W!==F&&r.event.preventDefault()}));var Z,Y,X,$=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;Z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,X=W})).on("drag",(function(){var t=r.event.sourceEvent;2===t.buttons||t.ctrlKey||(Y="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,W=function(t,e,r){var i=(r-e)/G+t;return n.constrain(i,0,F)}(X,Z,Y),J(W,O,G))}));H.call($);var K=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;"touchstart"===t.type&&(Z=t.changedTouches[0].clientY,X=W)})).on("drag",(function(){var t=r.event.sourceEvent;"touchmove"===t.type&&(Y=t.changedTouches[0].clientY,W=function(t,e,r){var i=(e-r)/G+t;return n.constrain(i,0,F)}(X,Z,Y),J(W,O,G))}));V.call(K)}function J(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),j.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,v=e.y}},moveFn:function(t,r){if(void 0!==y&&void 0!==v){var n=y+t,i=v+r;l.setTranslate(B,n,i),e=s.align(n,p._width,_.l,_.l+_.w,p.xanchor),c=s.align(i+p._height,-p._height,_.t+_.h,_.t,p.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==c){var r={};r[b+".x"]=e,r[b+".y"]=c,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&&A(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 A(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 c=o.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===c)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!==c&&h(r,t,n))}function k(t,e,r){var i,o,s=L(r),c=t.data()[0][0],h=c.trace,p=a.traceIs(h,"pie-like"),d=!r._inHover&&e._context.edits.legendText&&!p,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=p?c.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;u.positionText(g,y,0),d?g.call(u.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=c.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(c.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)),A(e,n,t,s,r.event)}})))}function E(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),u.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 c,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);c=g.height,h=g.width,1===n?l.setTranslate(a,p,p+.75*c):l.setTranslate(a,0,.25*c)}else{var y="."+s+(1===n?"title":"")+"text",v=t.select(y),x=u.lineCount(v),_=v.node();if(c=m*x,h=_?l.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),u.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),u.positionText(v,b,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(i.lineHeight=m,i.height=Math.max(c,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])}}}}}),Mr=p({"src/components/fx/hover.js"(t){var e=x(),r=A(),n=O(),i=le(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,l=pe(),c=Se(),u=dr(),h=Qe(),f=H(),p=fr(),d=ir(),m=ve().zindexSeparator,g=qt(),y=$e(),v=B(),_=yr(),b=kr(),w=v.YANGLE,T=Math.PI*w/180,k=1/Math.sin(T),M=Math.cos(T),S=Math.sin(T),E=v.HOVERARROWSIZE,C=v.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 c=n.target;i.throttle(t._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,(function(){!function(t,n,o,s,c){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||[],A=T[o],M=b._has("cartesian"),S=n.hovermode||b.hovermode,C="x"===(S||"").charAt(0),D="y"===(S||"").charAt(0);if(M&&(C||D)&&"axis"===w)for(var O=_.length,F=0;F<O;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 H=0;H<B.length;H++)a(_,B[H])}if(A&&"single"!==w){var G=A.overlays.map((function(t){return t.id}));_=_.concat(G)}for(var X=_.length,$=new Array(X),K=new Array(X),J=!1,Q=0;Q<X;Q++)if(T[h=_[Q]])J=!0,$[Q]=T[h].xaxis,K[Q]=T[h].yaxis;else{if(!b[h]||!b[h]._subplot)return void i.warn("Unrecognized subplot: "+h);var tt=b[h]._subplot;$[Q]=tt.xaxis,K[Q]=tt.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 et=b.hoverdistance;-1===et&&(et=1/0);var rt=b.spikedistance;-1===rt&&(rt=1/0);var nt,it,at,ot,st,lt,ct,ut,ht,ft,pt,dt,mt,gt=[],yt=[],vt={hLinePoint:null,vLinePoint:null},xt=!1;if(Array.isArray(n))for(S="array",at=0;at<n.length;at++)(st=t.calcdata[n[at].curveNumber||0])&&(lt=st[0].trace,"skip"!==st[0].trace.hoverinfo&&(yt.push(st),"h"===lt.orientation&&(xt=!0)));else{var _t,bt,wt=t.calcdata.slice();for(wt.sort((function(t,e){return(t[0].trace.zorder||0)-(e[0].trace.zorder||0)})),ot=0;ot<wt.length;ot++)st=wt[ot],"skip"!==(lt=st[0].trace).hoverinfo&&y.isTraceInSubplots(lt,_)&&(yt.push(st),"h"===lt.orientation&&(xt=!0));if(c){if(!1===l.triggerHandler(t,"plotly_beforehover",n))return;var Tt=c.getBoundingClientRect();_t=n.clientX-Tt.left,bt=n.clientY-Tt.top,b._calcInverseTransform(t);var At=i.apply3DTransform(b._invTransform)(_t,bt);if(_t=At[0],bt=At[1],_t<0||_t>$[0]._length||bt<0||bt>K[0]._length)return p.unhoverRaw(t,n)}else _t="xpx"in n?n.xpx:$[0]._length/2,bt="ypx"in n?n.ypx:K[0]._length/2;if(n.pointerX=_t+$[0]._offset,n.pointerY=bt+K[0]._offset,nt="xval"in n?y.flat(_,n.xval):y.p2c($,_t),it="yval"in n?y.flat(_,n.yval):y.p2c(K,bt),!r(nt[0])||!r(it[0]))return i.warn("Fx.hover failed",n,t),p.unhoverRaw(t,n)}var kt=1/0;function Mt(e,a){for(ot=0;ot<yt.length;ot++)if((st=yt[ot])&&st[0]&&st[0].trace&&!0===(lt=st[0].trace).visible&&0!==lt._length&&-1===["carpet","contourcarpet"].indexOf(lt._module.name)){if(ht=S,y.isUnifiedHover(ht)&&(ht=ht.charAt(0)),"splom"===lt.type?ct=_[ut=0]:(ct=y.getSubplot(lt),ut=_.indexOf(ct)),dt={cd:st,trace:lt,xa:$[ut],ya:K[ut],maxHoverDistance:et,maxSpikeDistance:rt,index:!1,distance:Math.min(kt,et),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:lt.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[ct]&&(dt.subplot=b[ct]._subplot),b._splomScenes&&b._splomScenes[lt.uid]&&(dt.scene=b._splomScenes[lt.uid]),"array"===ht){var o=n[ot];"pointNumber"in o?(dt.index=o.pointNumber,ht="closest"):(ht="","xval"in o&&(ft=o.xval,ht="x"),"yval"in o&&(pt=o.yval,ht=ht?"closest":"y"))}else void 0!==e&&void 0!==a?(ft=e,pt=a):(ft=nt[ut],pt=it[ut]);if(mt=gt.length,0!==et)if(lt._module&&lt._module.hoverPoints){var s=lt._module.hoverPoints(dt,ft,pt,ht,{finiteRange:!0,hoverLayer:b._hoverlayer,hoversubplots:w,gd:t});if(s)for(var l,c=0;c<s.length;c++)l=s[c],r(l.x0)&&r(l.y0)&&gt.push(U(l,S))}else i.log("Unrecognized trace type in hover:",lt);if("closest"===S&&gt.length>mt&&(gt.splice(0,mt),kt=gt[0].distance),M&&0!==rt&&0===gt.length){dt.distance=rt,dt.index=!1;var u=lt._module.hoverPoints(dt,ft,pt,"closest",{hoverLayer:b._hoverlayer});if(u&&(u=u.filter((function(t){return t.spikeDistance<=rt}))),u&&u.length){var h,p=u.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=Et(d),(!vt.vLinePoint||vt.vLinePoint.spikeDistance>h.spikeDistance)&&(vt.vLinePoint=h))}var m=u.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=Et(g),(!vt.hLinePoint||vt.hLinePoint.spikeDistance>h.spikeDistance)&&(vt.hLinePoint=h))}}}}}function St(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 Et(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}Mt();var Ct={fullLayout:b,container:b._hoverlayer,event:n},It=t._spikepoints,Lt={vLinePoint:vt.vLinePoint,hLinePoint:vt.hLinePoint};t._spikepoints=Lt;var Pt=function(){var t=gt.filter((function(t){return v&&v._id===t.xa._id&&x&&x._id===t.ya._id})),e=gt.filter((function(t){return!(v&&v._id===t.xa._id&&x&&x._id===t.ya._id)}));t.sort(P),e.sort(P),gt=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)}(gt=t.concat(e),S)};Pt();var zt=S.charAt(0),Dt=("x"===zt||"y"===zt)&&gt[0]&&L[gt[0].trace.type];if(M&&0!==rt&&0!==gt.length){var Ot=St(gt.filter((function(t){return t.ya.showspikes})),rt,Dt);vt.hLinePoint=Et(Ot);var Rt=St(gt.filter((function(t){return t.xa.showspikes})),rt,Dt);vt.vLinePoint=Et(Rt)}if(0===gt.length){var Ft=p.unhoverRaw(t,n);return M&&(null!==vt.hLinePoint||null!==vt.vLinePoint)&&q(It)&&V(t,vt,Ct),Ft}if(M&&q(It)&&V(t,vt,Ct),y.isXYhover(ht)&&0!==gt[0].length&&"splom"!==gt[0].trace.type){var Bt=gt[0],jt=(gt=I[Bt.trace.type]?gt.filter((function(t){return t.trace.index===Bt.trace.index})):[Bt]).length;Mt(W("x",Bt,b),W("y",Bt,b));var Nt,Ut=[],Vt={},qt=0,Ht=function(t){var e=I[t.trace.type]?z(t):t.trace.index;if(Vt[e]){var r=Vt[e]-1,n=Ut[r];r>0&&Math.abs(t.distance)<Math.abs(n.distance)&&(Ut[r]=t)}else qt++,Vt[e]=qt,Ut.push(t)};for(Nt=0;Nt<jt;Nt++)Ht(gt[Nt]);for(Nt=gt.length-1;Nt>jt-1;Nt--)Ht(gt[Nt]);gt=Ut,Pt()}var Gt=t._hoverdata,Wt=[],Zt=Z(t),Yt=Y(t);for(at=0;at<gt.length;at++){var Xt=gt[at],$t=y.makeEventData(Xt,Xt.trace,Xt.cd);if(!1!==Xt.hovertemplate){var Kt=!1;Xt.cd[Xt.index]&&Xt.cd[Xt.index].ht&&(Kt=Xt.cd[Xt.index].ht),Xt.hovertemplate=Kt||Xt.trace.hovertemplate||!1}if(Xt.xa&&Xt.ya){var Jt=Xt.x0+Xt.xa._offset,Qt=Xt.x1+Xt.xa._offset,te=Xt.y0+Xt.ya._offset,ee=Xt.y1+Xt.ya._offset,re=Math.min(Jt,Qt),ne=Math.max(Jt,Qt),ie=Math.min(te,ee),ae=Math.max(te,ee);$t.bbox={x0:re+Yt,x1:ne+Yt,y0:ie+Zt,y1:ae+Zt}}Xt.eventData=[$t],Wt.push($t)}t._hoverdata=Wt;var oe="y"===S&&(yt.length>1||gt.length>1)||"closest"===S&&xt&&gt.length>1,se=f.combine(b.plot_bgcolor||f.background,b.paper_bgcolor),le=R(gt,{gd:t,hovermode:S,rotateLabels:oe,bgColor:se,container:b._hoverlayer,outerContainer:b._paper.node(),commonLabelOpts:b.hoverlabel,hoverdistance:b.hoverdistance}),ce=le.hoverLabels;if(y.isUnifiedHover(S)||(function(t,e,r,n){var i,a,o,s,l,c,u,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 A(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++)(c=t[s]).pos+c.dp+c.size>e.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s<t.length&&!(n<=0);s++)if((c=t[s]).pos<e.pmin+1)for(c.del=!0,n--,o=2*c.size,l=t.length-1;l>=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.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 c,u,p=j(t,e),m=t.anchor,A="end"===m?-1:1;if("middle"===m)u=(c=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)u=(c=t.crossPos+T(E+p.y)-T(t.by/2-E))+T(t.by);else{var M=w(A*E+p.x),S=M+w(A*t.bx);c=t.crossPos+Math.min(M,S),u=t.crossPos+Math.max(M,S)}a?void 0!==_&&void 0!==b&&Math.min(u,b)-Math.max(c,_)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,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?k: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),u=0,l=M.length-1;l>=0;l--)u+=M[l].dp;for(o=u/M.length,l=M.length-1;l>=0;l--)M[l].dp-=o;i=!1}else s++}g.forEach(A)}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}}}(ce,oe,b,le.commonLabelBoundingBox),N(ce,oe,b._invScaleX,b._invScaleY)),c&&c.tagName){var ue=g.getComponentMethod("annotations","hasClickToShow")(t,Wt);u(e.select(c),ue?"pointer":"")}!c||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,Gt)||(Gt&&t.emit("plotly_unhover",{event:n,points:Gt}),t.emit("plotly_hover",{event:n,points:t._hoverdata,xaxes:$,yaxes:K,xvals:nt,yvals:it}))}(t,n,o,s,c)}))},t.loneHover=function(t,r){var n=!0;Array.isArray(t)||(n=!1,t=[t]);var i=r.gd,a=Z(i),o=Y(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,c=t.eventData;if(c){var u=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;u+=v,h+=v,p+=x,d+=x}c.bbox={x0:u+o,x1:h+o,y0:p+a,y1:d+a},r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!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:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||f.background,container:e.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=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<c?c-n+5:0,c=n+t.by+t.offset,e===r.anchorIndex&&(u=t.offset)})).each((function(t){t.offset-=u})),N(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,u=r.rotateLabels,p=r.bgColor,d=r.container,m=r.outerContainer,x=r.commonLabelOpts||{};if(0===t.length)return[[]];var T=r.fontFamily||v.HOVERFONT,A=r.fontSize||v.HOVERFONTSIZE,k=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,D=t[0],O=D.xa,R=D.ya,B=l.charAt(0),j=B+"Label",N=D[j];if(void 0===N&&"multicategory"===O.type)for(var U=0;U<t.length&&void 0===(N=t[U][j]);U++);var V=X(n,m),q=V.top,H=V.width,G=V.height,W=void 0!==N&&D.distance<=r.hoverdistance&&("x"===l||"y"===l);if(W){var Z,Y,$=!0;for(Z=0;Z<t.length;Z++)if($&&void 0===t[Z].zLabel&&($=!1),Y=t[Z].hoverinfo||t[Z].trace.hoverinfo){var K=Array.isArray(Y)?Y:Y.split("+");if(-1===K.indexOf("all")&&-1===K.indexOf(l)){W=!1;break}}$&&(W=!1)}var J=d.selectAll("g.axistext").data(W?[0]:[]);J.enter().append("g").classed("axistext",!0),J.exit().remove();var Q={minX:0,maxX:0,minY:0,maxY:0};if(J.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)})),u=x.bgcolor||f.defaultLine,p=x.bordercolor||f.contrast(u),d=f.contrast(u),m=x.font,g={weight:m.weight||k,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||A,color:m.color||d};r.style({fill:u,stroke:p}),s.text(N).call(h.font,g).call(c.positionText,0,0).call(c.convertToTspans,n),t.attr("transform","");var y,v,_=X(n,s.node());if("x"===l){var b="top"===O.side?"-":"";s.attr("text-anchor","middle").call(c.positionText,0,"top"===O.side?q-_.bottom-E-C:q-_.top+E+C),y=O._offset+(D.x0+D.x1)/2,v=R._offset+("top"===O.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"===O.side?(Q.minY=v-(2*C+_.height),Q.maxY=v-C):(Q.minY=v+C,Q.maxY=v+(2*C+_.height))}else{var F,B,j;"right"===R.side?(F="start",B=1,j="",y=O._offset+O._length):(F="end",B=-1,j="-",y=O._offset),v=R._offset+(D.y0+D.y1)/2,s.attr("text-anchor",F),r.attr("d","M0,0L"+j+E+","+E+"V"+(C+_.height/2)+"h"+j+(2*C+_.width)+"V-"+(C+_.height/2)+"H"+j+E+"V-"+E+"Z"),Q.minY=v-(C+_.height/2),Q.maxY=v+(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 W=_.width-y+C;c.positionText(s,W,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=X(n,r.node());Math.round(i.width)<Math.round(_.width)&&t.attr("x",W-i.width),r.remove()}))}else c.positionText(s,B*(C+E),H),U=null;var Z=a._topclips.selectAll("#"+G).data(U?[0]:[]);Z.enter().append("clipPath").attr("id",G).append("path"),Z.exit().remove(),Z.select("path").attr("d",U),h.setClipUrl(s,U?G:null,n)}t.attr("transform",o(y,v))})),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}):N,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 ct=tt[lt];if("none"!==ct.hoverinfo){var ut=F(ct,!0,l,a,N),ht=ut[0],ft=ut[1];ct.name=ft,ct.text=""!==ft?ft+" : "+ht:ht;var pt=ct.cd[ct.index];pt&&(pt.mc&&(ct.mc=pt.mc),pt.mcc&&(ct.mc=pt.mcc),pt.mlc&&(ct.mlc=pt.mlc),pt.mlcc&&(ct.mlc=pt.mlcc),pt.mlw&&(ct.mlw=pt.mlw),pt.mrc&&(ct.mrc=pt.mrc),pt.dir&&(ct.dir=pt.dir)),ct._distinct=!0,st.entries.push([ct])}}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=X(n,vt.node()),_t=xt.width+2*C,bt=xt.height+2*C,wt=tt[0],Tt=(wt.x0+wt.x1)/2,At=(wt.y0+wt.y1)/2,kt=!(g.traceIs(wt.trace,"bar-like")||g.traceIs(wt.trace,"box-violin"));"y"===B?kt?(mt=At-C,dt=At+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"===B?kt?(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=O._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-At<At-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:k,style:M,variant:S,textcase:I,lineposition:L,shadow:P,family:T,size:A})})),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=F(t,W,l,a,N,r),x=v[0],_=v[1],b=r.select("text.nums").call(h.font,{family:t.fontFamily||T,size:t.fontSize||A,color:t.fontColor||y,weight:t.fontWeight||k,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(c.positionText,0,0).call(c.convertToTspans,n),z=r.select("text.name"),D=0,O=0;if(_&&_!==x){z.call(h.font,{family:t.fontFamily||T,size:t.fontSize||A,color:g,weight:t.fontWeight||k,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(c.positionText,0,0).call(c.convertToTspans,n);var R=X(n,z.node());D=R.width+2*C,O=R.height+2*C}else z.remove(),r.select("rect").remove();r.select("path").style({fill:m,stroke:y});var B=t.xa._offset+(t.x0+t.x1)/2,j=t.ya._offset+(t.y0+t.y1)/2,U=Math.abs(t.x1-t.x0),V=Math.abs(t.y1-t.y0),Z=X(n,b.node()),Y=Z.width/a._invScaleX,$=Z.height/a._invScaleY;t.ty0=(q-Z.top)/a._invScaleY,t.bx=Y+2*C,t.by=Math.max($+2*C,O),t.anchor="start",t.txwidth=Y,t.tx2width=D,t.offset=0;var K,J,Q=(Y+E+C+D)*a._invScaleX;if(u)t.pos=B,K=j+V/2+Q<=G,J=j-V/2-Q>=0,"top"!==t.idealAlign&&K||!J?K?(j+=V/2,t.anchor="start"):t.anchor="middle":(j-=V/2,t.anchor="end"),t.crossPos=j;else{if(t.pos=j,K=B+U/2+Q<=H,J=B-U/2-Q>=0,"left"!==t.idealAlign&&K||!J)if(K)B+=U/2,t.anchor="start";else{t.anchor="middle";var tt=Q/2,et=B+tt-H,rt=B-tt;et>0&&(B-=et),rt<0&&(B+=-rt)}else B-=U/2,t.anchor="end";t.crossPos=B}b.attr("text-anchor",t.anchor),D&&z.attr("text-anchor",t.anchor),r.attr("transform",o(B,j)+(u?s(w):""))})),{hoverLabels:It,commonLabelBoundingBox:Q}}function F(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=G(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"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[c+"Label"]===a?l=t[u+"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[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),l=(l=i.hovertemplateString(h,f,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(D,(function(e,r){return s=G(r,t.nameLength),""}))}return[l,s]}function j(t,e){var r=0,n=t.offset;return e&&(n*=-S,r=t.offset*M),{x:r,y:n}}function N(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,u="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=j(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(u*E+d)+","+o(E+m)+"v"+o(t.by/2-E)+"h"+a(u*t.bx)+"v-"+o(t.by)+"H"+a(u*E+d)+"V"+o(m-E)+"Z":"M"+a(u*E+d)+","+o(m-t.by/2)+"h"+a(u*t.bx)+"v"+o(t.by)+"h"+a(-u*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(c.positionText,a(v),o(x)),t.tx2width&&(n.select("text.name").call(c.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 c=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 u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("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,c=r.event,u=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||u){var m=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=e.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.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,A=a.spikecolor||b,k=d.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,_=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:A,"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:k+("right"!==a.side?T:-T),cy:y,r:T,fill:A}).classed("spikeline",!0)}if(p){var E,C,I=e.vLinePoint;i=I&&I.xa,a=I&&I.ya,"cursor"===i.spikesnap?(E=c.pointerX,C=c.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,D=i.spikemode,O=i.spikethickness,R=i.spikecolor||z,F=d.getPxPosition(t,i);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(L=F,P=C),-1!==D.indexOf("across")){var B=i._counterDomainMin,j=i._counterDomainMax;"free"===i.anchor&&(B=Math.min(B,i.position),j=Math.max(j,i.position)),L=l.t+(1-j)*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":O,stroke:R,"stroke-dasharray":h.dashStyle(i.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==i.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function q(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function G(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function W(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 c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/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 Y(t){return t.offsetLeft+t.clientLeft}function X(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],f=c[1],p=u[0],d=u[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)}}}}),Sr=p({"src/components/fx/hoverlabel_defaults.js"(t,e){var r=le(),n=H(),i=$e().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)}}}),Er=p({"src/components/fx/layout_global_defaults.js"(t,e){var r=le(),n=Sr(),i=j();e.exports=function(t,e){n(t,e,(function(n,a){return r.coerce(t,e,i,n,a)}))}}}),Cr=p({"src/components/fx/defaults.js"(t,e){var r=le(),n=N(),i=Sr();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)}}}),Ir=p({"src/components/fx/hovermode_defaults.js"(t,e){var r=le(),n=j();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")}}}),Lr=p({"src/components/fx/layout_defaults.js"(t,e){var r=le(),n=j(),i=Ir(),a=Sr();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"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(e.dragmode="pan"),a(t,e,o),r.coerceFont(o,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}}),Pr=p({"src/components/fx/calc.js"(t,e){var r=le(),n=qt();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],c=l[0].trace;if(!n.traceIs(c,"pie-like")){var u=n.traceIs(c,"2dMap")?i:r.fillArray;u(c.hoverinfo,l,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,l,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,l,"hbg"),u(c.hoverlabel.bordercolor,l,"hbc"),u(c.hoverlabel.font.size,l,"hts"),u(c.hoverlabel.font.color,l,"htc"),u(c.hoverlabel.font.family,l,"htf"),u(c.hoverlabel.font.weight,l,"htw"),u(c.hoverlabel.font.style,l,"hty"),u(c.hoverlabel.font.variant,l,"htv"),u(c.hoverlabel.namelength,l,"hnl"),u(c.hoverlabel.align,l,"hta"),u(c.hoverlabel.showarrow,l,"htsa"))}}}}}),zr=p({"src/components/fx/click.js"(t,e){var r=qt(),n=Mr().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())}}}),Dr=p({"src/components/fx/index.js"(t,e){var r=x(),n=le(),i=fr(),a=$e(),o=j(),s=Mr();e.exports={moduleType:"component",name:"fx",constants:B(),schema:{layout:o},attributes:N(),layoutAttributes:o,supplyLayoutGlobalDefaults:Er(),supplyDefaults:Cr(),supplyLayoutDefaults:Lr(),calc:Pr(),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:zr()}}}),Or=p({"src/components/dragelement/helpers.js"(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)}}}),Rr=p({"src/lib/clear_gl_canvases.js"(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})}))}}}),Fr=p({"src/fonts/ploticon.js"(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("")}}}}),Br=p({"src/components/shapes/draw_newshape/constants.js"(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)}}}),jr=p({"src/components/selections/helpers.js"(t,e){var r=le().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)}}}}),Nr=p({"src/components/shapes/draw_newshape/helpers.js"(t){var e=Ke(),r=Br(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=jr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(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,u=0;u<s;u++){var h=u;"Q"===o||"S"===o?h=c[u]:"C"===o&&(h=l[u]),r+=t[n][a][h],u>0&&u<s-1&&(r+=",")}}return r},t.readPaths=function(t,r,i,a){var l,c,u,h=e(t),f=[],p=-1,d=0,m=0,g=function(){c=d,u=m};g();for(var y=0;y<h.length;y++){var v,x,_,b,w=[],T=h[y][0],A=T;switch(T){case"M":f[++p]=[],d=+h[y][1],m=+h[y][2],w.push([A,d,m]),g();break;case"Q":case"S":v=+h[y][1],_=+h[y][2],d=+h[y][3],m=+h[y][4],w.push([A,d,m,v,_]);break;case"C":v=+h[y][1],_=+h[y][2],x=+h[y][3],b=+h[y][4],d=+h[y][5],m=+h[y][6],w.push([A,d,m,v,_,x,b]);break;case"T":case"L":d=+h[y][1],m=+h[y][2],w.push([A,d,m]);break;case"H":A="L",d=+h[y][1],w.push([A,d,m]);break;case"V":A="L",m=+h[y][1],w.push([A,d,m]);break;case"A":A="L";var k=+h[y][1],M=+h[y][2];+h[y][4]||(k=-k,M=-M);var S=d-k,E=m;for(l=1;l<=n/2;l++){var C=2*Math.PI*l/n;w.push([A,S+k*Math.cos(C),E+M*Math.sin(C)])}break;case"Z":(d!==c||m!==u)&&(d=c,m=u,w.push([A,d,m]))}for(var I=(i||{}).domain,L=r._fullLayout._size,P=i&&"pixel"===i.xsizemode,z=i&&"pixel"===i.ysizemode,D=!1===a,O=0;O<w.length;O++){for(l=0;l+2<7;l+=2){var R=w[O][l+1],F=w[O][l+2];void 0===R||void 0===F||(d=R,m=F,i&&(i.xaxis&&i.xaxis.p2r?(D&&(R-=i.xaxis._offset),R=P?s(i.xaxis,i.xanchor)+R:o(i.xaxis,R)):(D&&(R-=L.l),I?R=I.x[0]+R/L.w:R/=L.w),i.yaxis&&i.yaxis.p2r?(D&&(F-=i.yaxis._offset),F=z?s(i.yaxis,i.yanchor)-F:o(i.yaxis,F)):(D&&(F-=L.t),F=I?I.y[1]-F/L.h:1-F/L.h)),w[O][l+1]=R,w[O][l+2]=F)}f[p].push(w[O].slice())}}return f},t.pointsOnRectangle=function(t){if(5!==t.length)return!1;for(var e=1;e<3;e++){if(!u(t[0][e]-t[1][e],t[3][e]-t[2][e]))return!1;if(!u(t[0][e]-t[3][e],t[1][e]-t[2][e]))return!1}return!(!u(t[0][1],t[1][1])&&!u(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(!u(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,c=(o.x1-o.x0)/2,u=(o.y1-o.y0)/2;c||(c=u/=i),u||(u=c/=i);for(var h=[],f=0;f<n;f++){var p=2*f*Math.PI/n;h.push([s+c*Math.cos(p),l+u*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,c=((r-=s)+a)/2;return{x0:l-(o*=i),y0:c-(s*=i),x1:l+o,y1:c+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}}}),Ur=p({"src/components/shapes/draw_newshape/newshapes.js"(t,e){var r=xe(),n=Or(),i=n.drawMode,a=n.openMode,o=Br(),s=o.i000,l=o.i090,c=o.i180,u=o.i270,h=o.cos45,f=o.sin45,p=jr(),d=p.p2r,m=p.r2p,g=_e().clearOutline,y=Nr(),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,A=y.yaxis,k=!!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:k?"paper":T._id,yref:M?"paper":A._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[c][1],z=n[u][1],D=n[s][2],O=n[l][2],R=n[c][2],F=n[u][2],B=y.xaxis&&("date"===y.xaxis.type||"log"===y.xaxis.type),j=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)),j&&(D=m(y.yaxis,D),O=m(y.yaxis,O),R=m(y.yaxis,R),F=m(y.yaxis,F));var N=(L+z)/2,U=(D+R)/2,V=_({x0:N,y0:U,x1:N+(z-L+P-I)/2*h,y1:U+(F-O+R-D)/2*f});B&&(V.x0=d(y.xaxis,V.x0),V.x1=d(y.xaxis,V.x1)),j&&(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&&A&&b(E,T,A),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 c=s[l].path||"";o="Z"===c[c.length-1]?"drawclosedpath":"drawopenpath"}}var u=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=u;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(u),p):h?h.getUpdateObj():{}}},createShapeObj:w}}}),Vr=p({"src/components/selections/draw_newselection/newselections.js"(t,e){var r=Or().selectMode,n=_e().clearOutline,i=Nr(),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"),c=e.gd,u=c._fullLayout.newselection,h=e.plotinfo,f=h.xaxis,p=h.yaxis,d=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!r(m)&&void 0!==d){var y=c._fullLayout._activeSelectionIndex;if(y<g.length)switch(c._fullLayout.selections[y].type){case"rect":m="select";break;case"path":m="lasso"}}var v,x=a(l,c,h,d),_={xref:f._id,yref:p._id,opacity:u.opacity,line:{color:u.line.color,width:u.line.width,dash:u.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(c);for(var b=e.editHelpers,w=(b||{}).modifyItem,T=[],A=0;A<g.length;A++){var k=c._fullLayout.selections[A];if(k){if(T[A]=k._input,void 0!==d&&A===c._fullLayout._activeSelectionIndex){var M=_;switch(k.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[A]=k}return void 0===d?(T.push(_),T):b?b.getUpdateObj():{}}}}}}),qr=p({"src/components/shapes/constants.js"(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}}}}),Hr=p({"src/components/shapes/helpers.js"(t){var e=qr(),r=le(),n=ir();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],c=i?l:r.cleanNumber(l);a.push(c)}}})),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 c=t.shapePositionToRange(r);s=function(t){var e=i(r,n);return r._offset+r.r2p(c(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,c,u,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),A=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?u=function(t){return x._offset+x._length*(1-t)}:(c=t.shapePositionToRange(x),u=function(t){return x._offset+x.r2p(c(t,!0))}):u=function(t){return _.t+_.h*(1-t)},"path"===m)return v&&"date"===v.type&&(l=t.decodeDate(l)),x&&"date"===x.type&&(u=t.decodeDate(u)),function(t,n,i){var a=t.path,o=t.xsizemode,s=t.ysizemode,l=t.xanchor,c=t.yanchor;return a.replace(e.segmentRE,(function(t){var a=0,u=t.charAt(0),h=e.paramIsX[u],f=e.paramIsY[u],p=e.numParams[u],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(c)-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)),u+d}))}(o,l,u);if("pixel"===o.xsizemode){var k=l(o.xanchor);h=k+o.x0+b,f=k+o.x1+w}else h=l(o.x0)+b,f=l(o.x1)+w;if("pixel"===o.ysizemode){var M=u(o.yanchor);p=M-o.y0+T,d=M-o.y1+A}else p=u(o.y0)+T,d=u(o.y1)+A;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"}}}),Gr=p({"src/components/shapes/display_labels.js"(t,e){var r=le(),n=ir(),i=Se(),a=Qe(),o=Nr().readPaths,s=Hr(),l=s.getPathString,c=Rt(),u=Me().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 c){var v=c[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},A=h.label.font,k=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 D=n.getFromId(t,h.xref),O=h.x0shift,R=h.x1shift,F=n.getRefType(h.xref),B=n.getFromId(t,h.yref),j=h.y0shift,N=h.y1shift,U=n.getRefType(h.yref),V=function(e,r){return s.getDataToPixel(t,D,r,!1,F)(e)},q=function(e,r){return s.getDataToPixel(t,B,r,!0,U)(e)};x=V(h.x0,O),_=V(h.x1,R),b=q(h.y0,j),w=q(h.y1,N)}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),k.call((function(e){return e.call(a.font,A).attr({}),i.convertToTspans(e,t),e}));var G=function(t,e,r,n,i,a,o){var s,l,c,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={bottom:-1,middle:0,top:1};if("auto"===p){var w=b[_];c=-d*y*w,h=d*v*w}else c=d*{left:1,center:0,right:-1}[x],h=d*b[_];s+=c,l+=h}else c=d+3,-1!==f.indexOf("right")?(s=Math.max(t,r)-c,"auto"===x&&(x="right")):-1!==f.indexOf("left")?(s=Math.min(t,r)+c,"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 T=u[_],A=i.label.font.size,k=o.height;return{textx:s+(k*T-A)*y,texty:l+-(k*T-A)*v,xanchor:x}}(x,b,_,w,h,H,a.bBox(k.node())),W=G.textx,Z=G.texty,Y=G.xanchor;k.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[Y],y:Z,x:W,transform:"rotate("+H+","+W+","+Z+")"}).call(i.positionText,W,Z)}}}}),Wr=p({"src/components/shapes/display_outlines.js"(t,e){var r=le().strTranslate,n=fr(),i=Or(),a=i.drawMode,o=i.selectMode,s=qt(),l=H(),c=Br(),u=c.i000,h=c.i090,f=c.i180,p=c.i270,d=_e().clearOutlineControllers,m=Nr(),g=m.pointsOnRectangle,y=m.pointsOnEllipse,v=m.writePaths,x=Ur().newShapes,_=Ur().createShapeObj,b=Vr(),w=Gr();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,c,m){m||(m=0);var A=c.gd;function k(){t(e,i,c,m++),(y(e[0])||c.hasText)&&M({redrawing:!0})}function M(t){var e={};void 0!==c.isActiveShape&&(c.isActiveShape=!1,e=x(i,c)),void 0!==c.isActiveSelection&&(c.isActiveSelection=!1,e=b(i,c),A._fullLayout._reselect=!0),Object.keys(e).length&&s.call((t||{}).redrawing?"relayout":"_guiRelayout",A,e)}var S,E,C,I,L,P=A._fullLayout._zoomlayer,z=c.dragmode,D=a(z),O=o(z);if((D||O)&&(A._fullLayout._outlining=!0),d(A),i.attr("d",v(e)),m||!c.isActiveShape&&!c.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===u||m===h||m===f||m===p)){var v,x=o&&c.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 k=v[1]-_,M=v[2]-b,E=M?5:Math.max(Math.min(25,Math.abs(k)-5),5),C=k?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(k/2,M/2))}else w.classed("cursor-grab",!0).attr("r",5).attr("cx",_).attr("cy",b);S[i][m]={element:w.node(),gd:A,prepFn:B,doneFn:N,clickFn:U},n.init(S[i][m])}}}(P.append("g").attr("class","outline-controllers")),function(){if(E=[],e.length){E[0]={element:i[0][0],gd:A,prepFn:q,doneFn:H,clickFn:G},n.init(E[0])}}()),D&&c.hasText){var R=P.select(".label-temp"),F=_(i,c,c.dragmode);w(A,"label-temp",F,R)}function B(t){C=+t.srcElement.getAttribute("data-i"),I=+t.srcElement.getAttribute("data-j"),S[C][I].moveFn=j}function j(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;c.isActiveSelection&&(T(a,I)[1]===a[I][1]?l=0:s=0);for(var u=0;u<o;u++)if(u!==I){var h=a[u];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;k()}}function N(){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,k(),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),k()}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})}}}(A)}}}}),Zr=p({"src/components/shapes/draw.js"(t,e){var r=x(),n=qt(),i=le(),a=ir(),o=Nr().readPaths,s=Wr(),l=Gr(),c=_e().clearOutlineControllers,u=H(),h=Qe(),f=ye().arrayEditor,p=fr(),d=pr(),m=qr(),g=Hr(),y=g.getPathString;function v(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 c=g.makeShapesOptionsAndPlotinfo(t,e),x=c.options,w=c.plotinfo;function M(c){var M=y(t,x),S={"data-index":e,"fill-rule":x.fillrule,d:M},E=x.opacity,C=x.fillcolor,I=x.line.width?x.line.color:"rgba(0,0,0,0)",L=x.line.width,P=x.line.dash;!L&&!0===x.editable&&(L=5,P="solid");var z="Z"!==M[M.length-1],D=b(t)&&x.editable&&t._fullLayout._activeShapeIndex===e;D&&(C=z?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,E=t._fullLayout.activeshape.opacity);var O,R=c.append("g").classed("shape-group",!0).attr({"data-index":e}),F=R.append("path").attr(S).style("opacity",E).call(u.stroke,I).call(u.fill,C).call(h.dashLine,P,L);if(T(R,t,x),l(t,e,x,R),(D||t._context.edits.shapePosition)&&(O=f(t.layout,"shapes",x)),D){F.style({cursor:"move"});var B={element:F.node(),plotinfo:w,gd:t,editHelpers:O,hasText:x.label.text||x.label.texttemplate,isActiveShape:!0},j=o(M,t);s(j,F,B)}else t._context.edits.shapePosition?function(t,e,o,s,c,u){var f,v,x,b,w,k,M,S,E,C,I,L,P,z,D,O,R="pixel"===o.xsizemode,F="pixel"===o.ysizemode,B="line"===o.type,j="path"===o.type,N=u.modifyItem,U=r.select(e.node().parentNode),V=a.getFromId(t,o.xref),q=a.getRefType(o.xref),H=a.getFromId(t,o.yref),G=a.getRefType(o.yref),W=o.x0shift,Z=o.x1shift,Y=o.y0shift,X=o.y1shift,$=function(e,r){return g.getDataToPixel(t,V,r,!1,q)(e)},K=function(e,r){return g.getDataToPixel(t,H,r,!0,G)(e)},J=g.getPixelToData(t,V,!1,q),Q=g.getPixelToData(t,H,!0,G),tt=B?function(){var t=10,r=Math.max(o.line.width,t),n=c.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:R?$(o.xanchor)+o.x0:$(o.x0,W),cy:F?K(o.yanchor)-o.y0:K(o.y0,Y),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:R?$(o.xanchor)+o.x1:$(o.x1,Z),cy:F?K(o.yanchor)-o.y1:K(o.y1,X),r:a}).style(i).classed("cursor-grab",!0),n}():e,et={element:tt.node(),gd:t,prepFn:function(r){_(t)||(R&&(w=$(o.xanchor)),F&&(k=K(o.yanchor)),"path"===o.type?D=o.path:(f=R?o.x0:$(o.x0),v=F?o.y0:K(o.y0),x=R?o.x1:$(o.x1),b=F?o.y1:K(o.y1)),f<x?(E=f,P="x0",C=x,z="x1"):(E=x,P="x1",C=f,z="x0"),!F&&v<b||F&&v>b?(M=v,I="y0",S=b,L="y1"):(M=b,I="y1",S=v,L="y0"),rt(r),at(c,o),function(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)}(e,o,t),et.moveFn="move"===O?nt:it,et.altKey=r.altKey)},doneFn:function(){_(t)||(d(e),ot(c),T(e,t,o),n.call("_guiRelayout",t,u.getUpdateObj()))},clickFn:function(){_(t)||ot(c)}};function rt(r){if(_(t))O=null;else if(B)O="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=et.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!j&&i>10&&a>10&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";d(e,l),O=l.split("-")[0]}}function nt(r,n){if("path"===o.type){var i=function(t){return t},a=i,u=i;R?N("xanchor",o.xanchor=J(w+r)):(a=function(t){return J($(t)+r)},V&&"date"===V.type&&(a=g.encodeDate(a))),F?N("yanchor",o.yanchor=Q(k+n)):(u=function(t){return Q(K(t)+n)},H&&"date"===H.type&&(u=g.encodeDate(u))),N("path",o.path=A(D,a,u))}else R?N("xanchor",o.xanchor=J(w+r)):(N("x0",o.x0=J(f+r)),N("x1",o.x1=J(x+r))),F?N("yanchor",o.yanchor=Q(k+n)):(N("y0",o.y0=Q(v+n)),N("y1",o.y1=Q(b+n)));e.attr("d",y(t,o)),at(c,o),l(t,s,o,U)}function it(r,n){if(j){var i=function(t){return t},a=i,u=i;R?N("xanchor",o.xanchor=J(w+r)):(a=function(t){return J($(t)+r)},V&&"date"===V.type&&(a=g.encodeDate(a))),F?N("yanchor",o.yanchor=Q(k+n)):(u=function(t){return Q(K(t)+n)},H&&"date"===H.type&&(u=g.encodeDate(u))),N("path",o.path=A(D,a,u))}else if(B){if("resize-over-start-point"===O){var h=f+r,p=F?v-n:v+n;N("x0",o.x0=R?h:J(h)),N("y0",o.y0=F?p:Q(p))}else if("resize-over-end-point"===O){var d=x+r,m=F?b-n:b+n;N("x1",o.x1=R?d:J(d)),N("y1",o.y1=F?m:Q(m))}}else{var _=function(t){return-1!==O.indexOf(t)},T=_("n"),q=_("s"),G=_("w"),W=_("e"),Z=T?M+n:M,Y=q?S+n:S,X=G?E+r:E,tt=W?C+r:C;F&&(T&&(Z=M-n),q&&(Y=S-n)),(!F&&Y-Z>10||F&&Z-Y>10)&&(N(I,o[I]=F?Z:Q(Z)),N(L,o[L]=F?Y:Q(Y))),tt-X>10&&(N(P,o[P]=R?X:J(X)),N(z,o[z]=R?tt:J(tt)))}e.attr("d",y(t,o)),at(c,o),l(t,s,o,U)}function at(t,e){(R||F)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=$(R?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,m.paramIsX))),o=K(F?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,m.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),R&&F){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(R){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function ot(t){t.selectAll(".visual-cue").remove()}p.init(et),tt.node().onmousemove=rt}(t,F,x,e,c,O):!0===x.editable&&F.style("pointer-events",z||u.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 k(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=k,v(t)}}}(t,F)}))}x._input&&!0===x.visible&&("above"===x.layer?M(t._fullLayout._shapeUpperLayer):"paper"===x.xref||"paper"===x.yref?M(t._fullLayout._shapeLowerLayer):"between"===x.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 A(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 k(t){b(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,v(t))}e.exports={draw:v,drawOne:w,eraseActiveShape:function(t){if(b(t)){c(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}}}),Yr=p({"src/components/modebar/buttons.js"(t,e){var r=qt(),n=Ae(),i=xe(),a=Fr(),o=Zr().eraseActiveShape,s=le(),l=s._,c=e.exports={};function u(t,e){var n,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},h=i.list(t,null,!0),f=c._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)u[p+".autorange"]=!0;else if("reset"===l)void 0===n._rangeInitial0&&void 0===n._rangeInitial1?u[p+".autorange"]=!0:void 0===n._rangeInitial0?(u[p+".autorange"]=n._autorangeInitial,u[p+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(u[p+".range"]=[n._rangeInitial0,null],u[p+".autorange"]=n._autorangeInitial):u[p+".range"]=[n._rangeInitial0,n._rangeInitial1],void 0!==n._showSpikeInitial&&(u[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]];u[p+".range[0]"]=n.l2r(v[0]),u[p+".range[1]"]=n.l2r(v[1])}}else"hovermode"===s&&("x"===l||"y"===l)&&(l=c._isHoriz?"y":"x",o.setAttribute("data-val",l)),u[s]=l;c._cartesianSpikesEnabled=f,r.call("_guiRelayout",t,u)}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("."),c=0;c<o.length;c++)s[o[c]+"."+l[1]]=a;var u="pan"===a?a:"zoom";s.dragmode=u,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={},c=0;c<s.length;c++){var u,h=s[c],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,u=!0):a&&(l[f+".up"]=null,l[f+".eye"]=null,l[f+".center"]=null,u=!0),u&&(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 c=0;c<a.length;c++){var u=a[c],h=i[u],f=u+".hovermode";s[f]=h.hovermode,l[f]=!1;for(var p=0;p<3;p++){var d=o[p],m=u+"."+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 c=s[l],u=o[c];if("zoom"===i){var h=u.projection.scale,f="in"===a?2*h:.5*h;r.call("_guiRelayout",t,c+".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 c=o[l],u=a[c].zoom,h="in"===i?1.05*u:u/1.05;s[c+".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,c=Object.keys(l),u=0;u<c.length;u++){var h=c[u];a[s+"."+h]=l[h]}r.call("_guiRelayout",t,a)}c.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")}))}},c.sendDataToCloud={name:"sendDataToCloud",title:function(t){return l(t,"Edit in Chart Studio")},icon:a.disk,click:function(t){n.sendDataToCloud(t)}},c.editInChartStudio={name:"editInChartStudio",title:function(t){return l(t,"Edit in Chart Studio")},icon:a.pencil,click:function(t){n.sendDataToCloud(t)}},c.zoom2d={name:"zoom2d",_cat:"zoom",title:function(t){return l(t,"Zoom")},attr:"dragmode",val:"zoom",icon:a.zoombox,click:u},c.pan2d={name:"pan2d",_cat:"pan",title:function(t){return l(t,"Pan")},attr:"dragmode",val:"pan",icon:a.pan,click:u},c.select2d={name:"select2d",_cat:"select",title:function(t){return l(t,"Box Select")},attr:"dragmode",val:"select",icon:a.selectbox,click:u},c.lasso2d={name:"lasso2d",_cat:"lasso",title:function(t){return l(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:a.lasso,click:u},c.drawclosedpath={name:"drawclosedpath",title:function(t){return l(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:a.drawclosedpath,click:u},c.drawopenpath={name:"drawopenpath",title:function(t){return l(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:a.drawopenpath,click:u},c.drawline={name:"drawline",title:function(t){return l(t,"Draw line")},attr:"dragmode",val:"drawline",icon:a.drawline,click:u},c.drawrect={name:"drawrect",title:function(t){return l(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:a.drawrect,click:u},c.drawcircle={name:"drawcircle",title:function(t){return l(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:a.drawcircle,click:u},c.eraseshape={name:"eraseshape",title:function(t){return l(t,"Erase active shape")},icon:a.eraseshape,click:o},c.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(t){return l(t,"Autoscale")},attr:"zoom",val:"auto",icon:a.autoscale,click:u},c.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(t){return l(t,"Reset axes")},attr:"zoom",val:"reset",icon:a.home,click:u},c.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:u},c.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:u},c.zoom3d={name:"zoom3d",_cat:"zoom",title:function(t){return l(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:a.zoombox,click:h},c.pan3d={name:"pan3d",_cat:"pan",title:function(t){return l(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:a.pan,click:h},c.orbitRotation={name:"orbitRotation",title:function(t){return l(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:a["3d_rotate"],click:h},c.tableRotation={name:"tableRotation",title:function(t){return l(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:a["z-axis"],click:h},c.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(t){return l(t,"Reset camera to default")},attr:"resetDefault",icon:a.home,click:f},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(t){return l(t,"Reset camera to last save")},attr:"resetLastSave",icon:a.movie,click:f},c.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)}},c.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:d},c.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:d},c.resetGeo={name:"resetGeo",_cat:"reset",title:function(t){return l(t,"Reset")},attr:"reset",val:null,icon:a.autoscale,click:d},c.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},c.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},c.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)}},c.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)}},c.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"),u(t,e),r.setAttribute("data-attr","resetLastSave"),f(t,e),_(t,"geo"),_(t,"mapbox"),_(t,"map")}},c.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))}},c.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(t){return l(t,"Reset view")},attr:"reset",icon:a.home,click:function(t){_(t,"mapbox")}},c.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(t){return l(t,"Reset view")},attr:"reset",icon:a.home,click:function(t){_(t,"map")}},c.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:y},c.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:v},c.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:y},c.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:v}}}),Xr=p({"src/components/modebar/constants.js"(t,e){var r=Yr(),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}}}),$r=p({"src/components/modebar/attributes.js"(t,e){Xr(),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"}}}}),Kr=p({"src/components/modebar/defaults.js"(t,e){var r=le(),n=H(),i=ye(),a=$r();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 c=n.contrast(n.rgb(e.modebar.bgcolor));l("color",n.addOpacity(c,.3)),l("activecolor",n.addOpacity(c,.7)),l("uirevision",e.uirevision),l("add"),l("remove")}}}),Jr=p({"src/components/modebar/modebar.js"(t,e){var r=x(),n=A(),i=le(),a=Fr(),o=y().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 c=l.prototype;c.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),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(l||c||u)&&(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)},c.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)}))},c.createGroup=function(){var t=document.createElement("div");t.className="modebar-group";var e=this.graphInfo._fullLayout.modebar;return t.style.backgroundColor=e.bgcolor,t},c.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},c.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},c.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),c=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 u=!l.classed("active");l.classed("active",u),c(t,u)}}else{var h=null===o?o:i.nestedProperty(e,o).get();l.classed("active",h===a),c(t,h===a)}}))},c.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},c.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},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.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}}}),Qr=p({"src/components/modebar/manage.js"(t,e){var r=xe(),n=Ye(),i=qt(),a=$e().isUnifiedHover,o=Jr(),s=Yr(),l=Xr().DRAW_MODES,c=le().extendDeep;e.exports=function(t){var e=t._fullLayout,u=t._context,h=e._modeBar;if(u.displayModeBar||u.watermark){if(!Array.isArray(u.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(u.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,p=u.modeBarButtons;f=Array.isArray(p)&&p.length?function(t){for(var e=c([],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):!u.displayModeBar&&u.watermark?[]:function(t){var e=t._fullLayout,o=t._fullData,c=t._context;function u(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=c.modeBarButtonsToAdd.concat(h.filter((function(t){for(var e=0;e<c.modeBarButtonsToRemove.length;e++)if(u(t,c.modeBarButtonsToRemove[e]))return!1;return!0}))),d=c.modeBarButtonsToRemove.concat(f.filter((function(t){for(var e=0;e<c.modeBarButtonsToAdd.length;e++)if(u(t,c.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"),A=e._has("smith"),k=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,c=0;c<d.length;c++){var u=d[c].toLowerCase();if(u===a||u===o){l=!0;break}}l||e.push(s[n])}E.push(e)}}var I=["toImage"];c.showEditInChartStudio?I.push("editInChartStudio"):c.showSendToCloud&&I.push("sendDataToCloud"),C(I);var L=[],P=[],z=[],D=[];(m||v||x||_)+y+g+b+w+T+A>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"]:k?(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?D=["zoom3d","pan3d","orbitRotation","tableRotation"]:m&&!M||_?D=["zoom2d","pan2d"]:b||w||y?D=["pan2d"]:T&&(D=["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)&&D.push("select2d","lasso2d");var O=[],R=function(t){-1===O.indexOf(t)&&-1!==P.indexOf(t)&&O.push(t)};if(Array.isArray(p)){for(var F=[],B=0;B<p.length;B++){var j=p[B];"string"==typeof j?(j=j.toLowerCase(),-1!==l.indexOf(j)?(e._has("mapbox")||e._has("map")||e._has("cartesian"))&&D.push(j):"togglespikelines"===j?R("toggleSpikelines"):"togglehover"===j?R("toggleHover"):"hovercompare"===j?R("hoverCompareCartesian"):"hoverclosest"===j?(R("hoverClosestCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie")):"v1hovermode"===j&&(R("hoverClosestCartesian"),R("hoverCompareCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie"))):F.push(j)}p=F}return C(D),C(L.concat(z)),C(O),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)}}}),tn=p({"src/components/modebar/index.js"(t,e){e.exports={moduleType:"component",name:"modebar",layoutAttributes:$r(),supplyLayoutDefaults:Kr(),manage:Qr()}}}),en=p({"src/plots/cartesian/scale_zoom.js"(t,e){var r=Me().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()}}}),rn=p({"src/plots/cartesian/constraints.js"(t){var e=le(),r=nr(),n=xe().id2name,i=Ie(),a=en(),o=er(),s=k().ALMOST_EQUAL,l=Me().FROM_BL;function c(t,r,a){var o=a.axIds,s=a.layoutOut,l=a.hasImage,c=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 A=h(c,y);if(A){var k=[];for(_=0;_<T.length;_++)A[b=T[_]]||k.push(b);T=k}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=u(s,r)/u(s,I);v!==("x"===M.charAt(0))&&(L=(v?"x":"y")+L),f(c,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(c,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 u(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,c=h(t,e);null===c?((c={})[e]=1,l=t.length,t.push(c)):l=t.indexOf(c);var u=Object.keys(c);for(i=0;i<t.length;i++)if(o=t[i],i!==l&&o[r]){var f=o[r];for(a=0;a<u.length;a++)o[s=u[a]]=p(f,p(n,c[s]));return void t.splice(l,1)}if(1!==n)for(a=0;a<u.length;a++){var d=u[a];c[d]=p(n,c[d])}c[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 c=l.match(/^[xy]*/)[0],u=c.length;l=+l.substr(u);for(var h="y"===c.charAt(0)?n:1/n,f=0;f<u;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,u,h,f,p,d,m=i.axIds,g=i.axHasImage,y=r._axisConstraintGroups=[],v=r._axisMatchGroups=[];for(a=0;a<m.length;a++)c(h=t[u=n(m[a])],f=r[u],{axIds:m,layoutOut:r,hasImage:g[u]});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,A=!1;function k(){d=f[p],"rangebreaks"===p&&(A=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[u=n(l)],f=r[u],p in f){if(!f.matches&&(S=f,p in h)){k();break}null===d&&p in h&&k()}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=A,o(f,r))}}},t.enforce=function(t){var e,i,o,l,c,u,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]]=c=p[n(l)],c._inputDomain?c.domain=c._inputDomain.slice():c._inputDomain=c.domain.slice(),c._inputRange||(c._inputRange=c.range.slice()),c.setScale(),b[l]=u=Math.abs(c._m)/o[l],v=Math.min(v,u),("domain"===c.constrain||!c._constraintShrinkable)&&(_=Math.min(_,u)),delete c._constraintShrinkable,x=Math.max(x,u),"domain"===c.constrain&&(T=!0);if(!(v>s*x)||T)for(i=0;i<y.length;i++)if(u=b[l=y[i]],h=(c=w[l]).constrain,u!==_||"domain"===h)if(f=u/_,"range"===h)a(c,f);else{var A=c._inputDomain,k=(c.domain[1]-c.domain[0])/(A[1]-A[0]),M=(c.r2l(c.range[1])-c.r2l(c.range[0]))/(c.r2l(c._inputRange[1])-c.r2l(c._inputRange[0]));if((f/=k)*M<1){c.domain=c._input.domain=A.slice(),a(c,f);continue}if(M<1&&(c.range=c._input.range=c._inputRange.slice(),f*=M),c.autorange){var S=c.r2l(c.range[0]),E=c.r2l(c.range[1]),C=(S+E)/2,I=C,L=C,P=Math.abs(E-C),z=C-P*f*1.0001,D=C+P*f*1.0001,O=r.makePadFn(p,c,0),R=r.makePadFn(p,c,1);m(c,f);var F,B,j=Math.abs(c._m),N=r.concatExtremes(t,c),U=N.min,V=N.max;for(B=0;B<U.length;B++)(F=U[B].val-O(U[B])/j)>z&&F<I&&(I=F);for(B=0;B<V.length;B++)(F=V[B].val+R(V[B])/j)<D&&F>L&&(L=F);f/=(L-I)/(2*P),I=c.l2r(I),L=c.l2r(L),c.range=c._input.range=S<E?[I,L]:[L,I]}m(c,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)}}}}),nn=p({"src/plot_api/subroutines.js"(t){var e=x(),r=qt(),n=Ae(),i=le(),a=Se(),o=Rr(),s=H(),l=Qe(),c=tr(),u=tn(),h=ir(),f=Me(),p=rn(),d=p.enforce,m=p.clean,g=nr().doAutoRange,y="start",v=ve().zindexSeparator;function _(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 b(r){var a,o,c,p,d,m,g=r._fullLayout,y=g._size,x=y.p,b=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),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:y.l+y.w*(t.position||0)+n%1}for(a=0;a<b.length;a++){var k=(p=b[a])._anchorAxis;p._linepositions={},p._lw=l.crispRound(r,p.linewidth,1),p._mainLinePosition=T(p,k,p.side),p._mainMirrorPosition=p.mirror&&k?T(p,k,f.OPPOSITE_SIDE[p.side]):null}var M=[],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((c=g._plots[o]).mainplot)c.bg&&c.bg.remove(),c.bg=void 0;else{var I=c.xaxis.domain,L=c.yaxis.domain,P=c.plotgroup;if(_(I,L,E)&&-1===o.indexOf(v)){var z=P.node(),D=c.bg=i.ensureSingle(P,"rect","bg");z.insertBefore(D.node(),z.childNodes[0]),S.push(o)}else P.select("rect.bg").remove(),E.push([I,L]),C||(M.push(o),S.push(o))}var O,R,F,B,j,N,U,V,q,H,G,W,Z,Y=g._bgLayer.selectAll(".bg").data(M);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++)c=g._plots[S[a]],d=c.xaxis,m=c.yaxis,c.bg&&void 0!==d._offset&&void 0!==m._offset&&c.bg.call(l.setRect,d._offset-x,m._offset-x,d._length+2*x,m._length+2*x).call(s.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(o in g._plots){c=g._plots[o],d=c.xaxis,m=c.yaxis;var X,$,K=c.clipId="clip"+g._uid+o+"plot",J=i.ensureSingleById(g._clips,"clipPath",K,(function(t){t.classed("plotclip",!0).append("rect")}));c.clipRect=J.select("rect").attr({width:d._length,height:m._length}),l.setTranslate(c.plot,d._offset,m._offset),c._hasClipOnAxisFalse?(X=null,$=K):(X=K,$=null),l.setClipUrl(c.plot,X,r),c.layerClipId=$}function Q(t){return"M"+O+","+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){c=g._plots[o],d=c.xaxis,m=c.yaxis;var it="M0,0";w(d,o)&&(j=A(d,"left",m,b),O=d._offset-(j?x+j:0),N=A(d,"right",m,b),R=d._offset+d._length+(N?x+N:0),F=T(d,m,"bottom"),B=T(d,m,"top"),(Z=!d._anchorAxis||o!==d._mainSubplot)&&("allticks"===d.mirror||"all"===d.mirror)&&(d._linepositions[o]=[F,B]),it=nt(d,Q,tt),Z&&d.showline&&("all"===d.mirror||"allticks"===d.mirror)&&(it+=Q(F)+Q(B)),c.xlines.style("stroke-width",d._lw+"px").call(s.stroke,d.showline?d.linecolor:"rgba(0,0,0,0)")),c.xlines.attr("d",it);var at="M0,0";w(m,o)&&(G=A(m,"bottom",d,b),U=m._offset+m._length+(G?x:0),W=A(m,"top",d,b),V=m._offset-(W?x:0),q=T(m,d,"left"),H=T(m,d,"right"),(Z=!m._anchorAxis||o!==m._mainSubplot)&&("allticks"===m.mirror||"all"===m.mirror)&&(m._linepositions[o]=[q,H]),at=nt(m,et,rt),Z&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(at+=et(q)+et(H)),c.ylines.style("stroke-width",m._lw+"px").call(s.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),c.ylines.attr("d",at)}return h.makeClipPaths(r),n.previousPromises(r)}function w(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function T(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 A(t,e,r,n){if(T(t,e,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&T(t,e,a))return a._lw}return 0}function k(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,b],t)},t.drawMainTitle=function(t){var r=t._fullLayout.title,o=t._fullLayout,s=function(t){var e=t.title,r="middle";return i.isRightAnchor(e)?r="end":i.isLeftAnchor(e)&&(r=y),r}(o),u=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,u),p=function(t,e){var r=t.title,n=t._size,i=0;return"paper"===(e===y?i=r.pad.l:"end"===e&&(i=-r.pad.r),r.xref)?n.l+n.w*r.x+i:t.width*r.x+i}(o,s);if(c.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:u}}),r.text&&r.automargin){var d=e.selectAll(".gtitle"),m=l.bBox(e.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",c={x:s.x,y:s.y,t:0,b:0},u={};"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)?c[l]=r:"container"===s.yref&&(u[l]=r,t._fullLayout._reservedMargin[o]=u),n.allowAutoMargin(t,o),n.autoMargin(t,o,c)})(t,h,g,m),d.attr({x:p,y:h,"text-anchor":s,dy:k(r.yanchor)}).call(a.positionText,p,h);var v=(r.text.match(a.BR_TAG_ALL)||[]).length;if(v){var x=f.LINE_SPACING*v+f.MID_SHIFT;0===r.y&&(x=-x),d.selectAll(".line").each((function(){var t=+this.getAttribute("dy").slice(0,-2)-x+"em";this.setAttribute("dy",t)}))}var _=e.selectAll(".gtitle-subtitle");if(_.node()){var b=d.node().getBBox(),w=b.y+b.height+c.SUBTITLE_PADDING_EM*r.subtitle.font.size;_.attr({x:p,y:w,"text-anchor":s,dy:k(r.yanchor)}).call(a.positionText,p,w)}}}},t.doTraceStyle=function(e){var i,a=e.calcdata,s=[];for(i=0;i<a.length;i++){var l=a[i],c=l[0]||{},u=c.trace||{},h=u._module||{},f=h.arraysToCalcdata;f&&f(l,u);var p=h.editStyle;p&&s.push({fn:p,cd0:c})}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;u.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)}}}),an=p({"src/components/selections/draw.js"(t,e){var r=Nr().readPaths,n=Wr(),i=_e().clearOutlineControllers,a=H(),o=Qe(),s=ye().arrayEditor,l=Hr(),c=l.getPathString;function u(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=c(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=[],A=1;A>=0;A--){var k=i.append("path").attr(g).style("opacity",A?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,A?"solid":b,A?4+_:_);if(p(k,t,f),w){var M=s(t.layout,"selections",f);k.style({cursor:"move"});var S={element:k.node(),plotinfo:m,gd:t,editHelpers:M,isActiveSelection:!0},E=r(l,t);n(E,k,S)}else k.style("pointer-events",A?"all":"none");T[A]=k}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,u(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,u(t))}e.exports={draw:u,drawOne:f,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=d,u(t)}}}}}),on=p({"node_modules/polybooljs/lib/build-log.js"(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")}}}}}),sn=p({"node_modules/polybooljs/lib/epsilon.js"(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],c=a*l-o*s;if(Math.abs(c)<t)return!1;var u=e[0]-n[0],h=e[1]-n[1],f=(s*h-l*u)/c,p=(a*h-o*u)/c,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 c=r[l][0],u=r[l][1];u-i>t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}}}),ln=p({"node_modules/polybooljs/lib/linked-list.js"(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}}}}),cn=p({"node_modules/polybooljs/lib/intersecter.js"(t,e){var r=ln();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 c(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 u(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 u(t,r){var i=t.seg,a=r.seg,o=i.start,s=i.end,l=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=e.linesIntersect(o,s,l,u);if(!1===h){if(!e.pointsCollinear(o,s,l)||e.pointsSame(o,u)||e.pointsSame(s,l))return!1;var f=e.pointsSame(o,l),p=e.pointsSame(s,u);if(f&&p)return r;var d=!f&&e.pointBetween(o,l,u),m=!p&&e.pointBetween(s,l,u);if(f)return m?c(r,s):c(t,u),r;d&&(p||(m?c(r,s):c(t,u)),c(r,o))}else 0===h.alongA&&(-1===h.alongB?c(t,l):0===h.alongB?c(t,h.pt):1===h.alongB&&c(t,u)),0===h.alongB&&(-1===h.alongA?c(r,o):0===h.alongA?c(r,h.pt):1===h.alongA&&c(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=u(f,d);if(t)return t}return!!m&&u(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)&&u(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 u(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)})),u(e,n)}}}}}),un=p({"node_modules/polybooljs/lib/segment-chainer.js"(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},c=s,u=0;u<n.length;u++){var h=(g=n[u])[0],f=(g[1],g[g.length-1]);if(g[g.length-2],e.pointsSame(h,a)){if(A(u,!0,!0))break}else if(e.pointsSame(h,o)){if(A(u,!0,!1))break}else if(e.pointsSame(f,a)){if(A(u,!1,!0))break}else if(e.pointsSame(f,o)&&A(u,!1,!1))break}if(c===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(c===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?(k(b),M(b,w)):(k(w),M(w,b)):M(w,b):l.matches_head?M(b,w):T?(k(b),M(w,b)):(k(w),M(b,w))}function A(t,e,r){return c.index=t,c.matches_head=e,c.matches_pt1=r,c===s?(c=l,!1):(c=null,!0)}function k(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],c=o[0],u=o[1];e.pointsCollinear(l,s,c)&&(r&&r.chainRemoveTail(t,s),a.pop(),s=l),e.pointsCollinear(s,c,u)&&(r&&r.chainRemoveHead(i,c),o.shift()),r&&r.chainJoin(t,i),n[t]=a.concat(o),n.splice(i,1)}})),i}}}),hn=p({"node_modules/polybooljs/lib/segment-selector.js"(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}}),fn=p({"node_modules/polybooljs/lib/geojson.js"(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 c(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 u=[];function h(t){var e=[c(t.region,!1)];u.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 c(t.region,!0)}for(s=0;s<a.children.length;s++)h(a.children[s]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};e.exports=r}}),pn=p({"node_modules/polybooljs/index.js"(t,e){var r,n=on(),i=sn(),a=cn(),o=un(),s=hn(),l=fn(),c=!1,u=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?c=n():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return u.epsilon(t)},segments:function(t){var e=a(!0,u,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:a(!1,u,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:o(t.segments,u,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return l.toPolygon(r,t)},polygonToGeoJSON:function(t){return l.fromPolygon(r,u,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}}),dn=p({"node_modules/point-in-polygon/nested.js"(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,c=s-1;l<s;c=l++){var u=e[l+r][0],h=e[l+r][1],f=e[c+r][0],p=e[c+r][1];h>a!=p>a&&i<(f-u)*(a-h)/(p-h)+u&&(o=!o)}return o}}}),mn=p({"src/lib/polygon.js"(t,e){var r=Ct().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,c=!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]&&(c=!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]&&(c=!0,l=function(t){return t[1]===r[0][1]}));var u=!0,h=r[0];for(e=1;e<r.length;e++)if(h[0]!==r[e][0]||h[1]!==r[e][1]){u=!1;break}return{xmin:i,xmax:a,ymin:o,ymax:s,pts:r,contains:c?function(t,e){var r=t[0],c=t[1];return!(r===n||r<i||r>a||c===n||c<o||c>s||e&&l(t))}:function(t,e){var l=t[0],c=t[1];if(l===n||l<i||l>a||c===n||c<o||c>s)return!1;var u,h,f,p,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;u<m;u++)if(h=g,f=y,g=r[u][0],y=r[u][1],!(l<(p=Math.min(h,g))||l>Math.max(h,g)||c>Math.max(f,y)))if(c<Math.min(f,y))l!==p&&v++;else{if(c===(d=g===h?c:f+(l-h)*(y-f)/(g-h)))return!(1===u&&e);c<=d&&l!==p&&v++}return v%2==1},isRect:c,degenerate:u}},i.isSegmentBent=function(t,e,n,i){var a,o,s,l=t[e],c=[t[n][0]-l[0],t[n][1]-l[1]],u=r(c,c),h=Math.sqrt(u),f=[-c[1]/h,c[0]/h];for(a=e+1;a<n;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],(s=r(o,c))<0||s>u||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 c=l+1;c<t.length;c++)(c===t.length-1||i.isSegmentBent(t,l,c+1,e))&&(r.push(t[c]),r.length<s-2&&(n=c,a=r.length-1),l=c)}return t.length>1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}}}),gn=p({"src/components/selections/constants.js"(t,e){e.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),yn=p({"src/components/selections/select.js"(t,e){var r=pn(),n=dn(),i=qt(),a=Qe().dashStyle,o=H(),s=Dr(),l=$e().makeEventData,c=Or(),u=c.freeMode,h=c.rectMode,f=c.drawMode,p=c.openMode,d=c.selectMode,m=Hr(),g=qr(),y=Wr(),v=_e().clearOutline,x=Nr(),_=x.handleEllipse,b=x.readPaths,w=Ur().newShapes,T=Vr(),A=an().activateLastSelection,k=le(),M=k.sorterAsc,S=mn(),E=Jt(),C=xe().getFromId,I=Rr(),L=nn().redrawReglTraces,P=gn(),z=P.MINSELECT,D=S.filter,O=S.tester,R=jr(),F=R.p2r,B=R.axValue,j=R.getTransform;function N(t){return void 0!==t.subplot}function U(t,e,r,n,i,a,o){var s,l,c,u,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)){W(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=0;for(r=0;r<t.length;r++)if((e=t[r].cd[0].trace).selectedpoints&&(e.selectedpoints.length>1||(n+=e.selectedpoints.length)>1))return!1;return 1===n}(s)&&(f=K(b))){for(o&&o.remove(),g=0;g<s.length;g++)(l=s[g])._module.selectPoints(l,!1);J(e,s),Z(a),x&&ft(e)}else{for(d=t.shiftKey&&(void 0!==f?f:K(b)),c=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:!!r}}(b.pointNumber,b.searchInfo,d),u=G(a.selectionDefs.concat([c])),g=0;g<s.length;g++)if(h=tt(s[g]._module.selectPoints(s[g],u),s[g]),_.length)for(var w=0;w<h.length;w++)_.push(h[w]);else _=h;if(J(e,s,m={points:_}),c&&a&&a.selectionDefs.push(c),o){var T=a.mergedPolygons,A=p(a.dragmode);y(et(T,A),o,a)}x&&ht(e,m)}}}function V(t){return"pointNumber"in t&&"searchInfo"in t}function q(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(q(t[o]));else{var s=O(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 W(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)&&Z(r),o||(v(e),n._lastSelectedSubplot=i.id)}function Z(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 c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,t)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(t)&&(u=T(h,t)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){e&&A(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),c=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(!N({subplot:n})||a.subplot!==n&&a.geo!==n)if("splom"===a.type){if(a._xaxes[l[0]]&&a._yaxes[c[0]]){var u=$(a._module,i,e[0],r[0]);u.scene=t._fullLayout._splomScenes[a.uid],s.push(u)}}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!==c.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 K(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 J(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 c=0;c<l.length;c++){var u=l[c],h=u.data,f=u.fullData,p=u.pointIndex,d=u.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 c=[],u=[],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"),A=b(T,t,a),k=[],M=0;M<A.length;M++){for(var S=A[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,k),k.push(E)}h=h.concat(k)}}}}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 D=L[z],O=D.indexOf("y"),R=D.slice(0,O),F=D.slice(O),B=o&&s?r:void 0;if(B=at(h,R,F,B)){var j=n;if(!l){var N=C(t,R,"x"),U=C(t,F,"y");j=X(t,[N],[U],D);for(var V=0;V<j.length;V++){var q=j[V],H=q.cd[0],G=H.trace;if("scattergl"===q._module.name&&!H.t.xpx){var W=G.x,Z=G.y,Y=G._length;H.t.xpx=[],H.t.ypx=[];for(var $=0;$<Y;$++)H.t.xpx[$]=N.c2p(W[$]),H.t.ypx[$]=U.c2p(Z[$])}"splom"===q._module.name&&(P[G.uid]||(P[G.uid]=!0))}}var K=rt(B,j);c=c.concat(K),u=u.concat(j)}}var Q={points:c};J(t,u,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=ct(et);ut([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,u)||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)}J(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=O(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,c,u,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,_),c=Math.max(x,_),u=Math.min(b,w),h=Math.max(b,w),f.xmin=l,f.xmax=c,f.ymin=u,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"),A=[],k=0;k<T.length;k++){var M=T[k];if(M){M+="Z";var S=m.extractPathCoords(M,g.paramIsX,"raw"),E=m.extractPathCoords(M,g.paramIsY,"raw");l=1/0,c=-1/0,u=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),c=Math.max(L,c),u=Math.min(P,u),h=Math.max(P,h)}f.xmin=l,f.xmax=c,f.ymin=u,f.ymax=h,f.xref=p,f.yref=d,f.subtract=st(f,A),A.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 ct(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 ut(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 c=r[l+"min"],u=r[l+"max"];void 0!==c&&void 0!==u&&(n[s]=[F(o,c),F(o,u)].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 c=!N(n),m=u(l),g=h(l),v=p(l),x=f(l),b=d(l),w="drawcircle"===l,T="drawline"===l||w,A=n.gd,M=A._fullLayout,S=b&&"immediate"===M.newselection.mode&&c,C=M._zoomlayer,I=n.element.getBoundingClientRect(),L=n.plotinfo,R=j(L),F=e-I.left,B=r-I.top;M._calcInverseTransform(A);var V=k.apply3DTransform(M._invTransform)(F,B);F=V[0],B=V[1];var q,H,Y,$,K,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);W(t,A,n),m&&(q=D([[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||(c?o.contrast(A._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 At=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 kt=C.select(".label-temp");kt.empty()&&(kt=C.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Mt=M._uid+P.SELECTID,St=[],Et=X(A,n.xaxes,n.yaxes,n.subplot);S&&!t.shiftKey&&(n._clearSubplotSelections=function(){if(c){var t=mt._id,e=gt._id;it(A,t,e,Et);for(var r=(A.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&&(A._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",A,{selections:n}))}});var Ct=function(t){return t.plotinfo.fillRangeItems||ut(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),At.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),At.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),At.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=O($)),y(et(Y,v),_t,n),b){var c,u=nt(A,!1),h=u.eventData?u.eventData.points.slice():[];u=nt(A,!1,H,Et,n),H=u.selectionTesters,at=u.eventData,c=q?q.filtered:ct(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,c),function(t,e){t.emit("plotly_selecting",e)}(A,at)}))}},n.clickFn=function(t,e){if(At.remove(),A._fullLayout._activeShapeIndex>=0)A._fullLayout._deactivateShape(A);else if(!x){var r=M.clickmode;E.done(Mt).then((function(){if(E.clear(Mt),2===t){for(_t.remove(),K=0;K<Et.length;K++)(tt=Et[K])._module.selectPoints(tt,!1);if(J(A,Et),Z(n),ft(A),Et.length){var a=Et[0].xaxis,o=Et[0].yaxis;if(a&&o){for(var l=[],c=A._fullLayout.selections,u=0;u<c.length;u++){var h=c[u];h&&(h.xref!==a._id||h.yref!==o._id)&&l.push(h)}l.length<c.length&&(A._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",A,{selections:l}))}}}else r.indexOf("select")>-1&&U(e,A,n.xaxes,n.yaxes,n.subplot,n,_t),"event"===r&&ht(A,void 0);s.click(A,e,L.id)})).catch(k.error)}},n.doneFn=function(){At.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)&&Z(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),b&&ht(A,at)})).catch(k.error)}},clearOutline:v,clearSelectionsCache:Z,selectOnClick:U}}}),vn=p({"src/components/annotations/arrow_paths.js"(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}]}}),xn=p({"src/constants/axis_placeable_objects.js"(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(" ")}}}}),_n=p({"src/components/annotations/attributes.js"(t,e){var r=vn(),n=F(),i=ve(),a=ye().templatedArray;xn(),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"})}}),bn=p({"src/traces/scatter/constants.js"(t,e){e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),wn=p({"src/traces/scatter/fillcolor_attribute.js"(t,e){e.exports=function(t){return{valType:"color",editType:"style",anim:!0}}}}),Tn=p({"src/traces/scatter/attributes.js"(t,e){var r=Ce().axisHoverFormat,n=Ot().texttemplateAttrs,i=Ot().hovertemplateAttrs,a=Pe(),o=F(),s=zt().dash,l=zt().pattern,c=Qe(),u=bn(),h=R().extendFlat,f=wn();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:u.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:c.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"}}}}),An=p({"src/components/selections/attributes.js"(t,e){var r=_n(),n=Tn().line,i=zt().dash,a=R().extendFlat,o=Pt().overrideAll,s=ye().templatedArray;xn(),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")}}),kn=p({"src/components/selections/defaults.js"(t,e){var r=le(),n=ir(),i=je(),a=An(),o=Hr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete e.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var f,p,d,m=u[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),c){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)}}c&&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)}}}}),Mn=p({"src/components/selections/draw_newselection/defaults.js"(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")}}}),Sn=p({"src/plots/cartesian/include_components.js"(t,e){var r=qt(),n=le(),i=xe();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,c=a._subplots,u=c.xaxis,h=c.yaxis,f=c.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===u.indexOf(g)&&(u.push(g),_=!0),x&&-1===h.indexOf(y)&&(h.push(y),_=!0),_&&v&&x&&f.push(g+y)}}}}}}}),En=p({"src/components/selections/index.js"(t,e){var r=an(),n=yn();e.exports={moduleType:"component",name:"selections",layoutAttributes:An(),supplyLayoutDefaults:kn(),supplyDrawNewSelectionDefaults:Mn(),includeBasePlot:Sn()("selections"),draw:r.draw,drawOne:r.drawOne,reselect:n.reselect,prepSelect:n.prepSelect,clearOutline:n.clearOutline,clearSelectionsCache:n.clearSelectionsCache,selectOnClick:n.selectOnClick}}}),Cn=p({"src/plots/cartesian/dragbox.js"(t,e){var r=x(),n=le(),i=n.numberFormat,a=O(),o=lr(),s=qt(),l=n.strTranslate,c=Se(),u=H(),h=Qe(),f=Dr(),p=ir(),d=pr(),m=fr(),g=Or(),y=g.selectingOrDrawing,v=g.freeMode,_=Me().FROM_TL,b=Rr(),w=nn().redrawReglTraces,T=Ae(),A=xe().getFromId,k=En().prepSelect,M=En().clearOutline,S=En().selectOnClick,E=en(),C=ve(),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,c=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(c*o._length))}else{var u=o._rl[0],h=o._rl[1]-u;n[o._name+".range[0]"]=o.l2r(u+h*e),n[o._name+".range[1]"]=o.l2r(u+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 j(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(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:u.background,stroke:u.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"),q(t,e,i,a)}function q(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 W(t){P&&t.data&&t._context.showTips&&(n.notifier(n._(t,"Double-click to zoom back out"),"long"),P=!1)}function Z(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,c,u=!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]&&(u=!0)}for(s in i)if(g[s])for(c in g)(!a||!p[c]&&!d[c])&&!("x"===c.charAt(0)?r:i)[c]&&(f[c]=s)}u&&(n.extendFlat(h,f),f={});var y={},v=[];for(l in h){var x=A(t,l);v.push(x),y[x._id]=x}var _={},b=[];for(c in f){var w=A(t,c);b.push(w),_[w._id]=w}return{xaHash:y,yaHash:_,xaxes:v,yaxes:b,xLinks:h,yLinks:f,isSubplotConstrained:u}}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,u,d,g,x){var P,z,O,q,H,K,J,Q,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ht,ft,pt,dt,mt=t._fullLayout._zoomlayer,gt=g+x==="nsew",yt=1===(g+x).length;function vt(){if(P=e.xaxis,z=e.yaxis,tt=P._length,et=z._length,J=P._offset,Q=z._offset,(O={})[P._id]=P,(q={})[z._id]=z,g&&x)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),K=$(q),it=R(H,x),at=R(K,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=x||o,lt=g||o;var s=t._fullLayout;ct=s._has("scattergl"),ut=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+x+"drag",xt,o,l,u,d);if(ot&&!gt)return _t.onmousedown=null,_t.style.pointerEvents="none",_t;var bt,wt,Tt,At,kt,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(K)),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,c=void 0!==o||void 0!==l;if(c&&(void 0!==o&&o!==n.range[0]||void 0!==l&&l!==n.range[1])||!c&&!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(K)):r=r.concat(H)),i=0;i<r.length;i++)if(!(n=r[i]).fixedrange){var u=n._name,h=n._autorangeInitial;void 0===n._rangeInitial0&&void 0===n._rangeInitial1?a[u+".autorange"]=!0:void 0===n._rangeInitial0?(a[u+".autorange"]=h,a[u+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(a[u+".range"]=[n._rangeInitial0,null],a[u+".autorange"]=h):a[u+".range"]=[n._rangeInitial0,n._rangeInitial1]}t.emit("plotly_doubleclick",null),s.call("_guiRelayout",t,a)}}(),gt)l.indexOf("select")>-1&&S(a,o,H,K,e.id,Lt),l.indexOf("event")>-1&&f.click(o,a,e.id);else if(1===n&&yt){var u=g?z:P,h="s"===g||"w"===x?0:1,p=u._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))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===x&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(_t).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(d),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(t){var e=u.d2r(t);void 0!==e&&s.call("_guiRelayout",o,p,e)}))}}}function Dt(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",Z(Tt))):s();else if(nt.isSubplotConstrained)if(a>L||o>L){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Ct.attr("d",Z(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",Z(Tt)));Tt.w=Tt.r-Tt.l,Tt.h=Tt.b-Tt.t,St&&(It=!0),t._dragged=It,V(Et,Ct,Tt,kt,Mt,At),Ot(),t.emit("plotly_relayouting",ft),Mt=!0}function Ot(){ft={},("xy"===St||"x"===St)&&(F(H,Tt.l/tt,Tt.r/tt,ft,rt.xaxes),Vt("x",ft)),("xy"===St||"y"===St)&&(F(K,(et-Tt.b)/et,(et-Tt.t)/et,ft,rt.yaxes),Vt("y",ft))}function Rt(){Ot(),G(t),Ht(),W(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"),v(s)?Lt.minDrag=1:Lt.minDrag=void 0,y(s)?(Lt.xaxes=H,Lt.yaxes=K,k(e,r,i,Lt,s)):(Lt.clickFn=zt,y(o)&&Pt(),ot||("zoom"===s?(Lt.moveFn=Dt,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},At=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),Mt=!1,St="xy",It=!1,Et=N(mt,At,J,Q,kt="M0,0H"+tt+"V"+et+"H0V0"),Ct=U(mt,J,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,jt=C.REDRAWDELAY,Nt=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(K,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 c=(e/tt+l*r/et)/2;e=c*tt,r=l*c*et}if("w"===it?e=p(H,0,e):"e"===it?e=p(H,1,-e):it||(e=0),"n"===at?r=p(K,1,r):"s"===at?r=p(K,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 u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;u<H.length;u++)H[u].range=H[u]._r.slice(),E(H[u],1-r/et);o=(e=r*tt/et)/2}if(nt.isSubplotConstrained||!at&&1===it.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),E(K[u],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])/j(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:K,y:H}[t]:nt[t+"axes"],n=nt.isSubplotConstrained?{x:H,y:K}[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(K),i(rt.yaxes),i(nt.yaxes),a(e.overlays,"yaxis")),ft={},r=0;r<n.length;r++){var o=n[r],s=A(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,c=l._plots,u=l._subplots.cartesian;if(ut&&s.subplotsRegistry.splom.drag(t),ct)for(r=0;r<u.length;r++)if(a=(i=c[u[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((ut||ct)&&(b(t),w(t)),ht){var d=e[2]/P._length,m=e[3]/z._length;for(r=0;r<u.length;r++){a=(i=c[u[r]]).xaxis,o=i.yaxis;var y,v,_,T,A=(st||nt.isSubplotConstrained)&&!a.fixedrange&&O[a._id],k=(lt||nt.isSubplotConstrained)&&!o.fixedrange&&q[o._id];if(A?(y=d,_=x||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])):_=Zt(a,y=Wt(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),k?(v=m,T=g||nt.isSubplotConstrained?e[1]:Yt(o,v)):nt.yaHash[o._id]?(v=m,T=e[1]*o._length/z._length):nt.xaHash[o._id]?(v=d,T="ew"===it?-e[0]*o._length/P._length:Yt(o,v,{e:"right",w:"left"}[it])):T=Zt(o,v=Wt(o,d,m)),v>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"))&&(v=1,T=0),y||v){y||(y=1),v||(v=1);var M=a._offset-_/y,S=o._offset-T/v;i.clipRect.call(h.setTranslate,_,T).call(h.setScale,y,v),i.plot.call(h.setTranslate,M,S).call(h.setScale,1/y,1/v),(y!==i.xScaleFactor||v!==i.yScaleFactor)&&(h.setPointGroupScale(i.zoomScalePts,y,v),h.setTextPointsScale(i.zoomScaleTxt,y,v)),h.hideOutsideRangePoints(i.clipOnAxisFalseTraces,i),i.xScaleFactor=y,i.yScaleFactor=v}}}}function Wt(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 Zt(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*x.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=Nt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-o.left)/o.width,l=(o.bottom-e.clientY)/o.height;if(st){for(x||(s=.5),i=0;i<H.length;i++)c(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<K.length;i++)c(K[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())}),jt),e.preventDefault()}else n.log("Did not find wheel motion attributes: ",e)}function c(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:N,makeCorners:U,updateZoombox:V,xyCorners:Z,transitionZoombox:q,removeZoombox:G,showDoubleClickNotifier:W,attachWheelEventHandler:X}}}),In=p({"src/plots/cartesian/graph_interact.js"(t){var e=x(),r=Dr(),n=fr(),i=pr(),a=Cn().makeDragBox,o=ve().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,c=e.yaxis;if(!e.mainplot){var u=a(i,e,l._offset,c._offset,l._length,c._length,"ns","ew");u.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=u,i._fullLayout._hoversubplot=t},u.onmouseout=function(t){i._dragging||(i._fullLayout._hoversubplot=null,n.unhover(i,t))},i._context.showAxisDragHandles&&(a(i,e,l._offset-o,c._offset-o,o,o,"n","w"),a(i,e,l._offset+l._length,c._offset-o,o,o,"n","e"),a(i,e,l._offset-o,c._offset+c._length,o,o,"s","w"),a(i,e,l._offset+l._length,c._offset+c._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===c._mainSubplot){var f=c._mainLinePosition;"right"!==c.side&&(f-=o),a(i,e,f,c._offset+.1*c._length,o,.8*c._length,"ns",""),a(i,e,f,c._offset+.9*c._length,o,.1*c._length,"s",""),a(i,e,f,c._offset,o,.1*c._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)}}}),Ln=p({"src/plot_api/container_array_match.js"(t,e){var r=qt();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:""}}}}),Pn=p({"src/plot_api/manage_arrays.js"(t){var e=S(),r=K(),n=$(),i=Wt().sorterAsc,a=qt();t.containerArrayMatch=Ln();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,c,u){var h=e.astr,f=a.getComponentMethod(h,"supplyLayoutDefaults"),p=a.getComponentMethod(h,"draw"),d=a.getComponentMethod(h,"drawOne"),m=c.replot||c.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,A,k,M,S=Object.keys(l).map(Number).sort(i),E=e.get(),C=E||[],I=u(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),A=w[""],k=o(A),b<0||b>C.length-(k?0:1))n.warn("index out of range",h,b);else if(void 0!==A)T.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,b),s(A)?L.push(b):k?("add"===A&&(A={}),C.splice(b,0,A),I&&I.splice(b,0,{})):n.warn("Unrecognized full object edit value",h,b,A),-1===P&&(P=b);else for(_=0;_<T.length;_++)M=h+"["+b+"].",u(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 D;if(-1===P)D=S;else{for(z=Math.max(C.length,z),D=[],x=0;x<S.length&&!((b=S[x])>=P);x++)D.push(b);for(x=P;x<z;x++)D.push(x)}for(x=0;x<D.length;x++)d(t,D[x])}else p(t);return!0}}}),zn=p({"src/plot_api/helpers.js"(t){var e=A(),r=(bt(),qt()),n=le(),i=Ae(),a=xe(),o=H(),s=a.cleanId,l=a.getFromTrace,c=r.traceIs;function u(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,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(e));for(r=0;r<l.length;r++){var c=l[r];if(a&&a.test(c)){var h=e[c];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)&&(u(p,"xref"),u(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)&&(u(g,"xref"),u(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)&&(u(v,"xref"),u(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,u=e[a];if("histogramy"===u.type&&"xbins"in u&&!("ybins"in u)&&(u.ybins=u.xbins,delete u.xbins),"histogramy"===u.type&&t.swapXYData(u),("histogramx"===u.type||"histogramy"===u.type)&&(u.type="histogram"),"scl"in u&&!("colorscale"in u)&&(u.colorscale=u.scl,delete u.scl),"reversescl"in u&&!("reversescale"in u)&&(u.reversescale=u.reversescl,delete u.reversescl),u.xaxis&&(u.xaxis=s(u.xaxis,"x")),u.yaxis&&(u.yaxis=s(u.yaxis,"y")),c(u,"gl3d")&&u.scene&&(u.scene=i.subplotsRegistry.gl3d.cleanId(u.scene)),!c(u,"pie-like")&&!c(u,"bar-like"))if(Array.isArray(u.textposition))for(l=0;l<u.textposition.length;l++)u.textposition[l]=p(u.textposition[l]);else u.textposition&&(u.textposition=p(u.textposition));var m=r.getModule(u);if(m&&m.colorbar){var g=m.colorbar.container,y=g?u[g]:u;y&&y.colorscale&&("YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd"))}if("surface"===u.type&&n.isPlainObject(u.contours)){var v=["x","y","z"];for(l=0;l<v.length;l++){var x=u.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"===u.type||"ohlc"===u.type){var _=!1!==(u.increasing||{}).showlegend,b=!1!==(u.decreasing||{}).showlegend,w=h(u.increasing),T=h(u.decreasing);if(!1!==w&&!1!==T){var A=f(w,T,_,b);A&&(u.name=A)}else(w||T)&&!u.name&&(u.name=w||T)}d(u,"line")&&delete u.line,"marker"in u&&(d(u.marker,"line")&&delete u.marker.line,d(u,"marker")&&delete u.marker),o.clean(u),u.autobinx&&(delete u.autobinx,delete u.xbins),u.autobiny&&(delete u.autobiny,delete u.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],c=e(l);if(c&&null===r){var u=o.slice(0,s-1).join(".");n.nestedProperty(a,u).get().splice(l,1)}else c&&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 c=s._name,u=s._id.substr(1);if("scene"===u.substr(0,5)){if(void 0!==r[u])continue;c=u+"."+c}var h=c+".type";void 0===r[c]&&void 0===r[h]&&n.nestedProperty(t.layout,h).set(null)}}}}}),Dn=p({"src/plot_api/plot_api.js"(t){var e=x(),r=A(),n=he(),i=le(),a=i.nestedProperty,o=pe(),s=de(),l=qt(),c=ge(),u=Ae(),h=ir(),f=or(),p=Ie(),d=Qe(),m=H(),g=In().initInteractions,y=ke(),v=En().clearOutline,_=Y().dfltConfig,b=Pn(),w=zn(),T=nn(),k=Pt(),M=ve().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,c=t._context;if(r){for(s=Object.keys(r),o=0;o<s.length;o++)"editable"!==(l=s[o])&&"edits"!==l&&l in c&&("setBackground"===l&&"opaque"===r[l]?c[l]=I:c[l]=r[l]);var u=r.editable;if(void 0!==u)for(c.editable=u,s=Object.keys(c.edits),o=0;o<s.length;o++)c.edits[s[o]]=u;if(r.edits)for(s=Object.keys(r.edits),o=0;o<s.length;o++)(l=s[o])in c.edits&&(c.edits[l]=r.edits[l]);c._exportedPlot=r._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"===c.displayModeBar&&!n&&(c.displayModeBar=!0),("transparent"===c.setBackground||"function"!=typeof c.setBackground)&&(c.setBackground=C),c._hasZeroHeight=c._hasZeroHeight||0===t.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===t.clientWidth;var h=c.scrollZoom,f=c._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 D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(typeof e>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),typeof r<"u"&&!Array.isArray(r)&&(r=[r]),typeof r<"u"&&z(t,r,"newIndices"),typeof r<"u"&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(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(typeof r>"u")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 corrispondence 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,c,u,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=(c=a(s,d)).get(),u=e[d][m],!i.isArrayOrTypedArray(u))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!==u.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:c,target:l,insert:u,maxp:Math.floor(h)})}return p}(t,e,n,o),c={},u={},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(c[f.astr])||(c[f.astr]=[]),c[f.astr].push(d[1]),Array.isArray(u[f.astr])||(u[f.astr]=[]),u[f.astr].push(l[h].target.length)}return{update:c,maxPoints:u}}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),c=U(e,o,l),h=c.flags;h.calc&&(e.calcdata=void 0),h.clearAxisTypes&&w.clearAxisTypes(e,l,{});var f=[];h.fullReplot?f.push(t._doPlot):(f.push(u.previousPromises),u.supplyDefaults(e),h.markerSize&&(u.doCalcdata(e),G(f)),h.style&&f.push(T.doTraceStyle),h.colorbars&&f.push(T.doColorBars),f.push(E)),f.push(u.rehover,u.redrag,u.reselect),s.add(e,F,[e,c.undoit,c.traces],F,[e,c.redoit,c.traces]);var p=i.syncOrAsync(f,e);return(!p||!p.then)&&(p=Promise.resolve()),p.then((function(){return e.emit("plotly_restyle",c.eventData),e}))}function B(t){return void 0===t?null:t}function j(t,e){return e?function(e,r,n){var i=a(e,r),o=i.set;return i.set=function(e){N((n||"")+r,i.get(),e,t),o(e)},i}:a}function N(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++)N(t+"["+l+"]",a[l],o[l],n);else if(i.isPlainObject(e)||i.isPlainObject(r)){var c=i.isPlainObject(e)?e:{},u=i.isPlainObject(r)?r:{},h=i.extendFlat({},c,u);for(var f in h)N(t+"."+f,c[f],u[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=j(s._preGUI,d),g=i.extendDeepAll({},e),y=k.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 A(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=j(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,D,O,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]),D=(z=j(s._tracePreGUI[P._fullInput.uid],d)(L,I)).get(),void 0!==(O=Array.isArray(F)?F[n%F.length]:F)){var N=z.parts[z.parts.length-1],U=I.substr(0,I.length-N.length-1),V=U?U+".":"",q=U?a(P,U).get():P;if((R=c.getTraceValObject(P,z.parts))&&R.impliedEdits&&null!==O)for(var H in R.impliedEdits)S(i.relativeAttr(I,H),R.impliedEdits[H],n);else if("thicknessmode"!==N&&"lenmode"!==N||D===O||"fraction"!==O&&"pixels"!==O||!q){if("type"===I&&("pie"===O!=("pie"===D)||"funnelarea"===O!=("funnelarea"===D))){var G="x",W="y";("bar"===O||"bar"===D)&&"h"===L.orientation&&(G="y",W="x"),i.swapAttrs(L,["?","?src"],"labels",G),i.swapAttrs(L,["d?","?0"],"label",G),i.swapAttrs(L,["?","?src"],"values",W),"pie"===D||"funnelarea"===D?(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 Z=s._size,Y=q.orient,X="top"===Y||"bottom"===Y;if("thicknessmode"===N){var $=X?Z.h:Z.w;S(V+"thickness",q.thickness*("fraction"===O?1/$:$),n)}else{var K=X?Z.w:Z.h;S(V+"len",q.len*("fraction"===O?1/K:K),n)}}if(x[I][n]=B(D),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(I)){if("orientation"===I){z.set(O);var J=L.x&&!L.y?"h":"v";if((z.get()||J)===P.orientation)continue}else"orientationaxes"===I&&(L.orientation={v:"h",h:"v"}[P.orientation]);w.swapXYData(L),y.calc=y.clearAxisTypes=!0}else-1!==u.dataArrayContainers.indexOf(z.parts[0])?(w.manageArrayContainers(z,O,x),y.calc=!0):(R?R.arrayOk&&!l.traceIs(P,"regl")&&(i.isArrayOrTypedArray(O)||i.isArrayOrTypedArray(D))?y.calc=!0:k.update(y,R):y.calc=!0,z.set(O))}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(A),[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=[u.previousPromises];o.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(q(t,o,a)||u.supplyDefaults(t),o.legend&&l.push(T.doLegend),o.layoutstyle&&l.push(T.layoutStyles),o.axrange&&G(l,a.rangesAltered),o.ticks&&l.push(T.doTicksRelayout),o.modebar&&l.push(T.doModeBar),o.camera&&l.push(T.doCamera),o.colorbars&&l.push(T.doColorBars),l.push(E)),l.push(u.rehover,u.redrag,u.reselect),s.add(t,V,[t,a.undoit],V,[t,a.redoit]);var c=i.syncOrAsync(l,t);return(!c||!c.then)&&(c=Promise.resolve(t)),c.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function q(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)},c={};for(var u in r.rangesAltered){var d=h.id2name(u);if(o=t.layout[d],s=n[d],f(o,s,l,c),s._matchGroup)for(var m in s._matchGroup)if(m!==u){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(v,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var W=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Z=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function $(t,e){var r,n,o,s=t.layout,u=t._fullLayout,f=u._guiEditing,p=j(u._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=k.layoutFlags(),A={},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),D=e[P],O=z.parts.length-1;O>0&&"string"!=typeof z.parts[O];)O--;var R=z.parts[O],F=z.parts[O-1]+"."+R,N=z.parts.slice(0,O).join("."),U=a(t.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==D){A[P]=D,S[P]="reverse"===R?D:B(q);var H=c.getLayoutValObject(u,z.parts);if(H&&H.impliedEdits&&null!==D)for(var G in H.impliedEdits)E(i.relativeAttr(P,G),H.impliedEdits[G]);if(-1!==["width","height"].indexOf(P))if(D){E("autosize",null);var Y="height"===P?"width":"height";E(Y,u[Y])}else u[P]=t._initialAutoSize[P];else if("autosize"===P)E("width",D?null:u.width),E("height",D?null:u.height);else if(F.match(W))L(F),a(u,N+"._inputRange").set(null);else if(F.match(Z)){L(F),a(u,N+"._inputRange").set(null);var $=a(u,N).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&a(u,N+"._inputDomain").set(null);if("type"===R){C=U;var J="linear"===V.type&&"log"===D,Q="log"===V.type&&"linear"===D;if(J||Q){if(C&&C.range)if(V.autorange)J&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var tt=C.range[0],et=C.range[1];J?(tt<=0&&et<=0&&E(N+".autorange",!0),tt<=0?tt=et/1e6:et<=0&&(et=tt/1e6),E(N+".range[0]",Math.log(tt)/Math.LN10),E(N+".range[1]",Math.log(et)/Math.LN10)):(E(N+".range[0]",Math.pow(10,tt)),E(N+".range[1]",Math.pow(10,et)))}else E(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(t,V,D,E),l.getComponentMethod("images","convertCoords")(t,V,D,E)}else E(N+".autorange",!0),E(N+".range",null);a(u,N+"._inputRange").set(null)}else if(R.match(M)){var rt=a(u,P).get(),nt=(D||{}).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(D)?S[P]=null:b.isRemoveVal(D)?S[P]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",e)),k.update(T,ot),y[r]||(y[r]={});var st=y[r][n];st||(st=y[r][n]={}),st[at]=D,delete e[P]}else"reverse"===R?(U.range?U.range.reverse():(E(N+".autorange",!0),U.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===D&&!1!==q||!1!==D&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===P&&("lasso"===D||"select"===D)&&"lasso"!==q&&"select"!==q?T.plot=!0:H?k.update(T,H):T.calc=!0,z.set(D))}}for(r in y)b.applyContainerArrayChanges(t,p(s,r),y[r],T,p)||(T.plot=!0);for(var lt in I){var ct=(C=h.getFromId(t,lt))&&C._constraintGroup;if(ct)for(var ut in T.calc=!0,ct)I[ut]||(h.getFromId(t,ut)._constraintShrinkable=!0)}(K(t)||e.height||e.width)&&(T.plot=!0);var ht=u.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:A,eventData:g}}function K(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&u.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function J(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),c=l.flags,h=$(e,i.extendFlat({},n)),f=h.flags;(c.calc||f.calc)&&(e.calcdata=void 0),c.clearAxisTypes&&w.clearAxisTypes(e,o,n);var p=[];f.layoutReplot?p.push(T.layoutReplot):c.fullReplot?p.push(t._doPlot):(p.push(u.previousPromises),q(e,f,h)||u.supplyDefaults(e),c.style&&p.push(T.doTraceStyle),(c.colorbars||f.colorbars)&&p.push(T.doColorBars),f.legend&&p.push(T.doLegend),f.layoutstyle&&p.push(T.layoutStyles),f.axrange&&G(p,h.rangesAltered),f.ticks&&p.push(T.doTicksRelayout),f.modebar&&p.push(T.doModeBar),f.camera&&p.push(T.doCamera),p.push(E)),p.push(u.rehover,u.redrag,u.reselect),s.add(e,J,[e,l.undoit,h.undoit,l.traces],J,[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,c=n.flags,u=n.immutable,h=n.inArray,f=n.arrayIndex;function p(){var t=a.editType;h&&-1!==t.indexOf("arraydraw")?i.pushUnique(c.arrays[h],f):(k.update(c,a),"none"!==t&&c.nChanges++,n.transition&&a.anim&&c.nChangesAnim++,(W.test(s)||Z.test(s))&&(c.rangesAltered[r[0]]=1),"datarevision"===o&&(c.newDataRevision=1))}function d(t){return"data_array"===t.valType||t.arrayOk}for(o in t){if(c.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 A="_input_"+o,M=t[A],S=e[A];if(Array.isArray(M)&&M===S)continue}if(void 0===g)b&&w?c.calc=!0:p();else if(a._isLinkedToArray){var E=[],C=!1;h||(c.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?(u&&(c.calc=!0),(u||n.newDataRevision)&&p()):w!==T?c.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(c.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 ct(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=u.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 c(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?u.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=c(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,u.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,c=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=c.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:u.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=c.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<c.length&&(c[o]||{}).name!==a.name;o++);x.push({type:"replace",index:o,value:a}),_.unshift({type:"replace",index:o,value:c[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=u.modifyFrames,T=u.modifyFrames,A=[t,_],k=[t,x];return s&&s.add(t,w,A,T,k),u.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 c=u.modifyFrames,h=u.modifyFrames,f=[t,l],p=[t,o];return s&&s.add(t,c,f,h,p),u.modifyFrames(t,o)},t.addTraces=function e(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=t.deleteTraces,h=e,f=[r,c],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(typeof e>"u")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(typeof r<"u"&&!Array.isArray(r)&&(r=[r]),typeof r<"u"&&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++)c.push(-n.length+o);if(typeof a>"u")return l=t.redraw(r),s.add(r,u,f,h,p),l;Array.isArray(a)||(a=[a]);try{D(r,c,a)}catch(t){throw r.data.splice(r.data.length-n.length,n.length),t}return s.startSequence(r),s.add(r,u,f,h,p),l=t.moveTraces(r,c,a),s.stopSequence(r),l},t.deleteTraces=function e(r,n){r=i.getGraphDiv(r);var a,o,l=[],c=t.addTraces,u=e,h=[r,l,n],f=[r,n];if(typeof n>"u")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,c,h,u,f),p},t.extendTraces=function e(r,n,a,o){var l=O(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 c=r-e.length,u=t.length-c;n.set(t.subarray(u)),n.set(e,c),a.set(t.subarray(0,u))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]})),c=t.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,t.prependTraces,u,e,arguments),c},t.moveTraces=function e(r,n,a){var o,l=[],c=[],u=e,h=e,f=[r=i.getGraphDiv(r),a,n],p=[r,n,a];if(D(r,n,a),n=Array.isArray(n)?n:[n],typeof a>"u")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++)c.push({newIndex:a[o],trace:r.data[n[o]]});for(c.sort((function(t,e){return t.newIndex-e.newIndex})),o=0;o<c.length;o+=1)l.splice(c[o].newIndex,0,c[o].trace);r.data=l;var d=t.redraw(r);return s.add(r,u,f,h,p),d},t.prependTraces=function e(r,n,a,o){var l=O(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 c=r-e.length;n.set(e),n.set(t.subarray(0,c),e.length),a.set(t.subarray(c))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]})),c=t.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,t.extendTraces,u,e,arguments),c},t.newPlot=function(e,r,n,a){return e=i.getGraphDiv(e),u.cleanPlot([],{},e._fullData||[],e._fullLayout||{}),u.purge(e),t._doPlot(e,r,n,a)},t._doPlot=function(r,n,a,s){var c;if(r=i.getGraphDiv(r),o.init(r),i.isPlainObject(n)){var f=n;n=f.data,a=f.layout,s=f.config,c=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)),u.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=ct,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&&u.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)||u.resize(r)},window.addEventListener("resize",r._responsiveChartHandler)):i.clearResponsive(r);var b=i.extendFlat({},m._size),A=0;function k(){if(u.clearAutoMarginIds(r),T.drawMarginPushers(r),h.allowAutoMargin(r),r._fullLayout.title.text&&r._fullLayout.title.automargin&&u.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&&u.allowAutoMargin(r,"pie."+n.uid+".automargin")}return u.doAutoMargin(r),u.previousPromises(r)}function M(){r._transitioning||(T.doAutoRangeAndConstraints(r),p&&h.saveRangeInitial(r),l.getComponentMethod("rangeslider","calcAutorange")(r))}var S=[u.previousPromises,function(){if(c)return t.addFrames(r,c)},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(!A)return i.log(s+" Clearing graph and plotting again."),u.cleanPlot([],{},r._fullData,m),u.supplyDefaults(r),m=r._fullLayout,u.doCalcdata(r),A++,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"),u.previousPromises(r)},k,function(){if(u.didMarginChange(b,m._size))return i.syncOrAsync([k,T.layoutStyles],r)}];v&&S.push((function(){if(x)return i.syncOrAsync([l.getComponentMethod("shapes","calcAutorange"),l.getComponentMethod("annotations","calcAutorange"),M],r);M()})),S.push(T.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(T.drawData,T.finalDraw,g,u.addLinks,u.rehover,u.redrag,u.reselect,u.doAutoMargin,u.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 u.cleanPlot([],{},r,e),u.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)}e.data=r||[],w.cleanData(e.data),e.layout=n||{},w.cleanLayout(e.layout),function(t,e,r,n){var o,s,l,c,u,h,f,p,d,m,g=n._preGUI,y=[],v={},x={};for(o in g){if(u=rt(o,tt)){if(d=u.head,m=u.tail,s=u.attr||d+".uirevision",(c=(l=a(n,s).get())&&nt(s,e))&&c===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],u&&"range["===u.tail.substr(0,6)&&(x[u.head]=1)}for(var A=0;A<y.length;A++){var k=y[A];if(x[k]){var M=a(e,k).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(u=rt(o,et)){if(u.attr?c=(l=a(n,u.attr).get())&&nt(u.attr,e):(l=C.uirevision,void 0===(c=L.uirevision)&&(c=e.uirevision)),c&&c===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),u.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=k.layoutFlags();for(var o in a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0,r)if((o.startsWith("xaxis")||o.startsWith("yaxis"))&&e[o]){var s=r[o].domain,l=e[o].domain,u=e[o]._inputDomain;e[o]._inputDomain&&(s[0]===u[0]&&s[1]===u[1]?r[o].domain=e[o].domain:(s[0]!==l[0]||s[1]!==l[1])&&(r[o]._inputDomain=null))}var h={getValObject:function(t){return c.getLayoutValObject(r,t)},flags:a,immutable:n,transition:i,gd:t};return st(e,r,[],h),(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,_),A=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,u=k.traceFlags();u.arrays={},u.nChanges=0,u.nChangesAnim=0;var h={getValObject:function(t){var e=c.getTraceValObject(l,t);return!l._module.animatable&&e.anim&&(e.anim=!1),e},flags:u,immutable:n,transition:i,newDataRevision:a,gd:t},f={};for(s=0;s<e.length;s++)if(r[s]){if(f[(l=r[s]._fullInput).uid])continue;f[l.uid]=1,st(e[s]._fullInput,l,[],h)}return(u.calc||u.plot)&&(u.fullReplot=!0),i&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some"),u}(e,f,y,x,_,A);if(K(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 u.supplyDefaultsUpdateCalc(e.calcdata,y);var D=[];if(s&&(e._transitionData={},u.createTransitionData(e),D.push((function(){return t.addFrames(e,s)}))),v.transition&&!m&&(M.anim||b.anim))b.ticks&&D.push(T.doTicksRelayout),u.doCalcdata(e),T.doAutoRangeAndConstraints(e),D.push((function(){return u.transitionFromReact(e,M,b,p)}));else if(M.fullReplot||b.layoutReplot||m)e._fullLayout._skipDefaults=!0,D.push(t._doPlot);else{for(var O in b.arrays){var R=b.arrays[O];if(R.length){var F=l.getComponentMethod(O,"drawOne");if(F!==i.noop)for(var j=0;j<R.length;j++)F(e,R[j]);else{var N=l.getComponentMethod(O,"draw");if(N===i.noop)throw new Error("cannot draw components: "+O);N(e)}}}D.push(u.previousPromises),M.style&&D.push(T.doTraceStyle),(M.colorbars||b.colorbars)&&D.push(T.doColorBars),b.legend&&D.push(T.doLegend),b.layoutstyle&&D.push(T.layoutStyles),b.axrange&&G(D),b.ticks&&D.push(T.doTicksRelayout),b.modebar&&D.push(T.doModeBar),b.camera&&D.push(T.doCamera),D.push(E)}D.push(u.rehover,u.redrag,u.reselect),(!(h=i.syncOrAsync(D,e))||!h.then)&&(h=Promise.resolve(e))}else h=t.newPlot(e,r,n,o);return h.then((function(){return e.emit("plotly_react",{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=J,t._guiRelayout=Q(V),t._guiRestyle=Q(F),t._guiUpdate=Q(J),t._storeDirectGUIEdit=function(t,e,r){for(var n in r)N(n,a(t,n).get(),r[n],e)}}}),On=p({"src/snapshot/helpers.js"(t){var e=qt();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,/}}),Rn=p({"src/snapshot/tosvg.js"(t,e){var r=x(),n=(le(),Qe()),i=H(),a=(ke(),/"/g),o="TOBESTRIPPED",s=new RegExp('("'+o+")|("+o+'")',"g");e.exports=function(t,e,l){var c,u=t._fullLayout,h=u._paper,f=u._toppaper,p=u.width,d=u.height;h.insert("rect",":first-child").call(n.setRect,0,0,p,d).call(i.fill,u.paper_bgcolor);var m=u._basePlotModules||[];for(c=0;c<m.length;c++){var g=m[c];g.toSVG&&g.toSVG(t)}if(f){var y=f.node().childNodes,v=Array.prototype.slice.call(y);for(c=0;c<v.length;c++){var x=v[c];x.childNodes.length&&h.node().appendChild(x)}}u._draggers&&u._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,"'")}}}),Fn=p({"src/snapshot/svgtoimg.js"(t,e){var r=le(),n=fe().EventEmitter,i=On();e.exports=function(t){var e=t.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=t.svg,u=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"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){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}}}),Bn=p({"src/plot_api/to_image.js"(t,e){var r=A(),n=Dn(),i=Ae(),a=le(),o=On(),s=Rn(),l=Fn(),c=y().version,u={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],u[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(u.format.values,", "," or ")+".");var g={};function y(t,r){return a.coerce(e,g,u,t,r)}var v=y("format"),x=y("width"),_=y("height"),b=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),A=document.createElement("div");A.style.position="absolute",A.style.left="-5000px",document.body.appendChild(A);var k=a.extendFlat({},f);x?k.width=x:null===e.width&&r(d.width)&&(k.width=d.width),_?k.height=_:null===e.height&&r(d.height)&&(k.height=d.height);var M=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(A);function E(){return new Promise((function(t){setTimeout(t,o.getDelay(A._fullLayout))}))}function C(){return new Promise((function(t,e){var r=s(A,v,b),u=A._fullLayout.width,h=A._fullLayout.height;function f(){n.purge(A),document.body.removeChild(A)}if("full-json"===v){var p=i.graphJson(A,!1,"keepdata","object",!0,!0);return p.version=c,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:u,height:h,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){n.newPlot(A,h,k,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)}))}))}}}),jn=p({"src/plot_api/validate.js"(t,e){var r=le(),n=Ae(),i=ge(),a=Y().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(t,e,n,i,a,u){u=u||[];for(var h=Object.keys(t),m=0;m<h.length;m++){var g=h[m],y=u.slice();y.push(g);var v=t[g],x=e[g],_=d(n,g),b=(_||{}).valType,w="info_array"===b,T="colorscale"===b,A=(_||{}).items;if(p(n,g))if(o(v)&&o(x)&&"any"!==b)c(v,x,_,i,a,y);else if(w&&s(v)){v.length>x.length&&i.push(f("unused",a,y.concat(x.length)));var k,M,S,E,C,I=x.length,L=Array.isArray(A);if(L&&(I=Math.min(I,A.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(k=0;k<(L?Math.min(P,A[M].length):P);k++)S=L?A[M][k]:A,E=v[M][k],C=x[M][k],r.validate(E,S)?C!==E&&C!==+E&&i.push(f("dynamic",a,y.concat(M,k),E,C)):i.push(f("value",a,y.concat(M,k),E))}else i.push(f("array",a,y.concat(M),v[M]));else for(M=0;M<I;M++)S=L?A[M]:A,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,D,O=A[Object.keys(A)[0]],R=[];for(z=0;z<x.length;z++){var F=x[z]._index||z;if((D=y.slice()).push(F),o(v[F])&&o(x[z])){R.push(F);var B=v[F],j=x[z];o(B)&&!1!==B.visible&&!1===j.visible?i.push(f("invisible",a,D)):c(B,j,O,i,a,D)}}for(z=0;z<v.length;z++)(D=y.slice()).push(z),o(v[z])?-1===R.indexOf(z)&&i.push(f("unused",a,D)):i.push(f("object",a,D,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,u,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),u=e):(d.layout={},u={},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)),c(v,_,w,p,x)}else p.push(f("object",x))}var T=d._fullLayout,A=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 c(u,T,A,p,"layout"),0===p.length?void 0:p};var u={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 c=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=u[t](e,c,i,a);return r.log(h),{code:t,container:o,trace:l,path:n,astr:c,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]}}}}),Nn=p({"src/snapshot/filesaver.js"(t,e){var r=le(),n=On();e.exports=function(t,e,i){var a=document.createElement("a"),o="download"in a;return new Promise((function(s,l){var c,u;if(o)return c=n.createBlob(t,i),u=n.createObjectURL(c),a.href=u,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),n.revokeObjectURL(u),c=null,s(e);if(r.isSafari()){var h="svg"===i?",":";base64,";return n.octetStream(h+encodeURIComponent(t)),s(e)}l(new Error("download error"))}))}}}),Un=p({"src/snapshot/download.js"(t,e){var r=le(),n=Bn(),i=Nn();On(),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)}))}))}}}),Vn=p({"src/plot_api/template_api.js"(t){var e=le(),r=e.isPlainObject,n=ge(),i=Ae(),a=U(),o=ye(),s=Y().dfltConfig;function l(t,n){t=e.extendDeep({},t);var i,a,s=Object.keys(t).sort();function u(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 c=n[a],u=s.newItem(c)._template;u&&l(u,c)}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?u(f,n[h],h):n[h]=f,c(h)===h)for(var p in n){var d=c(p);p!==d&&d===h&&!(p in t)&&u(f,n[p],h)}}}function c(t){return t.replace(/[0-9]+$/,"")}function u(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=c(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))u(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]||(u(w,n,i,p(f,x,d),p(f,x,m)),x++,_[T]=1);else if(!v){var A=p(t,o.arrayDefaultKey(h),a),k=p(f,x,d);u(w,n,i,k,p(f,x,m));var M=e.nestedProperty(n,k);e.nestedProperty(n,A).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 c={data:{},layout:{}};n.forEach((function(t){var r={};u(t,r,f.bind(null,t));var n=e.coerce(t,{},a,"type"),i=c.data[n];i||(i=c.data[n]=[]),i.push(r)})),u(o,c.layout,h.bind(null,o)),delete c.layout.template;var p=o.template;if(r(p)){var d,m,g,y,v,x,_=p.layout;r(_)&&l(_,c.layout);var b=p.data;if(r(b)){for(m in c.data)if(g=b[m],Array.isArray(g)){for(x=(v=c.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 c.data||(c.data[m]=e.extendDeep([],b[m]))}}return c},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,u=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=c(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(u)){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 u){var w=u[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)}}}),qn=p({"src/plot_api/index.js"(t){var e=Dn();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=It().getGraphDiv,n=Zr().eraseActiveShape;t.deleteActiveShape=function(t){return n(r(t))},t.toImage=Bn(),t.validate=jn(),t.downloadImage=Un();var i=Vn();t.makeTemplate=i.makeTemplate,t.validateTemplate=i.validateTemplate}}),Hn=p({"src/traces/scatter/xy_defaults.js"(t,e){var r=le(),n=qt();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 c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}}}),Gn=p({"src/traces/scatter/period_defaults.js"(t,e){var r=le().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"))}}}}),Wn=p({"src/traces/scatter/stack_defaults.js"(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 c=l[o],u=!1;c?c.traces.push(e):(c=l[o]={traceIndices:[],traces:[e]},u=!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(!c[d]){var m=void 0!==t[p],g="orientation"===p;if((m||u)&&(c[p]=i(p,h[p]),g&&(c.fillDflt="h"===c[p]?"tonextx":"tonexty"),m&&(c[d]=!0,!u&&(delete c.traces[0][p],g))))for(var y=0;y<c.traces.length-1;y++){var v=c.traces[y];v._input.fill!==v.fill&&(v.fill=c.fillDflt)}}}return c}}}}),Zn=p({"src/traces/scatter/marker_defaults.js"(t,e){var r=H(),n=Ee().hasColorscale,i=qe(),a=Ye();e.exports=function(t,e,o,s,l,c){var u=a.isBubble(t),h=(t.line||{}).color;c=c||{},h&&(o=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",o),n(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?r.background:r.defaultLine),n(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}}),Yn=p({"src/traces/scatter/line_defaults.js"(t,e){var r=le().isArrayOrTypedArray,n=Ee().hasColorscale,i=qe();e.exports=function(t,e,a,o,s,l){l||(l={});var c=(t.marker||{}).color;c&&c._inputArray&&(c=c._inputArray),s("line.color",a),n(t,"line")?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!r(c)&&c||a),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}}}),Xn=p({"src/traces/scatter/line_shape_defaults.js"(t,e){e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}}}),$n=p({"src/traces/scatter/text_defaults.js"(t,e){var r=le();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"))}}}),Kn=p({"src/traces/scatter/fillcolor_defaults.js"(t,e){var r=H(),n=le().isArrayOrTypedArray;e.exports=function(t,e,i,a,o){o||(o={});var s,l=!1;if(e.marker){var c=e.marker.color,u=(e.marker.line||{}).color;c&&!n(c)?l=c:u&&!n(u)&&(l=u)}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))}}}),Jn=p({"src/traces/scatter/defaults.js"(t,e){var r=le(),n=qt(),i=Tn(),a=bn(),o=Ye(),s=Hn(),l=Gn(),c=Wn(),u=Zn(),h=Yn(),f=Xn(),p=$n(),d=Kn(),m=le().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 _=c(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)&&u(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,A=(e.marker||{}).color;("tonext"===e.fill||"toself"===e.fill)&&w.push("fills"),v("hoveron",w.join("+")||"points"),"fills"!==e.hoveron&&v("hovertemplate");var k=n.getComponentMethod("errorbars","supplyDefaults");k(t,e,T||A||g,{axis:"y"}),k(t,e,T||A||g,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(e,v)}}}}),Qn=p({"src/traces/scatter/grouping_defaults.js"(t,e){var r=rn().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,c=n._alignmentOpts||{},u=i("alignmentgroup"),h=c[l];h||(h=c[l]={});var f=h[u];f?f.traces.push(e):f=h[u]={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)}}}),ti=p({"src/traces/scatter/cross_trace_defaults.js"(t,e){var r=le(),n=Qn(),i=Tn();e.exports=function(t,e){var a,o,s,l=e.scattermode;function c(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,c,l));for(s=0;s<t.length;s++){var u=t[s];if("scatter"===u.type){var h=u.fill;if("none"!==h&&"toself"!==h&&(u.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===u.xaxis&&p.yaxis===u.yaxis){p.opacity=void 0;break}}}}}}}),ei=p({"src/traces/scatter/layout_defaults.js"(t,e){var r=le(),n=be();e.exports=function(t,e){var i,a="group"===e.barmode;"group"===e.scattermode&&(i=a?e.bargap:.2,r.coerce(t,e,n,"scattergap",i))}}}),ri=p({"src/plots/cartesian/align_period.js"(t,e){var r=A(),n=le(),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 c,u=t[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"==typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=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,A,k=s[b];if(c){for(w=Math.round((k-g)/(c*o)),A=a(g,c*w,f);A>k;)A=a(A,-c,f);for(;A<=k;)A=a(A,c,f);T=a(A,-c,f)}else{for(A=g+(w=Math.round((k-g)/u))*u;A>k;)A-=u;for(;A<=k;)A+=u;T=A-u}y[b]=p?T:d?A:(T+A)/2,v[b]=T,x[b]=A}return{vals:y,starts:v,ends:x}}}}),ni=p({"src/traces/scatter/colorscale_calc.js"(t,e){var r=Ee().hasColorscale,n=We(),i=Ye();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"}))}}}),ii=p({"src/traces/scatter/arrays_to_calcdata.js"(t,e){var r=le();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"))}}}}),ai=p({"src/traces/scatter/calc_selection.js"(t,e){var r=le();e.exports=function(t,e){r.isArrayOrTypedArray(e.selectedpoints)&&r.tagSelected(t,e)}}}),oi=p({"src/traces/scatter/calc.js"(t,e){var r=A(),n=le(),i=ir(),a=ri(),o=k().BADNUM,s=Ye(),l=ni(),c=ii(),u=ai();function h(t,e,r,n,a,o,l){var c=e._length,u=t._fullLayout,h=r._id,f=n._id,p=u._firstScatter[d(e)]===e.uid,g=(m(e,u,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 _=c<2||a[0]!==a[c-1]||o[0]!==o[c-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 c=l.makeCalcdata(t.marker,"size"),u=new Array(e),h=0;h<e;h++)u[h]=r(c[h]);return u}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"),A=w.makeCalcdata(e,"y"),k=a(e,b,"x",T),M=a(e,w,"y",A),S=k.vals,E=M.vals,C=e._length,I=new Array(C),L=e.ids,P=m(e,_,b,w),z=!1;p(_,e);var D,O="x",R="y";P?(n.pushUnique(P.traceIndices,e.index),(s="v"===P.orientation)?(R="s",D="x"):(O="s",D="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 j=I[d]={},N=r(S[d]),U=r(E[d]);N&&U?(j[O]=S[d],j[R]=E[d],F&&(j.orig_x=T[d],j.xEnd=k.ends[d],j.xStart=k.starts[d]),B&&(j.orig_y=A[d],j.yEnd=M.ends[d],j.yStart=M.starts[d])):P&&(s?N:U)?(j[D]=s?S[d]:E[d],j.gap=!0,v?(j.s=o,z=!0):j.s=0):j[O]=j[R]=o,L&&(j.id=String(L[d]))}if(c(I,e),l(t,e),u(I,e),P){for(d=0;d<I.length;)I[d][D]===o?I.splice(d,1):d++;if(n.sort(I,(function(t,e){return t[D]-e[D]||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][D],q=I[d-1].s,H=(I[g].s-q)/(I[g][D]-V);d<g;)I[d].s=q+(I[d][D]-V)*H,d++}}}return I},calcMarkerSize:f,calcAxisExpansion:h,setFirstScatter:p,getStackOpts:m}}}),si=p({"src/traces/bar/sieve.js"(t,e){e.exports=n;var r=le().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 c=s[l],u=c.p;void 0===u&&(u=c[i]),void 0!==u&&a.push(u)}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}}}),li=p({"src/traces/bar/cross_trace_calc.js"(t,e){var r=A(),n=le().isArrayOrTypedArray,i=k().BADNUM,a=qt(),o=ir(),s=rn().getAxisGroup,l=si();function c(t,e,a,s,c){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,c="funnel"===l.type?l._base:l.base,u="h"===l.orientation?l.xcalendar:l.ycalendar,h="category"===t.type||"multicategory"===t.type?function(){return null}:t.d2c;if(n(c)){for(a=0;a<Math.min(c.length,s.length);a++)o=h(c[a],0,u),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(c,0,u);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),c.mode){case"overlay":u(t,e,a,s,c);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 c=new l([a],{posAxis:e,sepNegVal:!0,overlapNoMerge:!0}),u=0;u<a.length;u++){var h=a[u];if(h.p!==i){var f=c.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,c),f.length&&u(t,e,a,f,c);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,c,u,h,f=g(t),p=e.traces;for(l=0;l<p.length;l++)if("funnel"===(a=(n=p[l])[0].trace).type)for(h=n[0].t.offsetindex,c=0;c<n.length;c++)(u=n[c]).s!==i&&e.put(u.p,h,-.5*u.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(c=0;c<n.length;c++)if((u=n[c]).s!==i){var m;m=s?u.s:u.s+u.b;var y=e.put(u.p,h,m),v=y+m;u.b=y,u[f]=v,r.norm||(d.push(v),u.hasB&&d.push(y))}r.norm||(a._extremes[t._id]=o.findExtremes(t,d,{tozero:!0,padded:!0}))}}(r,s,a);for(var c=0;c<n.length;c++)for(var u=n[c],f=u[0].t.offsetindex,p=0;p<u.length;p++){var d=u[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,c),f.length&&u(t,e,a,f,c)}(function(t){var e,n,i,a,o,s,l;for(e=0;e<t.length;e++)i=(n=t[e])[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={},c=1/0,u=-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)&&(c=Math.min(c,h),u=Math.max(u,h))}var f=1e4/(u-c),p=l.round=function(t){return String(Math.round(f*(t-c)))},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 A=Math.min(_.s0,_.s1)||0,k=Math.max(_.s0,_.s1)||0,M=_[s];d[M]=M in d?Math.min(d[M],A):A,m[M]=M in m?Math.max(m[M],k):k}}}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],c=l[i];l._sMin=e[c],l._sMax=r[c]}}(t,d,m,e)}(s,e)}}function u(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,c,u,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)c=-(l=(o=_)*(1-(a.groupgap||0)))/2;else{var b=s(h,e._id)+y[0][0].trace.orientation;u=h._alignmentOpts[b]||{}}for(var w=0;w<v;w++){var T=y[w],A=T[0].trace;if("angularaxis"!==e._id){var k=u[A.alignmentgroup]||{},M=Object.keys(k.offsetGroups||{}).length;l=(o=M?_/M:x?_/v:_)*(1-(a.groupgap||0)),c=M?((2*A._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=A._offsetIndex||0,S.poffset=c,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],c=l.trace,u=l.t,h=c._offset||c.offset,f=u.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);u.poffset=o}else void 0!==h&&(u.poffset=h);var p=c._width||c.width,d=u.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(u.barwidth=m,void 0===h){for(o=[],i=0;i<s.length;i++)o.push(f+(d-m[i])/2);u.poffset=o}}else void 0!==p&&(u.barwidth=p,void 0===h&&(u.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,c=n(l),u=s.barwidth,h=n(u),f=0;f<o.length;f++){var p=o[f],d=p.w=h?u[f]:u;void 0===p.p&&(p.p=p[i],p["orig_"+i]=p[i]);var m=(c?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,c,u,h,f=i[s],p=f[0],d=p.trace,m=[];for(h=0;h<f.length;h++)c=(l=f[h]).p-a,u=l.p+a,m.push(c,u);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;u=(c=l.p+b)+w,m.push(c,u)}}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,c="v"===s.orientation,u=[],h=!1,f=0;f<a.length;f++){var p=a[f],d=l?0:p.b,m=l?c?p.y:p.x:d+p.s;p[n]=m,u.push(m),p.hasB&&u.push(d),(!p.hasB||!p.b)&&(h=!0)}s._extremes[t._id]=o.findExtremes(t,u,{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,c=l/1e9,u=t.l2c(t.c2l(0)),h="stack"===n.mode?l:u;function f(e){return r(t.c2l(e))&&(e<u-c||e>h+c||!r(u))}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 A=w.b,k=A+w.s;w[s]=k,v.push(k),_=_||f(k),w.hasB&&(v.push(A),_=_||f(A)),(!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=[],u=[],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]):u.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};c(t,r,n,u,m),c(t,n,r,l,m)},setGroupPositions:c}}}),ci=p({"src/traces/scatter/cross_trace_calc.js"(t,e){var r=oi(),n=li().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=[],c=[],u=0;u<o.length;u++){var h=o[u];!0===h.visible&&"scatter"===h.type&&h.xaxis===r._id&&h.yaxis===i._id&&("h"===h.orientation?l.push(s[u]):"v"===h.orientation&&c.push(s[u]))}var f={mode:a.scattermode,gap:a.scattergap};n(t,r,i,c,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 c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A=t.calcdata;for(var k in l){var M=(v=l[k]).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),c=0;c<T.length;c++)T[c]=!1;d=A[M[0]];var S=new Array(d.length);for(c=0;c<d.length;c++)S[c]=d[c][b];for(c=1;c<M.length;c++){for(p=A[M[c]],u=h=0;u<p.length;u++){for(m=p[u][b];m>S[h]&&h<S.length;h++)i(p,u,S[h],c,T,x,b),u++;if(m!==S[h]){for(f=0;f<c;f++)i(A[M[f]],h,m,f,T,x,b);S.splice(h,0,m)}h++}for(;h<S.length;h++)i(p,u,S[h],c,T,x,b),u++}var E=S.length;for(u=0;u<d.length;u++){for(g=d[u][w]=d[u].s,c=1;c<M.length;c++)(p=A[M[c]])[0].trace._rawLength=p[0].trace._length,p[0].trace._length=E,g+=p[u].s,p[u][w]=g;if(_)for(y=("fraction"===_?g:g/100)||1,c=0;c<M.length;c++){var C=A[M[c]][u];C[w]/=y,C.sNorm=C.s/y}}for(c=0;c<M.length;c++){var I=(p=A[M[c]])[0].trace,L=r.calcMarkerSize(I,I._rawLength),P=Array.isArray(L);if(L&&T[c]||P){var z=L;for(L=new Array(E),u=0;u<E;u++)L[u]=p[u].gap?0:P?z[p[u].i]:z}var D=new Array(E),O=new Array(E);for(u=0;u<E;u++)D[u]=p[u].x,O[u]=p[u].y;r.calcAxisExpansion(t,I,a,o,D,O,L),p[0].t.orientation=v.orientation}}}}}}}),ui=p({"src/traces/scatter/line_points.js"(t,e){var r=Qe(),n=k(),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=le(),c=l.segmentsIntersect,u=l.constrain,h=bn();e.exports=function(t,e){var n,a,f,p,d,m,g,y,v,x,_,b,w,T,A,k,M,S,E=e.trace||{},C=e.xaxis,I=e.yaxis,L="log"===C.type,P="log"===I.type,z=C._length,D=I._length,O=e.backoff,R=E.marker,F=e.connectGaps,B=e.baseTolerance,j=e.shape,N="linear"===j,U=E.fill&&"none"!==E.fill,V=[],q=h.minTolerance,H=t.length,G=new Array(H),W=0;function Z(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*D*(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,c=i*o+a*s;if(c>0&&c<l){var u=o*a-s*i;if(u*u<l)return!0}}function X(t,e){var r=t[0]/z,n=t[1]/D,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]/D)&&(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 K,J,Q,tt,et,rt,nt,it=h.maxScreensAway,at=-z*it,ot=z*(1+it),st=-D*it,lt=D*(1+it),ct=[[at,st,ot,st],[ot,st,ot,lt],[ot,lt,at,lt],[at,lt,at,st]];function ut(t){if(t[0]<at||t[0]>ot||t[1]<st||t[1]>lt)return[u(t[0],at,ot),u(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=ut(n),o=ut(i),s=[];if(a&&o&&ht(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return c&&((a&&o?c>0==a[t]>o[t]?a:o:a||o)[t]+=c),s}}function pt(t){var e=t[0],r=t[1],n=e===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=e===G[W-2][0],o=r===G[W-2][1];n&&(e===at||e===ot)&&a?o?W--:G[W-1]=t:i&&(r===st||r===lt)&&o?a?W--:G[W-1]=t:G[W++]=t}else G[W++]=t}function dt(t){G[W-1][0]!==t[0]&&G[W-1][1]!==t[1]&&pt([Q,tt]),pt(t),et=null,Q=tt=0}"linear"===j||"spline"===j?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=c(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"===j||"vh"===j?nt=function(t,e){var r=[],n=ut(t),i=ut(e);return n&&i&&ht(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===j?nt=ft(0,at,ot):"vhv"===j&&(nt=ft(1,st,lt));var mt=l.isArrayOrTypedArray(R);function gt(e){if(e&&O&&(e.i=n,e.d=t,e.trace=E,e.marker=mt?R[e.i]:R,e.backoff=O),M=e[0]/z,S=e[1]/D,K=e[0]<at?at:e[0]>ot?ot:0,J=e[1]<st?st:e[1]>lt?lt:0,K||J){if(W)if(et){var r=nt(et,e);r.length>1&&(dt(r[0]),G[W++]=r[1])}else rt=nt(G[W-1],e)[0],G[W++]=rt;else G[W++]=[K||e[0],J||e[1]];var i=G[W-1];K&&J&&(i[0]!==K||i[1]!==J)?(et&&(Q!==K&&tt!==J?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||K,tt||J]):Q&&tt&&pt([Q,tt])),pt([K,J])):Q-K&&tt-J&&pt([K||Q,J||tt]),et=e,Q=K,tt=J}else et&&dt(nt(et,e)[0]),G[W++]=e}for(n=0;n<H;n++)if(a=Z(n)){for(W=0,et=null,gt(a),n++;n<H;n++){if(!(p=Z(n))){if(F)continue;break}if(N&&e.simplify){var yt=Z(n+1);if(x=$(p,a),U&&(0===W||W===H-1)||!(x<X(p,yt)*q)){for(y=[(p[0]-a[0])/x,(p[1]-a[1])/x],d=a,_=x,b=T=A=0,g=!1,f=p,n++;n<t.length;n++){if(m=yt,yt=Z(n+1),!m){if(F)continue;break}if(k=(v=[m[0]-a[0],m[1]-a[1]])[0]*y[1]-v[1]*y[0],T=Math.min(T,k),(A=Math.max(A,k))-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,W))}var vt=j.slice(j.length-1);if(O&&"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 At=V[wt][Tt],kt=V[wt][Tt+1],Mt=r.applyBackoff(kt,At);(Mt[0]!==kt[0]||Mt[1]!==kt[1])&&(xt=!0),bt[_t+1]||(bt[++_t]=[At,[Mt[0],Mt[1]]])}return xt?bt:V}return V}}}),hi=p({"src/traces/scatter/link_traces.js"(t,e){var r={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,n){var i,a,o,s,l,c={},u=!1,h=-1,f=0,p=-1;for(a=0;a<n.length;a++)(o=(i=n[a][0].trace).stackgroup||"")?o in c?l=c[o]:(l=c[o]=f,f++):i.fill in r&&p>=0?l=p:(l=p=f,f++),l<h&&(u=!0),i._groupIndex=h=l;var d=n.slice();u&&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}}}),fi=p({"src/traces/scatter/plot.js"(t,e){var r=x(),n=qt(),i=le(),a=i.ensureSingle,o=i.identity,s=Qe(),l=Ye(),c=ui(),u=hi(),h=mn().tester;function f(t,e,u,f,p,d,m){var g,y=t._context.staticPlot;!function(t,e,n,a,o){var s=n.xaxis,c=n.yaxis,u=r.extent(i.simpleMap(s.range,s.r2c)),h=r.extent(i.simpleMap(c.range,c.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>=u[0]&&t.x<=u[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,u,f,p);var v=!!m&&m.duration>0;function x(t){return v?t.transition():t}var _=u.xaxis,b=u.yaxis,w=f[0].trace,T=w.line,A=r.select(d),k=a(A,"g","errorbars"),M=a(A,"g","lines"),S=a(A,"g","points"),E=a(A,"g","text");if(n.getComponentMethod("errorbars","plot")(t,k,u,m),!0===w.visible){x(A).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][u.isRangePlot?"nodeRangePlot3":"node3"]=A;var D="",O=[],R=w._prevtrace,F=null,B=null;R&&(D=R._prevRevpath||"",I=R._nextFill,O=R._ownPolygons,F=R._fillsegments,B=R._fillElement);var j,N,U,V,q,H,G,W,Z="",Y="",X=[];w._polygons=[];var $=[],K=[],J=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())},K=c(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(K.length);var Q=0;for(g=0;g<K.length;g++){var tt,et=K[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,K.length&&(H=K[0][0].slice(),W=(G=K[K.length-1])[G.length-1].slice()),J=function(t){return function(e){if(j=U(e),N=q(e),Z?z?(Z+="L"+j.substr(1),Y=N+"L"+Y.substr(1)):(Z+="Z"+j,Y=N+"Z"+Y):(Z=j,Y=N),l.hasLines(w)){var n=r.select(this);if(n.datum(f),t)x(n.style("opacity",0).attr("d",j).call(s.lineGroupStyle)).style("opacity",1);else{var i=x(n);i.attr("d",j),s.singleLineStyle(f,i)}}}}}var rt=M.selectAll(".js-line").data(K);x(rt.exit()).style("opacity",0).remove(),rt.each(J(!1)),rt.enter().append("path").classed("js-line",!0).style("vector-effect",y?"none":"non-scaling-stroke").call(s.lineGroupStyle).each(J(!0)),s.setClipUrl(rt,u.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};K.length?(C?(C.datum(f),H&&W&&(z?(H[L]=W[L]=P,x(C).attr("d","M"+W+"L"+H+"L"+Z.substr(1)).call(s.singleFillStyle,t),X=it(null)):(x(C).attr("d",Z+"Z").call(s.singleFillStyle,t),X=nt())),w._polygons=X,w._fillElement=C):I&&("tonext"===w.fill.substr(0,6)&&Z&&D?("tonext"===w.fill?(x(I).attr("d",Z+"Z"+D+"Z").call(s.singleFillStyle,t),X=nt(),w._polygons=X.concat(O)):(x(I).attr("d",Z+"L"+D.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,c=i[0].trace,h=l.hasMarkers(c),f=l.hasText(c),p=function(t){if(t.ids)return ut}(c),d=ht,m=ht;if(h||f){var g=o,y=c.stackgroup,w=y&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+b._id][y].stackgaps;c.marker.maxdisplayed||c._needsCull?g=w?lt:st:y&&!w&&(g=ct),h&&(d=g),f&&(m=g)}var T,A=(a=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&A.call(s.pointStyle,c,t).call(s.translatePoints,_,b).style("opacity",0).transition().style("opacity",1),a.order(),h&&(T=s.makePointStyleFns(c)),a.each((function(e){var n=r.select(this),i=x(n);s.translatePoint(e,i,_,b)?(s.singlePointStyle(e,i,c,T,t),u.layerClipId&&s.hideOutsideRangePoint(e,i,_,b,c.xcalendar,c.ycalendar),c.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)?u.layerClipId&&s.hideOutsideRangePoint(t,e,_,b,c.xcalendar,c.ycalendar):e.remove()})),a.selectAll("text").call(s.textPointStyle,c,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:u.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 ct(t){return t.filter((function(t){return!t.gap}))}function ut(t){return t.id}function ht(){return!1}}e.exports=function(t,e,n,i,l,c){var h,p,d=!l,m=!!l&&l.duration>0,g=u(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,c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().each((function(t){l[t]=null})).remove(),u.order().each((function(t){l[t]=a(r.select(this),"path","js-fill")}))}))}(t,h,e),m?(c&&(p=c()),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()}}}),pi=p({"src/traces/scatter/marker_colorbar.js"(t,e){e.exports={container:"marker",min:"cmin",max:"cmax"}}}),di=p({"src/traces/scatter/format_labels.js"(t,e){var r=ir();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 c=t.orig_y;return void 0===c&&(c=t.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),mi=p({"src/traces/scatter/style.js"(t,e){var r=x(),n=Qe(),i=qt();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))}}}}),gi=p({"src/traces/scatter/get_trace_color.js"(t,e){var r=H(),n=Ye();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}}}),yi=p({"src/traces/scatter/hover.js"(t,e){var r=le(),n=Dr(),i=qt(),a=gi(),o=H(),s=r.fillText;e.exports=function(t,e,l,c){var u=t.cd,h=u[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(c,(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(u,w,t),!1!==t.index){var T=u[t.index],A=f.c2p(T.x,!0),k=p.c2p(T.y,!0),M=T.mrc||1;t.index=T.i;var S=u[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:A-M,x1:A+M,xLabelVal:C,y0:k-M,y1:k+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{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,c,u=[],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)&&(u.push(v),m=Math.min(m,v.ymin),y=Math.max(y,v.ymax))}if(0===u.length)return null;for(r=((m=Math.max(m,0))+(y=Math.min(y,p._length)))/2,e=0;e<u.length;e++)for(i=u[e].pts,n=1;n<i.length;n++)(l=i[n-1][1])>r!=(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-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]}}}}),vi=p({"src/traces/scatter/select.js"(t,e){var r=Ye();e.exports=function(t,e){var n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],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=c.c2p(i.y),null!==i.i&&e.contains([a,o],!1,n,t)?(u.push({pointNumber:i.i,x:l.c2d(i.x),y:c.c2d(i.y)}),i.selected=1):i.selected=0;return u}}}),xi=p({"src/plots/cartesian/attributes.js"(t,e){e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}}),_i=p({"src/plots/cartesian/type_defaults.js"(t,e){var r=qt().traceIs,n=rr();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 c=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(c){if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",h=c[u],f={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0),f.autotypenumbers=t.autotypenumbers,a(c,l)){var p=i(c),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[u]!==h&&(h=void 0))}t.type=n(d,h,f)}else if("splom"===c.type){var g=c.dimensions[c._axesDim[s]];g.visible&&(t.type=n(g.values,h,f))}else t.type=n(c[l]||[c[l+"0"]],h,f)}}}(e,s.data),"-"===e.type?e.type="linear":t.type=e.type)}}}),bi=p({"src/plots/cartesian/category_order_defaults.js"(t,e){var r=E().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,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),!s&&"array"===c&&(c=e.categoryorder="trace"),"trace"===c?e._initialCategories=[]:"array"===c?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 c=l[i];null!=c&&(o[c]=1)}}return Object.keys(o)}(e,i).sort(),"category ascending"===c?e._initialCategories=l:"category descending"===c&&(e._initialCategories=l.reverse()))}}}}),wi=p({"src/plots/cartesian/line_grid_defaults.js"(t,e){var r=O().mix,n=q(),i=le();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 c=l("linecolor",s),u=l("linewidth");a("showline",o.showLine||!!c||!!u)||(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)}}}}),Ti=p({"src/plots/cartesian/axis_defaults.js"(t,e){var r=A(),n=qt(),i=le(),a=ye(),o=je(),s=Ie(),l=Re(),c=Fe(),u=Ne(),h=Ue(),f=bi(),p=wi(),d=or(),m=er(),g=ve().WEEKDAY_PATTERN,y=ve().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,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=_(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=_(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}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||{},A=r("visible",!y.visibleDflt),k=e._template||{},M=e.type||k.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),!A)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})),u(t,e,r,M,y),c(t,e,r,y),L){var P=y.isMinor;y.isMinor=!0,c(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 D=0;D<e.rangebreaks.length;D++)if(e.rangebreaks[D].pattern===g){e._hasDayOfWeekBreaks=!0;break}if(m(e,x),x._has("scattergl")||x._has("splom"))for(var O=0;O<y.data.length;O++){var R=y.data[O];("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()]}}}),Ai=p({"src/plots/cartesian/position_defaults.js"(t,e){var r=A(),n=le();e.exports=function(t,e,i,a){var o,s,l,c,u,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],c=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"),c=c||0,u=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")&&(c="left"===v?g[0]:g[1],h=!e.automargin||e.automargin,u="left"===v?-3:3),i("shift",u)),i("position",c)),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}}}),ki=p({"src/plots/cartesian/layout_defaults.js"(t,e){var r=le(),n=H(),i=$e().isUnifiedHover,a=Ir(),o=ye(),s=Nt(),l=Ie(),c=_i(),u=Ti(),h=rn(),f=Ai(),p=xe(),d=p.id2name,m=p.name2id,g=ve().AX_ID_PATTERN,y=qt(),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,A={},k={},M={},S={},E={},C={},I={},L={},P={},z={};for(b=0;b<y.length;b++){var D=y[b];if(v(D,"cartesian")){var O,R;if(D.xaxis)O=d(D.xaxis),_(A,O,D);else if(D.xaxes)for(w=0;w<D.xaxes.length;w++)_(A,d(D.xaxes[w]),D);if(D.yaxis)R=d(D.yaxis),_(A,R,D);else if(D.yaxes)for(w=0;w<D.yaxes.length;w++)_(A,d(D.yaxes[w]),D);"funnel"===D.type?"h"===D.orientation?(O&&(k[O]=!0),R&&(I[R]=!0)):R&&(M[R]=!0):"image"===D.type?(R&&(L[R]=!0),O&&(L[O]=!0)):(R&&(E[R]=!0,C[R]=!0),(!v(D,"carpet")||"carpet"===D.type&&!D._cheater)&&O&&(S[O]=!0)),"carpet"===D.type&&D._cheater&&O&&(k[O]=!0),v(D,"2dMap")&&(P[O]=!0,P[R]=!0),v(D,"oriented")&&(z["h"===D.orientation?R:O]=!0)}}var F=e._subplots,B=F.xaxis,j=F.yaxis,N=r.simpleMap(B,d),U=r.simpleMap(j,d),V=N.concat(U),q=n.background;B.length&&j.length&&(q=r.coerce(t,e,s,"plot_bgcolor"));var H,G,W,Z,Y,X=n.combine(q,e.paper_bgcolor);function $(){var t=A[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 K(t,e){return r.coerce(Z,Y,l,t,e)}function J(t,e){return r.coerce2(Z,Y,l,t,e)}function Q(t){return"x"===t?j:B}function tt(e,r){for(var n="x"===e?N: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=Z.matches;g.test(t)&&-1===rt.indexOf(t)&&(nt[t]=Z.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),W=H.charAt(0),r.isPlainObject(t[H])||(t[H]={}),Z=t[H],Y=o.newContainer(e,H,W+"axis"),$();var lt="x"===W&&!S[H]&&k[H]||"y"===W&&!E[H]&&M[H],ct="y"===W&&(!C[H]&&I[H]||L[H]),ut={hasMinor:!0,letter:W,font:e.font,outerTicks:P[H],showGrid:!z[H],data:A[H]||[],bgColor:X,calendar:e.calendar,automargin:!0,visibleDflt:lt,reverseDflt:ct,autotypenumbersDflt:T,splomStash:((e._splomAxes||{})[W]||{})[G],noAutotickangles:"y"===W};K("uirevision",e.uirevision),c(Z,Y,K,ut),u(Z,Y,K,ut,e);var ht=st&&W===ot.charAt(0),ft=J("spikecolor",st?Y.color:void 0),pt=J("spikethickness",st?1.5:void 0),dt=J("spikedash",st?"dot":void 0),mt=J("spikemode",st?"across":void 0),gt=J("spikesnap");K("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(Z.overlaying),vt=[0,1];if(void 0!==e[yt]){var xt=d(e[yt].anchor);void 0!==e[xt]&&(vt=e[xt].domain)}f(Z,Y,K,{letter:W,counterAxes:et[W],overlayableAxes:tt(W,H),grid:e.grid,overlayingDomain:vt}),K("title.standoff"),at(),Y._input=Z}for(b=0;b<it.length;){G=it[b++],W=(H=d(G)).charAt(0),r.isPlainObject(t[H])||(t[H]={}),Z=t[H],Y=o.newContainer(e,H,W+"axis"),$();var _t={letter:W,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||{})[W]||{})[G]};K("uirevision",e.uirevision),Y.type=nt[G]||"linear",u(Z,Y,K,_t,e),f(Z,Y,K,{letter:W,counterAxes:et[W],overlayableAxes:tt(W,H),grid:e.grid}),K("fixedrange"),K("modebardisable"),at(),Y._input=Z}var bt=x("rangeslider","handleDefaults"),wt=x("rangeselector","handleDefaults");for(b=0;b<N.length;b++)H=N[b],Z=t[H],Y=e[H],bt(t,e,H),"date"===Y.type&&wt(Z,Y,e,U,Y.calendar),K("fixedrange"),K("modebardisable");for(b=0;b<U.length;b++){H=U[b],Z=t[H],Y=e[H];var Tt=e[d(Y.anchor)];K("fixedrange",x("rangeslider","isVisible")(Tt)),K("modebardisable")}h.handleDefaults(t,e,{axIds:rt.concat(it).sort(p.idSort),axHasImage:L})}}}),Mi=p({"src/plots/cartesian/transition_axes.js"(t,e){var r=x(),n=qt(),i=le(),a=Qe(),o=ir();e.exports=function(t,e,s,l){var c=t._fullLayout;if(0!==e.length){var u;l&&(u=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())}u&&u(),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;c._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,c=s._length,u=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])*c,p[2]=c*(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]=c;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])*u,p[3]=u*(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]=u;o.drawOne(t,s,{skipTitle:!0}),o.drawOne(t,l,{skipTitle:!0}),o.redrawComponents(t,[s._id,l._id]);var w=h?c/p[2]:1,T=f?u/p[3]:1,A=h?p[0]:0,k=f?p[1]:0,M=h?p[0]/p[2]*c:0,S=f?p[1]/p[3]*u:0,E=s._offset-M,C=l._offset-S;n.clipRect.call(a.setTranslate,A,k).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)}}}),Si=p({"src/plots/cartesian/index.js"(t){var e=x(),r=qt(),n=le(),i=Ae(),a=Qe(),o=we().getModuleCalcData,s=xe(),l=ve(),c=ke(),u=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,c){for(var u,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=(u=g[b]).name,T=r.modules[w].categories;if(T.svg){var A=u.layerName||w+"layer",k=A+(x?Number(x)+1:""),M=u.plot;f=(h=o(i,M,_))[0],i=h[1],f.length&&y.push({i:p.indexOf(A),zindex:x,className:k,plotMethod:M,cdModule:f}),T.zoomScale&&v.push("."+k)}}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,c),-1===l.clipOnAxisFalseQuery.indexOf("."+o)&&a.setClipUrl(i,n.layerClipId,t)})),d._has("scattergl")&&(u=r.getModule("scattergl"),f=o(i,u)[0],u.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],c=l.layerValue2layerClass[e.yaxis.layer],p=r._hasOnlyLargeSploms,d=r._zindices.length>1,m=e.mainplotinfo;if(!e.mainplot||d)if(p)e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.xaxislayer=u(n,"g","xaxislayer-above"),e.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");e.shapelayer=u(g,"g","shapelayer"),e.imagelayer=u(g,"g","imagelayer"),m&&d?(e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer):(e.minorGridlayer=u(n,"g","minor-gridlayer"),e.gridlayer=u(n,"g","gridlayer"),e.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");e.shapelayerBetween=u(y,"g","shapelayer"),e.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),e.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),e.overaxesBelow=u(n,"g","overaxes-below")}e.overplot=u(n,"g","overplot"),e.plot=u(e.overplot,"g",i),e.zerolinelayerAbove=m&&d?m.zerolinelayerAbove:u(n,"g","zerolinelayer-above"),a||(e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),e.overaxesAbove=u(n,"g","overaxes-above"),e.xlines=n.select(".xlines-"+o),e.ylines=n.select(".ylines-"+c),e.xaxislayer=n.select(".xaxislayer-"+o),e.yaxislayer=n.select(".yaxislayer-"+c))}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,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",_),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",_),e.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",_),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",_),e.xlines=v.select(".overlines-"+o).select("."+x),e.ylines=v.select(".overlines-"+c).select("."+_),e.xaxislayer=v.select(".overaxes-"+o).select("."+x),e.yaxislayer=v.select(".overaxes-"+c).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=xi(),t.layoutAttributes=Ie(),t.supplyLayoutDefaults=ki(),t.transitionAxes=Mi(),t.finalizeSubplots=function(t,e){var r,i,a,o=e._subplots,c=o.xaxis,u=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<c.length;r++)p[i=c[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(u,a)));for(r=0;r<u.length;r++)d[a=u[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(c,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",c.push(i),u.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 c=o._zindices,u=0;u<c.length;u++){var h=c[u];for(a=0;a<s.length;a++){var d=s[a],m=o._plots[d];if(u>0){var g=m.id;if(-1!==g.indexOf(f))continue;g+=f+(u+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||{},c=e._plots||{},u=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(u.xaxis&&u.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(u.cartesian)for(a=0;a<u.cartesian.length;a++){var _=u.cartesian[a];if(-1===_.indexOf(f)&&!c[_]){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 c=Object.keys(o).map(Number).sort(n.sorterAsc);c.length||(c=[0]),i._zindices=c;var h=function(t){var e,r,n,i,a,o,s=t._fullLayout,l=s._zindices.length,c=s._subplots.cartesian,u=c.length,h=[],p=[];for(e=0;e<u;e++){n=c[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<u;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<c.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,c=i._plots[a];c||(c=n.extendFlat({},i._plots[l]))&&(c.id=a,i._plots[a]=c,i._subplots.cartesian.push(a)),c&&(c.plotgroup=e.select(this),d(t,c),s||(c.draglayer=u(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:c.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})}))},t.updateFx=In().updateFx}}),Ei=p({"src/traces/scatter/index.js"(t,e){var r=Ye();e.exports={hasLines:r.hasLines,hasMarkers:r.hasMarkers,hasText:r.hasText,isBubble:r.isBubble,attributes:Tn(),layoutAttributes:be(),supplyDefaults:Jn(),crossTraceDefaults:ti(),supplyLayoutDefaults:ei(),calc:oi().calc,crossTraceCalc:ci(),arraysToCalcdata:ii(),plot:fi(),colorbar:pi(),formatLabels:di(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:yi(),selectPoints:vi(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Si(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}}),Ci=p({"src/components/annotations/draw_arrow_head.js"(t,e){var r=x(),n=H(),i=vn(),a=le(),o=a.strScale,s=a.strRotate,l=a.strTranslate;e.exports=function(t,e,a){var c,u,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){c={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=c.x-u.x,T=c.y-u.y;if(f=(h=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void D();if(_){if(_*_>w*w+T*T)return void D();var A=_*Math.cos(h),k=_*Math.sin(h);u.x+=A,u.y+=k,t.attr({x2:u.x,y2:u.y})}if(b){if(b*b>w*w+T*T)return void D();var M=b*Math.cos(h),S=b*Math.sin(h);c.x-=M,c.y-=S,t.attr({x1:c.x,y1:c.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),C="";if(E<_+b)return void D();var I=p.getPointAtLength(0),L=p.getPointAtLength(.1);h=Math.atan2(I.y-L.y,I.x-L.x),c=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),u=p.getPointAtLength(Math.max(0,E-_)),C+=E-(C?b+_:_)+"px,"+E+"px",t.style("stroke-dasharray",C)}function D(){t.style("stroke-dasharray","0px,100px")}function O(e,i,c,u){e.path&&(e.noRotate&&(c=0),r.select(p.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:l(i.x,i.y)+s(180*c/Math.PI)+o(u)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&O(m,c,h,y),x&&O(d,u,f,g)}}}),Ii=p({"src/components/annotations/draw.js"(t,e){var r=x(),n=qt(),i=Ae(),a=le(),o=a.strTranslate,s=ir(),l=H(),c=Qe(),u=Dr(),h=Se(),f=pr(),p=fr(),d=ye().arrayEditor,m=Ci();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(),v(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"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return t?c?a+(l?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(l?-e:e)/u}function v(t,e,i,g,v,x){var _,b,w=t._fullLayout,T=t._fullLayout._size,A=t._context.edits;g?(_="annotation-"+g,b=g+".annotations"):(_="annotation",b="annotations");var k=d(t.layout,b,e),M=k.modifyBase,S=k.modifyItem,E=k.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),D=A[e.showarrow?"annotationTail":"annotationPosition"],O=e.captureevents||A.annotationText||D,R=z.append("g").style("pointer-events",O?"all":null).call(f,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",W(r.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();u.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(){u.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,B=e.borderpad,j=F+B,N=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);A.annotationText?G.call(h.makeEditable,{delegate:R,gd:t}).call(Z).on("edit",(function(r){e.text=r,this.call(Z),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(Z)}else r.selectAll("#"+C).remove();function W(t){var r={index:i,annotation:e._input,fullAnnotation:e,event:t};return g&&(r.subplotId=g),r}function Z(r){return r.call(c.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(N.node());var i=R.select(".annotation-text-math-group"),u=!i.empty(),d=c.bBox((u?i:G).node()),_=d.width,b=d.height,k=e.width||_,O=e.height||b,B=Math.round(k+2*j),q=Math.round(O+2*j);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 Z=!1,Y=["x","y"],X=0;X<Y.length;X++){var $,K,J,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),ct=e[et+"anchor"],ut=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)&&(Z=!0):Z=!0),$=it._offset+it.r2p(e[et]),Q=.5}else{var dt="domain"===ft;"x"===et?(J=e[et],$=dt?it._offset+it._length*J:$=T.l+T.w*J):(J=1-e[et],$=dt?it._offset+it._length*J:$=T.t+T.h*J),Q=e.showarrow?.5:J}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),K=tt}else ht.tail=$+mt,K=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+=ut,ht.head+=ut}else K=tt=lt*H(Q,ct),ht.text=$+tt;ht.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Z)R.remove();else{var _t=0,bt=0;if("left"!==e.align&&(_t=(k-_)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),u)i.select("svg").attr({x:j+_t-1,y:j+bt}).call(c.setClipUrl,U?C:null,t);else{var wt=j+bt-d.top,Tt=j+_t-d.left;G.call(h.positionText,Tt,wt).call(c.setClipUrl,U?C:null,t)}V.select("rect").call(c.setRect,j,j,k,O),N.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.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 At,kt=function(r,i){P.selectAll(".annotation-arrow-g").remove();var s=I.x.head,u=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),k=a.apply2DTransform2(b),C=+N.attr("width"),D=+N.attr("height"),O=d-.5*C,F=O+C,B=_-.5*D,j=B+D,U=[[O,B,O,j],[O,j,F,j],[F,j,F,B],[F,B,O,B]].map(k);if(!U.reduce((function(t,e){return t^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=a.segmentsIntersect(h,f,s,u,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),W=G.append("path").attr("d","M"+h+","+f+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(W,H,e),A.annotationPosition&&W.node().parentNode&&!g){var Z=s,Y=u;if(e.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-f,2));Z+=e.standoff*(h-s)/X,Y+=e.standoff*(f-u)/X}var $,K,J=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-Z)+","+(f-Y),transform:o(Z,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:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);$=t.x,K=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($,K),i=n[0]+t,a=n[1]+r;R.call(c.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&&kt(0,0),D&&p.init({element:R.node(),gd:t,prepFn:function(){At=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),kt(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 c=e._ysize/T.h,u=e.y-(e._yshift+e.yshift)/T.h-c/2;a=p.align(u-r/T.h,c,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)+At}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",W(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:v}}}),Li=p({"src/components/annotations/click.js"(t,e){var r=le(),n=qt(),i=ye().arrayEditor;function a(t,e){var r,n,i,a,s,l,c,u=t._fullLayout.annotations,h=[],f=[],p=[],d=(e||[]).length;for(r=0;r<u.length;r++)if(a=(i=u[r]).clicktoshow){for(n=0;n<d;n++)if(l=(s=e[n]).xaxis,c=s.yaxis,l._id===i.xref&&c._id===i.yref&&l.d2r(s.x)===o(i._xclick,l)&&c.d2r(s.y)===o(i._yclick,c)){(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),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(c.length||u.length){for(o=0;o<c.length;o++)(s=i(t.layout,"annotations",f[c[o]])).modifyItem("visible",!0),r.extendFlat(h,s.getUpdateObj());for(o=0;o<u.length;o++)(s=i(t.layout,"annotations",f[u[o]])).modifyItem("visible",!1),r.extendFlat(h,s.getUpdateObj());return n.call("update",t,{},h)}}}}}),Pi=p({"src/components/annotations/common_defaults.js"(t,e){var r=le(),n=H();e.exports=function(t,e,i,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=n.opacity(s);a("borderpad");var c=a("borderwidth"),u=a("showarrow");if(a("text",u?" ":i._dfltTitle.annotation),a("textangle"),r.coerceFont(a,"font",i.font),a("width"),a("align"),a("height")&&a("valign"),u){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&&c||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)}}}),zi=p({"src/components/annotations/defaults.js"(t,e){var r=le(),n=ir(),i=je(),a=Pi(),o=_n();function s(t,e,i){function s(n,i){return r.coerce(t,e,o,n,i)}var l=s("visible"),c=s("clicktoshow");if(l||c){a(t,e,i,s);for(var u=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),u){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"]),u&&r.noneOrAll(t,e,["ax","ay"]),c){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})}}}),Di=p({"src/components/annotations/calc_autorange.js"(t,e){var r=le(),n=ir(),i=Ii().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"],c=t["a"+a+"ref"],u=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(c===l){var x=n.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),_=n.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,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(u,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)}}}),Oi=p({"src/components/annotations/convert_coords.js"(t,e){var r=A(),n=P();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,c,u=t._fullLayout.annotations,h=e._id.charAt(0),f=0;f<u.length;f++)l=u[f],c="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(c+t,s)}}}}),Ri=p({"src/components/annotations/index.js"(t,e){var r=Ii(),n=Li();e.exports={moduleType:"component",name:"annotations",layoutAttributes:_n(),supplyLayoutDefaults:zi(),includeBasePlot:Sn()("annotations"),calcAutorange:Di(),draw:r.draw,drawOne:r.drawOne,drawRaw:r.drawRaw,hasClickToShow:n.hasClickToShow,onClick:n.onClick,convertCoords:Oi()}}}),Fi=p({"src/components/annotations3d/attributes.js"(t,e){var r=_n(),n=Pt().overrideAll,i=ye().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")}}),Bi=p({"src/components/annotations3d/defaults.js"(t,e){var r=le(),n=ir(),i=je(),a=Pi(),o=Fi();function s(t,e,i,s){function l(n,i){return r.coerce(t,e,o,n,i)}function c(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),c("x"),c("y"),c("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})}}}),ji=p({"src/components/annotations3d/convert.js"(t,e){var r=le(),n=ir();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()}}}),Ni=p({"src/plots/gl3d/project.js"(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])))}}}),Ui=p({"src/components/annotations3d/draw.js"(t,e){var r=Ii().drawRaw,n=Ni(),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],c=!1,u=0;u<3;u++){var h=i[u],f=l[h],p=e[h+"axis"].r2fraction(f);if(p<0||p>1){c=!0;break}}c?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))}}}}),Vi=p({"src/components/annotations3d/index.js"(t,e){var r=qt(),n=le();e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Fi()}}},layoutAttributes:Fi(),handleDefaults:Bi(),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:ji(),draw:Ui()}}}),qi=p({"src/components/shapes/attributes.js"(t,e){var r=_n(),n=F(),i=Tn().line,a=zt().dash,o=R().extendFlat,s=ye().templatedArray,l=(xn(),U()),c=Ot().shapeTexttemplateAttrs,u=Rt();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:c({},{keys:Object.keys(u)}),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"})}}),Hi=p({"src/components/shapes/defaults.js"(t,e){var r=le(),n=ir(),i=je(),a=qi(),o=Hr();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"),c=s("type",l?"path":"rect"),u="path"!==c;u&&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,u){var T=v+"0",A=v+"1",k=t[T],M=t[A];t[T]=g(t[T],!0),t[A]=g(t[A],!0),"pixel"===_?(s(T,0),s(A,10)):(n.coercePosition(e,b,s,w,T,.25),n.coercePosition(e,b,s,w,A,.75)),e[T]=y(e[T]),e[A]=y(e[A]),t[T]=k,t[A]=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}}u&&r.noneOrAll(t,e,["x0","x1","y0","y1"]);var E,C,I="line"===c;if(u&&(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})}}}),Gi=p({"src/components/shapes/draw_newshape/defaults.js"(t,e){var r=H(),n=le();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 c=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,c)),i("newshape.label.padding"),n.coerceFont(i,"newshape.label.font",e.font)}i("activeshape.fillcolor"),i("activeshape.opacity")}}}),Wi=p({"src/components/shapes/calc_autorange.js"(t,e){var r=le(),n=ir(),i=qr(),a=Hr();function o(t){return s(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function s(t,e,n,o,s,l){var c=t/2,u=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)+c:c,m=f>0?f+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function l(t,e,r){var n,o,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,c=0,u=0,h=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],o=e[s+"1"],l&&(c=e[s+"0shift"],u=e[s+"1shift"])):(n=e[s+"anchor"],o=e[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];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,a=t._fullLayout,c=r.filterVisible(a.shapes);if(c.length&&t._fullData.length)for(var u=0;u<c.length;u++){var h=c[u];h._extremes={};var f,p,d=n.getRefType(h.xref),m=n.getRefType(h.yref);"paper"!==h.xref&&"domain"!==d&&(p=l(f=n.getFromId(t,h.xref),h,i.paramIsX))&&(h._extremes[f._id]=n.findExtremes(f,p,s((e=h).line.width,e.xsizemode,e.x0,e.x1,e.path,!1))),"paper"!==h.yref&&"domain"!==m&&(p=l(f=n.getFromId(t,h.yref),h,i.paramIsY))&&(h._extremes[f._id]=n.findExtremes(f,p,o(h)))}}}}),Zi=p({"src/components/shapes/index.js"(t,e){var r=Zr();e.exports={moduleType:"component",name:"shapes",layoutAttributes:qi(),supplyLayoutDefaults:Hi(),supplyDrawNewShapeDefaults:Gi(),includeBasePlot:Sn()("shapes"),calcAutorange:Wi(),draw:r.draw,drawOne:r.drawOne}}}),Yi=p({"src/components/images/attributes.js"(t,e){var r=ve(),n=ye().templatedArray;xn(),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"})}}),Xi=p({"src/components/images/defaults.js"(t,e){var r=le(),n=ir(),i=je(),a=Yi();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},c=["x","y"],u=0;u<2;u++){var h=c[u],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})}}}),$i=p({"src/components/images/draw.js"(t,e){var r=x(),n=Qe(),i=ir(),a=xe(),o=ke();e.exports=function(t){var e,s,l=t._fullLayout,c=[],u={},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),u[e]||(u[e]=[]),u[e].push(f)}else"above"===f.layer?c.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),c=i.getFromId(t,e.xref),u=i.getFromId(t,e.yref),h="domain"===i.getRefType(e.xref),f="domain"===i.getRefType(e.yref),p=l._size;a=void 0!==c?"string"==typeof e.xref&&h?c._length*e.sizex:Math.abs(c.l2p(e.sizex)-c.l2p(0)):e.sizex*p.w,o=void 0!==u?"string"==typeof e.yref&&f?u._length*e.sizey:Math.abs(u.l2p(e.sizey)-u.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!==c?"string"==typeof e.xref&&h?c._length*e.x+c._offset:c.r2p(e.x)+c._offset:e.x*p.w+p.l,g+=v,y=void 0!==u?"string"==typeof e.yref&&f?u._length*(1-e.y)+u._offset:u.r2p(e.y)+u._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,width:a,height:o,preserveAspectRatio:_,opacity:e.opacity});var b=(c&&"domain"!==i.getRefType(e.xref)?c._id:"")+(u&&"domain"!==i.getRefType(e.yref)?u._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(c,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 A=T.imagelayer.selectAll("image").data(u[e]||[],v);A.enter().append("image"),A.exit().remove(),A.each((function(t){g.bind(this)(t),y.bind(this)(t)})),A.sort(x)}}}}}),Ki=p({"src/components/images/convert_coords.js"(t,e){var r=A(),n=P();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,c,u=t._fullLayout.images,h=e._id.charAt(0),f=0;f<u.length;f++)if(c="images["+f+"].",(l=u[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(c+h,m),a(c+"size"+h,g)}}}}),Ji=p({"src/components/images/index.js"(t,e){e.exports={moduleType:"component",name:"images",layoutAttributes:Yi(),supplyLayoutDefaults:Xi(),includeBasePlot:Sn()("images"),draw:$i(),convertCoords:Ki()}}}),Qi=p({"src/components/updatemenus/constants.js"(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:"▼"}}}}),ta=p({"src/components/updatemenus/attributes.js"(t,e){var r=F(),n=q(),i=R().extendFlat,a=Pt().overrideAll,o=jt(),s=ye().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")}}),ea=p({"src/components/updatemenus/defaults.js"(t,e){var r=le(),n=je(),i=ta(),a=Qi().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})}}}),ra=p({"src/components/updatemenus/scrollbox.js"(t,e){e.exports=o;var r=x(),n=H(),i=Qe(),a=le();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,c=s.height;this.position=t;var u,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=(u=d)+w,x?(f=g,T=(p=Math.min(f+T,c))-f):T=(p=g+T)-(f=Math.max(p-T,0))):(p=(f=g)+T,_?w=(h=d+w)-(u=Math.max(h-w,0)):(u=d,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:f,w,h:T};var A=m>w,k=o.barLength+2*o.barPad,M=o.barWidth+2*o.barPad,S=d,E=g+y;E+M>c&&(E=c-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),A?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:S,y:E,width:k,height:M}),this._hbarXMin=S+k/2,this._hbarTranslateMax=w-k):(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,D=g;z+L>l&&(z=l-L);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),I?(this.vbar=O.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:D,width:L,height:P}),this._vbarYMin=D+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=I?h+L+.5:h+.5,j=f-.5,N=A?p+M+.5:p+.5,U=s._topdefs.selectAll("#"+R).data(A||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),A||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(N)-Math.floor(j)}),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),A||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));A&&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)}}}}),na=p({"src/components/updatemenus/draw.js"(t,e){var r=x(),n=Ae(),i=H(),a=Qe(),o=le(),s=Se(),l=ye().arrayEditor,c=Me().LINE_SPACING,u=Qi(),h=ra();function f(t){return t._index}function p(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function d(t,e,r,n,i,a,o,s){e.active=o,l(t.layout,u.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(u.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",u.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.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",u.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(a.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.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(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),f=h.enter().append("g").classed(c,!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+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var _={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},A={l:_.x+s.borderwidth,t:_.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,t).call(M,s,_),c.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}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,s),h.call(b,s)}))})),h.call(b,s),x?(A.w=Math.max(v.openWidth,v.headerWidth),A.h=_.y-A.t):(A.w=_.x-A.l,A.h=Math.max(v.openHeight,v.headerHeight)),A.direction=s.direction,a&&(h.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,f=i._dims,p=i.active;if(h)for(s=0,l=0;l<p;l++)s+=f.heights[l]+u.gapButton;else for(o=0,l=0;l<p;l++)o+=f.widths[l]+u.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,A):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(v,e).call(_,e,r,n)}function v(t,e){o.ensureSingle(t,"rect",u.itemRectClassName,(function(t){t.attr({rx:u.rx,ry:u.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",u.itemTextClassName,(function(t){t.attr({"text-anchor":"start","data-notex":1})})),l=r.label,c=n._fullLayout._meta;c&&(l=o.templateString(l,c)),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."+u.itemRectClassName).call(i.fill,u.activeColor)}))}function w(t){t.select("rect."+u.itemRectClassName).call(i.fill,u.hoverColor)}function T(t,e){t.select("rect."+u.itemRectClassName).call(i.fill,e.bgcolor)}function A(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."+u.dropdownButtonClassName).data(o.filterVisible(e.buttons));l.enter().append("g").classed(u.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("."+u.itemTextClassName),p=f.node()&&a.bBox(f.node()).width,d=Math.max(p+u.textPadX,u.minWidth),m=e.font.size*c,g=s.lineCount(f),v=Math.max(m*g,u.minHeight)+u.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+u.gapButton,i.openHeight+=v+u.gapButton):(i.totalWidth+=d+u.gapButton,i.openWidth+=d+u.gapButton,i.totalHeight=Math.max(i.totalHeight,v),i.openHeight=i.totalHeight)})),h?i.totalHeight-=u.gapButton:i.totalWidth-=u.gapButton,i.headerWidth=i.width1+u.arrowPadX,i.headerHeight=i.height1,"dropdown"===e.type&&(h?(i.width1+=u.arrowPadX,i.totalHeight=i.height1):i.totalWidth=i.width1,i.totalWidth+=u.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,k(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 k(t){return u.autoMarginIdRoot+t._index}function M(t,e,r,n){n=n||{};var i=t.select("."+u.itemRectClassName),o=t.select("."+u.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*c,g=(s.lineCount(o)-1)*m/2;s.positionText(o,u.textOffsetX,d/2-g+u.textOffsetY),p?r.y+=f.heights[h]+r.yPad:r.x+=f.widths[h]+r.xPad,r.index++}function S(t,e){t.attr(u.menuIndexAttrName,e||"-1").selectAll("g."+u.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,i=o.filterVisible(e[u.name]);function a(e){n.autoMargin(t,k(e))}var s=e._menulayer.selectAll("g."+u.containerClassName).data(i.length>0?[0]:[]);if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),s.exit().each((function(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,f);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),y=0;y<i.length;y++){var v=i[y];A(t,v)}var x="updatemenus"+e._uid,_=new h(t,c,x);l.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(S)),l.exit().each((function(t){c.call(S),a(t)})).remove(),l.each((function(e){var i=r.select(this),a="dropdown"===e.type?c: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,c,_,e),p(c,e)&&g(t,i,c,_,e)):g(t,i,null,null,e)}))}}}}),ia=p({"src/components/updatemenus/index.js"(t,e){var r=Qi();e.exports={moduleType:"component",name:r.name,layoutAttributes:ta(),supplyLayoutDefaults:ea(),draw:na()}}}),aa=p({"src/components/sliders/constants.js"(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}}}),oa=p({"src/components/sliders/attributes.js"(t,e){var r=F(),n=jt(),i=R().extendDeepAll,a=Pt().overrideAll,o=Lt(),s=ye().templatedArray,l=aa(),c=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:c,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")}}),sa=p({"src/components/sliders/defaults.js"(t,e){var r=le(),n=je(),i=oa(),a=aa().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}),c=0,u=0;u<s.length;u++)s[u].visible&&c++;if(c<2?e.visible=!1:o("visible")){e._stepCount=c;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})}}}),la=p({"src/components/sliders/draw.js"(t,e){var r=x(),n=Ae(),i=H(),a=Qe(),o=le(),s=o.strTranslate,l=Se(),c=ye().arrayEditor,u=aa(),h=Me(),f=h.LINE_SPACING,p=h.FROM_TL,d=h.FROM_BR;function m(t){return u.autoMarginIdRoot+t._index}function g(t){return t._index}function y(t,e){var i=a.tester.selectAll("g."+u.labelGroupClass).data(e._visibleSteps);i.enter().append("g").classed(u.labelGroupClass,!0);var s=0,c=0;i.each((function(t){var n=b(r.select(this),{step:t},e).node();if(n){var i=a.bBox(n);c=Math.max(c,i.height),s=Math.max(s,i.width)}})),i.remove();var h=e._dims={};h.inputAreaWidth=Math.max(u.railWidth,u.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*u.stepInset)/(e._stepCount-1),y=s+u.labelPadding;if(h.labelStride=Math.max(1,Math.ceil(y/g)),h.labelHeight=c,h.currentValueMaxWidth=0,h.currentValueHeight=0,h.currentValueTotalHeight=0,h.currentValueMaxLines=1,e.currentvalue.visible){var x=a.tester.append("g");i.each((function(t){var r=v(x,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,x.remove()}h.height=h.currentValueTotalHeight+u.tickOffset+e.ticklen+u.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 v(t,e,r){if(e.currentvalue.visible){var n,i,s=e._dims;switch(e.currentvalue.xanchor){case"right":n=s.inputAreaLength-u.currentValueInset-s.currentValueMaxWidth,i="left";break;case"center":n=.5*s.inputAreaLength,i="middle";break;default:n=u.currentValueInset,i="left"}var c=o.ensureSingle(t,"text",u.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),c.call(a.font,e.currentvalue.font).text(h).call(l.convertToTspans,e._gd);var m=l.lineCount(c),g=(s.currentValueMaxLines+1-m)*e.currentvalue.font.size*f;return l.positionText(c,n,g),c}}function _(t,e,r){o.ensureSingle(t,"rect",u.gripRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")})).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.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",u.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",u.labelsClass),i=e._dims,s=n.selectAll("g."+u.labelGroupClass).data(i.labelSteps);s.enter().append("g").classed(u.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),u.tickOffset+e.ticklen+e.font.size*f+u.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&&A(t,e,r,o,!0,i)}function A(t,e,r,i,a,o){var s=r.active;r.active=i,c(t.layout,u.name,r).applyUpdate("active",i);var l=r.steps[r.active];e.call(S,r,o),e.call(v,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 k(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("."+u.gripRectClass);r.event.stopPropagation(),r.event.preventDefault(),l.call(i.fill,t.activebgcolor);var c=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,c,!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."+u.tickRectClass).data(e._visibleSteps),o=e._dims;n.enter().append("rect").classed(u.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?u.tickOffset:u.minorTickOffset)+o.currentValueTotalHeight)}))}function S(t,e,r){for(var n=t.select("rect."+u.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*u.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,s=o.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.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*u.railInset,s=o.ensureSingle(t,"rect",u.railRectClass);s.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),a.setTranslate(s,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._context.staticPlot,i=t._fullLayout,o=function(t,e){for(var r=t[u.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."+u.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(u.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h<o.length;h++){var f=o[h];y(t,f)}c.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||A(t,i,r,e.index,!1,!0))})),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),e.call(v,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(v,r)}(t,r.select(this),e)}))}}}}),ca=p({"src/components/sliders/index.js"(t,e){var r=aa();e.exports={moduleType:"component",name:r.name,layoutAttributes:oa(),supplyLayoutDefaults:sa(),draw:la()}}}),ua=p({"src/components/rangeslider/attributes.js"(t,e){var r=q();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"}}}),ha=p({"src/components/rangeslider/oppaxis_attributes.js"(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"}}}),fa=p({"src/components/rangeslider/constants.js"(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}}}),pa=p({"src/components/rangeslider/helpers.js"(t){var e=xe(),r=Se(),n=fa(),i=Me().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 c=l[a];c._id=a+l._id,c._height=(t.height-n.b-n.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}t._rangeSliderData=i},t.autoMarginOpts=function(t,e){var o=t._fullLayout,s=e[a],l=e._id.charAt(0),c=0,u=0;return"bottom"===e.side&&(c=e._depth,e.title.text!==o._dfltTitle[l])&&(u=1.5*e.title.font.size+10+s._offsetShift,u+=(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+c+Math.max(o.margin.b,u),pad:n.extraPad+2*s._offsetShift}}}}),da=p({"src/components/rangeslider/defaults.js"(t,e){var r=le(),n=ye(),i=xe(),a=ua(),o=ha();e.exports=function(t,e,s){var l=t[s],c=e[s];if(l.rangeslider||e._requestRangeslider[c._id]){r.isPlainObject(l.rangeslider)||(l.rangeslider={});var u,h,f=l.rangeslider,p=n.newContainer(c,"rangeslider");if(b("visible")){b("bgcolor",e.plot_bgcolor),b("bordercolor"),b("borderwidth"),b("thickness"),b("autorange",!c.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];u=f[v]||{},h=n.newContainer(p,v,"yaxis");var x,_=e[v];u.range&&_.isValidRange(u.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(u,h,o,t,e)}}}}),ma=p({"src/components/rangeslider/calc_autorange.js"(t,e){var r=xe().list,n=nr().getAutoRange,i=fa();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))}}}}),ga=p({"src/components/rangeslider/draw.js"(t,e){var r=x(),n=qt(),i=Ae(),a=le(),o=a.strTranslate,s=Qe(),l=H(),c=tr(),u=Si(),h=xe(),f=fr(),p=pr(),d=fa();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"})})),c=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(e,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"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 v(t,e,n,o){var l,c=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),u.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}(c,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"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};a.ensureSingle(i,"rect",d.handleMinClassName,(function(t){t.attr(s)})).attr(c),a.ensureSingle(o,"rect",d.handleMaxClassName,(function(t){t.attr(s)})).attr(c);var u={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(u)})).attr("height",n._height),a.ensureSingle(o,"rect",d.grabAreaMaxClassName,(function(t){t.attr(u)})).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 u=e._infolayer.selectAll("g."+d.containerClassName).data(i,(function(t){return t._name}));u.exit().each((function(t){var r=t[d.name];e._topdefs.select("#"+r._clipId).remove()})).remove(),0!==i.length&&(u.enter().append("g").classed(d.containerClassName,!0).attr("pointer-events","all"),u.each((function(i){var s=r.select(this),l=i[d.name],u=e[h.id2name(i.anchor)],x=l[h.id2name(i.anchor)];if(l.range){var T,A=a.simpleMap(l.range,i.r2l),k=a.simpleMap(i.range,i.r2l);T=k[0]<k[1]?[Math.min(A[0],k[0]),Math.max(A[1],k[1])]:[Math.max(A[0],k[0]),Math.min(A[1],k[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 D,O,R=0;for(D=0;D<z.length;D++)R+=(O=z[D]).max-O.min;var F=l._width/(L-I-R),B=[-F*I];for(D=0;D<z.length;D++)O=z[D],B.push(B[B.length-1]-F*(O.max-O.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},D=0;D<z.length;D++)(O=z[D]).pmin=l.d2p(O.min),O.pmax=l.d2p(O.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"!==x.rangemode){var j=u.r2l(x.range[0]),N=u.r2l(x.range[1])-j;l.d2pOppAxis=function(t){return(t-j)/N*l._height}}s.call(g,t,i,l).call(y,t,i,l).call(v,t,i,l).call(_,t,i,l,x).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(),c=t.select("rect."+d.grabAreaMaxClassName).node();t.on("mousedown",u),t.on("touchstart",u)}function u(){var u=r.event,h=u.target,d=m(u),g=d-t.node().getBoundingClientRect().left,y=o.d2p(i._rl[0]),v=o.d2p(i._rl[1]),x=f.coverSlip();function _(t){var u,f,_,b=+m(t)-d;switch(h){case s:if(_="ew-resize",y+b>i._length||v+b<0)return;u=y+b,f=v+b;break;case l:if(_="col-resize",y+b>i._length)return;u=y+b,f=v;break;case c:if(_="col-resize",v+b<0)return;u=y,f=v+b;break;default:_="ew-resize",u=g,f=g+b}if(f<u){var w=f;f=u,u=w}o._pixelMin=u,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 c(t){return a.constrain(t,0,n._width)}function u(t){return a.constrain(t,0,n._height)}function h(t){return a.constrain(t,-l,n._width+l)}var f=c(n.d2p(r._rl[0])),p=c(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-u(n.d2pOppAxis(i._rl[1])),g=n._height-u(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,u,x),"bottom"===i.side&&c.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"}})})))}}}),ya=p({"src/components/rangeslider/index.js"(t,e){var r=le(),n=ua(),i=ha(),a=pa();e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:r.extendFlat({},n,{yaxis:i})}}},layoutAttributes:ua(),handleDefaults:da(),calcAutorange:ma(),draw:ga(),isVisible:a.isVisible,makeData:a.makeData,autoMarginOpts:a.autoMarginOpts}}}),va=p({"src/components/rangeselector/attributes.js"(t,e){var r=F(),n=q(),i=(0,ye().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"}}}),xa=p({"src/components/rangeselector/constants.js"(t,e){e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}}),_a=p({"src/components/rangeselector/defaults.js"(t,e){var r=le(),n=H(),i=ye(),a=je(),o=va(),s=xa();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,c,u,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,c,u);d("x",m[0]),d("y",m[1]),r.noneOrAll(t,e,["x","y"]),d("xanchor"),d("yanchor"),r.coerceFont(d,"font",c.font);var g=d("bgcolor");d("activecolor",n.contrast(g,s.lightAmount,s.darkAmount)),d("bordercolor"),d("borderwidth")}}}}),ba=p({"src/components/rangeselector/get_update_object.js"(t,e){var r=_(),n=le().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)],c=e.count;switch(e.stepmode){case"backward":i=t.l2r(+l.offset(o,-c));break;case"todate":var u=l.offset(o,-c);i=t.l2r(+l.ceil(u))}return[i,a[1]]}(t,e);a[i+".range[0]"]=o[0],a[i+".range[1]"]=o[1]}return a}}}),wa=p({"src/components/rangeselector/draw.js"(t,e){var r=x(),n=qt(),i=Ae(),a=H(),o=Qe(),s=le(),l=s.strTranslate,c=Se(),u=xe(),h=Me(),f=h.LINE_SPACING,p=h.FROM_TL,d=h.FROM_BR,m=xa(),g=ba();function y(t){return t._id}function v(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){c.convertToTspans(t,n)}))}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=u.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),u=e,h=u.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(u,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]]}(u,e,a),i.call(v,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(v,h,e)})),i.on("mouseout",(function(){e._isHovered=!1,i.call(v,h,e)}))})),function(t,e,n,a,u){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*c.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,u=c.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}),c.positionText(i,p/2,g/2-(u-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]}),u.attr("transform",l(x,_))}(t,y,h,u._name,a)}))}}}),Ta=p({"src/components/rangeselector/index.js"(t,e){e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:va()}}},layoutAttributes:va(),handleDefaults:_a(),draw:wa()}}}),Aa=p({"src/plots/domain.js"(t){var e=R().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]},i=(t.name&&t.name,t.trace,r.description&&r.description,{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 c=r("domain.x",i),u=r("domain.y",a);c[0]<c[1]||(t.domain.x=i.slice()),u[0]<u[1]||(t.domain.y=a.slice())}}}),ka=p({"src/components/grid/index.js"(t,e){var r=le(),n=W().counter,i=Aa().attributes,a=ve().idRegex,o=ye(),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 c(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),c=s[0],u=(s[1]-c)/(i-o),h=u*(1-o),f=0;f<i;f++){var p=c+u*f;l[a?i-1-f:f]=[p,p+h]}return l}function u(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 u,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?(u=n.subplots.length,h=n.subplots[0].length):(d&&(u=a.length),p&&(h=i.length));var g=o.newContainer(e,"grid"),y=A("rows",u),v=A("columns",h);if(y*v>1){f||p||d||"independent"===A("pattern")&&(f=!0),g._hasSubplotGrid=f;var x,_,b="top to bottom"===A("roworder"),w=f?.2:.1,T=f?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:c("x",A,w,x,v),y:c("y",A,T,_,y,b)}}else delete e.grid}function A(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,c,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||[];c=r.subplots=new Array(m);var _=1;for(n=0;n<m;n++){var b=c[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"),A=l(e,f,"y");r.xaxes=u(T,p.xaxis,g,v,"x"),r.yaxes=u(A,p.yaxis,m,v,"y")}var k=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)k[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=c[n][z])&&(h=s.indexOf("y"),s.slice(0,h)===S)){k[S]=s.slice(h);break}}else for(n=E;n!==I;n+=C)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(S+o)){k[S]=o;break}}else if("l"===P.charAt(0)?(E=0,C=1,I=g):(E=g-1,C=-1,I=-1),d){var D=v[S];for(n=E;n!==I;n+=C)if((s=c[D][n])&&(h=s.indexOf("y"),s.slice(h)===S)){k[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)){k[S]=a;break}}}}}}}),Ma=p({"src/components/errorbars/attributes.js"(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"}}}),Sa=p({"src/components/errorbars/defaults.js"(t,e){var r=A(),n=qt(),i=le(),a=ye(),o=Ma();e.exports=function(t,e,s,l){var c="error_"+l.axis,u=a.newContainer(e,c),h=t[c]||{};function f(t,e){return i.coerce(h,u,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||!u[m])&&(f("color",s),f("thickness"),f("width",n.traceIs(e,"gl3d")?0:4))}}}}),Ea=p({"src/components/errorbars/compute_error.js"(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)]}}}}),Ca=p({"src/components/errorbars/calc.js"(t,e){var r=A(),n=qt(),i=ir(),a=le(),o=Ea();function s(t,e,n,s){var l=e["error_"+s]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(n.type)){for(var u=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=u(d,p);if(r(m[0])&&r(m[1])){var g=f[s+"s"]=d-m[0],y=f[s+"h"]=d+m[1];c.push(g,y)}}}var v=n._id,x=e._extremes[v],_=i.findExtremes(n,c,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),c=i.getFromId(t,o.yaxis);s(a,o,l,"x"),s(a,o,c,"y")}}}}}),Ia=p({"src/components/errorbars/plot.js"(t,e){var r=x(),n=A(),i=Qe(),a=Ye();e.exports=function(t,e,o,s){var l=o.xaxis,c=o.yaxis,u=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);u&&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,c);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()?u&&(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()?u&&(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()}}))}}))}}}),La=p({"src/components/errorbars/style.js"(t,e){var r=x(),n=H();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)}))}}}),Pa=p({"src/components/errorbars/index.js"(t,e){var r=le(),n=Pt().overrideAll,i=Ma(),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:Sa(),calc:Ca(),makeComputeError:Ea(),plot:Ia(),style:La(),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))}}}}),za=p({"src/components/colorbar/constants.js"(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"}}}}),Da=p({"src/components/colorbar/draw.js"(t,e){var r=x(),n=O(),i=Ae(),a=qt(),o=ir(),s=fr(),l=le(),c=l.strTranslate,u=R().extendFlat,h=pr(),f=Qe(),p=H(),d=tr(),m=Se(),g=Ee().flipScale,y=Ti(),v=Ai(),_=Ie(),b=Me(),w=b.LINE_SPACING,T=b.FROM_TL,A=b.FROM_BR,k=za().cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+k.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return u(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"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,c(),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),c(),s.push(e)}return s}(t),(function(t){return t._id}));e.enter().append("g").attr("class",(function(t){return t._id})).classed(k.colorbar,!0),e.each((function(e){var g=r.select(this);l.ensureSingle(g,"rect",k.cbbg),l.ensureSingle(g,"g",k.cbfills),l.ensureSingle(g,"g",k.cblines),l.ensureSingle(g,"g",k.cbaxis,(function(t){t.classed(k.crisp,!0)})),l.ensureSingle(g,"g",k.cbtitleunshift,(function(t){t.append("g").classed(k.cbtitle,!0)})),l.ensureSingle(g,"rect",k.cboutline);var x=function(t,e,a){var s="v"===e.orientation,h=e.len,g=e.lenmode,x=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,D=s?e.y:1-e.y,O="paper"===e.yref,R="paper"===e.xref,F=a._fullLayout,B=F._size,j=e._fillcolor,N=e._line,U=e.title,V=U.side,q=e._zrange||r.extent(("function"==typeof j?j:N.color).domain()),H="function"==typeof N.color?N.color:function(){return N.color},G="function"==typeof j?j:function(){return j},W=e._levels,Z=function(t,e,r){var n,i,a=e._levels,o=[],s=[],l=a.end+a.size/100,c=a.size,u=1.001*r[0]-.001*r[1],h=1.001*r[1]-.001*r[0];for(i=0;i<1e5&&(n=a.start+i*c,!(c>0?n>=l:n<=l));i++)n>u&&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,c=f.size,i=0;i<1e5&&(n=f.start+i*c,!(c>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=Z.fill,X=Z.line,$=Math.round(x*("fraction"===b?s?B.w:B.h:1)),K=$/(s?B.w:B.h),J=Math.round(h*("fraction"===g?s?B.h:B.w:1)),Q=J/(s?B.h:B.w),tt=R?B.w:a._fullLayout.width,et=O?B.h:a._fullLayout.height,rt=Math.round(s?z*tt+L:D*et+P),nt={center:.5,right:1}[C]||0,it={top:1,middle:.5}[I]||0,at=s?z-nt*K:D-it*K,ot=s?D-it*Q:z-nt*Q,st=Math.round(s?et*(1-ot):tt*ot);e._lenFrac=Q,e._thickFrac=K,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},c={letter:o,font:n.font,noAutotickangles:"y"===o,noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:n.calendar};function u(t,e){return l.coerce(a,s,_,t,e)}return y(a,s,u,c,n),v(a,s,u,c),s}(a,e,q);lt.position=K+(s?z+L/B.w:D+P/B.h);var ct=-1!==["top","bottom"].indexOf(V);if(s&&ct&&(lt.title.side=V,lt.titlex=z+L/B.w,lt.titley=ot+("top"===U.side?Q-P/B.h:P/B.h)),!s&&!ct&&(lt.title.side=V,lt.titley=D+P/B.h,lt.titlex=ot+L/B.w),N.color&&"auto"===e.tickmode){lt.tickmode="linear",lt.tick0=W.start;var ut=W.size,ht=l.constrain(J/50,4,15)+1,ft=(q[1]-q[0])/((e.nticks||ht)*ut);if(ft>1){var pt=Math.pow(10,Math.floor(Math.log(ft)/Math.LN10));ut*=pt*l.roundUp(ft/pt,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ut}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",c(Math.round(B.l),Math.round(B.t)));var dt,mt=t.select("."+k.cbtitleunshift).attr("transform",c(-Math.round(B.l),-Math.round(B.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,vt=t.select("."+k.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("."+k.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;t.selectAll("."+o+",."+o+"-math-group").remove(),d.draw(a,r,u(i,n||{}))}return l.syncOrAsync([i.previousPromises,function(){var t,e;(s&&ct||!s&&!ct)&&("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*D+3+.75*yt,t=L+B.l+tt*ot),bt(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":s?"start":"middle"}}))},function(){if(!s&&!ct||s&&ct){var i,u=t.select("."+k.cbtitle),h=u.select("text"),p=[-M/2,M/2],d=u.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(k.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}u.attr("transform",c(p[0],p[1])),lt.setScale()}}else _t&&("right"===V&&(lt.domain[0]+=(_t+yt/2)/B.w),u.attr("transform",c(p[0],p[1])),lt.setScale())}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",s?c(0,Math.round(B.h*(1-lt.domain[1]))):c(Math.round(B.w*lt.domain[0]),0)),vt.attr("transform",s?c(0,Math.round(-B.t)):c(Math.round(-B.l),0));var v=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(Y);v.enter().append("rect").classed(k.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 c=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(c,a,e._id,s?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=G(t).replace("e-","");c.attr("fill",n(u).toHexString())}}));var _=t.select("."+k.cblines).selectAll("path."+k.cbline).data(N.color&&N.width?X:[]);_.enter().append("path").classed(k.cbline,!0),_.exit().remove(),_.each((function(t){var e=rt,n=Math.round(lt.c2p(t))+N.width/2%1;r.select(this).attr("d","M"+(s?e+","+n:n+","+e)+(s?"h":"v")+$).call(f.lineGroupStyle,N.width,H(t),N.dash)})),vt.selectAll("g."+lt._id+"tick,path").remove();var b=rt+$+(M||0)/2-("outside"===e.ticks?1:0),T=o.calcTicks(lt),A=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,A),transFn:o.makeTransTickFn(lt)}),o.drawLabels(a,lt,{vals:T,layer:vt,transFn:o.makeTransTickLabelFn(lt),labelFns:o.makeLabelFns(lt,b)})},function(){if(s&&!ct||!s&&ct){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)+("intside"!==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}})}},i.previousPromises,function(){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,u=s&&"top"===V,d=!s&&"right"===V,m=0;if(dt.node()&&!dt.classed(k.jsPlaceholder)){var y,v=mt.select(".h"+lt._id+"title-math-group").node();v&&(s&&ct||!s&&!ct)?(l=(r=f.bBox(v)).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",c(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&&D<=0&&(_+=w=_/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var j=S+M,N=(s?rt:st)-j/2-(s?L:0),q=(s?st:rt)-(s?J:P+m-w);t.select("."+k.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(_-w,2)).attr(s?"height":"width",Math.max(J+j,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("."+k.cboutline).attr("x",(s?rt:st+L)+H).attr("y",(s?st+P-J:rt)+(u?xt:0)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(J-(s?2*P+xt:2*L+H),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":M});var G=s?nt*_:0,W=s?0:(1-it)*_-m;if(G=R?B.l-G:-G,W=O?B.t-W:-W,t.attr("transform",c(G,W)),!s&&(S||n(E).getAlpha()&&!n.equals(F.paper_bgcolor,E))){var Z=vt.selectAll("text"),Y=Z[0].length,X=t.select("."+k.cbbg).node(),K=f.bBox(X),Q=f.getTranslate(t);Z.each((function(t,e){var r=Y-1;if(0===e||e===r){var n,i=f.bBox(this),a=f.getTranslate(this);if(e===r){var o=i.right+a.x;(n=K.right+Q.x+st-S-2+z-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=K.left+Q.x+st+S+2-s)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var tt={},et=T[C],at=A[C],ot=T[I],ut=A[I],ht=_-$;s?("pixels"===g?(tt.y=D,tt.t=J*ot,tt.b=J*ut):(tt.t=tt.b=0,tt.yt=D+h*ot,tt.yb=D-h*ut),"pixels"===b?(tt.x=z,tt.l=_*et,tt.r=_*at):(tt.l=ht*et,tt.r=ht*at,tt.xl=z-x*et,tt.xr=z+x*at)):("pixels"===g?(tt.x=z,tt.l=J*et,tt.r=J*at):(tt.l=tt.r=0,tt.xl=z+h*et,tt.xr=z-h*at),"pixels"===b?(tt.y=1-D,tt.t=_*ot,tt.b=_*ut):(tt.t=ht*ot,tt.b=ht*ut,tt.yt=D-x*ot,tt.yb=D+x*ut));var ft=e.y<.5?"b":"t",pt=e.x<.5?"l":"r";a._fullLayout._reservedMargin[e._id]={};var _t={r:F.width-N-G,l:N+tt.r,b:F.height-q-W,t:q+tt.b};R&&O?i.autoMargin(a,e._id,tt):R?a._fullLayout._reservedMargin[e._id][ft]=_t[ft]:O||s?a._fullLayout._reservedMargin[e._id][pt]=_t[pt]:a._fullLayout._reservedMargin[e._id][ft]=_t[ft]}],a)}(g,e,t);x&&x.then&&(t._promises||[]).push(x),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,o,l="v"===e.orientation,u=r._fullLayout._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,a){t.attr("transform",n+c(r,a)),i=s.align((l?e._uFrac:e._vFrac)+r/u.w,l?e._thickFrac:e._lenFrac,0,1,e.xanchor),o=s.align((l?e._vFrac:1-e._uFrac)-a/u.h,l?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=s.getCursor(i,o,e.xanchor,e.yanchor);h(t,f)},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()}}}}),Oa=p({"src/components/colorbar/index.js"(t,e){e.exports={moduleType:"component",name:"colorbar",attributes:Le(),supplyDefaults:Ve(),draw:Da().draw,hasColorbar:De()}}}),Ra=p({"src/components/legend/index.js"(t,e){e.exports={moduleType:"component",name:"legend",layoutAttributes:mr(),supplyLayoutDefaults:yr(),draw:kr(),style:Ar()}}}),Fa=p({"src/locale-en.js"(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"}}}}),Ba=p({"src/locale-en-us.js"(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"}}}}),ja=p({"src/snapshot/cloneplot.js"(t,e){var r=qt(),n=le(),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}e.exports=function(t,e){var n,s,l=t.data,c=t.layout,u=a([],l),h=a({},c,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],["xaxis","yaxis","zaxis"].indexOf(s.slice(0,5))>-1&&(h[p[n]].title={text:""});for(n=0;n<u.length;n++){var d=u[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:u,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}}}),Na=p({"src/snapshot/toimage.js"(t,e){var r=fe().EventEmitter,n=qt(),i=le(),a=On(),o=ja(),s=Rn(),l=Fn();e.exports=function(t,e){var c=new r,u=o(t,{format:"png"}),h=u.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var f=a.getRedrawFunc(h);return n.call("_doPlot",h,u.data,u.layout,u.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(),(c=l({format:e.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:r,emitter:c,svg:t})).clean=function(){h&&document.body.removeChild(h)}}),t)})).catch((function(t){c.emit("error",t)})),c}}}),Ua=p({"src/snapshot/index.js"(t,e){var r=On(),n={getDelay:r.getDelay,getRedrawFunc:r.getRedrawFunc,clone:ja(),toSVG:Rn(),svgToImg:Fn(),toImage:Na(),downloadImage:Un()};e.exports=n}}),Va=p({"src/core.js"(t){t.version=y().version,v(),ce();var e,r,n=qt(),i=t.register=n.register,a=qn(),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(Ei()),i([Ri(),Vi(),En(),Zi(),Ji(),ia(),ca(),ya(),Ta(),ka(),Pa(),Ze(),Oa(),Ra(),Dr(),tn()]),i([Fa(),Ba()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(i(window.PlotlyLocales),delete window.PlotlyLocales),t.Icons=Fr();var s=Dr(),l=Ae();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=Ua(),t.PlotSchema=ge()}}),qa=p({"lib/core.js"(t,e){e.exports=Va()}}),Ha=p({"src/traces/bar/constants.js"(t,e){e.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}}),Ga=p({"src/traces/bar/attributes.js"(t,e){var r=Tn(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Ot().texttemplateAttrs,o=Pe(),s=F(),l=Ha(),c=zt().pattern,u=R().extendFlat,h=s({editType:"calc",arrayOk:!0,colorEditType:"style"}),f=u({},r.marker.line.width,{dflt:0}),p=u({width:f,editType:"calc"},o("marker.line")),d=u({line:p,editType:"calc"},o("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:c,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:u({},h,{}),insidetextfont:u({},h,{}),outsidetextfont:u({},h,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:u({},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}}}),Wa=p({"src/traces/bar/layout_attributes.js"(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"}}}}),Za=p({"src/traces/bar/style_defaults.js"(t,e){var r=H(),n=Ee().hasColorscale,i=qe(),a=le().coercePattern;e.exports=function(t,e,o,s,l){var c=o("marker.color",s),u=n(t,"marker");u&&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",c,u),o("selected.marker.color"),o("unselected.marker.color")}}}),Ya=p({"src/traces/bar/defaults.js"(t,e){var r=A(),n=le(),i=H(),a=qt(),o=Hn(),s=Gn(),l=Za(),c=Qn(),u=Ga(),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,c=!1!==o.moduleHasConstrain,u=!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"),c&&i("constraintext"),u&&i("cliponaxis"),f&&i("textangle"),i("texttemplate")}g&&p&&i("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,c){function h(r,i){return n.coerce(t,e,u,r,i)}if(o(t,e,c,h)){s(t,e,c,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,c,h,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,h,r,c);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,u,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)),c(r,i,e,a,e.barmode)}},handleText:p,validateCornerradius:f}}}),Xa=p({"src/traces/bar/layout_defaults.js"(t,e){var r=qt(),n=ir(),i=le(),a=Wa(),o=Ya().validateCornerradius;e.exports=function(t,e,s){function l(r,n){return i.coerce(t,e,a,r,n)}for(var c=!1,u=!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){c=!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&&(u=!0)}}if(c){"overlay"!==p&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");e.barcornerradius=o(v)}else delete e.barmode}}}),$a=p({"src/traces/bar/arrays_to_calcdata.js"(t,e){var r=le();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"))}}}}),Ka=p({"src/traces/bar/calc.js"(t,e){var r=ir(),n=ri(),i=Ee().hasColorscale,a=We(),o=$a(),s=ai();e.exports=function(t,e){var l,c,u,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),u=m.makeCalcdata(e,"y"),h=n(e,m,"y",u),f=!!e.yperiodalignment,p="y"):(l=m.makeCalcdata(e,"y",g),u=d.makeCalcdata(e,"x"),h=n(e,d,"x",u),f=!!e.xperiodalignment,p="x"),c=h.vals;for(var y=Math.min(c.length,l.length),v=new Array(y),x=0;x<y;x++)v[x]={p:c[x],s:l[x]},f&&(v[x].orig_p=u[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}}}),Ja=p({"src/traces/bar/uniform_text.js"(t,e){var r=x(),n=le();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)}}))}}}}}),Qa=p({"src/traces/bar/helpers.js"(t){var e=A(),r=O(),n=le().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}}}),to=p({"src/traces/bar/style.js"(t,e){var r=x(),n=H(),i=Qe(),a=le(),o=qt(),s=Ja().resizeText,l=Ga(),c=l.textfont,u=l.insidetextfont,h=l.outsidetextfont,f=Qa();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=v(r,e.i,i));return a}function g(t,e,r){return _(c,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}),_(u,t.insidetextfont,e,a)}function v(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),c=f.getValue(e.variant,r),u=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,c,n.variant),textcase:f.coerceString(t.variant,u,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:v,getBarColor:b,resizeText:s}}}),eo=p({"src/traces/bar/plot.js"(t,e){var r=x(),n=A(),i=le(),a=Se(),o=H(),s=Qe(),l=qt(),c=ir().tickText,u=Ja(),h=u.recordMinTextSize,f=u.clearMinTextSize,p=to(),d=Qa(),m=Ha(),g=Ga(),y=g.text,v=g.textposition,_=$e().appendArrayPointValue,b=m.TEXTPAD;function w(t){return t.id}function T(t){return(t>0)-(t<0)}function k(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,c=a.anchor,u="end"===c,h="start"===c,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 A,M,S=I(i,T);if(m&&m-g>b){var E=function(t,e,r,n,i,a,o,s,l){var c,u,h,f,p=Math.max(0,Math.abs(e-t)-2*b),d=Math.max(0,Math.abs(n-r)-2*b),m=a-b,g=o?m-Math.sqrt(m*m-(m-o)*(m-o)):m,y=l?2*m:s?m-o:2*g,v=l?2*m:s?2*g:m-o;return i.y/i.x>=d/(p-y)?f=d/i.y:i.y/i.x<=(d-v)/p?f=p/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(p-m)*(p-m)+(d/2-m)*(d/2-m)-m*m,f=(-(u=-2*i.x*(p-m)-i.y*(d/2-m))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(p/2-m)*(p/2-m)+(d/2-m)*(d/2-m)-m*m,f=(-(u=-i.x*(p/2-m)-i.y*(d/2-m))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(p/2-m)*(p/2-m)+(d-m)*(d-m)-m*m,f=(-(u=-i.x*(p/2-m)-2*i.y*(d-m))+Math.sqrt(u*u-4*c*h))/(2*c)),{scale:f=Math.min(1,f),pad:s?Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(d-i.y*f)/2)*(m-(d-i.y*f)/2)))-o):Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(p-i.x*f)/2)*(m-(p-i.x*f)/2)))-o)}}(t,e,r,n,S,m,g,o,d);A=E.scale,M=E.pad}else A=1,s&&(A=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,D=(r+n)/2,O=0,R=0;if(h||u){var F=(o?S.x:S.y)/2;m&&(u||d)&&(w+=M);var B=o?k(t,e):k(r,n);o?h?(z=t+B*w,O=-B*F):(z=e-B*w,O=B*F):h?(D=r+B*w,R=-B*F):(D=n-B*w,R=B*F)}return{textX:L,textY:P,targetX:z,targetY:D,anchorX:O,anchorY:R,scale:A,rotate:T}}e.exports={plot:function(t,e,u,m,g,x){var A=e.xaxis,P=e.yaxis,z=t._fullLayout,D=t._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},f("bar",z));var O=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),f=l[0].trace,m=l[0].t,O="waterfall"===f.type,R="funnel"===f.type,F="histogram"===f.type,B="bar"===f.type,j=B||R,N=0;O&&f.connector.visible&&"between"===f.connector.mode&&(N=f.connector.line.width/2);var U="h"===f.orientation,V=S(g),q=i.ensureSingle(u,"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(u,w){var S,O,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]}(u,A,P,U),H=q[0][0],G=q[0][1],W=q[1][0],Z=q[1][1],Y=0==(U?G-H:Z-W);if(Y&&j&&d.getLineWidth(f,u)&&(Y=!1),Y||(Y=!(n(H)&&n(G)&&n(W)&&n(Z))),u.isBlank=Y,Y&&(U?G=H:Z=W),N&&!Y&&(U?(H-=k(H,G)*N,G+=k(H,G)*N):(W-=k(W,Z)*N,Z+=k(W,Z)*N)),"waterfall"===f.type){if(!Y){var X=f[u.dir].marker;S=X.line.width,O=X.color}}else S=d.getLineWidth(f,u),O=u.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 K=o.opacity(O)<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=K(H,G,U),G=K(G,H,U),W=K(W,Z,!U),Z=K(Z,W,!U));var J,Q=U?A.c2p:P.c2p;J=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var tt,et,rt=B||F?function(t,e){if(!t)return 0;var r,n=Math.abs(U?Z-W:G-H),i=Math.abs(U?G-H:Z-W),a=K(Math.abs(Q(J,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===e?n*(Math.min(50,t)/100):t,K(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,nt="M"+H+","+W+"V"+Z+"H"+G+"V"+W+"Z",it=0;if(rt&&u.s){var at=0===T(u.s0)||T(u.s)===T(u.s0)?u.s1:u.s0;if((it=K(u.hasB?0:Math.abs(Q(J,!0)-Q(at,!0))))<rt){var ot=k(H,G),st=k(W,Z),lt=ot===-st?1:0;if(U)if(u.hasB)tt="M"+(H+rt*ot)+","+W+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(W+rt*st)+"V"+(Z-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot)+","+Z+"H"+(G-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(Z-rt*st)+"V"+(W+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-rt*ot)+","+W+"Z";else{var ct=(et=Math.abs(G-H)+it)<rt?rt-Math.sqrt(et*(2*rt-et)):0,ut=it>0?Math.sqrt(it*(2*rt-it)):0,ht=ot>0?Math.max:Math.min;tt="M"+H+","+W+"V"+(Z-ct*st)+"H"+ht(G-(rt-it)*ot,H)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(Z-rt*st-ut)+"V"+(W+rt*st+ut)+"A "+rt+","+rt+" 0 0 "+lt+" "+ht(G-(rt-it)*ot,H)+","+(W+ct*st)+"Z"}else if(u.hasB)tt="M"+(H+rt*ot)+","+W+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(W+rt*st)+"V"+(Z-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot)+","+Z+"H"+(G-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(Z-rt*st)+"V"+(W+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-rt*ot)+","+W+"Z";else{var ft=(et=Math.abs(Z-W)+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)+","+W+"V"+dt(Z-(rt-it)*st,W)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot-pt)+","+Z+"H"+(G-rt*ot+pt)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-ft*ot)+","+dt(Z-(rt-it)*st,W)+"V"+W+"Z"}}else tt=nt}else tt=nt;var mt=M(i.ensureSingle(R,"path"),z,g,x);if(mt.style("vector-effect",D?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*(Z-W))||Y&&t._context.staticPlot?"M0,0Z":tt).call(s.setClipUrl,e.layerClipId,t),!z.uniformtext.mode&&V){var gt=s.makePointStyleFns(f);s.singlePointStyle(u,mt,f,gt,t)}(function(t,e,r,n,o,l,u,f,m,g,x,w,T){var A,S=e.xaxis,P=e.yaxis,z=t._fullLayout;function D(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+A,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,t)}var O=n[0].trace,R="h"===O.orientation,F=function(t,e,r,n,a){var o,s=e[0].trace;return o=s.texttemplate?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,f,p="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(t){return c(f,f.c2l(t),!0).text}g?(l="y",u=a,h="x",f=n):(l="x",u=n,h="y",f=a);var v=e[r],x={};x.label=v.p,x.labelLabel=x[l+"Label"]=function(t){return c(u,u.c2l(t),!0).text}(v.p);var b=i.castOption(o,v.i,"text");(0===b||b)&&(x.text=b),x.value=v.s,x.valueLabel=x[h+"Label"]=y(v.s);var w={};_(w,o,v.i),(p||void 0===w.x)&&(w.x=g?x.value:x.label),(p||void 0===w.y)&&(w.y=g?x.label:x.value),(p||void 0===w.xLabel)&&(w.xLabel=g?x.valueLabel:x.labelLabel),(p||void 0===w.yLabel)&&(w.yLabel=g?x.labelLabel:x.valueLabel),d&&(x.delta=+v.rawS||v.s,x.deltaLabel=y(x.delta),x.final=v.v,x.finalLabel=y(x.final),x.initial=x.final-x.delta,x.initialLabel=y(x.initial)),m&&(x.value=v.s,x.valueLabel=y(x.value),x.percentInitial=v.begR,x.percentInitialLabel=i.formatPercent(v.begR),x.percentPrevious=v.difR,x.percentPreviousLabel=i.formatPercent(v.difR),x.percentTotal=v.sumR,x.percenTotalLabel=i.formatPercent(v.sumR));var T=i.castOption(o,v.i,"customdata");return T&&(x.customdata=T),i.texttemplateString(s,x,t._d3locale,w,x,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 u(t){return c(o?r:n,+t,!0).text}var h,f=a.textinfo,p=t[e],d=f.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};if(g("label")&&m.push(function(t){return c(o?n:r,t,!0).text}(t[e].p)),g("text")&&(0===(h=i.castOption(a,p.i,"text"))||h)&&m.push(h),s){var y=+p.rawS||p.s,v=p.v,x=v-y;g("initial")&&m.push(u(x)),g("delta")&&m.push(u(y)),g("final")&&m.push(u(v))}if(l){g("value")&&m.push(u(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var b=_>1;g("percent initial")&&(h=i.formatPercent(p.begR),b&&(h+=" of initial"),m.push(h)),g("percent previous")&&(h=i.formatPercent(p.difR),b&&(h+=" of previous"),m.push(h)),g("percent total")&&(h=i.formatPercent(p.sumR),b&&(h+=" of total"),m.push(h))}return m.join("<br>")}(e,r,n,a):d.getValue(s.text,r),d.coerceString(y,o)}(z,n,o,S,P);A=function(t,e){var r=d.getValue(t.textposition,e);return d.coerceEnumerated(v,r)}(O,o);var B="stack"===w.mode||"relative"===w.mode,j=n[o],N=!B||j._outmost,U=j.hasB,V=g&&g-x>b;if(F&&"none"!==A&&(!j.isBlank&&l!==u&&f!==m||"auto"!==A&&"inside"!==A)){var q=z.font,H=p.getBarColor(n[o],O),G=p.getInsideTextFont(O,o,q,H),W=p.getOutsideTextFont(O,o,q),Z=O.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,$,K,J,Q,tt=Math.abs(u-l),et=Math.abs(m-f),rt=tt-2*b,nt=et-2*b;if("outside"===A&&!N&&!j.hasB&&(A="inside"),"auto"===A)if(N){A="inside",X=D(r,F,Q=i.ensureUniformFontSize(t,G)),K=($=s.bBox(X.node())).width,J=$.height;var it,at=K>0&&J>0;it=V?U?E(rt-2*g,nt,K,J,R)||E(rt,nt-2*g,K,J,R):R?E(rt-(g-x),nt,K,J,R)||E(rt,nt-2*(g-x),K,J,R):E(rt,nt-(g-x),K,J,R)||E(rt-2*(g-x),nt,K,J,R):E(rt,nt,K,J,R),at&&it?A="inside":(A="outside",X.remove(),X=null)}else A="inside";if(!X){var ot=(X=D(r,F,Q=i.ensureUniformFontSize(t,"outside"===A?W:G))).attr("transform");if(X.attr("transform",""),K=($=s.bBox(X.node())).width,J=$.height,X.attr("transform",ot),K<=0||J<=0)return void X.remove()}var st,lt=O.textangle;"outside"===A?st=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=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/u));var m=C(c),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,A=0,M=s?k(e,t):k(r,n);return s?(_=e-M*o,T=M*y):(w=n+M*o,A=-M*y),{textX:v,textY:x,targetX:_,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:m}}(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"outside"===O.constraintext,angle:lt}):st=L(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"inside"===O.constraintext,angle:lt,anchor:Z,hasB:U,r:g,overhead:x}),st.fontSize=Q.size,h("histogram"===O.type?"bar":O.type,st,z),j.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,W,Z,rt,it,g,x),e.layerClipId&&s.hideOutsideRangePoint(u,R.select("text"),A,P,f.xcalendar,f.ycalendar)}));var W=!1===f.cliponaxis;s.setClipUrl(u,W?null:e.layerClipId,t)}));l.getComponentMethod("errorbars","plot")(t,O,e,g)},toMoveInsideBar:L}}}),ro=p({"src/traces/bar/hover.js"(t,e){var r=Dr(),n=qt(),i=H(),a=le().fillText,o=Qa().getLineWidth,s=ir().hoverLabelText,l=k().BADNUM;function c(t,e,n,i,o){var c,u,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?(c=n,u=e,h="y",f="x",p=D,d=P):(c=e,u=n,h="x",f="y",d=D,p=P);var T=y[h+"period"],A=x||T;function k(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?k:T?function(t){return t.p-E(t)/2}:function(t){return Math.min(k(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-c,e-c,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;u>0?e+=r:u<0&&(e-=r)}return e}function D(t){var e=u,n=t.b,i=z(t);return r.inbox(n-e,i-e,b+(i-e)/(i-n)-1)}var O=t[h+"a"],R=t[f+"a"];m=Math.abs(O.r2c(O.range[1])-O.r2c(O.range[0]));var F,B,j,N,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){A||(C=function(t){return Math.min(k(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"]=O.c2p(x?C(V):H[0],!0),t[h+"1"]=O.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(O,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=u,j=(F=V).b,N=z(F),(r.inbox(j-B,N-B,w+(N-B)/(N-j)-1)+function(t){return L(k(t),M(t),w)}(V))/2),t[h+"Spike"]=O.c2p(V.p,!0),a(V,y,t),t.hovertemplate=y.hovertemplate,t}}function u(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=c(t,e,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),no=p({"src/traces/bar/event_data.js"(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}}}),io=p({"src/traces/bar/select.js"(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,c="h"===s.orientation,u=[];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,c,l);e.contains(f,!1,n,t)?(u.push({pointNumber:n,x:a.c2d(h.x),y:o.c2d(h.y)}),h.selected=1):h.selected=0}return u}}}),ao=p({"src/traces/bar/index.js"(t,e){e.exports={attributes:Ga(),layoutAttributes:Wa(),supplyDefaults:Ya().supplyDefaults,crossTraceDefaults:Ya().crossTraceDefaults,supplyLayoutDefaults:Xa(),calc:Ka(),crossTraceCalc:li().crossTraceCalc,colorbar:pi(),arraysToCalcdata:$a(),plot:eo().plot,style:to().style,styleOnSelect:to().styleOnSelect,hoverPoints:ro().hoverPoints,eventData:no(),selectPoints:io(),moduleType:"trace",name:"bar",basePlotModule:Si(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}}),oo=p({"lib/bar.js"(t,e){e.exports=ao()}}),so=p({"src/traces/box/attributes.js"(t,e){var r=wn(),n=Tn(),i=Ga(),a=q(),o=Ce().axisHoverFormat,s=Ot().hovertemplateAttrs,l=R().extendFlat,c=n.marker,u=c.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({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},c.angle,{arrayOk:!1,editType:"calc"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.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}}}),lo=p({"src/traces/box/layout_attributes.js"(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"}}}}),co=p({"src/traces/box/defaults.js"(t,e){var r=le(),n=qt(),i=H(),a=Gn(),o=Qn(),s=rr(),l=so();function c(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 c(e){return r.validate(t[e],l[e])}var u,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,u=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 A=c("x0")||c("dx");g=!c("y0")&&!c("dy")||A?"v":"h",y=u;break;case"10":g="v",y=Math.min(u,b);break;case"20":g="h",y=Math.min(u,f.length);break;case"01":g="h",y=Math.min(u,_);break;case"02":g="v",y=Math.min(u,h.length);break;case"12":g="v",y=Math.min(u,b,h.length);break;case"21":g="h",y=Math.min(u,f.length,_);break;case"11":y=0;break;case"22":var k,M=!1;for(k=0;k<f.length;k++)if("category"===s(f[k],w,T)){M=!0;break}if(M)g="v",y=Math.min(u,b,h.length);else{for(k=0;k<h.length;k++)if("category"===s(h[k],w,T)){M=!0;break}M?(g="h",y=Math.min(u,f.length,_)):(g="v",y=Math.min(u,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 u(t,e,n,i){var a=i.prefix,o=r.coerce2(t,e,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";e._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-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"===u&&(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(c(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"),u(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 c=(i=t[s]).type;if("box"===c||"violin"===c){n=i._input;var u=e[c+"mode"];"group"===u&&o(n,i,e,a,u)}}},handleSampleDefaults:c,handlePointsDefaults:u}}}),uo=p({"src/traces/box/layout_defaults.js"(t,e){var r=qt(),n=le(),i=lo();function a(t,e,n,i,a){for(var o=a+"Layout",s=!1,l=0;l<n.length;l++){var c=n[l];if(r.traceIs(c,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}}}),ho=p({"src/traces/box/calc.js"(t,e){var r=A(),n=ir(),i=ri(),a=le(),o=k().BADNUM,s=a._;e.exports=function(t,e){var l,y,v,x,_,b,w,T=t._fullLayout,A=n.getFromId(t,e.xaxis||"x"),k=n.getFromId(t,e.yaxis||"y"),M=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=A,x="x",_=k,b="y",w=!!e.yperiodalignment):(v=k,x="y",_=A,b="x",w=!!e.xperiodalignment);var E,C,I,L,P,z,D=function(t,e,n,o){var s,l=e+"0"in t;if(e in t||l&&"d"+e in t){var c=n.makeCalcdata(t,e);return[i(t,n,e,c).vals,c]}s=l?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 u="multicategory"===n.type?n.r2c_just_indices(s):n.d2c(s,0,t[e+"calendar"]),h=t._length,f=new Array(h),p=0;p<h;p++)f[p]=u;return[f]}(e,b,_,T[S]),O=D[0],R=D[1],F=a.distinctVals(O,_),B=F.vals,j=F.minDiff/2,N="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=O[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&&(c(P={v:z,i:[l,y]},e,[l,y]),C.push(P));if(E.pts=C.sort(u),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 W=V("lowerfence");E.lf=W!==o&&W<=E.q1?W:f(E,I,L);var Z=V("upperfence");E.uf=Z!==o&&Z>=E.q3?Z: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 K=E.lf,J=E.uf;e.boxpoints&&I.length&&(K=Math.min(K,I[0]),J=Math.max(J,I[L-1])),e.notched&&(K=Math.min(K,E.ln),J=Math.max(J,E.un)),E.min=K,E.max=J}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(N),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,j),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(O[l],et);it>=0&&it<rt&&(c(P={v:z,i:l},e,l),nt[it].push(P))}var at=1/0,ot=-1/0,st=e.quartilemethod,lt="exclusive"===st,ct="inclusive"===st;for(l=0;l<rt;l++)if(nt[l].length>0){var ut,ht;(E={}).pos=E[b]=B[l],C=E.pts=nt[l].sort(u),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||ct)?(lt?(ut=I.slice(0,L/2),ht=I.slice(L/2+1)):ct&&(ut=I.slice(0,L/2+1),ht=I.slice(L/2)),E.q1=a.interp(ut,.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(N),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:j,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 c(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 u(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)}}}),fo=p({"src/traces/box/cross_trace_calc.js"(t,e){var r=ir(),n=le(),i=rn().getAxisGroup,a=["v","h"];function o(t,e,a,o){var s,l,c,u=e.calcdata,h=e._fullLayout,f=o._id,p=f.charAt(0),d=[],m=0;for(s=0;s<a.length;s++)for(c=u[a[s]],l=0;l<c.length;l++)d.push(o.c2l(c[l].pos,!0)),m+=(c[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,A,k,M=(c=u[a[s]])[0].trace,S=c[0].t,E=M.width,C=M.side;if(E)w=T=k=E/2,A=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,A=2*w*(((P?M._offsetIndex:S.num)+.5)/z-.5)*_,k=w*_/z}else T=w*_*b,A=0,k=w;S.dPos=w,S.bPos=A,S.bdPos=T,S.wHover=k;var D,O,R,F,B,j,N,U,V=A+T,q=!!E;if("positive"===C?(D=w*(E?1:.5),R=V,O=R=A):"negative"===C?(D=R=A,O=w*(E?1:.5),F=V):(D=O=w,R=F=V),(M.boxpoints||M.points)&&m>0){var H=M.pointpos,G=M.jitter,W=M.marker.size/2,Z=0;H+G>=0&&((Z=V*(H+G))>D?(q=!0,N=W,B=Z):Z>R&&(N=W,B=D)),Z<=D&&(B=D);var Y=0;H-G<=0&&((Y=-V*(H-G))>O?(q=!0,U=W,j=Y):Y>F&&(U=W,j=O)),Y<=O&&(j=O)}else B=D,j=O;var X=new Array(c.length);for(l=0;l<c.length;l++)X[l]=c[l].pos;M._extremes[f]=r.findExtremes(o,X,{padded:q,vpadminus:j,vpadplus:B,vpadLinearized:!0,ppadminus:{x:U,y:N}[p],ppadplus:{x:N,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],c="h"===l?i:n,u=[],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&&u.push(h)}o("box",t,u,c)}},setPositionOffset:o}}}),po=p({"src/traces/box/plot.js"(t,e){var r=x(),n=le(),i=Qe();function a(t,e,i,a,o){var s,l,c="h"===i.orientation,u=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,A=h.l2p(e-s*x)+m,k=h.l2p(e+l*x)+m,M="sd"===i.sizemode,S=u.c2p(M?t.mean-t.sd:t.q1,!0),E=M?u.c2p(t.mean+t.sd,!0):u.c2p(t.q3,!0),C=n.constrain(M?u.c2p(t.mean,!0):u.c2p(t.med,!0),Math.min(S,E)+1,Math.max(S,E)-1),I=void 0===t.lf||!1===i.boxpoints||M,L=u.c2p(I?t.min:t.lf,!0),P=u.c2p(I?t.max:t.uf,!0),z=u.c2p(t.ln,!0),D=u.c2p(t.un,!0);c?r.select(this).attr("d","M"+C+","+A+"V"+k+"M"+S+","+a+"V"+o+(v?"H"+z+"L"+C+","+k+"L"+D+","+o:"")+"H"+E+"V"+a+(v?"H"+D+"L"+C+","+A+"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"+A+","+C+"H"+k+"M"+a+","+S+"H"+o+(v?"V"+z+"L"+k+","+C+"L"+o+","+D:"")+"V"+E+"H"+a+(v?"V"+D+"L"+A+","+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,c=a.bPos,u=r.boxpoints||r.points;n.seedPseudoRandom();var h=t.selectAll("g.points").data(u?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"!==u&&(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+c+l*(r.pointpos+b);"h"===r.orientation?(x.y=w,x.x=_):(x.x=w,x.y=_),"suspectedoutliers"===u&&_<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,c=e.pos,u=!!c.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=c.c2l(t.pos+h,!0),n=c.l2p(e-o)+f,a=c.l2p(e+s)+f,d=u?(n+a)/2:c.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 c=t._context.staticPlot,u=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=u):(e=u,n=h),a(i,{pos:e,val:n},p,f,c),o(i,{x:u,y:h},p,f),s(i,{pos:e,val:n},p,f))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),mo=p({"src/traces/box/style.js"(t,e){var r=x(),n=H(),i=Qe();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 c=a.selectAll("path.box");if("candlestick"===o.type)c.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(c,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 u=a.selectAll("path.point");i.pointStyle(u,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)}}}}),go=p({"src/traces/box/hover.js"(t,e){var r=ir(),n=le(),i=Dr(),a=H(),o=n.fillText;function s(t,e,o,s){var l,c,u,h,f,p,d,m,g,y,v,x,_,b,w=t.cd,T=t.xa,A=t.ya,k=w[0].trace,M=w[0].t,S="violin"===k.type,E=M.bdPos,C=M.wHover,I=function(t){return u.c2l(t.pos)+M.bPos-u.c2l(p)};S&&"both"!==k.side?("positive"===k.side&&(g=function(t){var e=I(t);return i.inbox(e,e+C,y)},x=E,_=0),"negative"===k.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"===k.orientation?(f=e,p=o,d=b,m=g,l="y",u=A,c="x",h=T):(f=o,p=e,d=g,m=b,l="x",u=T,c="y",h=A);var L=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.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 D=w[t.index],O=k.line.color,R=(k.marker||{}).color;a.opacity(O)&&k.line.width?t.color=O:a.opacity(R)&&k.boxpoints?t.color=R:t.color=k.fillcolor,t[l+"0"]=u.c2p(D.pos+M.bPos-_,!0),t[l+"1"]=u.c2p(D.pos+M.bPos+x,!0),t[l+"LabelVal"]=void 0!==D.orig_p?D.orig_p:D.pos;var F=l+"Spike";t.spikeDistance=P(D)*v/y,t[F]=u.c2p(D.pos,!0);var B=k.boxmean||"sd"===k.sizemode||(k.meanline||{}).visible,j=k.boxpoints||k.points,N=j&&B?["max","uf","q3","med","mean","q1","lf","min"]:j&&!B?["max","uf","q3","med","q1","lf","min"]:!j&&B?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]<h.range[0];k.orientation===(U?"v":"h")&&N.reverse();for(var V=t.spikeDistance,q=t[F],H=[],G=0;G<N.length;G++){var W=N[G];if(W in D){var Z=D[W],Y=h.c2p(Z,!0),X=n.extendFlat({},t);X.attr=W,X[c+"0"]=X[c+"1"]=Y,X[c+"LabelVal"]=Z,X[c+"Label"]=(M.labels?M.labels[W]+" ":"")+r.hoverLabelText(h,Z,k[c+"hoverformat"]),X.hoverOnBox=!0,"mean"===W&&"sd"in D&&("sd"===k.boxmean||"sd"===k.sizemode)&&(X[c+"err"]=D.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,c=t.cd,u=t.xa,h=t.ya,f=c[0].trace,p=u.c2p(e),d=h.c2p(r),m=i.quadrature((function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.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<c.length;y++){s=c[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=c[g[0]]).pts[g[1]];var _=u.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,A=s.orig_p,k=void 0!==A?A:s.pos;return"h"===f.orientation?(T=h,a.xLabelVal=l.x,a.yLabelVal=k):(T=u,a.xLabelVal=k,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}}}),yo=p({"src/traces/box/event_data.js"(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}}}),vo=p({"src/traces/box/select.js"(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],c=a.c2p(l.x),u=o.c2p(l.y);e.contains([c,u],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}}}),xo=p({"src/traces/box/index.js"(t,e){e.exports={attributes:so(),layoutAttributes:lo(),supplyDefaults:co().supplyDefaults,crossTraceDefaults:co().crossTraceDefaults,supplyLayoutDefaults:uo().supplyLayoutDefaults,calc:ho(),crossTraceCalc:fo().crossTraceCalc,plot:po().plot,style:mo().style,styleOnSelect:mo().styleOnSelect,hoverPoints:go().hoverPoints,eventData:yo(),selectPoints:vo(),moduleType:"trace",name:"box",basePlotModule:Si(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}}),_o=p({"lib/box.js"(t,e){e.exports=xo()}}),bo=p({"src/traces/heatmap/attributes.js"(t,e){var r=Tn(),n=U(),i=F(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=Pe(),c=R().extendFlat;e.exports=c({z:{valType:"data_array",editType:"calc"},x:c({},r.x,{impliedEdits:{xtype:"array"}}),x0:c({},r.x0,{impliedEdits:{xtype:"scaled"}}),dx:c({},r.dx,{impliedEdits:{xtype:"scaled"}}),y:c({},r.y,{impliedEdits:{ytype:"array"}}),y0:c({},r.y0,{impliedEdits:{ytype:"scaled"}}),dy:c({},r.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:c({},r.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:c({},r.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:c({},r.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:c({},r.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:c({},r.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:c({},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:c({},n.showlegend,{dflt:!1}),zorder:r.zorder},l("",{cLetter:"z",autoColorDflt:!1}))}}),wo=p({"src/traces/heatmap/xyz_defaults.js"(t,e){var r=A(),n=le(),i=qt();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,c){var u,h,f=o("z");if(l=l||"x",c=c||"y",void 0===f||!f.length)return 0;if(n.isArray1D(f)){u=o(l),h=o(c);var p=n.minRowLength(u),d=n.minRowLength(h);if(0===p||0===d)return 0;e._length=Math.min(p,d,f.length)}else{if(u=a(l,o),h=a(c,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,c],s),!0}}}),To=p({"src/traces/heatmap/label_defaults.js"(t,e){var r=le();e.exports=function(t,e){t("texttemplate");var n=r.extendFlat({},e.font,{color:"auto",size:"auto"});r.coerceFont(t,"textfont",n)}}}),Ao=p({"src/traces/heatmap/style_defaults.js"(t,e){e.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}}}),ko=p({"src/traces/heatmap/defaults.js"(t,e){var r=le(),n=wo(),i=To(),a=Gn(),o=Ao(),s=qe(),l=bo();e.exports=function(t,e,c,u){function h(n,i){return r.coerce(t,e,l,n,i)}n(t,e,h,u)?(a(t,e,u,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),i(h,u),o(t,e,h,u),h("hoverongaps"),h("connectgaps",r.isArray1D(e.z)&&!1!==e.zsmooth),s(t,e,u,h,{prefix:"",cLetter:"z"}),h("zorder")):e.visible=!1}}}),Mo=p({"src/traces/histogram/bin_functions.js"(t,e){var r=A();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}}}}),So=p({"src/traces/histogram/norm_functions.js"(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}}}}),Eo=p({"src/traces/histogram/average.js"(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}}}),Co=p({"src/traces/histogram/bin_label_vals.js"(t,e){var r=k(),n=r.ONEAVGYEAR,i=r.ONEAVGMONTH,a=r.ONEDAY,o=r.ONEHOUR,s=r.ONEMIN,l=r.ONESEC,c=ir().tickIncrement;function u(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),c=p(r,o,s),u=t===n?0:1;return l[u]!==c[u]}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(u(d+f,d+p,i,o),u(m+f,m+p,i,o)),y=Math.min(u(d+h,d+f,i,o),u(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 u=i.d2c(a,0,o);if(u<e){var h=c(u,x,!1,o);(u+h)/2<e+t&&(u=h)}return r&&l?c(u,x,!0,o):u}}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}}}}),Io=p({"src/traces/histogram/calc.js"(t,e){var r=A(),n=le(),i=qt(),a=ir(),o=$a(),s=Mo(),l=So(),c=Eo(),u=Co();function h(t,e,o,s,l){var c,u,f,p,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,p)},T=function(t){return o.c2r(t,0,p)},A="date"===o.type?function(t){return t||0===t?n.cleanDate(t,null,p):null}:function(t){return r(t)?Number(t):null};function k(t,e,r){e[t+"Found"]?(e[t]=A(e[t]),null===e[t]&&(e[t]=r[t])):(m[t]=e[t]=r[t],n.nestedProperty(u[0],y+"."+t).set(r[t]))}if(e["_"+s+"autoBinFinished"])delete e["_"+s+"autoBinFinished"];else{u=_.traces;var M=[],S=!0,E=!1,C=!1;for(c=0;c<u.length;c++)if((f=u[c]).visible){var I=_.dirs[c];d=f["_"+I+"pos0"]=o.makeCalcdata(f,I),M=n.concat(M,d),delete f["_"+s+"autoBinFinished"],!0===e.visible&&(S?S=!1:(delete f._autoBin,f["_"+s+"autoBinFinished"]=1),i.traceIs(f,"2dMap")&&(E=!0),"histogram2dcontour"===f.type&&(C=!0))}p=u[0][s+"calendar"];var L=a.autoBin(M,o,_.nbins,E,p,_.sizeFound&&_.size),P=u[0]._autoBin={};if(m=P[_.dirs[0]]={},C&&(_.size||(L.start=T(a.tickIncrement(w(L.start),L.size,!0,p))),void 0===_.end&&(L.end=T(a.tickIncrement(w(L.end),L.size,!1,p)))),b&&!i.traceIs(e,"2dMap")&&0===L._dataSpan&&"category"!==o.type&&"multicategory"!==o.type&&""===e.bingroup&&typeof e.xbins>"u"){if(l)return[L,d,!0];L=function(t,e,r,i,a){var o,s,l,c=t._fullLayout,u=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),f=!1,p=1/0,d=[e];for(o=0;o<u.length;o++)if((s=u[o])===e)f=!0;else if(f){var m=h(t,s,r,i,!0),g=m[0],y=m[2];s["_"+i+"autoBinFinished"]=1,s["_"+i+"pos0"]=m[1],y?d.push(s):p=Math.min(p,g.size)}else l=c._histogramBinOpts[s["_"+i+"bingroup"]],p=Math.min(p,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(p)||(p=n.distinctVals(v).minDiff),o=0;o<d.length;o++){var b=(s=d[o])[i+"calendar"],w={start:r.c2r(v[o]-p/2,0,b),end:r.c2r(v[o]+p/2,0,b),size:p};s._input[a]=s[a]=w,(l=c._histogramBinOpts[s["_"+i+"bingroup"]])&&n.extendFlat(l,w)}return e[a]}(t,e,o,s,y)}(g=f.cumulative||{}).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?L.start=T(a.tickIncrement(w(L.start),L.size,!0,p)):L.end=T(a.tickIncrement(w(L.end),L.size,!1,p))),_.size=L.size,_.sizeFound||(m.size=L.size,n.nestedProperty(u[0],y+".size").set(L.size)),k("start",_,L),k("end",_,L)}d=e["_"+s+"pos0"],delete e["_"+s+"pos0"];var z=e._input[y]||{},D=n.extendFlat({},_),O=_.start,R=o.r2l(z.start),F=void 0!==R;if((_.startFound||F)&&R!==o.r2l(O)){var B=F?R:n.aggNums(Math.min,null,d),j={type:"category"===o.type||"multicategory"===o.type?"linear":o.type,r2l:o.r2l,dtick:_.size,tick0:O,calendar:p,range:[B,a.tickIncrement(B,_.size,!1,p)].map(o.l2r)},N=a.tickFirst(j);N>o.r2l(B)&&(N=a.tickIncrement(N,_.size,!0,p)),D.start=o.l2r(N),F||n.nestedProperty(e,y+".start").set(D.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);D.end=o.l2r(H),q||n.nestedProperty(e,y+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=n.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var i,f,p,d,m=[],g=[],y="h"===e.orientation,v=a.getFromId(t,y?e.yaxis:e.xaxis),x=y?"y":"x",_={x:"y",y:"x"}[x],b=e[x+"calendar"],w=e.cumulative,T=h(t,e,v,x),A=T[0],k=T[1],M="string"==typeof A.size,S=[],E=M?S:A,C=[],I=[],L=[],P=0,z=e.histnorm,D=e.histfunc,O=-1!==z.indexOf("density");w.enabled&&O&&(z=z.replace(/ ?density$/,""),O=!1);var R,F="max"===D||"min"===D?null:0,B=s.count,j=l[z],N=!1,U=function(t){return v.r2c(t,0,b)};for(n.isArrayOrTypedArray(e[_])&&"count"!==D&&(R=e[_],N="avg"===D,B=s[D]),i=U(A.start),p=U(A.end)+(i-a.tickIncrement(i,A.size,!1,b))/1e6;i<p&&m.length<1e6&&(f=a.tickIncrement(i,A.size,!1,b),m.push((i+f)/2),g.push(F),L.push([]),S.push(i),O&&C.push(1/(f-i)),N&&I.push(0),!(f<=i));)i=f;S.push(i),!M&&"date"===v.type&&(E={start:U(E.start),end:U(E.end),size:E.size}),t._fullLayout._roundFnOpts||(t._fullLayout._roundFnOpts={});var V=e["_"+x+"bingroup"],q={leftGap:1/0,rightGap:1/0};V&&(t._fullLayout._roundFnOpts[V]||(t._fullLayout._roundFnOpts[V]=q),q=t._fullLayout._roundFnOpts[V]);var H,G=g.length,W=!0,Z=q.leftGap,Y=q.rightGap,X={};for(i=0;i<k.length;i++){var $=k[i];(d=n.findBin($,E))>=0&&d<G&&(P+=B(d,i,g,R,I),W&&L[d].length&&$!==k[L[d][0]]&&(W=!1),L[d].push(i),X[i]=d,Z=Math.min(Z,$-S[d]),Y=Math.min(Y,S[d+1]-$))}q.leftGap=Z,q.rightGap=Y,W||(H=function(e,r){return function(){var n=t._fullLayout._roundFnOpts[V];return u(n.leftGap,n.rightGap,S,v,b)(e,r)}}),N&&(P=c(g,I)),j&&j(g,P,C),w.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())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,tt=K-1;for(i=0;i<K;i++)if(g[i]){Q=i;break}for(i=K-1;i>=Q;i--)if(g[i]){tt=i;break}for(i=Q;i<=tt;i++)if(r(m[i])&&r(g[i])){var et={p:m[i],s:g[i],b:0};w.enabled||(et.pts=L[i],W?et.ph0=et.ph1=L[i].length?k[L[i][0]]:m[i]:(e._computePh=!0,et.ph0=H(S[i]),et.ph1=H(S[i+1],!0))),J.push(et)}return 1===J.length&&(J[0].width1=a.tickIncrement(J[0].p,A.size,!1,b)-J[0].p),o(J,e),n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(J,e,X),J},calcAllAutoBins:h}}}),Lo=p({"src/traces/histogram2d/calc.js"(t,e){var r=le(),n=ir(),i=Mo(),a=So(),o=Eo(),s=Co(),l=Io().calcAllAutoBins;function c(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 u(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,c=new Array(l),u=s(r,n,t,i,a);for(o=0;o<l;o++){var h=(e||[])[o];c[o]=void 0===h?[u(t[o]),u(t[o+1],!0)]:[h,h]}return c}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],A=l(t,e,g,"y"),k=A[0],M=A[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 k.size,z=[],D=[],O=L?z:w,R=P?D:k,F=0,B=[],j=[],N=e.histnorm,U=e.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[N],W=!1,Z=[],Y=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(W="avg"===U,H=i[U]);var $=w.size,K=x(w.start),J=x(w.end)+(K-n.tickIncrement(K,$,!1,y))/1e6;for(s=K;s<J;s=n.tickIncrement(s,$,!1,y))C.push(q),z.push(s),W&&I.push(0);z.push(s);var Q,tt=C.length,et=(s-K)/tt,rt=(Q=K+et/2,m.c2r(Q,0,y)),nt=k.size,it=_(k.start),at=_(k.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()),D.push(s);var ot=new Array(tt);for(f=0;f<tt;f++)ot[f]=[];j.push(ot),W&&B.push(I.slice())}D.push(s);var st=E.length,lt=(s-it)/st,ct=function(t){return g.c2r(t,0,v)}(it+lt/2);V&&(Z=c(C.length,O,et,L),Y=c(E.length,R,lt,P)),!L&&"date"===m.type&&(O=u(x,O)),!P&&"date"===g.type&&(R=u(_,R));var ut=!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,O),d=r.findBin(xt,R),p>=0&&p<tt&&d>=0&&d<st&&(F+=H(p,s,E[d],X,B[d]),j[d][p].push(s),ut&&(void 0===ft[p]?ft[p]=vt:ft[p]!==vt&&(ut=!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-D[d]),yt=Math.min(yt,D[d+1]-xt))}if(W)for(d=0;d<st;d++)F+=o(E[d],B[d]);if(G)for(d=0;d<st;d++)G(E[d],F,Z,Y[d]);return{x:T,xRanges:h(z,ut&&ft,dt,mt,m,y),x0:rt,dx:et,y:M,yRanges:h(D,ht&&pt,gt,yt,g,v),y0:ct,dy:lt,z:E,pts:j}}}}),Po=p({"src/traces/heatmap/convert_column_xyz.js"(t,e){var r=le(),n=k().BADNUM,i=ri();e.exports=function(t,e,a,o,s,l){var c=t._length,u=e.makeCalcdata(t,o),h=a.makeCalcdata(t,s);u=i(t,e,o,u).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(u),b=_.vals,w=r.distinctVals(h),T=w.vals,A=[],k=T.length,M=b.length;for(f=0;f<l.length;f++)A[f]=r.init2dArray(k,M);y&&(d=r.init2dArray(k,M)),x&&(m=r.init2dArray(k,M));var S=r.init2dArray(k,M);for(f=0;f<c;f++)if(u[f]!==n&&h[f]!==n){var E=r.findBin(u[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]];A[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]]=A[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}}}),zo=p({"src/traces/heatmap/clean_2d_array.js"(t,e){var r=A(),n=le(),i=k().BADNUM;e.exports=function(t,e,a,o){var s,l,c,u,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;c=function(t){return t.length},u=function(t,e,r){return(t[r]||[])[e]}}else s=t.length,c=function(t,e){return t[e].length},u=function(t,e,r){return(t[e]||[])[r]};function d(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 m=d(a),g=d(o);o&&"category"===o.type&&(s=o._categories.length);var y,v,x,_=new Array(s);for(h=0;h<s;h++)for(l=a&&"category"===a.type?a._categories.length:c(t,h),_[h]=new Array(l),f=0;f<l;f++)_[h][f]=p((y=t,v=g(h),x=m(f),v===i||x===i?i:u(y,v,x)));return _}}}),Do=p({"src/traces/heatmap/interp2d.js"(t,e){var r=le(),n=[[-1,0],[1,0],[0,-1],[0,1]];function i(t,e,r){var i,a,o,s,l,c,u,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++)(u=t[a+(c=n[l])[0]])&&void 0!==(h=u[o+c[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,a,o=1;for(i(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=i(t,e,(a=o,.5-.25*Math.min(1,.5*a)));return o>.01&&r.log("interp2d didn't converge quickly",o),t}}}),Oo=p({"src/traces/heatmap/find_empties.js"(t,e){var r=le().maxRowLength;e.exports=function(t){var e,n,i,a,o,s,l,c,u=[],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]),u.push([n,i,s])):f.push([n,i]));for(;f.length;){for(l={},c=!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),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}}}),Ro=p({"src/traces/heatmap/make_bound_array.js"(t,e){var r=qt(),n=le().isArrayOrTypedArray;e.exports=function(t,e,i,a,o,s){var l,c,u,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)],u=1;u<d;u++)h.push(Math.sqrt(e[u-1]*e[u]));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]],u=1;u<d;u++)h.push(.5*(e[u-1]+e[u]));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],u=d;u<o;u++)g*=m,h.push(g);else for(m=g-h[h.length-2],u=d;u<o;u++)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),c=a||1,u=f?0:-.5;u<o;u++)h.push(l+c*u)}return h}}}),Fo=p({"src/traces/heatmap/calc.js"(t,e){var r=qt(),n=le(),i=ir(),a=ri(),o=Lo(),s=We(),l=Po(),c=zo(),u=Do(),h=Oo(),f=Ro(),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,A,k,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=(k=o(t,e)).orig_x,m=k.x,g=k.x0,y=k.dx,w=k.orig_y,x=k.y,_=k.y0,b=k.dy,T=k.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=c(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(A=0;A<t.length-1;A++)if(Math.abs(t[A+1]-t[A]-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),u(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 D=n.maxRowLength(T),O="scaled"===e.xtype?"":m,R=f(e,O,g,y,D,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 j={x:R,y:B,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&v&&(j.orig_x=v),e.yperiodalignment&&w&&(j.orig_y=w),O&&O.length===R.length-1&&(j.xCenter=O),F&&F.length===B.length-1&&(j.yCenter=F),C&&(j.xRanges=k.xRanges,j.yRanges=k.yRanges,j.pts=k.pts),E||s(t,e,{vals:T,cLetter:"z"}),E&&e.contours&&"heatmap"===e.contours.coloring){var N={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=f(N,O,g,y,D,M),j.yfill=f(N,F,_,b,T.length,S)}return[j]}}}),Bo=p({"src/constants/pixelated_image.js"(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("")}}),jo=p({"src/lib/supports_pixelated_image.js"(t,e){var r=Bo(),n=Qe(),i=le(),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}}}),No=p({"src/traces/heatmap/plot.js"(t,e){var r=x(),n=O(),i=qt(),a=Qe(),o=ir(),s=le(),l=Se(),c=di(),u=H(),h=Ze().extractOpts,f=Ze().makeColorScaleFuncFromTrace,p=ke(),d=Me().LINE_SPACING,m=jo(),g=Bo().STYLE,y="heatmap-label";function v(t){return t.selectAll("g."+y)}function _(t){v(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),c=Math.abs(o-l);return o&&o!==r&&c?{bin0:l,frac:c,bin1:Math.round(l+c/(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,x,A){var k=e.xaxis,M=e.yaxis;s.makeTraceGroups(A,x,"hm").each((function(e){var x,A,S,E,C,I,L,P,z=r.select(this),D=e[0],O=D.trace,R=O.xgap||0,F=O.ygap||0,B=D.z,j=D.x,N=D.y,U=D.xCenter,V=D.yCenter,q=i.traceIs(O,"contour"),H=q?"best":O.zsmooth,G=B.length,W=s.maxRowLength(B),Z=!1,Y=!1;for(I=0;void 0===x&&I<j.length-1;)x=k.c2p(j[I]),I++;for(I=j.length-1;void 0===A&&I>0;)A=k.c2p(j[I]),I--;for(A<x&&(S=A,A=x,x=S,Z=!0),I=0;void 0===E&&I<N.length-1;)E=M.c2p(N[I]),I++;for(I=N.length-1;void 0===C&&I>0;)C=M.c2p(N[I]),I--;C<E&&(S=E,E=C,C=S,Y=!0),q&&(U=j,V=N,j=D.xfill,N=D.yfill);var X="default";if(H?X="best"===H?"smooth":"fast":O._islinear&&0===R&&0===F&&m()&&(X="fast"),"fast"!==X){var $="best"===H?0:.5;x=Math.max(-$*k._length,x),A=Math.min((1+$)*k._length,A),E=Math.max(-$*M._length,E),C=Math.min((1+$)*M._length,C)}var K,J,Q=Math.round(A-x),tt=Math.round(C-E);if(x>=k._length||A<=0||E>=M._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void _(z);"fast"===X?(K=W,J=G):(K=Q,J=tt);var et=document.createElement("canvas");et.width=K,et.height=J;var rt,nt,it=et.getContext("2d",{willReadFrequently:!0}),at=f(O,{noNumericCheck:!0,returnArray:!0});"fast"===X?(rt=Z?function(t){return W-1-t}:s.identity,nt=Y?function(t){return G-1-t}:s.identity):(rt=function(t){return s.constrain(Math.round(k.c2p(j[t])-x),0,Q)},nt=function(t){return s.constrain(Math.round(M.c2p(N[t])-E),0,tt)});var ot,st,lt,ct,ut=nt(0),ht=[ut,ut],ft=Z?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],c=o-i||0,u=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*c+n.frac*(u+r.frac*a))}if("default"!==X){var _t,bt=0;try{_t=new Uint8Array(K*J*4)}catch{_t=new Array(K*J*4)}if("smooth"===X){var wt,Tt,At,kt=U||j,Mt=V||N,St=new Array(kt.length),Et=new Array(Mt.length),Ct=new Array(Q),It=U?w:b,Lt=V?w:b;for(I=0;I<kt.length;I++)St[I]=Math.round(k.c2p(kt[I])-x);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],At=B[wt.bin1],I=0;I<Q;I++,bt+=4)T(_t,bt,ct=xt(Tt,At,Ct[I],wt))}else for(L=0;L<G;L++)for(lt=B[L],ht=nt(L),I=0;I<W;I++)ct=vt(lt[I],1),T(_t,bt=4*(ht*W+rt(I)),ct);var Pt=it.createImageData(K,J);try{Pt.data.set(_t)}catch{var zt=Pt.data,Dt=zt.length;for(L=0;L<Dt;L++)zt[L]=_t[L]}it.putImageData(Pt,0,0)}else{var Ot=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<W;I++)ot.reverse(),ot[ft]=rt(I+1),ot[0]!==ot[1]&&void 0!==ot[0]&&void 0!==ot[1]&&(ct=vt(lt[I],(ot[1]-ot[0])*(ht[1]-ht[0])),it.fillStyle="rgba("+ct.join(",")+")",it.fillRect(ot[0]+Ot,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,y:E,"xlink:href":et.toDataURL("image/png")}),"fast"===X&&!H&&Bt.attr("style",g),_(z);var jt=O.texttemplate;if(jt){var Nt=h(O),Ut={type:"linear",range:[Nt.min,Nt.max],_separators:k._separators,_numFormat:k._numFormat},Vt="histogram2dcontour"===O.type,qt="contour"===O.type,Ht=qt?G-1:G,Gt=qt?1:0,Wt=qt?W-1:W,Zt=[];for(I=qt?1:0;I<Ht;I++){var Yt;if(qt)Yt=D.y[I];else if(Vt){if(0===I||I===G-1)continue;Yt=D.y[I]}else if(D.yCenter)Yt=D.yCenter[I];else{if(I+1===G&&void 0===D.y[I+1])continue;Yt=(D.y[I]+D.y[I+1])/2}var Xt=Math.round(M.c2p(Yt));if(!(0>Xt||Xt>M._length))for(L=Gt;L<Wt;L++){var $t;if(qt)$t=D.x[L];else if(Vt){if(0===L||L===W-1)continue;$t=D.x[L]}else if(D.xCenter)$t=D.xCenter[L];else{if(L+1===W&&void 0===D.x[L+1])continue;$t=(D.x[L]+D.x[L+1])/2}var Kt=Math.round(k.c2p($t));if(!(0>Kt||Kt>k._length)){var Jt=c({x:$t,y:Yt},O,t._fullLayout);Jt.x=$t,Jt.y=Yt;var Qt=D.z[I][L];void 0===Qt?(Jt.z="",Jt.zLabel=""):(Jt.z=Qt,Jt.zLabel=o.tickText(Ut,Qt,"hover").text);var te=D.text&&D.text[I]&&D.text[I][L];(void 0===te||!1===te)&&(te=""),Jt.text=te;var ee=s.texttemplateString(jt,Jt,t._fullLayout._d3locale,Jt,O._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);Zt.push({l:ne,c:ie,t:ee,x:Kt,y:Xt,z:Qt})}}}}var ae=O.textfont,oe=ae.size,se=t._fullLayout.font.size;if(!oe||"auto"===oe){var le=1/0,ce=1/0,ue=0,he=0;for(P=0;P<Zt.length;P++){var fe=Zt[P];if(ue=Math.max(ue,fe.l),he=Math.max(he,fe.c),P<Zt.length-1){var pe=Zt[P+1],de=Math.abs(pe.x-fe.x),me=Math.abs(pe.y-fe.y);de&&(le=Math.min(le,de)),me&&(ce=Math.min(ce,me))}}isFinite(le)&&isFinite(ce)?(le-=R,ce-=F,le/=he,ce/=ue,le/=d/2,ce/=d,oe=Math.min(Math.floor(le),Math.floor(ce),se)):oe=se}if(oe<=0||!isFinite(oe))return;v(z).data(Zt).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=u.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)}))}}))}}}),Uo=p({"src/traces/heatmap/colorbar.js"(t,e){e.exports={min:"zmin",max:"zmax"}}}),Vo=p({"src/traces/heatmap/style.js"(t,e){var r=x();e.exports=function(t){r.select(t).selectAll(".hm image").style("opacity",(function(t){return t.trace.opacity}))}}}),qo=p({"src/traces/heatmap/hover.js"(t,e){var r=Dr(),n=le(),i=n.isArrayOrTypedArray,a=ir(),o=Ze().extractOpts;e.exports=function(t,e,s,l,c){c||(c={});var u,h,f,p,d=c.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,A=m.zmask,k=g.zhoverformat,M=x,S=_;if(!1!==t.index){try{f=Math.round(t.index[1]),p=Math.round(t.index[0])}catch{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]),D=v.c2p(_[p+1]);d?(C=m.orig_x||x,I=m.orig_y||_,P=L,u=C[f],D=z,h=I[p]):(C=m.orig_x||w||x,I=m.orig_y||T||_,u=w?C[f]:(C[f]+C[f+1])/2,h=T?I[p]:(I[p]+I[p+1])/2,y&&"category"===y.type&&(u=x[f]),v&&"category"===v.type&&(h=_[p]),g.zsmooth&&(L=P=y.c2p(u),z=D=v.c2p(h)));var O=b[p][f];if(A&&!A[p][f]&&(O=void 0),void 0!==O||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:k,_separators:y._separators,_numFormat:y._numFormat},j=a.tickText(B,O,"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:D,xLabelVal:u,yLabelVal:h,zLabelVal:O,zLabel:j,text:R})]}}}}),Ho=p({"src/traces/heatmap/index.js"(t,e){e.exports={attributes:bo(),supplyDefaults:ko(),calc:Fo(),plot:No(),colorbar:Uo(),style:Vo(),hoverPoints:qo(),moduleType:"trace",name:"heatmap",basePlotModule:Si(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}}),Go=p({"lib/heatmap.js"(t,e){e.exports=Ho()}}),Wo=p({"src/traces/histogram/bin_attributes.js"(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"}}}}),Zo=p({"src/traces/histogram/constants.js"(t,e){e.exports={eventDataKeys:["binNumber"]}}}),Yo=p({"src/traces/histogram/attributes.js"(t,e){var r=Ga(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Ot().texttemplateAttrs,o=F(),s=Wo(),l=Zo(),c=R().extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:n("x"),yhoverformat:n("y"),text:c({},r.text,{}),hovertext:c({},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:c({},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}}}),Xo=p({"src/traces/histogram/defaults.js"(t,e){var r=qt(),n=le(),i=H(),a=Ya().handleText,o=Za(),s=Yo();e.exports=function(t,e,l,c){function u(r,i){return n.coerce(t,e,s,r,i)}var h=u("x"),f=u("y");u("cumulative.enabled")&&(u("cumulative.direction"),u("cumulative.currentbin")),u("text");var p=u("textposition");a(t,e,c,u,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u("hovertext"),u("hovertemplate"),u("xhoverformat"),u("yhoverformat");var d=u("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"],c),e[g]&&u("histfunc"),u("histnorm"),u("autobin"+m),o(t,e,u,l,c),n.coerceSelectionMarkerOpacity(e,u);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"}),u("zorder")}else e.visible=!1}}}),$o=p({"src/traces/histogram/cross_trace_defaults.js"(t,e){var r=le(),n=xe(),i=qt().traceIs,a=Qn(),o=Ya().validateCornerradius,s=r.nestedProperty,l=rn().getAxisGroup,c=[{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"}],u=["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 A(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"]||"",c=v[i],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(i=o,s!==c.axType&&r.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&r.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(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 k=w("marker.cornerradius",e.barcornerradius);h.marker&&(h.marker.cornerradius=o(k))}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,A(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=u[y])+"bingroup",L?L+"__"+d:null);A(h,P,d)}else A(h,L,T(h))}for(p in v){var z=v[p];for(f=z.traces,g=0;g<c.length;g++){var D,O,R=c[g],F=R.name;if("nbins"!==F||!z.sizeFound){for(m=0;m<f.length;m++){if(h=f[m],d=z.dirs[m],D=R.aStr[d],void 0!==s(h._input,D).get()){z[F]=w(D),z[F+"Found"]=!0;break}(O=(h._autoBin||{})[d]||{})[F]&&s(h,D).set(O[F])}if("start"===F||"end"===F)for(;m<f.length;m++)(h=f[m])["_"+d+"bingroup"]&&w(D,(O=(h._autoBin||{})[d]||{})[F]);"nbins"===F&&!z.sizeFound&&!z.nbinsFound&&(h=f[0],z[F]=w(D))}}}}}}),Ko=p({"src/traces/histogram/hover.js"(t,e){var r=ro().hoverPoints,n=ir().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],c=t.cd[0].trace;if(!c.cumulative.enabled){var u="h"===c.orientation?"y":"x";t[u+"Label"]=n(t[u+"a"],[l.ph0,l.ph1],c[u+"hoverformat"])}return s}}}}),Jo=p({"src/traces/histogram/event_data.js"(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}}}),Qo=p({"src/traces/histogram/index.js"(t,e){e.exports={attributes:Yo(),layoutAttributes:Wa(),supplyDefaults:Xo(),crossTraceDefaults:$o(),supplyLayoutDefaults:Xa(),calc:Io().calc,crossTraceCalc:li().crossTraceCalc,plot:eo().plot,layerName:"barlayer",style:to().style,styleOnSelect:to().styleOnSelect,colorbar:pi(),hoverPoints:Ko(),selectPoints:io(),eventData:Jo(),moduleType:"trace",name:"histogram",basePlotModule:Si(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}}),ts=p({"lib/histogram.js"(t,e){e.exports=Qo()}}),es=p({"src/traces/histogram2d/attributes.js"(t,e){var r=Yo(),n=Wo(),i=bo(),a=U(),o=Ce().axisHoverFormat,s=Ot().hovertemplateAttrs,l=Ot().texttemplateAttrs,c=Pe(),u=R().extendFlat;e.exports=u({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:u({},r.bingroup,{}),xbingroup:u({},r.bingroup,{}),ybingroup:u({},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:u({},a.showlegend,{dflt:!1})},c("",{cLetter:"z",autoColorDflt:!1}))}}),rs=p({"src/traces/histogram2d/sample_defaults.js"(t,e){var r=qt(),n=le();e.exports=function(t,e,i,a){var o=i("x"),s=i("y"),l=n.minRowLength(o),c=n.minRowLength(s);l&&c?(e._length=Math.min(l,c),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}}}),ns=p({"src/traces/histogram2d/defaults.js"(t,e){var r=le(),n=rs(),i=Ao(),a=qe(),o=To(),s=es();e.exports=function(t,e,l,c){function u(n,i){return r.coerce(t,e,s,n,i)}n(t,e,u,c),!1!==e.visible&&(i(t,e,u,c),a(t,e,c,u,{prefix:"",cLetter:"z"}),u("hovertemplate"),o(u,c),u("xhoverformat"),u("yhoverformat"))}}}),is=p({"src/traces/histogram2d/hover.js"(t,e){var r=qo(),n=ir().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,c=l[0],u=l[1],h=t.cd[0],f=h.trace,p=h.xRanges[u],d=h.yRanges[c];return t.xLabel=n(t.xa,[p[0],p[1]],f.xhoverformat),t.yLabel=n(t.ya,[d[0],d[1]],f.yhoverformat),s}}}}),as=p({"src/traces/histogram2d/index.js"(t,e){e.exports={attributes:es(),supplyDefaults:ns(),crossTraceDefaults:$o(),calc:Fo(),plot:No(),layerName:"heatmaplayer",colorbar:Uo(),style:Vo(),hoverPoints:is(),eventData:Jo(),moduleType:"trace",name:"histogram2d",basePlotModule:Si(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}}),os=p({"lib/histogram2d.js"(t,e){e.exports=as()}}),ss=p({"src/constants/filter_ops.js"(t,e){e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ls=p({"src/traces/contour/attributes.js"(t,e){var r=bo(),n=Tn(),i=Ce(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Pe(),l=zt().dash,c=F(),u=R().extendFlat,h=ss(),f=h.COMPARISON_OPS2,p=h.INTERVAL_OPS,d=n.line;e.exports=u({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:u({},r.texttemplate,{}),textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},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:c({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:u({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},d.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),cs=p({"src/traces/histogram2dcontour/attributes.js"(t,e){var r=es(),n=ls(),i=Pe(),a=Ce().axisHoverFormat,o=R().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"}))}}),us=p({"src/traces/contour/contours_defaults.js"(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")}}}),hs=p({"src/traces/contour/label_defaults.js"(t,e){var r=le();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")}}}),fs=p({"src/traces/contour/style_defaults.js"(t,e){var r=qe(),n=hs();e.exports=function(t,e,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=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,c,o)}}}),ps=p({"src/traces/histogram2dcontour/defaults.js"(t,e){var r=le(),n=rs(),i=us(),a=fs(),o=To(),s=cs();e.exports=function(t,e,l,c){function u(n,i){return r.coerce(t,e,s,n,i)}n(t,e,u,c),!1!==e.visible&&(i(t,e,u,(function(n){return r.coerce2(t,e,s,n)})),a(t,e,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),e.contours&&"heatmap"===e.contours.coloring&&o(u,c))}}}),ds=p({"src/traces/contour/set_contours.js"(t,e){var r=ir(),n=le();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 c,u=a.start,h=a.end,f=t._input.contours;u>h&&(a.start=f.start=h,h=a.end=f.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,t.ncontours).dtick,f.size=a.size=c)}}}}),ms=p({"src/traces/contour/end_plus.js"(t,e){e.exports=function(t){return t.end+t.size/1e6}}}),gs=p({"src/traces/contour/calc.js"(t,e){var r=Ze(),n=Fo(),i=ds(),a=ms();e.exports=function(t,e){var o=n(t,e),s=o[0].z;i(e,s);var l,c=e.contours,u=r.extractOpts(e);if("heatmap"===c.coloring&&u.auto&&!1===e.autocontour){var h=c.start,f=a(c),p=c.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}}}),ys=p({"src/traces/contour/constants.js"(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}}}}),vs=p({"src/traces/contour/make_crossings.js"(t,e){var r=ys();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,c,u,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++)(c=n((u=t[h]).level,l))&&(u.crossings[s]=c,-1!==a.indexOf(c)&&(u.starts.push([e,i]),m&&-1!==a.indexOf(c,a.indexOf(c)+1)&&u.starts.push([e,i])))}}}),xs=p({"src/traces/contour/find_all_paths.js"(t,e){var r=le(),n=ys();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,c){var u,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(u=0;u<1e4;u++){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,c)&&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===u&&r.log("Infinite loop in contour?");var _,b,w,T,A,k,M,S,E,C,I,L=i(d[0],d[d.length-1],l,c),P=0,z=.2*t.smoothing,D=[],O=0;for(u=1;u<d.length;u++)P+=M=a(d[u],d[u-1]),D.push(M);var R=P/D.length*z;function F(t){return d[t%d.length]}for(u=d.length-2;u>=O;u--)if((_=D[u])<R){for(w=0,b=u-1;b>=O&&_+D[b]<R;b--)_+=D[b];if(L&&u===d.length-2)for(w=0;w<b&&_+D[w]<R;w++)_+=D[w];A=u-b+w+1,k=Math.floor((u+b+w+2)/2),T=L||u!==d.length-2?L||-1!==b?A%2?F(k):[(F(k)[0]+F(k+1)[0])/2,(F(k)[1]+F(k+1)[1])/2]:d[0]:d[d.length-1],d.splice(b+1,u-b+1,T),u=b+1,w&&(O=w),L&&(u===d.length-2?d[w]=d[d.length-1]:0===u&&(d[d.length-1]=d[0]))}for(d.splice(0,O),u=0;u<d.length;u++)d[u].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,c)){d.pop(),B=!0;var j=!1;for(E=0;E<t.edgepaths.length;E++)if(i((I=t.edgepaths[E])[I.length-1],d[0],l,c)){j=!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}j||(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,c)&&(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),c=(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(c),!0),s.c2p(t.y[i],!0),n+l,i]}var u=(t.level-a)/(t.z[i+1][n]-a),h=(1!==u?(1-u)*s.c2l(t.y[i]):0)+(0!==u?u*s.c2l(t.y[i+1]):0);return[o.c2p(t.x[n],!0),s.c2p(s.l2c(h),!0),n,i+u]}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?")}}}}),_s=p({"src/traces/contour/constraint_mapping.js"(t,e){var r=ss(),n=A();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("=")}}}),bs=p({"src/traces/contour/empty_pathinfo.js"(t,e){var r=le(),n=_s(),i=ms();e.exports=function(t,e,a){for(var o="constraint"===t.type?n[t._operation](t.value):t,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y},f=o.start;f<c;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}}}),ws=p({"src/traces/contour/convert_to_constraints.js"(t,e){var r=le();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 c=s;s=l,l=c;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]}}}}),Ts=p({"src/traces/contour/close_boundaries.js"(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,c=-1/0,u=1/0;for(r=0;r<l;r++)u=Math.min(u,i[r][0]),u=Math.min(u,i[r][s-1]),c=Math.max(c,i[r][0]),c=Math.max(c,i[r][s-1]);for(r=1;r<s-1;r++)u=Math.min(u,i[0][r]),u=Math.min(u,i[l-1][r]),c=Math.max(c,i[0][r]),c=Math.max(c,i[l-1][r]);var h,f,p=e.value;switch(e._operation){case">":p>c&&(n.prefixBoundary=!0);break;case"<":(p<u||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"[]":h=Math.min(p[0],p[1]),((f=Math.max(p[0],p[1]))<u||h>c||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),h<u&&f>c&&(n.prefixBoundary=!0)}}}}}),As=p({"src/traces/contour/plot.js"(t){var e=x(),r=le(),n=Qe(),i=Ze(),a=Se(),o=ir(),s=er(),l=No(),c=vs(),u=xs(),h=bs(),f=ws(),p=Ts(),d=ys(),m=d.LABELOPTIMIZER;function g(t,e){var i,a,o,s,l,c,u,h="",f=0,p=t.edgepaths.map((function(t,e){return e})),d=!0;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(;p.length;){for(c=n.smoothopen(t.edgepaths[f],t.smoothing),h+=d?c:c.replace(/^M/,"L"),p.splice(p.indexOf(f),1),i=t.edgepaths[f][t.edgepaths[f].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",f,t);break}for(u=i,Math.abs(u[1]-e[0][1])<.01&&!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;h+="L"+a}if(s===t.edgepaths.length){r.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;f<t.paths.length;f++)h+=n.smoothclosed(t.paths[f],t.smoothing);return h}function y(t,e,n,i){var a=e.width/2,o=e.height/2,s=t.x,l=t.y,c=t.theta,u=Math.cos(c)*a,h=Math.sin(c)*a,f=(s>i.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=m.EDGECOST*(1/(f-1)+1/(p-1));d+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,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,A=2*r.segmentDistance(g,y,v,x,b.x-w,b.y-T,b.x+w,b.y+T)/(e.height+b.height),k=b.level===e.level,M=k?m.SAMELEVELDISTANCE:1;if(A<=M)return 1/0;d+=m.NEIGHBORCOST*(k?m.SAMELEVELFACTOR:1)/(A-M)}return d}function v(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),x=o[0],_=x.trace,b=x.x,w=x.y,T=_.contours,A=h(T,a,x),k=r.ensureSingle(s,"g","heatmapcoloring"),M=[];"heatmap"===T.coloring&&(M=[o]),l(i,a,M,k),c(A),u(A);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=A;"constraint"===T.type&&(P=f(A,T._operation)),function(t,e,n){var i=r.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"===n.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.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").selectAll("path").data(o?n:[]);l.enter().append("path"),l.exit().remove(),l.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 c=o._context.staticPlot,u=r.ensureSingle(i,"g","contourlines"),h=!1!==l.showlines,f=l.showlabels,p=h&&f,m=t.createLines(u,h||f,a,c),g=t.createLineClip(u,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,A=w._length,k=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),A),D=Math.max(T.c2p(L,!0),0),O=Math.min(T.c2p(I,!0),k),R={};M[0]<M[1]?(R.left=P,R.right=z):(R.left=z,R.right=P),S[0]<S[1]?(R.top=D,R.bottom=O):(R.top=O,R.bottom=D),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(A*A+k*k),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=r.getVisibleSegment(this,R,i.height/2);if(e&&!(e.len<(i.width+i.height)*d.LABELMIN))for(var n=Math.min(Math.ceil(e.len/B),d.LABELMAX),a=0;a<n;a++){var o=t.findBestTextLocation(this,e,i,x,R);if(!o)break;t.addLabelData(o,i,x,v)}}))})),b.remove(),t.drawLabels(y,x,o,g,p?v:null)}f&&!h&&m.remove()}(s,A,i,x,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:v(a),smoothing:0};c([d]),u([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,x,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,c={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(l.labelformat)c.tickformat=l.labelformat,s(c,n);else{var u=i.extractOpts(a);if(u&&u.colorbar&&u.colorbar._axis)c=u.colorbar._axis;else{if("constraint"===l.type){var h=l.value;r.isArrayOrTypedArray(h)?c.range=[h[0],h[h.length-1]]:c.range=[h,h]}else c.range=[l.start,l.end],c.nticks=(l.end-l.start)/l.size;c.range[0]===c.range[1]&&(c.range[1]+=c.range[0]||1),c.nticks||(c.nticks=1e3),s(c,n),o.prepTicks(c),c._tmin=null,c._tmax=null}}return function(t){return o.tickText(c,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,c,u,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,u=g,c=d)}if(f>2*m.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=m.MAXCOST)return u},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,c=t.theta,u=Math.sin(c),h=Math.cos(c),f=function(t,e){return[s+t*h-e*u,l+t*u+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:c,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 c="",u=0;u<s.length;u++)c+="M"+s[u].join("L")+"Z";r.ensureSingle(o,"path","").attr("d",c)}}}}),ks=p({"src/traces/contour/make_color_map.js"(t,e){var r=x(),n=Ze(),i=ms();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,c="lines"===e.coloring?0:1,u=n.extractOpts(t);isFinite(s)||(s=1,l=1);var h,f,p=u.reversescale?n.flipScale(u.colorscale):u.colorscale,d=p.length,m=new Array(d),g=new Array(d),y=u.min,v=u.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,c=0),f=0;f<d;f++)h=p[f],m[f]=(h[0]*(l+c-1)-c/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})}}}),Ms=p({"src/traces/contour/style.js"(t,e){var r=x(),n=Qe(),i=Vo(),a=ks();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,c=o.start,u="constraint"===o.type,h=!u&&"lines"===o.coloring,f=!u&&"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)})})),u)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=c),e.selectAll("g.contourbg path").style("fill",p(m-.5*l))}})),i(t)}}}),Ss=p({"src/traces/contour/colorbar.js"(t,e){var r=Ze(),n=ks(),i=ms();e.exports={min:"zmin",max:"zmax",calc:function(t,e,a){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=n(e,{isColorbar:!0});if("heatmap"===c){var h=r.extractOpts(e);a._fillgradient=h.reversescale?r.flipScale(h.colorscale):h.colorscale,a._zrange=[h.min,h.max]}else"fill"===c&&(a._fillcolor=u);a._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},a._levels={start:o.start,end:i(o),size:l}}}}}),Es=p({"src/traces/contour/hover.js"(t,e){var r=H(),n=qo();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}}}),Cs=p({"src/traces/histogram2dcontour/index.js"(t,e){e.exports={attributes:cs(),supplyDefaults:ps(),crossTraceDefaults:$o(),calc:gs(),plot:As().plot,layerName:"contourlayer",style:Ms(),colorbar:Ss(),hoverPoints:Es(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Si(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}}),Is=p({"lib/histogram2dcontour.js"(t,e){e.exports=Cs()}}),Ls=p({"src/traces/contour/constraint_defaults.js"(t,e){var r=A(),n=hs(),i=H(),a=i.addOpacity,o=i.opacity,s=ss(),l=le().isArrayOrTypedArray,c=s.CONSTRAINT_REDUCTION,u=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=c[y],function(t,e){var n;-1===u.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)}}}),Ps=p({"src/traces/contour/defaults.js"(t,e){var r=le(),n=wo(),i=Gn(),a=Ls(),o=us(),s=fs(),l=To(),c=ls();e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,c,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,u):(o(t,e,f,(function(n){return r.coerce2(t,e,c,n)})),s(t,e,f,h)),e.contours&&"heatmap"===e.contours.coloring&&l(f,h),f("zorder")}else e.visible=!1}}}),zs=p({"src/traces/contour/index.js"(t,e){e.exports={attributes:ls(),supplyDefaults:Ps(),calc:gs(),plot:As().plot,style:Ms(),colorbar:Ss(),hoverPoints:Es(),moduleType:"trace",name:"contour",basePlotModule:Si(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),Ds=p({"lib/contour.js"(t,e){e.exports=zs()}}),Os=p({"src/traces/scatterternary/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=wn(),a=Tn(),o=U(),s=Pe(),l=zt().dash,c=R().extendFlat,u=a.marker,h=a.line,f=u.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:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}}),Rs=p({"src/traces/scatterternary/defaults.js"(t,e){var r=le(),n=bn(),i=Ye(),a=Zn(),o=Yn(),s=Xn(),l=$n(),c=Kn(),u=Os();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,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&&(c(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}}}),Fs=p({"src/traces/scatterternary/format_labels.js"(t,e){var r=ir();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}}}),Bs=p({"src/traces/scatterternary/calc.js"(t,e){var r=A(),n=ni(),i=ii(),a=ai(),o=oi().calcMarkerSize,s=["a","b","c"],l={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var c,u,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(c=0;c<s.length;c++)if(!y[h=s[c]]){for(p=y[l[h][0]],d=y[l[h][1]],f=new Array(p.length),u=0;u<p.length;u++)f[u]=g-p[u]-d[u];y[h]=f}var x,_,b,w,T,A,k=e._length,M=new Array(k);for(c=0;c<k;c++)x=y.a[c],_=y.b[c],b=y.c[c],r(x)&&r(_)&&r(b)?(1!=(w=m/((x=+x)+(_=+_)+(b=+b)))&&(x*=w,_*=w,b*=w),A=x,T=b-_,M[c]={x:T,y:A,a:x,b:_,c:b},v&&(M[c].id=v[c])):M[c]={x:!1,y:!1};return o(e,k),n(t,e),i(M,e),a(M,e),M}}}),js=p({"src/traces/scatterternary/plot.js"(t,e){var r=fi();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"),c=0;c<n.length;c++){var u=n[c];u.length&&(u[0].trace._xA=a,u[0].trace._yA=o)}r(t,s,n,l)}}}),Ns=p({"src/traces/scatterternary/hover.js"(t,e){var r=yi();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,c=l*s/2,u=l-c;return o.x0=Math.max(Math.min(o.x0,u),c),o.x1=Math.max(Math.min(o.x1,u),c),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)}}}}),Us=p({"src/traces/scatterternary/event_data.js"(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}}}),Vs=p({"src/plots/ternary/ternary.js"(t,e){var r=x(),n=O(),i=qt(),a=le(),o=a.strTranslate,s=a._,l=H(),c=Qe(),u=er(),h=R().extendFlat,f=Ae(),p=ir(),d=fr(),m=Dr(),g=Or(),y=g.freeMode,v=g.rectMode,_=tr(),b=En().prepSelect,w=En().selectOnClick,T=En().clearOutline,A=En().clearSelectionsCache,k=ve();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),c.setClipUrl(e.layers.backplot,i,r),c.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,A=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*A-b,b-w-2*T],domain:[m-s/2,m+s/2],_id:"x"},u(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-A],domain:[g-f/2,g+f/2],_id:"y"},u(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var k=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,b-T-A],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+f*E],anchor:"free",position:0,_id:"y",_length:i});u(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[b-w-A,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(S,p.graphDiv._fullLayout),S.setScale();var C=p.caxis=h({},t.caxis,{range:[b-w-T,A],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+f*E],anchor:"free",position:0,_id:"y",_length:i});u(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 D=o(r+i/2,n)+"rotate(30)"+o(0,-M._offset);p.layers.aaxis.attr("transform",D),p.layers.agrid.attr("transform",D);var O=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);p.layers.caxis.attr("transform",O),p.layers.cgrid.attr("transform",O),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(),c.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 c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(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-c,"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-u,y:e.y0+e.h+.83*o.title.font.size+u,"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+u,y:e.y0+e.h+.83*l.title.font.size+u,"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",c=function(t){return t.ticks+String(t.ticklen)+String(t.showticklabels)}(t);e[l]!==c&&(s.selectAll("."+o+"tick").remove(),e[l]=c),t.setScale();var u=p.calcTicks(t),h=p.clipEnds(t,u),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:u,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:u,layer:s,transFn:f,labelFns:p.makeLabelFns(t,0,30)})};var C=k.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 D(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){A(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,u,h,f,p,g,x,_,T,A,M=this,S=M.layers.plotbg.select("path").node(),C=M.graphDiv,O=C._fullLayout._zoomlayer;function R(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;D(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,R({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 j(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function N(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(n,i){var a=r+n*t,o=u+i*e,s=Math.max(0,Math.min(1,B(0,u),B(0,o))),l=Math.max(0,Math.min(1,j(r,u),j(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),d=(s/2+c)*M.w,m=(1-s/2-l)*M.w,y=(d+m)/2,v=m-d,b=(1-s)*M.h,w=b-v/E;v<k.MINZOOM?(p=h,T.attr("d",x),A.attr("d","M0,0Z")):(p={a:h.a+s*f,b:h.b+l*f,c:h.c+c*f},T.attr("d",x+"M"+d+","+b+"H"+m+"L"+y+","+w+"L"+d+","+b+"Z"),A.attr("d","M"+r+","+u+"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),A.transition().style("opacity",1).duration(200),_=!0),C.emit("plotly_relayouting",R(p))}function V(){D(C),p!==h&&(i.call("_guiRelayout",C,R(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),u=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[u]},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(c.hideOutsideRangePoints,M),C.emit("plotly_relayouting",R(p))}function H(){i.call("_guiRelayout",C,R(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,c){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,u=i-s.top,C._fullLayout._calcInverseTransform(C);var c=C._fullLayout._invTransform,d=a.apply3DTransform(c)(r,u);r=d[0],u=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(),x="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",x),A=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,c)):"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)):(v(d)||y(d))&&b(i,s,c,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)}}}),qs=p({"src/plots/ternary/layout_attributes.js"(t,e){var r=q(),n=Aa().attributes,i=Ie(),a=Pt().overrideAll,o=R().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"}}}),Hs=p({"src/plots/subplot_defaults.js"(t,e){var r=le(),n=ye(),i=Aa().defaults;e.exports=function(t,e,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,f=o.partition||"x",p=e._subplots[c],d=p.length,m=d&&p[0].replace(/\d+$/,"");function g(t,e){return r.coerce(s,l,u,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)}}}}),Gs=p({"src/plots/ternary/layout_defaults.js"(t,e){var r=H(),n=ye(),i=le(),a=Hs(),o=Ne(),s=Ue(),l=Fe(),c=Re(),u=wi(),h=qs(),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,c,u,h=0;h<f.length;h++)c=t[l=f[h]]||{},(u=n.newContainer(e,l))._name=l,d(c,u,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"),c(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")),u(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})}}}),Ws=p({"src/plots/ternary/index.js"(t){var e=Vs(),r=we().getSubplotCalcData,n=le().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=qs(),t.supplyLayoutDefaults=Gs(),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],c=r(a,i,l),u=n[l]._subplot;u||(u=new e({id:l,graphDiv:t,container:n._ternarylayer.node()},n),n[l]._subplot=u),u.plot(c,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")}}}),Zs=p({"src/traces/scatterternary/index.js"(t,e){e.exports={attributes:Os(),supplyDefaults:Rs(),colorbar:pi(),formatLabels:Fs(),calc:Bs(),plot:js(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:Ns(),selectPoints:vi(),eventData:Us(),moduleType:"trace",name:"scatterternary",basePlotModule:Ws(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}}),Ys=p({"lib/scatterternary.js"(t,e){e.exports=Zs()}}),Xs=p({"src/traces/violin/attributes.js"(t,e){var r=so(),n=R().extendFlat,i=Ce().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}}}),$s=p({"src/traces/violin/layout_attributes.js"(t,e){var r=lo(),n=le().extendFlat;e.exports={violinmode:n({},r.boxmode,{}),violingap:n({},r.boxgap,{}),violingroupgap:n({},r.boxgroupgap,{})}}}),Ks=p({"src/traces/violin/defaults.js"(t,e){var r=le(),n=H(),i=co(),a=Xs();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}function c(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 u,h=l("span");Array.isArray(h)&&(u="manual"),l("spanmode",u);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=c("box.width"),g=c("box.fillcolor",d),y=c("box.line.color",f),v=c("box.line.width",p);l("box.visible",!!(m||g||y||v))||(e.box={visible:!1});var x=c("meanline.color",f),_=c("meanline.width",p);l("meanline.visible",!(!x&&!_))||(e.meanline={visible:!1}),l("quartilemethod"),l("zorder")}}}}),Js=p({"src/traces/violin/layout_defaults.js"(t,e){var r=le(),n=$s(),i=uo();e.exports=function(t,e,a){i._supply(t,e,a,(function(i,a){return r.coerce(t,e,n,i,a)}),"violin")}}}),Qs=p({"src/traces/violin/helpers.js"(t){var e=le(),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}}}),tl=p({"src/traces/violin/calc.js"(t,e){var r=le(),n=ir(),i=ho(),a=Qs(),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||[],c=[e.min,e.max],u=[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?u[n]:a}var f={type:"linear",range:a="soft"===s?u:"hard"===s?c:[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 c=t._fullLayout,u=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,u,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 A=0,k=x[0];k<x[1]+w/2;A++,k+=w){var M=T(k);g.density[A]={v:M,t:k},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(u,[h,f],{padded:!0});if(e._extremes[u._id]=S,e.width)o[0].t.maxKDE=p;else{var E=c._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}}}),el=p({"src/traces/violin/cross_trace_calc.js"(t,e){var r=fo().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],c="h"===l?o:a,u=[],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&&u.push(h)}r("violin",t,u,c)}}}}),rl=p({"src/traces/violin/plot.js"(t,e){var r=x(),n=le(),i=Qe(),a=po(),o=ui(),s=Qs();e.exports=function(t,e,l,c){var u=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(c,l,"trace violins").each((function(t){var i=r.select(this),o=t[0],l=o.t,c=o.trace;if(!0!==c.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"===c.side,_=x||"positive"===c.side,b=x||"negative"===c.side,w=i.selectAll("path.violin").data(n.identity);w.enter().append("path").style("vector-effect",u?"none":"non-scaling-stroke").attr("class","violin"),w.exit().remove(),w.each((function(t){var e,n,i,a,o,s,u,f,p=r.select(this),w=t.density,T=w.length,A=v.c2l(t.pos+m,!0),k=v.l2p(A);if(c.width)e=l.maxKDE/g;else{var M=h._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?M.maxKDE/g*(M.maxCount/t.pts.length):M.maxKDE/g}if(_){for(u=new Array(T),o=0;o<T;o++)(f=u[o]={})[l.posLetter]=A+w[o].v/e,f[l.valLetter]=y.c2l(w[o].t,!0);n=d(u,c)}if(b){for(u=new Array(T),s=0,o=T-1;s<T;s++,o--)(f=u[s]={})[l.posLetter]=A-w[o].v/e,f[l.valLetter]=y.c2l(w[o].t,!0);i=d(u,c)}if(x)a=n+"L"+i.substr(1)+"Z";else{var S=[k,y.c2p(w[0].t)],E=[k,y.c2p(w[T-1].t)];"h"===c.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=k,t.posDensityScale=e*g,t.path=p.node(),t.pathLength=t.path.getTotalLength()/(x?2:1)}));var T,A,k,M=c.box,S=M.width,E=(M.line||{}).width;x?(T=g*S,A=0):_?(T=[0,g*S/2],A=E*{x:1,y:-1}[l.posLetter]):(T=[g*S/2,0],A=E*{x:-1,y:1}[l.posLetter]),a.plotBoxAndWhiskers(i,{pos:v,val:y},c,{bPos:m,bdPos:T,bPosPxOffset:A}),a.plotBoxMean(i,{pos:v,val:y},c,{bPos:m,bdPos:T,bPosPxOffset:A}),!c.box.visible&&c.meanline.visible&&(k=n.identity);var C=i.selectAll("path.meanline").data(k||[]);C.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",u?"none":"non-scaling-stroke"),C.exit().remove(),C.each((function(t){var e=y.c2p(t.mean,!0),n=s.getPositionOnKdePath(t,c,e);r.select(this).attr("d","h"===c.orientation?"M"+e+","+n[0]+"V"+n[1]:"M"+n[0]+","+e+"H"+n[1])})),a.plotPoints(i,{x:f,y:p},c,l)}}))}}}),nl=p({"src/traces/violin/style.js"(t,e){var r=x(),n=H(),i=mi().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||{},c=a.meanline||{},u=c.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":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};o.selectAll("path.mean").style(h).call(n.stroke,c.color),o.selectAll("path.meanline").style(h).call(n.stroke,c.color),i(o,a,t)}))}}}),il=p({"src/traces/violin/hover.js"(t,e){var r=H(),n=le(),i=ir(),a=go(),o=Qs();e.exports=function(t,e,s,l,c){c||(c={});var u,h,f=c.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,A,k=t.xa,M=t.ya;"h"===d.orientation?(A=e,_="y",w=M,b="x",T=k):(A=s,_="x",w=k,b="y",T=M);var S=p[t.index];if(A>=S.span[0]&&A<=S.span[1]){var E=n.extendFlat({},t),C=T.c2p(A,!0),I=o.getKdeValue(S,d,A),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,A,d[b+"hoverformat"])+", "+p[0].t.labels.kde+" "+I.toFixed(3);for(var D=0,O=0;O<x.length;O++)if("med"===x[O].attr){D=O;break}E.spikeDistance=x[D].spikeDistance;var R=_+"Spike";E[R]=x[D][R],x[D].spikeDistance=void 0,x[D][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")&&(u=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?u?[u]:v:(u&&v.push(u),v)}}}),al=p({"src/traces/violin/index.js"(t,e){e.exports={attributes:Xs(),layoutAttributes:$s(),supplyDefaults:Ks(),crossTraceDefaults:co().crossTraceDefaults,supplyLayoutDefaults:Js(),calc:tl(),crossTraceCalc:el(),plot:rl(),style:nl(),styleOnSelect:mi().styleOnSelect,hoverPoints:il(),selectPoints:vo(),moduleType:"trace",name:"violin",basePlotModule:Si(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}}),ol=p({"lib/violin.js"(t,e){e.exports=al()}}),sl=p({"src/traces/funnel/constants.js"(t,e){e.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}}),ll=p({"src/traces/funnel/attributes.js"(t,e){var r,n=Ga(),i=Tn().line,a=U(),o=Ce().axisHoverFormat,s=Ot().hovertemplateAttrs,l=Ot().texttemplateAttrs,c=sl(),u=R().extendFlat,h=H();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:c.eventDataKeys}),hoverinfo:u({},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:c.eventDataKeys.concat(["label","value"])}),text:n.text,textposition:n.textposition,insidetextanchor:u({},n.insidetextanchor,{dflt:"middle"}),textangle:u({},n.textangle,{dflt:0}),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:u({},n.orientation,{}),offset:u({},n.offset,{arrayOk:!1}),width:u({},n.width,{arrayOk:!1}),marker:(r=u({},n.marker),delete r.pattern,delete r.cornerradius,r),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:u({},i.color,{dflt:h.defaultLine}),width:u({},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}}}),cl=p({"src/traces/funnel/layout_attributes.js"(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"}}}}),ul=p({"src/traces/funnel/defaults.js"(t,e){var r=le(),n=Qn(),i=Ya().handleText,a=Hn(),o=Gn(),s=ll(),l=H();e.exports={supplyDefaults:function(t,e,n,c){function u(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,c,u)){o(t,e,c,u),u("xhoverformat"),u("yhoverformat"),u("orientation",e.y&&!e.x?"v":"h"),u("offset"),u("width");var h=u("text");u("hovertext"),u("hovertemplate");var f=u("textposition");i(t,e,c,u,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&!e.texttemplate&&u("textinfo",r.isArrayOrTypedArray(h)?"text+value":"value");var p=u("marker.color",n);u("marker.line.color",l.defaultLine),u("marker.line.width"),u("connector.visible")&&(u("connector.fillcolor",function(t){var e=r.isArrayOrTypedArray(t)?"#000":t;return l.addOpacity(e,.5*l.opacity(e))}(p)),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)}for(var l=0;l<t.length;l++)"funnel"===(a=t[l]).type&&(i=a._input,n(i,a,e,o,e.funnelmode))}}}}),hl=p({"src/traces/funnel/layout_defaults.js"(t,e){var r=le(),n=cl();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"))}}}),fl=p({"src/traces/funnel/arrays_to_calcdata.js"(t,e){var r=le();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"))}}}}),pl=p({"src/traces/funnel/calc.js"(t,e){var r=ir(),n=ri(),i=fl(),a=ai(),o=k().BADNUM;function s(t){return t===o?0:t}e.exports=function(t,e){var l,c,u,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"),u=y.makeCalcdata(e,"y"),h=n(e,y,"y",u),f=!!e.yperiodalignment,p="y"):(l=y.makeCalcdata(e,"y"),u=g.makeCalcdata(e,"x"),h=n(e,g,"x",u),f=!!e.xperiodalignment,p="x"),c=h.vals;var v,x=Math.min(c.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:c[d],s:l[d],cNext:b},e._base[d]=-.5*m.s,f&&(_[d].orig_p=u[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),_}}}),dl=p({"src/traces/funnel/cross_trace_calc.js"(t,e){var r=li().setGroupPositions;e.exports=function(t,e){var n,i,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,c=e.yaxis,u=[],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===c._id&&"funnel"===p.type&&(n=s[i],d?f.push(n):h.push(n),u.push(n))}var m={mode:a.funnelmode,norm:a.funnelnorm,gap:a.funnelgap,groupgap:a.funnelgroupgap};for(r(t,l,c,h,m),r(t,c,l,f,m),i=0;i<u.length;i++){n=u[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)}}}}),ml=p({"src/traces/funnel/plot.js"(t,e){var r=x(),n=le(),i=Qe(),a=k().BADNUM,o=eo(),s=Ja().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,c,u){var h=t._fullLayout;s("funnel",h),function(t,e,o,s){var c=e.xaxis,u=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,c,u,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,c,u),function(t,e,a,o){var s=e.xaxis,c=e.yaxis;n.makeTraceGroups(o,a,"trace bars").each((function(a){var o=r.select(this),u=a[0].trace,h=n.ensureSingle(o,"g","lines");if(u.connector&&u.connector.visible&&u.connector.line.width){var f="h"===u.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 u=l(a,s,c,f),h=u[0],p=u[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,c,u),o.plot(t,e,c,u,{mode:h.funnelmode,norm:h.funnelmode,gap:h.funnelgap,groupgap:h.funnelgroupgap})}}}),yl=p({"src/traces/funnel/style.js"(t,e){var r=x(),n=Qe(),i=H(),a=G().DESELECTDIM,o=to(),s=Ja().resizeText,l=o.styleTextPoints;e.exports={style:function(t,e,o){var c=o||r.select(t).selectAll('g[class^="funnellayer"]').selectAll("g.trace");s(t,c,"funnel"),c.style("opacity",(function(t){return t[0].trace.opacity})),c.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)}))}))}}}}),vl=p({"src/traces/funnel/hover.js"(t,e){var r=H().opacity,n=ro().hoverOnBars,i=le().formatPercent;e.exports=function(t,e,a,o,s){var l=n(t,e,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,f=c[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||u.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}(u,f),[l]}}}}),xl=p({"src/traces/funnel/event_data.js"(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}}}),_l=p({"src/traces/funnel/index.js"(t,e){e.exports={attributes:ll(),layoutAttributes:cl(),supplyDefaults:ul().supplyDefaults,crossTraceDefaults:ul().crossTraceDefaults,supplyLayoutDefaults:hl(),calc:pl(),crossTraceCalc:dl(),plot:ml(),style:yl().style,hoverPoints:vl(),eventData:xl(),selectPoints:io(),moduleType:"trace",name:"funnel",basePlotModule:Si(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),bl=p({"lib/funnel.js"(t,e){e.exports=_l()}}),wl=p({"src/traces/waterfall/constants.js"(t,e){e.exports={eventDataKeys:["initial","delta","final"]}}}),Tl=p({"src/traces/waterfall/attributes.js"(t,e){var r=Ga(),n=Tn().line,i=U(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=wl(),c=R().extendFlat,u=H();function h(t){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},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:c({},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:c({},n.color,{dflt:u.defaultLine}),width:c({},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}}}),Al=p({"src/traces/waterfall/layout_attributes.js"(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"}}}}),kl=p({"src/constants/delta.js"(t,e){e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Ml=p({"src/traces/waterfall/defaults.js"(t,e){var r=le(),n=Qn(),i=Ya().handleText,a=Hn(),o=Gn(),s=Tl(),l=H(),c=kl(),u=c.INCREASING.COLOR,h=c.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 c(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,l,c)){o(t,e,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var p=c("textposition");i(t,e,l,c,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&(c("texttemplate"),e.texttemplate||c("textinfo")),f(c,"increasing",u),f(c,"decreasing",h),f(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),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)}if("group"===e.waterfallmode)for(var l=0;l<t.length;l++)i=(a=t[l])._input,n(i,a,e,o,e.waterfallmode)}}}}),Sl=p({"src/traces/waterfall/layout_defaults.js"(t,e){var r=le(),n=Al();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"))}}}),El=p({"src/traces/waterfall/calc.js"(t,e){var r=ir(),n=ri(),i=le().mergeArray,a=ai(),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 c,u,h,f,p,d,m=r.getFromId(t,e.xaxis||"x"),g=r.getFromId(t,e.yaxis||"y");"h"===e.orientation?(c=m.makeCalcdata(e,"x"),h=g.makeCalcdata(e,"y"),f=n(e,g,"y",h),p=!!e.yperiodalignment,d="y"):(c=g.makeCalcdata(e,"y"),h=m.makeCalcdata(e,"x"),f=n(e,m,"x",h),p=!!e.xperiodalignment,d="x"),u=f.vals;for(var y,v=Math.min(u.length,c.length),x=new Array(v),_=0,b=!1,w=0;w<v;w++){var T=c[w]||0,A=!1;(c[w]!==o||l(e.measure[w])||s(e.measure[w]))&&w+1<v&&(c[w+1]!==o||l(e.measure[w+1])||s(e.measure[w+1]))&&(A=!0);var k=x[w]={i:w,p:u[w],s:T,rawS:T,cNext:A};s(e.measure[w])?(_=k.s,k.isSum=!0,k.dir="totals",k.s=_):l(e.measure[w])?(k.isSum=!0,k.dir="totals",k.s=_):(k.isSum=!1,k.dir=k.rawS<0?"decreasing":"increasing",y=k.s,k.s=_+y,_+=y),"totals"===k.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&&(k.id=String(e.ids[w])),k.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}}}),Cl=p({"src/traces/waterfall/cross_trace_calc.js"(t,e){var r=li().setGroupPositions;e.exports=function(t,e){var n,i,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,c=e.yaxis,u=[],h=[],f=[];for(i=0;i<o.length;i++){var p=o[i];!0===p.visible&&p.xaxis===l._id&&p.yaxis===c._id&&"waterfall"===p.type&&(n=s[i],"h"===p.orientation?f.push(n):h.push(n),u.push(n))}var d={mode:a.waterfallmode,norm:a.waterfallnorm,gap:a.waterfallgap,groupgap:a.waterfallgroupgap};for(r(t,l,c,h,d),r(t,c,l,f,d),i=0;i<u.length;i++){n=u[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)}}}}}),Il=p({"src/traces/waterfall/plot.js"(t,e){var r=x(),n=le(),i=Qe(),a=k().BADNUM,o=eo(),s=Ja().clearMinTextSize;e.exports=function(t,e,l,c){var u=t._fullLayout;s("waterfall",u),o.plot(t,e,l,c,{mode:u.waterfallmode,norm:u.waterfallmode,gap:u.waterfallgap,groupgap:u.waterfallgroupgap}),function(t,e,o,s){var l=e.xaxis,c=e.yaxis;n.makeTraceGroups(s,o,"trace bars").each((function(o){var s=r.select(this),u=o[0].trace,h=n.ensureSingle(s,"g","lines");if(u.connector&&u.connector.visible){var f="h"===u.orientation,p=u.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 u=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,c,f),h=u[0],d=u[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,c)}}}),Ll=p({"src/traces/waterfall/style.js"(t,e){var r=x(),n=Qe(),i=H(),a=G().DESELECTDIM,o=to(),s=Ja().resizeText,l=o.styleTextPoints;e.exports={style:function(t,e,o){var c=o||r.select(t).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");s(t,c,"waterfall"),c.style("opacity",(function(t){return t[0].trace.opacity})),c.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)}))}))}}}}),Pl=p({"src/traces/waterfall/hover.js"(t,e){var r=ir().hoverLabelText,n=H().opacity,i=ro().hoverOnBars,a=kl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;e.exports=function(t,e,a,l,c){var u=i(t,e,a,l,c);if(u){var h=u.cd,f=h[0].trace,p="h"===f.orientation,d=p?"x":"y",m=p?t.xa:t.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=A(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=A(u.final),u.initialLabel=A(u.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(u.finalLabel),T("delta")&&(y<0?_.push(u.deltaLabel+" "+s):_.push(u.deltaLabel+" "+o)),T("initial")&&_.push("Initial: "+u.initialLabel))}return _.length&&(u.extraText=_.join("<br>")),u.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),[u]}function A(t){return r(m,t,f[d+"hoverformat"])}}}}),zl=p({"src/traces/waterfall/event_data.js"(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}}}),Dl=p({"src/traces/waterfall/index.js"(t,e){e.exports={attributes:Tl(),layoutAttributes:Al(),supplyDefaults:Ml().supplyDefaults,crossTraceDefaults:Ml().crossTraceDefaults,supplyLayoutDefaults:Sl(),calc:El(),crossTraceCalc:Cl(),plot:Il(),style:Ll().style,hoverPoints:Pl(),eventData:zl(),selectPoints:io(),moduleType:"trace",name:"waterfall",basePlotModule:Si(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Ol=p({"lib/waterfall.js"(t,e){e.exports=Dl()}}),Rl=p({"src/traces/image/constants.js"(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:["°","%","%",""]}}}}}),Fl=p({"src/traces/image/attributes.js"(t,e){var r,n,i=U(),a=Tn().zorder,o=Ot().hovertemplateAttrs,s=R().extendFlat,l=Rl().colormodel,c=["rgb","rgba","rgba256","hsl","hsla"],u=[],h=[];for(n=0;n<c.length;n++)r=l[c[n]],u.push("For the `"+c[n]+"` colormodel, it is ["+(r.zminDflt||r.min).join(", ")+"]."),h.push("For the `"+c[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:c,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})}}),Bl=p({"src/traces/image/defaults.js"(t,e){var r=le(),n=Fl(),i=Rl(),a=On().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}}}),jl=p({"node_modules/inherits/inherits_browser.js"(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}}}}),Nl=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js"(t,e){e.exports=fe().EventEmitter}}),Ul=p({"node_modules/base64-js/index.js"(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],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,l)),u=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)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},t.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,c=n-i;s<c;s+=o)a.push(l(t,s,s+o>c?c: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=typeof Uint8Array<"u"?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}}),Vl=p({"node_modules/ieee754/index.js"(t){t.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>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=u):(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>=u?(s=0,o=u):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,c+=i;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}}}),ql=p({"node_modules/buffer/index.js"(t){var e=Ul(),r=Vl(),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 c(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(Z(t,Uint8Array)){let e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return u(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(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(t,SharedArrayBuffer)||t&&Z(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):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(i)return i;if(typeof Symbol<"u"&&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 c(t){return l(t),a(t<0?0:0|f(t))}function u(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)||Z(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 A(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 c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(a=r;a<s;a++)if(c(t,a)===c(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(c(t,a+n)!==c(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 W(H(e,t.length-r),t,r,n)}function _(t,e,r,n){return W(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 W(G(e),t,r,n)}function w(t,e,r,n){return W(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 A(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<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));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{return!1}}(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"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 c(t)},o.allocUnsafeSlow=function(t){return c(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(Z(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),Z(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(Z(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?A(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(Z(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),c=this.slice(n,i),u=t.slice(e,r);for(let t=0;t<l;++t)if(c[t]!==u[t]){a=c[t],s=u[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 k=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){N(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){N(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 D(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 O(t,e,n,i,a){return e=+e,n>>>=0,a||D(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||D(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 O(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return O(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 j(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 N(t,e,r,n,i,a){if(t>r||t<e){let n,i="bigint"==typeof e?"n":"";throw n=a>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(a+1)}${i}`:`>= -(2${i} ** ${8*(a+1)-1}${i}) and < 2 ** ${8*(a+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new F.ERR_OUT_OF_RANGE("value",n,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(r||"offset","an integer",t)):e<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1: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=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(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 W(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 Z(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 typeof BigInt>"u"?K:t}function K(){throw new Error("BigInt not supported")}}}),Hl=p({"node_modules/has-symbols/shams.js"(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}}}),Gl=p({"node_modules/has-tostringtag/shams.js"(t,e){var r=Hl();e.exports=function(){return r()&&!!Symbol.toStringTag}}}),Wl=p({"node_modules/es-object-atoms/index.js"(t,e){e.exports=Object}}),Zl=p({"node_modules/es-errors/index.js"(t,e){e.exports=Error}}),Yl=p({"node_modules/es-errors/eval.js"(t,e){e.exports=EvalError}}),Xl=p({"node_modules/es-errors/range.js"(t,e){e.exports=RangeError}}),$l=p({"node_modules/es-errors/ref.js"(t,e){e.exports=ReferenceError}}),Kl=p({"node_modules/es-errors/syntax.js"(t,e){e.exports=SyntaxError}}),Jl=p({"node_modules/es-errors/type.js"(t,e){e.exports=TypeError}}),Ql=p({"node_modules/es-errors/uri.js"(t,e){e.exports=URIError}}),tc=p({"node_modules/math-intrinsics/abs.js"(t,e){e.exports=Math.abs}}),ec=p({"node_modules/math-intrinsics/floor.js"(t,e){e.exports=Math.floor}}),rc=p({"node_modules/math-intrinsics/max.js"(t,e){e.exports=Math.max}}),nc=p({"node_modules/math-intrinsics/min.js"(t,e){e.exports=Math.min}}),ic=p({"node_modules/math-intrinsics/pow.js"(t,e){e.exports=Math.pow}}),ac=p({"node_modules/math-intrinsics/round.js"(t,e){e.exports=Math.round}}),oc=p({"node_modules/math-intrinsics/isNaN.js"(t,e){e.exports=Number.isNaN||function(t){return t!=t}}}),sc=p({"node_modules/math-intrinsics/sign.js"(t,e){var r=oc();e.exports=function(t){return r(t)||0===t?t:t<0?-1:1}}}),lc=p({"node_modules/gopd/gOPD.js"(t,e){e.exports=Object.getOwnPropertyDescriptor}}),cc=p({"node_modules/gopd/index.js"(t,e){var r=lc();if(r)try{r([],"length")}catch{r=null}e.exports=r}}),uc=p({"node_modules/es-define-property/index.js"(t,e){var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}e.exports=r}}),hc=p({"node_modules/has-symbols/index.js"(t,e){var r=typeof Symbol<"u"&&Symbol,n=Hl();e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}}}),fc=p({"node_modules/get-proto/Reflect.getPrototypeOf.js"(t,e){e.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),pc=p({"node_modules/get-proto/Object.getPrototypeOf.js"(t,e){var r=Wl();e.exports=r.getPrototypeOf||null}}),dc=p({"node_modules/function-bind/implementation.js"(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){for(var e=[],r=1,n=0;r<t.length;r+=1,n+=1)e[n]=t[r];return e}(arguments),s=n(0,e.length-o.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(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 u=function(){};u.prototype=e.prototype,a.prototype=new u,u.prototype=null}return a}}}),mc=p({"node_modules/function-bind/index.js"(t,e){var r=dc();e.exports=Function.prototype.bind||r}}),gc=p({"node_modules/call-bind-apply-helpers/functionCall.js"(t,e){e.exports=Function.prototype.call}}),yc=p({"node_modules/call-bind-apply-helpers/functionApply.js"(t,e){e.exports=Function.prototype.apply}}),vc=p({"node_modules/call-bind-apply-helpers/reflectApply.js"(t,e){e.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}}),xc=p({"node_modules/call-bind-apply-helpers/actualApply.js"(t,e){var r=mc(),n=yc(),i=gc(),a=vc();e.exports=a||r.call(i,n)}}),_c=p({"node_modules/call-bind-apply-helpers/index.js"(t,e){var r=mc(),n=Jl(),i=gc(),a=xc();e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return a(r,i,t)}}}),bc=p({"node_modules/dunder-proto/get.js"(t,e){var r,n=_c(),i=cc();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))}}}),wc=p({"node_modules/get-proto/index.js"(t,e){var r=fc(),n=pc(),i=bc();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}}),Tc=p({"node_modules/hasown/index.js"(t,e){var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,i=mc();e.exports=i.call(r,n)}}),Ac=p({"node_modules/get-intrinsic/index.js"(t,e){var r,n=Wl(),i=Zl(),a=Yl(),o=Xl(),s=$l(),l=Kl(),c=Jl(),u=Ql(),h=tc(),f=ec(),p=rc(),d=nc(),m=ic(),g=ac(),y=sc(),v=Function,x=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch{}},_=cc(),b=uc(),w=function(){throw new c},T=_?function(){try{return w}catch{try{return _(arguments,"callee").get}catch{return w}}}():w,A=hc()(),k=wc(),M=pc(),S=fc(),E=yc(),C=gc(),I={},L=typeof Uint8Array>"u"||!k?r:k(Uint8Array),P={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&k?k([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&k?k(k([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!A||!k?r:k((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!A||!k?r:k((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&k?k(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":T,"%TypedArray%":L,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?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(k)try{null.error}catch(t){z=k(k(t)),P["%Error.prototype%"]=z}var z,D=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&&k&&(r=k(i.prototype))}return P[e]=r,r},O={__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=mc(),F=Tc(),B=R.call(C,Array.prototype.concat),j=R.call(E,Array.prototype.splice),N=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(O,n)&&(n="%"+(r=O[n])[0]+"%"),F(P,n)){var i=P[n];if(i===I&&(i=D(n)),typeof i>"u"&&!e)throw new c("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 c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new c('"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 N(t,q,(function(t,e,r,i){n[n.length]=r?N(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,u=i.alias;u&&(n=u[0],j(r,B([0,1],u)));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 c("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}}}),kc=p({"node_modules/define-data-property/index.js"(t,e){var r=uc(),n=Kl(),i=Jl(),a=cc();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,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(r)r(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=o}}}}),Mc=p({"node_modules/has-property-descriptors/index.js"(t,e){var r=uc(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch{return!0}},e.exports=n}}),Sc=p({"node_modules/set-function-length/index.js"(t,e){var r=Ac(),n=kc(),i=Mc()(),a=cc(),o=Jl(),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,c=!0;if("length"in t&&a){var u=a(t,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(t,"length",e,!0,!0):n(t,"length",e)),t}}}),Ec=p({"node_modules/call-bind/index.js"(t,e){var r=mc(),n=Ac(),i=Sc(),a=Jl(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=uc(),u=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+u(0,t.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h}}),Cc=p({"node_modules/call-bind/callBound.js"(t,e){var r=Ac(),n=Ec(),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}}}),Ic=p({"node_modules/is-arguments/index.js"(t,e){var r=Gl()(),n=Cc()("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}}),Lc=p({"node_modules/is-generator-function/index.js"(t,e){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=Gl()(),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(typeof r>"u"){var e=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch{}}();r=!!e&&s(e)}return s(t)===r}}}),Pc=p({"node_modules/is-callable/index.js"(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{return!1}},c=function(t){try{return!l(t)&&(i.call(t),!0)}catch{return!1}},u=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),p=function(){return!1};"object"==typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(p=function(t){if((f||!t)&&(typeof t>"u"||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch{}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)&&c(t)}:function(t){if(p(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;if(h)return c(t);if(l(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&c(t)}}}),zc=p({"node_modules/for-each/index.js"(t,e){var r=Pc(),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)}}}),Dc=p({"node_modules/available-typed-arrays/index.js"(t,e){var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n=typeof globalThis>"u"?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}}}),Oc=p({"node_modules/which-typed-array/index.js"(t,e){var r=zc(),n=Dc(),i=Ec(),a=Cc(),o=cc(),s=a("Object.prototype.toString"),l=Gl()(),c=typeof globalThis>"u"?window:globalThis,u=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(u,l&&o&&f?function(t){var e=new c[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 c[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(u,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{}})),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{}})),e}(t):null}}}),Rc=p({"node_modules/is-typed-array/index.js"(t,e){var r=zc(),n=Dc(),i=Cc(),a=i("Object.prototype.toString"),o=Gl()(),s=cc(),l=typeof globalThis>"u"?window:globalThis,c=n(),u=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(c,(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 u(c,e)>-1}return!!s&&function(t){var e=!1;return r(f,(function(r,n){if(!e)try{e=r.call(t)===n}catch{}})),e}(t)}}}),Fc=p({"node_modules/util/support/types.js"(t){var e=Ic(),r=Lc(),n=Oc(),i=Rc();function a(t){return t.call.bind(t)}var o,s,l=typeof BigInt<"u",c=typeof Symbol<"u",u=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{return!1}}function m(t){return"[object Map]"===u(t)}function g(t){return"[object Set]"===u(t)}function y(t){return"[object WeakMap]"===u(t)}function v(t){return"[object WeakSet]"===u(t)}function x(t){return"[object ArrayBuffer]"===u(t)}function _(t){return!(typeof ArrayBuffer>"u")&&(x.working?x(t):t instanceof ArrayBuffer)}function b(t){return"[object DataView]"===u(t)}function w(t){return!(typeof DataView>"u")&&(b.working?b(t):t instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i,t.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},t.isArrayBufferView=function(t){return typeof ArrayBuffer<"u"&&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=typeof Map<"u"&&m(new Map),t.isMap=function(t){return!(typeof Map>"u")&&(m.working?m(t):t instanceof Map)},g.working=typeof Set<"u"&&g(new Set),t.isSet=function(t){return!(typeof Set>"u")&&(g.working?g(t):t instanceof Set)},y.working=typeof WeakMap<"u"&&y(new WeakMap),t.isWeakMap=function(t){return!(typeof WeakMap>"u")&&(y.working?y(t):t instanceof WeakMap)},v.working=typeof WeakSet<"u"&&v(new WeakSet),t.isWeakSet=function(t){return v(t)},x.working=typeof ArrayBuffer<"u"&&x(new ArrayBuffer),t.isArrayBuffer=_,b.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&b(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var T=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===u(t)}function k(t){return!(typeof T>"u")&&(typeof A.working>"u"&&(A.working=A(new T)),A.working?A(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 c&&d(t,s)}t.isSharedArrayBuffer=k,t.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},t.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},t.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},t.isGeneratorObject=function(t){return"[object Generator]"===u(t)},t.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(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 typeof Uint8Array<"u"&&(_(t)||k(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))}}),Bc=p({"node_modules/util/support/isBufferBrowser.js"(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}}}),jc=p({"(disabled):node_modules/util/util.js"(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(!y(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{return"[Circular]"}default:return t}})),l=i[n];n<a;l=i[++n])m(l)||!_(l)?s+=" "+l:s+=" "+o(l);return s},t.deprecate=function(e,r){if(typeof c<"u"&&!0===c.noDeprecation)return e;if(typeof c>"u")return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(c.throwDeprecation)throw new Error(r);c.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]),d(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(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&&T(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return y(i)||(i=u(e,i,n)),i}var a=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):m(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)),w(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(T(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return e.stylize(Date.prototype.toString.call(r),"date");if(w(r))return h(r)}var c,_="",A=!1,k=["{","}"];return p(r)&&(A=!0,k=["[","]"]),T(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(_=" "+RegExp.prototype.toString.call(r)),b(r)&&(_=" "+Date.prototype.toUTCString.call(r)),w(r)&&(_=" "+h(r)),0!==o.length||A&&0!=r.length?n<0?x(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=A?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)S(e,String(o))?a.push(f(t,e,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(f(t,e,r,n,i,!0))})),a}(e,r,n,s,o):o.map((function(t){return f(e,r,n,s,t,A)})),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]}(c,_,k)):k[0]+_+k[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(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")),S(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(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")),v(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 p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===A(t)}function _(t){return"object"==typeof t&&null!==t}function b(t){return _(t)&&"[object Date]"===A(t)}function w(t){return _(t)&&("[object Error]"===A(t)||t instanceof Error)}function T(t){return"function"==typeof t}function A(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=c.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=Fc(),t.isArray=p,t.isBoolean=d,t.isNull=m,t.isNullOrUndefined=function(t){return null==t},t.isNumber=g,t.isString=y,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=v,t.isRegExp=x,t.types.isRegExp=x,t.isObject=_,t.isDate=b,t.types.isDate=b,t.isError=w,t.types.isNativeError=w,t.isFunction=T,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||typeof t>"u"},t.isBuffer=Bc();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var E=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function C(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(E&&t[E]){var r;if("function"!=typeof(r=t[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,E,{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)),E&&Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,e(t))},t.promisify.custom=E,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){c.nextTick(a.bind(null,null,t))}),(function(t){c.nextTick(C.bind(null,t,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,e(t)),r}}}),Nc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(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){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)}}var a=ql().Buffer,o=jc().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 function(t,e){e&&i(t.prototype,e)}(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}()}}),Uc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(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,c.nextTick(i,this,t)):c.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?c.nextTick(n,a):(a._writableState.errorEmitted=!0,c.nextTick(r,a,t)):c.nextTick(r,a,t):e?(c.nextTick(n,a),e(t)):c.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)}}}}),Vc=p({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(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,4)===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-9,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+1>t.length)&&-1!==t.indexOf(".",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}}),qc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(t,e){var r=Vc().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}}}}),Hc=p({"node_modules/util-deprecate/browser.js"(t,e){function r(t){try{if(!window.localStorage)return!1}catch{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)}}}}),Gc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(t,e){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(undefined),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var n;e.exports=A,A.WritableState=T;var i,a={deprecate:Hc()},o=Nl(),s=ql().Buffer,l=window.Uint8Array||function(){},u=Uc(),h=qc().getHighWaterMark,f=Vc().codes,p=f.ERR_INVALID_ARG_TYPE,d=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,g=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,x=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,b=u.errorOrDestroy;function w(){}function T(t,e,i){n=n||Wc(),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(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 m;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?(c.nextTick(i,n),c.nextTick(I,t,e),t._writableState.errorEmitted=!0,b(t,n)):(i(n),t._writableState.errorEmitted=!0,b(t,n),I(t,e))}(t,r,n,e,i);else{var a=E(r)||t.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&S(t,r),n?c.nextTick(M,t,r,a,i):M(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 A(t){var e=this instanceof(n=n||Wc());if(!e&&!i.call(A,this))return new A(t);this._writableState=new T(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 y("write")):r?t._writev(i,e.onwrite):t._write(i,a,e.onwrite),e.sync=!1}function M(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function S(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 c=n.chunk,u=n.encoding,h=n.callback;if(k(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function E(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,e){t._final((function(r){e.pendingcb--,r&&b(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=E(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,c.nextTick(C,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}jl()(A,o),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!i.call(this,t)||this===A&&t&&t._writableState instanceof T}})):i=function(t){return t instanceof this},A.prototype.pipe=function(){b(this,new g)},A.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=w),n.ending?function(t,e){var r=new x;b(t,r),c.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i;return null===r?i=new v:"string"!=typeof r&&!e.objectMode&&(i=new p("chunk",["string","Buffer"],r)),!i||(b(t,i),c.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 c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else k(t,e,!1,l,n,i,a);return c}(this,n,a,t,e,r)),i},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&S(this,t))},A.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 _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new d("_write()"))},A.prototype._writev=null,A.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,I(t,e),r&&(e.finished?c.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=u.destroy,A.prototype._undestroy=u.undestroy,A.prototype._destroy=function(t,e){e(t)}}}),Wc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(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=Jc(),s=Gc();for(jl()(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||c.nextTick(h,this)}function h(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)}})}}),Zc=p({"node_modules/safe-buffer/index.js"(t,e){var r=ql(),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)}}}),Yc=p({"node_modules/stream-browserify/node_modules/string_decoder/lib/string_decoder.js"(t){var e=Zc().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=c,n=3;break;default:return this.write=u,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 c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function u(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}}}),Xc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(t,e){var r=Vc().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||u()},c=e._writableState&&e._writableState.finished,u=function(){s=!1,c=!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&&!c?((!e._writableState||!e._writableState.ended)&&(t=new r),a.call(e,t)):void 0},m=function(){e.req.on("finish",u)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",u),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",u),!1!==i.error&&e.on("error",p),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",m),e.req&&e.req.removeListener("finish",u),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("end",f),e.removeListener("error",p),e.removeListener("close",d)}}}}),$c=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(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=Xc(),a=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[a];if(null!==e){var r=t[f].read();null!==r&&(t[u]=null,t[a]=null,t[o]=null,e(p(r,!1)))}}function m(t){c.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((n(r={get stream(){return this[f]},next:function(){var t=this,e=this[s];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(e,r){c.nextTick((function(){t[s]?r(t[s]):e(p(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(p(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[h])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),n(r,"return",(function(){var t=this;return new Promise((function(e,r){t[f].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),r),g);e.exports=function(t){var e,r=Object.create(y,(n(e={},f,{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,h,{value:function(t,e){var n=r[f].read();n?(r[u]=null,r[a]=null,r[o]=null,t(p(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(p(void 0,!0))),r[l]=!0})),t.on("readable",m.bind(null,r)),r}}}),Kc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js"(t,e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}}}),Jc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js"(t,e){var r;e.exports=A,A.ReadableState=T,fe().EventEmitter;var n,i=function(t,e){return t.listeners(e).length},a=Nl(),o=ql().Buffer,s=window.Uint8Array||function(){},l=jc();n=l&&l.debuglog?l.debuglog("stream"):function(){};var u,h,f,p=Nc(),d=Uc(),m=qc().getHighWaterMark,g=Vc().codes,y=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,x=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;jl()(A,a);var b=d.errorOrDestroy,w=["error","close","destroy","pause","resume"];function T(t,e,n){r=r||Wc(),t=t||{},"boolean"!=typeof n&&(n=e instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",n),this.buffer=new p,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=Yc().StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function A(t){if(r=r||Wc(),!(this instanceof A))return new A(t);var e=this instanceof r;this._readableState=new T(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,c=t._readableState;if(null===e)c.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?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,c);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 y("chunk",["string","Buffer","Uint8Array"],e)),r}(c,e)),l)b(t,l);else if(c.objectMode||e&&e.length>0)if("string"!=typeof e&&!c.objectMode&&Object.getPrototypeOf(e)!==o.prototype&&(e=function(t){return o.from(t)}(e)),i)c.endEmitted?b(t,new _):M(t,c,e,!0);else if(c.ended)b(t,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?M(t,c,e,!1):L(t,c)):M(t,c,e,!1)}else i||(c.reading=!1,L(t,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function M(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&&C(t)),L(t,e)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=d.destroy,A.prototype._undestroy=d.undestroy,A.prototype._destroy=function(t,e){e(t)},A.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)},A.prototype.unshift=function(t){return k(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){u||(u=Yc().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 S=1073741824;function E(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>=S?t=S:(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 C(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,c.nextTick(I,t))}function I(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,R(t)}function L(t,e){e.readingMore||(e.readingMore=!0,c.nextTick(P,t,e))}function P(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 z(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 D(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"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function F(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 B(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,c.nextTick(j,e,t))}function j(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}A.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?B(this):C(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&B(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=E(r,e))),null===(i=t>0?F(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&&B(this)),null!==i&&this.emit("data",i),i},A.prototype._read=function(t){b(this,new x("_read()"))},A.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===c.stdout||t===c.stderr?m:s;function s(){n("onend"),t.end()}a.endEmitted?c.nextTick(o):r.once("end",o),t.on("unpipe",(function e(i,o){n("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",l),t.removeListener("error",f),t.removeListener("unpipe",e),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",h),u=!0,a.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l())}));var l=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,R(t))}}(r);t.on("drain",l);var u=!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))&&!u&&(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")&&b(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},A.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},A.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?C(this):i.reading||c.nextTick(D,this)),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&c.nextTick(z,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&c.nextTick(z,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,c.nextTick(O,t,e))}(this,t)),t.paused=!1,this},A.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},A.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<w.length;o++)t.on(w[o],this.emit.bind(this,w[o]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=$c()),h(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===f&&(f=Kc()),f(A,t,e)})}}),Qc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js"(t,e){e.exports=c;var r=Vc().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=Wc();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 c(t){if(!(this instanceof c))return new c(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",u)}function u(){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)}jl()(c,s),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new n("_transform()"))},c.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)}},c.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))},c.prototype._destroy=function(t,e){s.prototype._destroy.call(this,t,(function(t){e(t)}))}}}),tu=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js"(t,e){e.exports=n;var r=Qc();function n(t){if(!(this instanceof n))return new n(t);r.call(this,t)}jl()(n,r),n.prototype._transform=function(t,e,r){r(null,t)}}}),eu=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js"(t,e){var r,n=Vc().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 c=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 u,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=Xc()),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){u||(u=t),t&&h.forEach(s),!i&&(h.forEach(s),c(u))}))}));return e.reduce(l)}}}),ru=p({"node_modules/stream-browserify/index.js"(t,e){e.exports=n;var r=fe().EventEmitter;function n(){r.call(this)}jl()(n,r),n.Readable=Jc(),n.Writable=Gc(),n.Duplex=Wc(),n.Transform=Qc(),n.PassThrough=tu(),n.finished=Xc(),n.pipeline=eu(),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 c(t){if(u(),0===r.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",i),t.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",c),t.on("error",c),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t}}}),nu=p({"node_modules/util/util.js"(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(!y(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{return"[Circular]"}default:return t}})),l=i[n];n<a;l=i[++n])m(l)||!_(l)?s+=" "+l:s+=" "+o(l);return s},t.deprecate=function(e,r){if(typeof c<"u"&&!0===c.noDeprecation)return e;if(typeof c>"u")return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(c.throwDeprecation)throw new Error(r);c.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]),d(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(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&&T(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return y(i)||(i=u(e,i,n)),i}var a=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):m(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)),w(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(T(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return e.stylize(Date.prototype.toString.call(r),"date");if(w(r))return h(r)}var c,_="",A=!1,k=["{","}"];return p(r)&&(A=!0,k=["[","]"]),T(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(_=" "+RegExp.prototype.toString.call(r)),b(r)&&(_=" "+Date.prototype.toUTCString.call(r)),w(r)&&(_=" "+h(r)),0!==o.length||A&&0!=r.length?n<0?x(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=A?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)S(e,String(o))?a.push(f(t,e,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(f(t,e,r,n,i,!0))})),a}(e,r,n,s,o):o.map((function(t){return f(e,r,n,s,t,A)})),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]}(c,_,k)):k[0]+_+k[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(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")),S(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(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")),v(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 p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===A(t)}function _(t){return"object"==typeof t&&null!==t}function b(t){return _(t)&&"[object Date]"===A(t)}function w(t){return _(t)&&("[object Error]"===A(t)||t instanceof Error)}function T(t){return"function"==typeof t}function A(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=c.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=Fc(),t.isArray=p,t.isBoolean=d,t.isNull=m,t.isNullOrUndefined=function(t){return null==t},t.isNumber=g,t.isString=y,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=v,t.isRegExp=x,t.types.isRegExp=x,t.isObject=_,t.isDate=b,t.types.isDate=b,t.isError=w,t.types.isNativeError=w,t.isFunction=T,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||typeof t>"u"},t.isBuffer=Bc();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var E=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function C(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(E&&t[E]){var r;if("function"!=typeof(r=t[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,E,{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)),E&&Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,e(t))},t.promisify.custom=E,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){c.nextTick(a.bind(null,null,t))}),(function(t){c.nextTick(C.bind(null,t,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,e(t)),r}}}),iu=p({"node_modules/assert/build/internal/errors.js"(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){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var a,o,s={};function l(t,e,a){a||(a=Error);var o=function(a){!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)}(s,a);var o=function(t){var e=function(){if(typeof Reflect>"u"||!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{return!1}}();return function(){var n,a=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.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)}}(s);function s(r,n,i){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),a=o.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i)),a.code=t,a}return function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}(s)}(a);s[t]=o}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))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,o;if(void 0===a&&(a=bu()),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&function(t,e){return t.substr(0,4)===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-9,r)===e}(t," argument"))o="The ".concat(t," ").concat(i," ").concat(c(e,"type"));else{var s=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+1>t.length)&&-1!==t.indexOf(".",r)}(t)?"property":"argument";o='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(c(e,"type"))}return o+". Received type ".concat(r(n))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===o&&(o=nu());var n=o.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),l("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),l("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];void 0===a&&(a=bu()),a(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=s}}),au=p({"node_modules/assert/build/internal/assert/assertion_error.js"(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){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)}}function o(t){var e=function(t){if("object"!==m(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===m(e)?e:String(e)}function s(t,e){if(e&&("object"===m(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(typeof e<"u"){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return h(t,arguments,d(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,t)},u(t)}function h(t,e,r){return(h=f()?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&&p(i,r.prototype),i}).apply(null,arguments)}function f(){if(typeof Reflect>"u"||!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{return!1}}function p(t,e){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t){return(m="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 g=nu().inspect,y=iu().codes.ERR_INVALID_ARG_TYPE;function v(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var x="",_="",b="",w="",T={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 A(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 g(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}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&&p(t,e)}(i,t);var r=function(t){var e=f();return function(){var r,n=d(t);if(e){var i=d(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"!==m(t)||null===t)throw new y("options","Object",t);var n=t.message,a=t.operator,o=t.stackStartFn,u=t.actual,h=t.expected,f=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)e=r.call(this,String(n));else if(c.stderr&&c.stderr.isTTY&&(c.stderr&&c.stderr.getColorDepth&&1!==c.stderr.getColorDepth()?(x="",_="",w="",b=""):(x="",_="",w="",b="")),"object"===m(u)&&null!==u&&"object"===m(h)&&null!==h&&"stack"in u&&u instanceof Error&&"stack"in h&&h instanceof Error&&(u=A(u),h=A(h)),"deepStrictEqual"===a||"strictEqual"===a)e=r.call(this,function(t,e,r){var n="",i="",a=0,o="",s=!1,l=k(t),u=l.split("\n"),h=k(e).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===m(t)&&"object"===m(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var d=u[0].length+h[0].length;if(d<=10){if(!("object"===m(t)&&null!==t||"object"===m(e)&&null!==e||0===t&&0===e))return"".concat(T[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&d<(c.stderr&&c.stderr.isTTY?c.stderr.columns:80)){for(;u[0][f]===h[0][f];)f++;f>2&&(p="\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)}(" ",f),"^"),f=0)}}for(var g=u[u.length-1],y=h[h.length-1];g===y&&(f++<2?o="\n ".concat(g).concat(o):n=g,u.pop(),h.pop(),0!==u.length&&0!==h.length);)g=u[u.length-1],y=h[h.length-1];var A=Math.max(u.length,h.length);if(0===A){var M=l.split("\n");if(M.length>30)for(M[26]="".concat(x,"...").concat(w);M.length>27;)M.pop();return"".concat(T.notIdentical,"\n\n").concat(M.join("\n"),"\n")}f>3&&(o="\n".concat(x,"...").concat(w).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var S=0,E=T[r]+"\n".concat(_,"+ actual").concat(w," ").concat(b,"- expected").concat(w),C=" ".concat(x,"...").concat(w," Lines skipped");for(f=0;f<A;f++){var I=f-a;if(u.length<f+1)I>1&&f>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(h[f-2]),S++),i+="\n ".concat(h[f-1]),S++),a=f,n+="\n".concat(b,"-").concat(w," ").concat(h[f]),S++;else if(h.length<f+1)I>1&&f>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(u[f-2]),S++),i+="\n ".concat(u[f-1]),S++),a=f,i+="\n".concat(_,"+").concat(w," ").concat(u[f]),S++;else{var L=h[f],P=u[f],z=P!==L&&(!v(P,",")||P.slice(0,-1)!==L);z&&v(L,",")&&L.slice(0,-1)===P&&(z=!1,P+=","),z?(I>1&&f>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(u[f-2]),S++),i+="\n ".concat(u[f-1]),S++),a=f,i+="\n".concat(_,"+").concat(w," ").concat(P),n+="\n".concat(b,"-").concat(w," ").concat(L),S+=2):(i+=n,n="",(1===I||0===f)&&(i+="\n ".concat(P),S++))}if(S>20&&f<A-2)return"".concat(E).concat(C,"\n").concat(i,"\n").concat(x,"...").concat(w).concat(n,"\n")+"".concat(x,"...").concat(w)}return"".concat(E).concat(s?C:"","\n").concat(i).concat(n).concat(o).concat(p)}(u,h,a));else if("notDeepStrictEqual"===a||"notStrictEqual"===a){var p=T[a],d=k(u).split("\n");if("notStrictEqual"===a&&"object"===m(u)&&null!==u&&(p=T.notStrictEqualObject),d.length>30)for(d[26]="".concat(x,"...").concat(w);d.length>27;)d.pop();e=1===d.length?r.call(this,"".concat(p," ").concat(d[0])):r.call(this,"".concat(p,"\n\n").concat(d.join("\n"),"\n"))}else{var g=k(u),M="",S=T[a];"notDeepEqual"===a||"notEqual"===a?(g="".concat(T[a],"\n\n").concat(g)).length>1024&&(g="".concat(g.slice(0,1021),"...")):(M="".concat(k(h)),g.length>512&&(g="".concat(g.slice(0,509),"...")),M.length>512&&(M="".concat(M.slice(0,509),"...")),"deepEqual"===a||"equal"===a?g="".concat(S,"\n\n").concat(g,"\n\nshould equal\n\n"):M=" ".concat(a," ").concat(M)),e=r.call(this,"".concat(g).concat(M))}return Error.stackTraceLimit=f,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=h,e.operator=a,Error.captureStackTrace&&Error.captureStackTrace(l(e),o),e.stack,e.name="AssertionError",s(e)}return function(t,e){e&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1})}(i,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return g(this,n(n({},e),{},{customInspect:!1,depth:0}))}}]),i}(u(Error),g.custom);e.exports=M}}),ou=p({"node_modules/object-keys/isArguments.js"(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}}}),su=p({"node_modules/object-keys/implementation.js"(t,e){var r,n,i,a,o,s,l,c,u,h,f,p;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=ou(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=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(typeof window>"u")return!1;for(var t in window)try{if(!h["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch{return!0}}catch{return!0}return!1}(),p=function(t){if(typeof window>"u"||!f)return u(t);try{return u(t)}catch{return!1}},r=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=a(t),u=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(u&&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<c.length;++v)(!y||"constructor"!==c[v])&&n.call(t,c[v])&&h.push(c[v]);return h}),e.exports=r}}),lu=p({"node_modules/object-keys/index.js"(t,e){var r=Array.prototype.slice,n=ou(),i=Object.keys,a=i?function(t){return i(t)}:su(),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}}),cu=p({"node_modules/object.assign/implementation.js"(t,e){var r=lu(),n=Hl()(),i=Cc(),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 c=1;c<arguments.length;++c){var u=a(arguments[c]),h=r(u),f=n&&(Object.getOwnPropertySymbols||l);if(f)for(var p=f(u),d=0;d<p.length;++d){var m=p[d];s(u,m)&&o(h,m)}for(var g=0;g<h.length;++g){var y=h[g];if(s(u,y)){var v=u[y];i[y]=v}}}return i}}}),uu=p({"node_modules/object.assign/polyfill.js"(t,e){var r=cu();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{return"y"===t[1]}return!1}()?r:Object.assign}}}),hu=p({"node_modules/object-is/implementation.js"(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))}}}),fu=p({"node_modules/object-is/polyfill.js"(t,e){var r=hu();e.exports=function(){return"function"==typeof Object.is?Object.is:r}}}),pu=p({"node_modules/define-properties/index.js"(t,e){var r=lu(),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,o=Object.defineProperty,s=Mc()(),l=o&&s,c=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},u=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)c(t,o[s],e[o[s]],i[o[s]])};u.supportsDescriptors=!!l,e.exports=u}}),du=p({"node_modules/object-is/shim.js"(t,e){var r=fu(),n=pu();e.exports=function(){var t=r();return n(Object,{is:t},{is:function(){return Object.is!==t}}),t}}}),mu=p({"node_modules/object-is/index.js"(t,e){var r=pu(),n=Ec(),i=hu(),a=fu(),o=du(),s=n(a(),Object);r(s,{getPolyfill:a,implementation:i,shim:o}),e.exports=s}}),gu=p({"node_modules/is-nan/implementation.js"(t,e){e.exports=function(t){return t!=t}}}),yu=p({"node_modules/is-nan/polyfill.js"(t,e){var r=gu();e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}}}),vu=p({"node_modules/is-nan/shim.js"(t,e){var r=pu(),n=yu();e.exports=function(){var t=n();return r(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}}}),xu=p({"node_modules/is-nan/index.js"(t,e){var r=Ec(),n=pu(),i=gu(),a=yu(),o=vu(),s=r(a(),Number);n(s,{getPolyfill:a,implementation:i,shim:o}),e.exports=s}}),_u=p({"node_modules/assert/build/internal/util/comparisons.js"(t,e){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)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:mu(),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:xu();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=nu().types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,x=m.isMap,_=m.isRegExp,b=m.isSet,w=m.isNativeError,T=m.isBoxedPrimitive,A=m.isNumberObject,k=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(c(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 D(t,e,r,n){if(t===e)return 0!==t||!r||l(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&u(t)&&u(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),c=P(e);return s.length===c.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 A(t)?A(e)&&l(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):k(t)?k(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 O(t,e){return e.filter((function(e){return p(t,e)}))}function R(t,e,n,a,l,u){if(5===arguments.length){u=Object.keys(t);var h=Object.keys(e);if(u.length!==h.length)return!1}for(var d=0;d<u.length;d++)if(!f(e,u[d]))return!1;if(n&&5===arguments.length){var m=c(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;u.push(y),g++}else if(p(e,y))return!1}var v=c(e);if(m.length!==v.length&&O(e,v).length!==g)return!1}else{var x=c(e);if(0!==x.length&&0!==O(e,x).length)return!1}}if(0===u.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,c){var u=0;if(2===c){if(!function(t,e,r,n){for(var a=null,s=o(t),l=0;l<s.length;l++){var c=s[l];if("object"===i(c)&&null!==c)null===a&&(a=new Set),a.add(c);else if(!e.has(c)){if(r||!j(t,e,c))return!1;null===a&&(a=new Set),a.add(c)}}if(null!==a){for(var u=o(e),h=0;h<u.length;h++){var f=u[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===c){if(!function(t,e,n,a){for(var o=null,l=s(t),c=0;c<l.length;c++){var u=r(l[c],2),h=u[0],f=u[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)||!D(f,p,n,a)){if(n||!N(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)&&D(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===c)for(;u<t.length;u++){if(!f(t,u)){if(f(e,u))return!1;for(var h=Object.keys(t);u<h.length;u++){var p=h[u];if(!f(e,p)||!D(t[p],e[p],n,l))return!1}return h.length===Object.keys(e).length}if(!f(e,u)||!D(t[u],e[u],n,l))return!1}for(u=0;u<a.length;u++){var d=a[u];if(!D(t[d],e[d],n,l))return!1}return!0}(t,e,n,u,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(D(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(u(t))return!1}return!0}function j(t,e,r){var n=B(r);return n??(e.has(n)&&!t.has(n))}function N(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)||!D(n,o,!1,i))&&!t.has(a)&&D(n,o,!1,i)}function U(t,e,r,n,i,a){for(var s=o(t),l=0;l<s.length;l++){var c=s[l];if(D(r,c,i,a)&&D(n,e.get(c),i,a))return t.delete(c),!0}return!1}e.exports={isDeepEqual:function(t,e){return D(t,e,!1)},isDeepStrictEqual:function(t,e){return D(t,e,!0)}}}}),bu=p({"node_modules/assert/build/assert.js"(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=iu().codes,o=a.ERR_AMBIGUOUS_ARGUMENT,s=a.ERR_INVALID_ARG_TYPE,l=a.ERR_INVALID_ARG_VALUE,u=a.ERR_INVALID_RETURN_VALUE,h=a.ERR_MISSING_ARGS,f=au(),p=nu().inspect,d=nu().types,m=d.isPromise,g=d.isRegExp,y=uu()(),v=fu()(),x=Cc()("RegExp.prototype.test");function _(){var t=_u();n=t.isDeepEqual,i=t.isDeepStrictEqual}var b=!1,w=e.exports=M,T={};function A(t){throw t.message instanceof Error?t.message:new f(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 f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw a.generatedMessage=i,a}}function M(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];k.apply(void 0,[M,e.length].concat(e))}w.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===b&&(b=!0,(c.emitWarning?c.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 f(l);throw o&&(u.message=o,u.generatedMessage=!0),u},w.AssertionError=f,w.ok=M,w.equal=function t(e,r,n){if(arguments.length<2)throw new h("actual","expected");e!=r&&A({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},w.notEqual=function t(e,r,n){if(arguments.length<2)throw new h("actual","expected");e==r&&A({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},w.deepEqual=function t(e,r,i){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),n(e,r)||A({actual:e,expected:r,message:i,operator:"deepEqual",stackStartFn:t})},w.notDeepEqual=function t(e,r,i){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),n(e,r)&&A({actual:e,expected:r,message:i,operator:"notDeepEqual",stackStartFn:t})},w.deepStrictEqual=function t(e,r,a){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),i(e,r)||A({actual:e,expected:r,message:a,operator:"deepStrictEqual",stackStartFn:t})},w.notDeepStrictEqual=function t(e,r,a){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),i(e,r)&&A({actual:e,expected:r,message:a,operator:"notDeepStrictEqual",stackStartFn:t})},w.strictEqual=function t(e,r,n){if(arguments.length<2)throw new h("actual","expected");v(e,r)||A({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},w.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new h("actual","expected");v(e,r)&&A({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var S,E=(S=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]&&g(e[t])&&x(e[t],n[t])?i[t]=n[t]:i[t]=e[t])}))},Object.defineProperty(S,"prototype",{writable:!1}),S);function C(t,e,a,o){if("function"!=typeof e){if(g(e))return x(e,t);if(2===arguments.length)throw new s("expected",["Function","RegExp"],e);if("object"!==r(t)||null===t){var c=new f({actual:t,expected:e,message:a,operator:"deepStrictEqual",stackStartFn:o});throw c.operator=o.name,c}var u=Object.keys(e);if(e instanceof Error)u.push("name","message");else if(0===u.length)throw new l("error",e,"may not be an empty object");return void 0===n&&_(),u.forEach((function(r){"string"==typeof t[r]&&g(e[r])&&x(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 E(t,a),l=new E(e,a,t),c=new f({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=t,c.expected=e,c.operator=o.name,c}A({actual:t,expected:e,message:n,operator:o.name,stackStartFn:o})}}(t,e,r,a,u,o)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function I(t){if("function"!=typeof t)throw new s("fn","Function",t);try{t()}catch(t){return t}return T}function L(t){return m(t)||null!==t&&"object"===r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function P(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!L(e=t()))throw new u("instance of Promise","promiseFn",e)}else{if(!L(t))throw new s("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return T})).catch((function(t){return t}))}))}function z(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===T){var a="";n&&n.name&&(a+=" (".concat(n.name,")")),a+=i?": ".concat(i):".";var l="rejects"===t.name?"rejection":"exception";A({actual:void 0,expected:n,operator:t.name,message:"Missing expected ".concat(l).concat(a),stackStartFn:t})}if(n&&!C(e,n,i,t))throw e}function D(t,e,r,n){if(e!==T){if("string"==typeof r&&(n=r,r=void 0),!r||C(e,r)){var i=n?": ".concat(n):".",a="doesNotReject"===t.name?"rejection":"exception";A({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(!g(e))throw new s("regexp","RegExp",e);var o="match"===a;if("string"!=typeof t||x(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(p(t),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(p(e),". Input:\n\n").concat(p(t),"\n"));var c=new f({actual:t,expected:e,message:n,operator:a,stackStartFn:i});throw c.generatedMessage=l,c}}function R(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];k.apply(void 0,[R,e.length].concat(e))}w.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];z.apply(void 0,[t,I(e)].concat(n))},w.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 P(e).then((function(e){return z.apply(void 0,[t,e].concat(n))}))},w.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];D.apply(void 0,[t,I(e)].concat(n))},w.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 P(e).then((function(e){return D.apply(void 0,[t,e].concat(n))}))},w.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+=p(e);var i=new f({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 c=s.indexOf(o[l]);if(-1!==c){s=s.slice(0,c);break}}i.stack="".concat(s.join("\n"),"\n").concat(o.join("\n"))}throw i}},w.match=function t(e,r,n){O(e,r,n,t,"match")},w.doesNotMatch=function t(e,r,n){O(e,r,n,t,"doesNotMatch")},w.strict=y(R,w,{equal:w.strictEqual,deepEqual:w.deepStrictEqual,notEqual:w.notStrictEqual,notDeepEqual:w.notDeepStrictEqual}),w.strict.strict=w.strict}}),wu=p({"node_modules/stream-parser/node_modules/ms/index.js"(t,e){var r=1e3,n=60*r,i=60*n,a=24*i;function o(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 s=typeof t;if("string"===s&&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 o=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"days":case"day":case"d":return o*a;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(t);if("number"===s&&!1===isNaN(t))return e.long?function(t){return o(t,a,"day")||o(t,i,"hour")||o(t,n,"minute")||o(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))}}}),Tu=p({"node_modules/stream-parser/node_modules/debug/src/debug.js"(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=wu(),t.names=[],t.skips=[],t.formatters={}}}),Au=p({"node_modules/stream-parser/node_modules/debug/src/browser.js"(t,e){function r(){var e;try{e=t.storage.debug}catch{}return!e&&typeof c<"u"&&"env"in c&&(e=c.env.DEBUG),e}(t=e.exports=Tu()).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.load=r,t.useColors=function(){return!!(typeof window<"u"&&window.process&&"renderer"===window.process.type)||typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),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())}}),ku=p({"node_modules/stream-parser/index.js"(t,e){var r=bu(),n=Au()("stream-parser");function i(t){n("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function a(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||i(this),n("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function s(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function l(t,e,r){this._parserInit||i(this),n("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function c(t,e,r){this._parserInit||i(this),n("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function u(t,e,r,i){if(t._parserBytesLeft-=e.length,n("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return i;var a=t._parserCallback;if(a&&0===t._parserState&&t._parserBuffers.length>1&&(e=Buffer.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),a){var o=[];e&&o.push(e),r&&o.push(r);var s=a.length>o.length;s&&o.push(f(i));var l=a.apply(t,o);if(!s||i===l)return i}}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=a,t._skipBytes=o,e&&(t._passthrough=s),e?t._transform=c:t._write=l};var h=f((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 u(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return u(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 f(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}}),Mu=p({"node_modules/probe-image-size/lib/common.js"(t){var e=ru().Transform,r=ku();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}}),Su=p({"node_modules/probe-image-size/lib/miaf_utils.js"(t,e){var r=Mu().readUInt16BE,n=Mu().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,c=0;c<s;c++){var u=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[u]={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),c="",u=8;u<s.data.length&&s.data[u];u++)c+=String.fromCharCode(s.data[u]);e.item_inf[c]=l}a=s.end}}function c(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&&c(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"}}}}),Eu=p({"node_modules/probe-image-size/lib/exif_utils.js"(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{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 this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return this.read_uint32(e);case 9:return 0|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),c=this.read_uint32(e+4),u=this.exif_format_length(l),h=c*u,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<c;g++,m+=u){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:c,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{return-1}}}}),Cu=p({"node_modules/probe-image-size/lib/parse_sync/avif.js"(t,e){var r=Mu().str2arr,n=Mu().sliceEq,i=Mu().readUInt32BE,a=Su(),o=Eu(),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,c=e.end;;){var u=a.unbox(t,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.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}}}}}}}}),Iu=p({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(t,e){var r=Mu().str2arr,n=Mu().sliceEq,i=Mu().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"}}}}),Lu=p({"node_modules/probe-image-size/lib/parse_sync/gif.js"(t,e){var r=Mu().str2arr,n=Mu().sliceEq,i=Mu().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"}}}}),Pu=p({"node_modules/probe-image-size/lib/parse_sync/ico.js"(t,e){var r=Mu().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,c=t[6+16*s+1]||256,u={width:l,height:c};a.push(u),(l>o.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),zu=p({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(t,e){var r=Mu().readUInt16BE,n=Mu().str2arr,i=Mu().sliceEq,a=Eu(),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 c={width:r(t,e+3),height:r(t,e+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return l>0&&(c.orientation=l),c}e+=n}}}}),Du=p({"node_modules/probe-image-size/lib/parse_sync/png.js"(t,e){var r=Mu().str2arr,n=Mu().sliceEq,i=Mu().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"}}}}),Ou=p({"node_modules/probe-image-size/lib/parse_sync/psd.js"(t,e){var r=Mu().str2arr,n=Mu().sliceEq,i=Mu().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"}}}}),Ru=p({"node_modules/probe-image-size/lib/parse_sync/svg.js"(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='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[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="",c=0;c<t.length;c++)e+=String.fromCharCode(t[c]);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:u(f.width),hUnits:u(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)&&u(g.width)===u(g.height)){var x=y/v;return f.width?n(p)?{width:p,height:p/x,type:"svg",mime:"image/svg+xml",wUnits:u(f.width),hUnits:u(f.width)}:void 0:f.height?n(d)?{width:d*x,height:d,type:"svg",mime:"image/svg+xml",wUnits:u(f.height),hUnits:u(f.height)}:void 0:{width:y,height:v,type:"svg",mime:"image/svg+xml",wUnits:u(g.width),hUnits:u(g.height)}}}}}}}),Fu=p({"node_modules/probe-image-size/lib/parse_sync/tiff.js"(t,e){var r=Mu().str2arr,n=Mu().sliceEq,i=Mu().readUInt16LE,a=Mu().readUInt16BE,o=Mu().readUInt32LE,s=Mu().readUInt32BE,l=r("II*\0"),c=r("MM\0*");function u(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=u(t,e+2,r);return 1!==h(t,e+4,r)||3!==n&&4!==n?null:3===n?u(t,e+8,r):h(t,e+8,r)}e.exports=function(t){if(!(t.length<8)&&(n(t,0,l)||n(t,0,c))){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*u(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=u(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"}}}}}}}}),Bu=p({"node_modules/probe-image-size/lib/parse_sync/webp.js"(t,e){var r=Mu().str2arr,n=Mu().sliceEq,i=Mu().readUInt16LE,a=Mu().readUInt32LE,o=Eu(),s=r("RIFF"),l=r("WEBP");function c(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 u(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||c(t,e+8):"VP8L"===p&&d>=9?r=r||u(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}}}}}),ju=p({"node_modules/probe-image-size/lib/parsers_sync.js"(t,e){e.exports={avif:Cu(),bmp:Iu(),gif:Lu(),ico:Pu(),jpeg:zu(),png:Du(),psd:Ou(),svg:Ru(),tiff:Fu(),webp:Bu()}}}),Nu=p({"node_modules/probe-image-size/sync.js"(t,e){var r=ju();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}}),Uu=p({"src/traces/image/helpers.js"(t){var e=Nu(),r=On().IMAGE_URL_PREFIX,n=ql().Buffer;t.getImageSize=function(t){var i=t.replace(r,""),a=new n(i,"base64");return e(a)}}}),Vu=p({"src/traces/image/calc.js"(t,e){var r=le(),n=Rl(),i=A(),a=ir(),o=le().maxRowLength,s=Uu().getImageSize;function l(t,e,n,i){return function(a){return r.constrain((a-t)*e,n,i)}}function c(t,e){return function(n){return r.constrain(n,t,e)}}e.exports=function(t,e){var r,u;if(e._hasZ)r=e.z.length,u=o(e.z);else if(e._hasSource){var h=s(e.source);r=h.height,u=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+u*e.dx],v=[g,g+r*e.dy];if(p&&"log"===p.type)for(f=0;f<u;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).length;t._sArray=[];for(var a=0;a<r;a++)e.min[a]!==t.zmin[a]||e.max[a]!==t.zmax[a]?t._sArray.push(l(t.zmin[a],(e.max[a]-e.min[a])/(t.zmax[a]-t.zmin[a]),e.min[a],e.max[a])):t._sArray.push(c(e.min[a],e.max[a]));return function(e){for(var n=e.slice(0,r),a=0;a<r;a++){var o=n[a];if(!i(o))return!1;n[a]=t._sArray[a](o)}return n}}(e),[{x0:m,y0:g,z:e.z,w:u,h:r}]}}}),qu=p({"src/traces/image/plot.js"(t,e){var r=x(),n=le(),i=n.strTranslate,a=ke(),o=Rl(),s=jo(),l=Bo().STYLE;e.exports=function(t,e,c,u){var h=e.xaxis,f=e.yaxis,p=!t._context._exportedPlot&&s();n.makeTraceGroups(u,c,"im").each((function(e){var s=r.select(this),c=e[0],u=c.trace,d=("fast"===u.zsmooth||!1===u.zsmooth&&p)&&!u._hasZ&&u._hasSource&&"linear"===h.type&&"linear"===f.type;u._realImage=d;var m,g,y,v,x,_,b=c.z,w=c.x0,T=c.y0,A=c.w,k=c.h,M=u.dx,S=u.dy;for(_=0;void 0===m&&_<A;)m=h.c2p(w+_*M),_++;for(_=A;void 0===g&&_>0;)g=h.c2p(w+_*M),_--;for(_=0;void 0===v&&_<k;)v=f.c2p(T+_*S),_++;for(_=k;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){m=Math.max(-.5*h._length,m),g=Math.min(1.5*h._length,g),v=Math.max(-.5*f._length,v),x=Math.min(1.5*f._length,x)}var E=Math.round(g-m),C=Math.round(x-v);if(E<=0||C<=0)s.selectAll("image").data([]).exit().remove();else{var I=s.selectAll("image").data([e]);I.enter().append("svg:image").attr({xmlns:a.svg,preserveAspectRatio:"none"}),I.exit().remove();var L=!1===u.zsmooth?l:"";if(d){var P=n.simpleMap(h.range,h.r2l),z=n.simpleMap(f.range,f.r2l),D=P[1]<P[0],O=z[1]>z[0];if(D||O){var R=m+E/2,F=v+C/2;L+="transform:"+i(R+"px",F+"px")+"scale("+(D?-1:1)+","+(O?-1:1)+")"+i(-R+"px",-F+"px")+";"}}I.attr("style",L);var B=new Promise((function(t){if(u._hasZ)t();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===A&&u._canvas.el.height===k&&u._canvas.source===u.source)t();else{var e=document.createElement("canvas");e.width=A,e.height=k;var r=e.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:e,source:u.source},t()},n.setAttribute("src",u.source)}})).then((function(){var t;if(u._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(u._hasSource)if(d)t=u.source;else{var e=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,A,k).data;t=j((function(t,r){var n=4*(r*A+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}I.attr({"xlink:href":t,height:C,width:E,x:m,y:v})}));t._promises.push(B)}function j(t){var e=document.createElement("canvas");e.width=E,e.height=C;var r,i=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return n.constrain(Math.round(h.c2p(w+t*M)-m),0,E)},s=function(t){return n.constrain(Math.round(f.c2p(T+t*S)-v),0,C)},l=o.colormodel[u.colormodel],p=l.colormodel||u.colormodel,d=l.fmt;for(_=0;_<c.w;_++){var g=a(_),y=a(_+1);if(y!==g&&!isNaN(y)&&!isNaN(g))for(var x=0;x<c.h;x++){var b=s(x),A=s(x+1);A===b||isNaN(A)||isNaN(b)||!t(_,x)||(r=u._scaler(t(_,x)),i.fillStyle=r?p+"("+d(r).join(",")+")":"rgba(0,0,0,0)",i.fillRect(g,b,y-g,A-b))}}return e}}))}}}),Hu=p({"src/traces/image/style.js"(t,e){var r=x();e.exports=function(t){r.select(t).selectAll(".im image").style("opacity",(function(t){return t[0].trace.opacity}))}}}),Gu=p({"src/traces/image/hover.js"(t,e){var r=Dr(),n=le(),i=n.isArrayOrTypedArray,a=Rl();e.exports=function(t,e,o){var s=t.cd[0],l=s.trace,c=t.xa,u=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 A=u.c2p(s.y0+(p+.5)*l.dy),k=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:c.c2p(s.x0+f*l.dx),x1:c.c2p(s.x0+(f+1)*l.dx),y0:A,y1:A,color:b,xVal:k,xLabelVal:k,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]}})]}}}}}),Wu=p({"src/traces/image/event_data.js"(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}}}),Zu=p({"src/traces/image/index.js"(t,e){e.exports={attributes:Fl(),supplyDefaults:Bl(),calc:Vu(),plot:qu(),style:Hu(),hoverPoints:Gu(),eventData:Wu(),moduleType:"trace",name:"image",basePlotModule:Si(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Yu=p({"lib/image.js"(t,e){e.exports=Zu()}}),Xu=p({"src/traces/pie/attributes.js"(t,e){var r=U(),n=Aa().attributes,i=F(),a=q(),o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=R().extendFlat,c=zt().pattern,u=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:c,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({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),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"}}}}),$u=p({"src/traces/pie/defaults.js"(t,e){var r=A(),n=le(),i=Xu(),a=Aa().defaults,o=Ya().handleText,s=le().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 c=e[l];if(r(c)&&c>0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(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:c,supplyDefaults:function(t,e,r,s){function u(r,a){return n.coerce(t,e,i,r,a)}var h=l(u("labels"),u("values")),f=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),f){e._length=f,c(t,e,s,u,!0),u("scalegroup");var p,d=u("text"),m=u("texttemplate");if(m||(p=u("textinfo",n.isArrayOrTypedArray(d)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),m||p&&"none"!==p){var g=u("textposition");o(t,e,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===p&&u("textposition","none");a(e,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");!y&&"middle center"===v&&(e.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else e.visible=!1}}}}),Ku=p({"src/traces/pie/layout_attributes.js"(t,e){e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Ju=p({"src/traces/pie/layout_defaults.js"(t,e){var r=le(),n=Ku();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")}}}),Qu=p({"src/traces/pie/calc.js"(t,e){var r=A(),n=O(),i=H(),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||[],c=e.labels,u=e.marker.colors||[],h=e.values,f=e._length,p=e._hasValues&&f;if(e.dlabel)for(c=new Array(f),n=0;n<f;n++)c[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=c[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,label:x,color:m(u[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&&u[n]&&(i.color=m(u[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 c=0,u=0;u<i.length;u++){var h=i[u];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[c%o.length],c++))}}},makePullColorFn:o,generateExtendedColors:s}}}),th=p({"src/traces/pie/event_data.js"(t,e){var r=$e().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}}}),eh=p({"src/traces/pie/plot.js"(t,e){var r=x(),n=Ae(),i=Dr(),a=H(),o=Qe(),s=le(),l=s.strScale,c=s.strTranslate,u=Se(),h=Ja(),f=h.recordMinTextSize,p=h.clearMinTextSize,d=Ha().TEXTPAD,m=br(),g=th(),y=le().isValidTextValue;function v(t,e,n){var a=n[0],o=a.cx,l=a.cy,c=a.trace,u="funnelarea"===c.type;"_hasHoverLabel"in c||(c._hasHoverLabel=!1),"_hasHoverEvent"in c||(c._hasHoverEvent=!1),t.on("mouseover",(function(t){var n=e._fullLayout,h=e._fullData[c.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:c._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:c,x0:d-p*a.r,x1:d+p*a.r,y,_x0:u?o+t.TL[0]:d-p*a.r,_x1:u?o+t.TR[0]:d+p*a.r,_y0:u?l+t.TL[1]:y-p*a.r,_y1:u?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],c._hasHoverLabel=!0}c._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[c.index],o=r.select(this).datum();c._hasHoverEvent&&(t.originalEvent=r.event,e.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var n=e._fullLayout,a=e._fullData[c.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,c=m.castOption(t.insidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,u=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:c,textcase:u,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(u.convertToTspans,e),c=o.bBox(l.node(),!0);r.titleBox={width:c.width,height:c.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,c=e.midangle,u=r.trace.insidetextorientation,h="horizontal"===u,f="tangential"===u,p="radial"===u,d="auto"===u,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),c=s<l?s:l;(a="tan"===i?A(t,n,o,c,0):T(t,n,o,c,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,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||f)&&((a=A(t,n,o,l,c)).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:k(a,o/e),rotate:M(i)}}function A(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:k(a,o/e),rotate:M(i+Math.PI/2)}}function k(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),c=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(c+=l,o.x-=(1+i)*l,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?c*=2:-1!==a.title.position.indexOf("right")&&(c+=l,o.x+=(1+i)*l,s.tx-=t.titleBox.width/2),r=c/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 c=s/2,u=l/2;"funnelarea"===a.type&&!a.scalegroup&&(u/=a.aspectratio),i.r=Math.min(c,u)/(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 c,u;i.aspectratio>1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}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 D(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function O(t,e,r){var n,i=t._fullLayout,a=r.trace,o=a.texttemplate,l=a.textinfo;if(!o&&l&&"none"!==l){var c,u=l.split("+"),h=function(t){return-1!==u.indexOf(t)},f=h("label"),p=h("text"),d=h("value"),g=h("percent"),v=i.separators;if(c=f?[e.label]:[],p){var x=m.getFirstFilled(a.text,e.pts);y(x)&&c.push(x)}d&&c.push(m.formatPieValue(e.v,v)),g&&c.push(m.formatPiePercent(e.v/r.vTotal,v)),e.text=c.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,c="px0",u="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,c="px1",u="px0"}for(n=D(a,s),e=0;e<t.length;e++)!(r=t[e]).hidden&&(r[c]=n,r.startangle=s,s+=l*r.v/2,r.pxmid=D(a,s),r.midangle=s,n=D(a,s+=l*r.v/2),r.stopangle=s,r[u]=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 x=r.select(this).selectAll("g.slice").data(e);x.enter().append("g").classed("slice",!0),x.exit().remove();var b=[[[],[]],[[],[]]],T=!1;x.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,c=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(v,t,e),y.pull){var x=+m.castOption(y.pull,n.pts)||0;x>0&&(l+=x*n.pxmid[0],c+=x*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var A=y.hole;if(n.v===g.vTotal){var k="M"+(l+n.px0[0])+","+(c+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";A?d.attr("d","M"+(l+A*n.px0[0])+","+(c+A*n.px0[1])+L(n.px0,n.pxmid,!1,A)+L(n.pxmid,n.px0,!1,A)+"Z"+k):d.attr("d",k)}else{var M=L(n.px0,n.px1,!0,1);if(A){var S=1-A;d.attr("d","M"+(l+A*n.px1[0])+","+(c+A*n.px1[1])+L(n.px1,n.px0,!1,A)+"l"+S*n.px0[0]+","+S*n.px0[1]+M+"Z")}else d.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+M+"Z")}O(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){return{color:m.castOption(t.outsidetextfont.color,e.pts)||m.castOption(t.textfont.color,e.pts)||r.color,family:m.castOption(t.outsidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,size:m.castOption(t.outsidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,weight:m.castOption(t.outsidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,style:m.castOption(t.outsidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,variant:m.castOption(t.outsidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,textcase:m.castOption(t.outsidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,lineposition:m.castOption(t.outsidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,shadow:m.castOption(t.outsidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow}}(y,n,h.font):_(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,p).call(u.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,A=void 0===b?n.pxmid:D(g.r,b);if(d.targetX=l+A[0]*d.rCenter+(d.x||0),d.targetY=c+A[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var k=d.targetY;n.yLabelMin=k-v.height/2,n.yLabelMid=k,n.yLabelMax=k+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 A=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(A.enter().append("g").classed("titletext",!0),A.exit().remove(),A.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(u.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",c(e.x,e.y)+l(Math.min(1,e.scale))+c(e.tx,e.ty))})),T&&function(t,e){var r,n,i,a,o,l,c,u,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,u,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*c>0&&(t.labelExtraY=x),s.isArrayOrTypedArray(e.pull))for(u=0;u<f.length;u++)!((h=f[u])===t||(m.castOption(e.pull,t.pts)||0)>=(m.castOption(e.pull,h.pts)||0))&&((t.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-t.labelExtraY)*c>0&&(t.labelExtraY+=x):(y+t.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-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,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=t[n][r]).sort(i),h=t[1-n][r],f=h.concat(u),d=[],p=0;p<u.length;p++)void 0!==u[p].yLabelMid&&d.push(u[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]),c=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var u=t.labelExtraX*t.pxmid[1]/t.pxmid[0],h=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(u)>Math.abs(h)?l+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+c):l+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;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()}))}(x,y),T&&y.automargin){var k=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-k.left,0),r:Math.max(k.right-(g.cx+g.r),0),b:Math.max(k.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-k.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:O,transformInsideText:w,determineInsideTextFont:_,positionTitleOutside:I,prerenderTitles:b,layoutAreas:z,attachFxHandlers:v,computeTransform:R}}}),rh=p({"src/traces/pie/style.js"(t,e){var r=x(),n=Tr(),i=Ja().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)}))}))}}}),nh=p({"src/traces/pie/base_plot.js"(t){var e=Ae();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)}}}),ih=p({"src/traces/pie/index.js"(t,e){e.exports={attributes:Xu(),supplyDefaults:$u().supplyDefaults,supplyLayoutDefaults:Ju(),layoutAttributes:Ku(),calc:Qu().calc,crossTraceCalc:Qu().crossTraceCalc,plot:eh().plot,style:rh(),styleOne:Tr(),moduleType:"trace",name:"pie",basePlotModule:nh(),categories:["pie-like","pie","showLegend"],meta:{}}}}),ah=p({"lib/pie.js"(t,e){e.exports=ih()}}),oh=p({"src/traces/sunburst/base_plot.js"(t){var e=Ae();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)}}}),sh=p({"src/traces/sunburst/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),lh=p({"src/traces/sunburst/attributes.js"(t,e){var r=U(),n=Ot().hovertemplateAttrs,i=Ot().texttemplateAttrs,a=Pe(),o=Aa().attributes,s=Xu(),l=sh(),c=R().extendFlat,u=zt().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:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},s.marker.line.color,{dflt:null}),width:c({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,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:c({},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:c({},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"})}}}),ch=p({"src/traces/sunburst/layout_attributes.js"(t,e){e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),uh=p({"src/traces/sunburst/defaults.js"(t,e){var r=le(),n=lh(),i=Aa().defaults,a=Ya().handleText,o=$u().handleMarkerDefaults,s=Ze(),l=s.hasColorscale,c=s.handleDefaults;e.exports=function(t,e,s,u){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,u,h);var m=e._hasColorscale=l(t,"marker","colors")||(t.marker||{}).coloraxis;m&&c(t,e,u,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,u,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,u,h),e._length=null}else e.visible=!1}}}),hh=p({"src/traces/sunburst/layout_defaults.js"(t,e){var r=le(),n=ch();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("sunburstcolorway",e.colorway),i("extendsunburstcolors")}}}),fh=p({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(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,u=new c(t),h=+t.value&&(u.value=t.value),f=[u];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 c(i[a])),n.parent=r,n.depth=r.depth+1;return u.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 c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,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 u=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}(u.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,c=o-n,u=s-i,h=Math.sqrt(l*l+c*c);return{x:(r+a+l/h*u)/2,y:(n+o+c/h*u)/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,c=r.x,u=r.y,h=r.r,f=n-o,p=n-c,d=i-s,m=i-u,g=l-a,y=h-a,v=n*n+i*i-a*a,x=v-o*o-s*s+l*l,_=v-c*c-u*u+h*h,b=p*d-f*m,w=(d*_-m*x)/(2*b)-n,T=(m*g-d*y)/b,A=(p*x-f*_)/(2*b)-i,k=(f*y-p*g)/b,M=T*T+k*k-1,S=2*(a+w*T+A*k),E=w*w+A*A-a*a,C=-(M?(S+Math.sqrt(S*S-4*M*E))/(2*M):E/S);return{x:n+w+T*C,y:i+A+k*C,r:C}}function x(t,e,r){var n,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+r.r,i*=i,o=t.r+r.r,i>(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-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,c,u,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,c=e.previous,u=r._.r,f=e._.r;do{if(u<=f){if(_(l._,n._)){r=l,e.next=r,r.previous=e,--s;continue t}u+=l._.r,l=l.next}else{if(_(c._,n._)){(e=c).next=r,r.previous=e,--s;continue t}f+=c._.r,c=c.previous}}while(l!==c.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 A(t){if("function"!=typeof t)throw new Error;return t}function k(){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,c=t.value&&(n-e)/t.value;++s<l;)(a=o[s]).y0=r,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var z={depth:-1},D={};function O(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 j(t){var e=t.children;return e?e[e.length-1]:t.t}function N(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,c=t.value&&(i-r)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=n,a.y0=r,a.y1=r+=a.value*c}V.prototype=Object.create(c.prototype);var H=(1+Math.sqrt(5))/2;function G(t,e,r,n,i,a){for(var o,s,l,c,u,h,f,p,d,m,g,y=[],v=e.children,x=0,_=0,b=v.length,w=e.value;x<b;){l=i-r,c=a-n;do{u=v[_++].value}while(!u&&_<b);for(h=f=u,g=u*u*(m=Math.max(c/l,l/c)/(w*t)),d=Math.max(f/g,g/h);_<b;++_){if(u+=s=v[_].value,s<h&&(h=s),s>f&&(f=s),g=u*u*m,(p=Math.max(f/g,g/h))>d){u-=s;break}d=p}y.push(o={value:u,dice:l<c,children:v.slice(x,_)}),o.dice?P(o,r,n,i,w?n+=c*u/w:a):q(o,r,n,w?r+=l*u/w:i,a),w-=u,x=_}return y}var W=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),Z=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,h=-1,f=o.length,p=t.value;++h<f;){for(l=(s=o[h]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].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 c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=c.x-t(c,u)/2,f=u.x+t(u,c)/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=k;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(k,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:A(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=O,e=R;function r(r){var n,i,a,o,s,u,h,f=r.length,p=new Array(f),d={};for(i=0;i<f;++i)n=r[i],s=p[i]=new c(n),null!=(u=t(n,i,r))&&(u+="")&&(d[h="$"+(s.id=u)]=h in d?D:s);for(i=0;i<f;++i)if(s=p[i],null!=(u=e(r[i],i,r))&&(u+="")){if(!(o=d["$"+u]))throw new Error("missing: "+u);if(o===D)throw new Error("ambiguous: "+u);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=A(e),r):t},r.parentId=function(t){return arguments.length?(e=A(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 c=i,u=i,h=i;i.eachBefore((function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>h.depth&&(h=t)}));var f=c===u?1:t(c,u)/2,p=f-c.x,d=e/(u.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],c=a.m,u=o.m,h=s.m,f=l.m;s=j(s),a=B(a),s&&a;)l=B(l),(o=j(o)).a=e,(i=s.z+h-a.z-c+t(s._,a._))>0&&(N(U(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=h-u),a&&!B(l)&&(l.t=a,l.m+=c-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=W,e=!1,r=1,n=1,i=[0],a=k,o=k,s=k,l=k,c=k;function u(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,u=e.y0+r,h=e.x1-r,f=e.y1-r;h<n&&(n=h=(n+h)/2),f<u&&(u=f=(u+f)/2),e.x0=n,e.y0=u,e.x1=h,e.y1=f,e.children&&(r=i[e.depth+1]=a(e)/2,n+=c(e)-r,u+=o(e)-r,(h-=s(e)-r)<n&&(n=h=(n+h)/2),(f-=l(e)-r)<u&&(u=f=(u+f)/2),t(e,n,u,h,f))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(r=+t[0],n=+t[1],u):[r,n]},u.tile=function(e){return arguments.length?(t=A(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:M(+t),u):a},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:M(+t),u):o},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:M(+t),u):s},u.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:M(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:M(+t),u):c},u},t.treemapBinary=function(t,e,r,n,i){var a,o,s=t.children,l=s.length,c=new Array(l+1);for(c[0]=o=a=0;a<l;++a)c[a+1]=o+=s[a].value;!function t(e,r,n,i,a,o,l){if(e>=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[e],f=n/2+h,p=e+1,d=r-1;p<d;){var m=p+d>>>1;c[m]<f?p=m+1:d=m}f-c[p-1]<c[p]-f&&e+1<p&&--p;var g=c[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=Z,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:P)(t,e,r,n,i)},t.treemapSquarify=W,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),ph=p({"src/traces/sunburst/calc.js"(t){var e=fh(),r=A(),n=le(),i=Ze().makeColorScaleFuncFromTrace,a=Qu().makePullColorFn,o=Qu().generateExtendedColors,s=Ze().calc,l=k().ALMOST_EQUAL,c={},u={},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 c,u,h,p,d,m,g=t._fullLayout,y=o.ids,v=n.isArrayOrTypedArray(y),x=o.labels,_=o.parents,b=o.values,w=n.isArrayOrTypedArray(b),T=[],A={},k={},M=function(t){return t||"number"==typeof t},S=function(t){return!w||r(b[t])&&b[t]>=0};v?(c=Math.min(y.length,_.length),u=function(t){return M(y[t])&&S(t)},h=function(t){return String(y[t])}):(c=Math.min(x.length,_.length),u=function(t){return M(x[t])&&S(t)},h=function(t){return String(x[t])}),w&&(c=Math.min(c,b.length));for(var E=0;E<c;E++)if(u(E)){var C=h(E),I=M(_[E])?String(_[E]):"",L={i:E,id:C,pid:I,label:M(x[E])?String(x[E]):""};w&&(L.v=+b[E]),T.push(L),d=C,A[p=I]?A[p].push(d):A[p]=[d],k[d]=1}if(A[""]){if(A[""].length>1){for(var P=n.randstr(),z=0;z<T.length;z++)""===T[z].pid&&(T[z].pid=P);T.unshift({hasMultipleRoots:!0,id:P,pid:"",label:""})}}else{var D,O=[];for(D in A)k[D]||O.push(D);if(1!==O.length)return n.warn(["Multiple implied roots, cannot build",o.type,"hierarchy of",o.name+".","These roots include:",O.join(", ")].join(" "));D=O[0],T.unshift({hasImpliedRoot:!0,id:D,pid:"",label:D})}try{m=e.stratify().id((function(t){return t.id})).parentId((function(t){return t.pid}))(T)}catch(p){return n.warn(["Failed to build",o.type,"hierarchy of",o.name+".","Error:",p.message].join(" "))}var R=e.hierarchy(m),F=!1;if(w)switch(o.branchvalues){case"remainder":R.sum((function(t){return t.data.v}));break;case"total":R.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 F=!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(R,o,{branches:-1!==o.count.indexOf("branches"),leaves:-1!==o.count.indexOf("leaves")});if(!F){o.sort&&R.sort((function(t,e){return e.value-t.value}));var B,j,N=o.marker.colors||[],U=!!N.length;return o._hasColorscale?(U||(N=w?o.values:o._values),s(t,o,{vals:N,containerStr:"marker",cLetter:"c"}),j=i(o.marker)):B=a(g["_"+o.type+"colormap"]),R.each((function(t){var e=t.data.data;e.color=o._hasColorscale?j(N[e.i]):B(N[e.i],e.id)})),T[0].hierarchy=R,T}},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?u:c));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 dh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function mh(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}var gh=f({"node_modules/d3-color/src/define.js"(){}});function yh(){}function vh(){return this.rgb().formatHex()}function xh(){return this.rgb().formatHex8()}function _h(){return Oh(this).formatHsl()}function bh(){return this.rgb().formatRgb()}function wh(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Wh.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?Th(e):3===r?new Sh(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Ah(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Ah(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=Zh.exec(t))?new Sh(e[1],e[2],e[3],1):(e=Yh.exec(t))?new Sh(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Xh.exec(t))?Ah(e[1],e[2],e[3],e[4]):(e=$h.exec(t))?Ah(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Kh.exec(t))?Dh(e[1],e[2]/100,e[3]/100,1):(e=Jh.exec(t))?Dh(e[1],e[2]/100,e[3]/100,e[4]):Qh.hasOwnProperty(t)?Th(Qh[t]):"transparent"===t?new Sh(NaN,NaN,NaN,0):null}function Th(t){return new Sh(t>>16&255,t>>8&255,255&t,1)}function Ah(t,e,r,n){return n<=0&&(t=e=r=NaN),new Sh(t,e,r,n)}function kh(t){return t instanceof yh||(t=wh(t)),t?new Sh((t=t.rgb()).r,t.g,t.b,t.opacity):new Sh}function Mh(t,e,r,n){return 1===arguments.length?kh(t):new Sh(t,e,r,n??1)}function Sh(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Eh(){return`#${zh(this.r)}${zh(this.g)}${zh(this.b)}`}function Ch(){return`#${zh(this.r)}${zh(this.g)}${zh(this.b)}${zh(255*(isNaN(this.opacity)?1:this.opacity))}`}function Ih(){let t=Lh(this.opacity);return`${1===t?"rgb(":"rgba("}${Ph(this.r)}, ${Ph(this.g)}, ${Ph(this.b)}${1===t?")":`, ${t})`}`}function Lh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ph(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function zh(t){return((t=Ph(t))<16?"0":"")+t.toString(16)}function Dh(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Fh(t,e,r,n)}function Oh(t){if(t instanceof Fh)return new Fh(t.h,t.s,t.l,t.opacity);if(t instanceof yh||(t=wh(t)),!t)return new Fh;if(t instanceof Fh)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 Fh(o,s,l,t.opacity)}function Rh(t,e,r,n){return 1===arguments.length?Oh(t):new Fh(t,e,r,n??1)}function Fh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Bh(t){return(t=(t||0)%360)<0?t+360:t}function jh(t){return Math.max(0,Math.min(1,t||0))}function Nh(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 Uh,Vh,qh,Hh,Gh,Wh,Zh,Yh,Xh,$h,Kh,Jh,Qh,tf,ef,rf=f({"node_modules/d3-color/src/color.js"(){gh(),Vh=1/(Uh=.7),qh="\\s*([+-]?\\d+)\\s*",Hh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wh=/^#([0-9a-f]{3,8})$/,Zh=new RegExp(`^rgb\\(${qh},${qh},${qh}\\)$`),Yh=new RegExp(`^rgb\\(${Gh},${Gh},${Gh}\\)$`),Xh=new RegExp(`^rgba\\(${qh},${qh},${qh},${Hh}\\)$`),$h=new RegExp(`^rgba\\(${Gh},${Gh},${Gh},${Hh}\\)$`),Kh=new RegExp(`^hsl\\(${Hh},${Gh},${Gh}\\)$`),Jh=new RegExp(`^hsla\\(${Hh},${Gh},${Gh},${Hh}\\)$`),Qh={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},dh(yh,wh,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:vh,formatHex:vh,formatHex8:xh,formatHsl:_h,formatRgb:bh,toString:bh}),dh(Sh,Mh,mh(yh,{brighter(t){return t=null==t?Vh:Math.pow(Vh,t),new Sh(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Uh:Math.pow(Uh,t),new Sh(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Sh(Ph(this.r),Ph(this.g),Ph(this.b),Lh(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:Eh,formatHex:Eh,formatHex8:Ch,formatRgb:Ih,toString:Ih})),dh(Fh,Rh,mh(yh,{brighter(t){return t=null==t?Vh:Math.pow(Vh,t),new Fh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Uh:Math.pow(Uh,t),new Fh(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 Sh(Nh(t>=240?t-240:t+120,i,n),Nh(t,i,n),Nh(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Fh(Bh(this.h),jh(this.s),jh(this.l),Lh(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=Lh(this.opacity);return`${1===t?"hsl(":"hsla("}${Bh(this.h)}, ${100*jh(this.s)}%, ${100*jh(this.l)}%${1===t?")":`, ${t})`}`}}))}}),nf=f({"node_modules/d3-color/src/math.js"(){tf=Math.PI/180,ef=180/Math.PI}});function af(t){if(t instanceof sf)return new sf(t.l,t.a,t.b,t.opacity);if(t instanceof pf)return df(t);t instanceof Sh||(t=kh(t));var e,r,n=hf(t.r),i=hf(t.g),a=hf(t.b),o=lf((.2225045*n+.7168786*i+.0606169*a)/gf);return n===i&&i===a?e=r=o:(e=lf((.4360747*n+.3850649*i+.1430804*a)/mf),r=lf((.0139322*n+.0971045*i+.7141733*a)/yf)),new sf(116*o-16,500*(e-o),200*(o-r),t.opacity)}function of(t,e,r,n){return 1===arguments.length?af(t):new sf(t,e,r,n??1)}function sf(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function lf(t){return t>bf?Math.pow(t,.3333333333333333):t/_f+vf}function cf(t){return t>xf?t*t*t:_f*(t-vf)}function uf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,.4166666666666667)-.055)}function hf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ff(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof pf)return new pf(t.h,t.c,t.l,t.opacity);if(t instanceof sf||(t=af(t)),0===t.a&&0===t.b)return new pf(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*ef;return new pf(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new pf(t,e,r,n??1)}function pf(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function df(t){if(isNaN(t.h))return new sf(t.l,0,0,t.opacity);var e=t.h*tf;return new sf(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}var mf,gf,yf,vf,xf,_f,bf,wf=f({"node_modules/d3-color/src/lab.js"(){gh(),rf(),nf(),mf=.96422,gf=1,yf=.82521,vf=4/29,_f=3*(xf=6/29)*xf,bf=xf*xf*xf,dh(sf,of,mh(yh,{brighter(t){return new sf(this.l+18*(t??1),this.a,this.b,this.opacity)},darker(t){return new sf(this.l-18*(t??1),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 Sh(uf(3.1338561*(e=mf*cf(e))-1.6168667*(t=gf*cf(t))-.4906146*(r=yf*cf(r))),uf(-.9787684*e+1.9161415*t+.033454*r),uf(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),dh(pf,ff,mh(yh,{brighter(t){return new pf(this.h,this.c,this.l+18*(t??1),this.opacity)},darker(t){return new pf(this.h,this.c,this.l-18*(t??1),this.opacity)},rgb(){return df(this).rgb()}}))}});function Tf(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof Af)return new Af(t.h,t.s,t.l,t.opacity);t instanceof Sh||(t=kh(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(Lf*n+Cf*e-If*r)/(Lf+Cf-If),a=n-i,o=(Ef*(r-i)-Mf*a)/Sf,s=Math.sqrt(o*o+a*a)/(Ef*i*(1-i)),l=s?Math.atan2(o,a)*ef-120:NaN;return new Af(l<0?l+360:l,s,i,t.opacity)}(t):new Af(t,e,r,n??1)}function Af(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var kf,Mf,Sf,Ef,Cf,If,Lf,Pf=f({"node_modules/d3-color/src/cubehelix.js"(){gh(),rf(),nf(),Cf=(Ef=1.97294)*(Sf=-.90649),If=Ef*(kf=1.78277),Lf=kf*(Mf=-.29227)-Sf*-.14861,dh(Af,Tf,mh(yh,{brighter(t){return t=null==t?Vh:Math.pow(Vh,t),new Af(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Uh:Math.pow(Uh,t),new Af(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*tf,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new Sh(255*(e+r*(-.14861*n+kf*i)),255*(e+r*(Mf*n+Sf*i)),255*(e+r*(Ef*n)),this.opacity)}}))}}),zf=f({"node_modules/d3-color/src/index.js"(){rf(),wf(),Pf()}});function Df(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 Df((r-n/e)*e,o,i,a,s)}}var Rf=f({"node_modules/d3-interpolate/src/basis.js"(){}});function Ff(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 Df((r-n/e)*e,i,a,o,s)}}var Bf,jf=f({"node_modules/d3-interpolate/src/basisClosed.js"(){Rf()}}),Nf=f({"node_modules/d3-interpolate/src/constant.js"(){Bf=t=>()=>t}});function Uf(t,e){return function(r){return t+r*e}}function Vf(t,e){var r=e-t;return r?Uf(t,r>180||r<-180?r-360*Math.round(r/360):r):Bf(isNaN(t)?e:t)}function qf(t,e){var r=e-t;return r?Uf(t,r):Bf(isNaN(t)?e:t)}var Hf=f({"node_modules/d3-interpolate/src/color.js"(){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=Mh(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 Wf,Zf,Yf,Xf=f({"node_modules/d3-interpolate/src/rgb.js"(){zf(),Rf(),jf(),Hf(),Wf=function t(e){var r=function(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):Bf(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Mh(t)).r,(e=Mh(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),Zf=Gf(Of),Yf=Gf(Ff)}});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 Kf(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var Jf=f({"node_modules/d3-interpolate/src/numberArray.js"(){}});function Qf(t,e){return(Kf(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=f({"node_modules/d3-interpolate/src/array.js"(){pp(),Jf()}});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=f({"node_modules/d3-interpolate/src/date.js"(){}});function ip(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var ap=f({"node_modules/d3-interpolate/src/number.js"(){}});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=f({"node_modules/d3-interpolate/src/object.js"(){pp()}});function lp(t,e){var r,n,i,a=cp.lastIndex=up.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=cp.exec(t))&&(n=up.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=up.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 cp,up,hp=f({"node_modules/d3-interpolate/src/string.js"(){ap(),cp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,up=new RegExp(cp.source,"g")}});function fp(t,e){var r,n=typeof e;return null==e||"boolean"===n?Bf(e):("number"===n?ip:"string"===n?(r=wh(e))?(e=r,Wf):lp:e instanceof wh?Wf:e instanceof Date?rp:Kf(e)?$f:Array.isArray(e)?tp:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?op:ip)(t,e)}var pp=f({"node_modules/d3-interpolate/src/value.js"(){zf(),Xf(),ep(),np(),ap(),sp(),hp(),Nf(),Jf()}});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=f({"node_modules/d3-interpolate/src/discrete.js"(){}});function gp(t,e){var r=Vf(+t,+e);return function(t){var e=r(t);return e-360*Math.floor(e/360)}}var yp=f({"node_modules/d3-interpolate/src/hue.js"(){Hf()}});function vp(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var xp=f({"node_modules/d3-interpolate/src/round.js"(){}});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=f({"node_modules/d3-interpolate/src/transform/decompose.js"(){bp=180/Math.PI,wp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}});function Ap(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 kp(t){return null!=t&&(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=f({"node_modules/d3-interpolate/src/transform/parse.js"(){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=f({"node_modules/d3-interpolate/src/transform/index.js"(){ap(),Sp(),Cp=Ep(Ap,"px, ","px)","deg)"),Ip=Ep(kp,", ",")",")")}});function Pp(t){return((t=Math.exp(t))+1/t)/2}var zp,Dp=f({"node_modules/d3-interpolate/src/zoom.js"(){zp=function t(e,r,n){function i(t,i){var a,o,s=t[0],l=t[1],c=t[2],u=i[0],h=i[1],f=i[2],p=u-s,d=h-l,m=p*p+d*d;if(m<1e-12)o=Math.log(f/c)/e,a=function(t){return[s+t*p,l+t*d,c*Math.exp(e*t*o)]};else{var g=Math.sqrt(m),y=(f*f-c*c+n*m)/(2*c*r*g),v=(f*f-c*c-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=c/(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,c*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 Op(t){return function(e,r){var n=t((e=Rh(e)).h,(r=Rh(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=f({"node_modules/d3-interpolate/src/hsl.js"(){zf(),Hf(),Rp=Op(Vf),Fp=Op(qf)}});function jp(t,e){var r=qf((t=of(t)).l,(e=of(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 Np=f({"node_modules/d3-interpolate/src/lab.js"(){zf(),Hf()}});function Up(t){return function(e,r){var n=t((e=ff(e)).h,(r=ff(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=f({"node_modules/d3-interpolate/src/hcl.js"(){zf(),Hf(),Vp=Up(Vf),qp=Up(qf)}});function Gp(t){return function e(r){function n(e,n){var i=t((e=Tf(e)).h,(n=Tf(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 Wp,Zp,Yp=f({"node_modules/d3-interpolate/src/cubehelix.js"(){zf(),Hf(),Wp=Gp(Vf),Zp=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=f({"node_modules/d3-interpolate/src/piecewise.js"(){pp()}});function Kp(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r}var Jp=f({"node_modules/d3-interpolate/src/quantize.js"(){}}),Qp={};d(Qp,{interpolate:()=>fp,interpolateArray:()=>Qf,interpolateBasis:()=>Of,interpolateBasisClosed:()=>Ff,interpolateCubehelix:()=>Wp,interpolateCubehelixLong:()=>Zp,interpolateDate:()=>rp,interpolateDiscrete:()=>dp,interpolateHcl:()=>Vp,interpolateHclLong:()=>qp,interpolateHsl:()=>Rp,interpolateHslLong:()=>Fp,interpolateHue:()=>gp,interpolateLab:()=>jp,interpolateNumber:()=>ip,interpolateNumberArray:()=>$f,interpolateObject:()=>op,interpolateRgb:()=>Wf,interpolateRgbBasis:()=>Zf,interpolateRgbBasisClosed:()=>Yf,interpolateRound:()=>vp,interpolateString:()=>lp,interpolateTransformCss:()=>Cp,interpolateTransformSvg:()=>Ip,interpolateZoom:()=>zp,piecewise:()=>Xp,quantize:()=>Kp});var td=f({"node_modules/d3-interpolate/src/index.js"(){pp(),ep(),Rf(),jf(),np(),mp(),yp(),ap(),Jf(),sp(),xp(),hp(),Lp(),Dp(),Xf(),Bp(),Np(),Hp(),Yp(),$p(),Jp()}}),ed=p({"src/traces/sunburst/fill_one.js"(t,e){var r=Qe(),n=H();e.exports=function(t,e,i,a,o){var s=e.data.data,l=s.i,c=o||s.color;if(l>=0){e.i=s.i;var u=i.marker;u.pattern?(!u.colors||!u.pattern.shape)&&(u.color=c,e.color=c):(u.color=c,e.color=c),r.pointStyle(t,i,a,e)}else n.fill(t,c)}}}),rd=p({"src/traces/sunburst/style.js"(t,e){var r=x(),n=H(),i=le(),a=Ja().resizeText,o=ed();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).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=p({"src/traces/sunburst/helpers.js"(t){var e=le(),r=H(),n=pr(),i=br();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,c=l.i,u=e.castOption(n,c,(s?"pathbar.textfont":"insidetextfont")+".color");return!u&&n._input.textfont&&(u=e.castOption(n._input,c,"textfont.color")),{color:u||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=p({"src/traces/sunburst/fx.js"(t,e){var r=x(),n=qt(),i=$e().appendArrayPointValue,a=Dr(),o=le(),s=pe(),l=nd(),c=br().formatPieValue;function u(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),A=function(t){return o.castOption(v,_,t)},k=A("hovertemplate"),M=a.castHoverinfo(v,s,_),S=s.separators;if(k||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=c(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 D,O=[],R=function(){-1===O.indexOf(D)&&(P.push(D),O.push(D))};I.percentParent=n.percentParent=T/l.getValue(w),I.parent=n.parentString=l.getPtLabel(w),z("percent parent")&&(D=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&&(D=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&&(D=l.formatPercent(I.percentRoot,S)+" of "+I.root,R()),I.text=A("hovertext")||A("text"),z("text")&&(D=I.text,o.isValidTextValue(D)&&P.push(D)),h=[u(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:k||z("name")?v.name:void 0,color:A("hoverlabel.bgcolor")||x.color,borderColor:A("hoverlabel.bordercolor"),fontFamily:A("hoverlabel.font.family"),fontSize:A("hoverlabel.font.size"),fontColor:A("hoverlabel.font.color"),fontWeight:A("hoverlabel.font.weight"),fontStyle:A("hoverlabel.font.style"),fontVariant:A("hoverlabel.font.variant"),nameLength:A("hoverlabel.namelength"),textAlign:A("hoverlabel.align"),hovertemplate:k,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 j=t.select("path.surface");f.styleOne(j,n,v,i,{hovered:!0})}d._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(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:[u(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],c=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:[u(t,o,f.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+d.type+"click",v);if(!1!==x&&e.hovermode&&(i._hoverdata=[u(t,o,f.eventDataKeys)],a.click(i,r.event)),!c&&!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=p({"src/traces/sunburst/plot.js"(t){var e=x(),r=fh(),n=(td(),g(Qp)).interpolate,i=Qe(),a=le(),o=Se(),s=Ja(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=eh(),h=br().getRotationAngle,f=u.computeTransform,p=u.transformInsideText,d=rd().styleOne,m=to().resizeText,y=id(),v=sh(),_=nd();function b(s,c,u,m){var g=s._context.staticPlot,x=s._fullLayout,b=!x.uniformtext.mode&&_.hasTransition(m),T=e.select(u).selectAll("g.slice"),A=c[0],k=A.trace,M=A.hierarchy,S=_.findEntryWithLevel(M,k.level),E=_.getMaxDepth(k),C=x._size,I=k.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),D=A.cx=C.l+C.w*(I.x[1]+I.x[0])/2,O=A.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(),j=S.height+1,N=0,U=E;A.hasMultipleRoots&&_.isHierarchyRoot(S)&&(B=B.slice(1),j-=1,N=1,U+=1),B=B.filter((function(t){return t.y1<=U}));var V=h(k.rotation);V&&B.forEach((function(t){t.x0+=V,t.x1+=V}));var q=Math.min(j,E),H=function(t){return(t-N)/q*z},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},W=function(t){return a.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,D,O)},Z=function(t){return D+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Y=function(t){return O+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 c,u=s.children;u.forEach((function(t,e){if(_.getPtId(t)===r)return c=e}));var h=u.length,f=n(s.x0,s.x1);e={rpx0:z,rpx1:z,x0:f(c/h),x1:f((c+1)/h)}}return n(i,e)}(t);return function(t){return W(e(t))}})),t.select("g.slicetext").attr("opacity",0)})).remove():T.exit().remove(),T.order();var X=null;if(b&&R){var $=_.getPtId(R);T.each((function(t){null===X&&_.getPtId(t)===$&&(X=t.x1)}))}var K=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&&(K=K.transition().each("end",(function(){var t=e.select(this);_.setSliceCursor(t,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})}))),K.each((function(r){var u=e.select(this),h=a.ensureSingle(u,"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=G(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(X){var o=(t.x1>X?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 W(e(t))}})):h.attr("d",W),u.call(y,S,s,c,{eventDataKeys:v.eventDataKeys,transitionTime:v.CLICK_TRANSITION_TIME,transitionEasing:v.CLICK_TRANSITION_EASING}).call(_.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(d,r,k,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),T=a.ensureUniformFontSize(s,_.determineTextFont(k,r,x.font));w.text(t.formatSliceLabel(r,S,k,c,x)).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,A),r.transform.targetX=Z(r),r.transform.targetY=Y(r);var E=function(t,e){var r=t.transform;return f(r,e),r.fontSize=T.size,l(k.type,r,x),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(X){var o=t.x1>X?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),c=n(e.rpx1,t.rpx1),u=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);return function(t){var e=c(t),r=u(t),n=h(t),a=function(t){return m(Math.pow(t,d))}(t),o={pxmid:G(e,(r+n)/2),rpx1:e,transform:{textPosAngle:s(t),rCenter:a,x:i.x,y:i.y}};return l(k.type,i,x),{transform:{targetX:Z(o),targetY:Y(o),scale:f(t),rotate:p(t),rCenter:a}}}}(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,u=!n,h=!s.uniformtext.mode&&_.hasTransition(n);c("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&&m(t,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&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,c=n[0],u=t.data.data,h=c.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")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(_.formatValue(u.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,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("<br>")}var A=a.castOption(r,u.i,"texttemplate");if(!A)return"";var k={};u.label&&(k.label=u.label),u.hasOwnProperty("v")&&(k.value=u.v,k.valueLabel=_.formatValue(u.v,l)),k.currentPath=_.getPath(t.data),f||(k.percentParent=d/_.getValue(p),k.percentParentLabel=_.formatPercent(k.percentParent,l),k.parent=_.getPtLabel(p)),k.percentEntry=d/_.getValue(e),k.percentEntryLabel=_.formatPercent(k.percentEntry,l),k.entry=_.getPtLabel(e),k.percentRoot=d/_.getValue(h),k.percentRootLabel=_.formatPercent(k.percentRoot,l),k.root=_.getPtLabel(h),u.hasOwnProperty("color")&&(k.color=u.color);var M=a.castOption(r,u.i,"text");return(a.isValidTextValue(M)||""===M)&&(k.text=M),k.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString(A,k,i._d3locale,k,r._meta||{})}}}),od=p({"src/traces/sunburst/index.js"(t,e){e.exports={moduleType:"trace",name:"sunburst",basePlotModule:oh(),categories:[],animatable:!0,attributes:lh(),layoutAttributes:ch(),supplyDefaults:uh(),supplyLayoutDefaults:hh(),calc:ph().calc,crossTraceCalc:ph().crossTraceCalc,plot:ad().plot,style:rd().style,colorbar:pi(),meta:{}}}}),sd=p({"lib/sunburst.js"(t,e){e.exports=od()}}),ld=p({"src/traces/treemap/base_plot.js"(t){var e=Ae();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)}}}),cd=p({"src/traces/treemap/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),ud=p({"src/traces/treemap/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Pe(),a=Aa().attributes,o=Xu(),s=lh(),l=cd(),c=R().extendFlat,u=zt().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:c({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:u,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:c({},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:c({},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=p({"src/traces/treemap/layout_attributes.js"(t,e){e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),fd=p({"src/traces/treemap/defaults.js"(t,e){var r=le(),n=ud(),i=H(),a=Aa().defaults,o=Ya().handleText,s=Ha().TEXTPAD,l=$u().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,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=u(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=p({"src/traces/treemap/layout_defaults.js"(t,e){var r=le(),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=p({"src/traces/treemap/calc.js"(t){var e=ph();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("treemap",t)}}}),md=p({"src/traces/treemap/flip_tree.js"(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=p({"src/traces/treemap/partition.js"(t,e){var r=fh(),n=md();e.exports=function(t,e,i){var a,o=i.flipX,s=i.flipY,l="dice-slice"===i.packing,c=i.pad[s?"bottom":"top"],u=i.pad[o?"right":"left"],h=i.pad[o?"left":"right"],f=i.pad[s?"top":"bottom"];l&&(a=u,u=c,c=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(u).paddingRight(h).paddingTop(c).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=p({"src/traces/treemap/style.js"(t,e){var r=x(),n=H(),i=le(),a=nd(),o=Ja().resizeText,s=ed();function l(t,e,r,o,l){var c,u,h=(l||{}).hovered,f=e.data.data,p=f.i,d=f.color,m=a.isHierarchyRoot(e),g=1;if(h)c=r._hovered.marker.line.color,u=r._hovered.marker.line.width;else if(m&&d===r.root.color)g=100,c="rgba(0,0,0,0)",u=0;else if(c=i.castOption(r,p,"marker.line.color")||n.defaultLine,u=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",u).call(n.stroke,c).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=p({"src/traces/treemap/draw_ancestors.js"(t,e){var r=x(),n=le(),i=Qe(),a=Se(),o=gd(),s=yd().styleOne,l=cd(),c=nd(),u=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,A=d.handleSlicesExit,k=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,D=c.listPath(f.data,"id"),O=o(P.copy(),[g,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(O=O.filter((function(t){var e=D.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(O,c.getPtId)).enter().append("g").classed("pathbar",!0),A(p,h,S,[g,y],_),p.order();var R=p;T&&(R=R.transition().each("end",(function(){var e=r.select(this);c.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=k(t,h,S,[g,y]);return function(t){return _(e(t))}})):d.attr("d",_),p.call(u,f,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),d.call(s,o,L,t,{hovered:!1}),o._text=(c.getPtLabel(o)||"").split("<br>").join(" ")||"";var m=n.ensureSingle(p,"g","slicetext"),A=n.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),I=n.ensureUniformFontSize(t,c.determineTextFont(L,o,C.font,{onPathbar:!0}));A.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,I).call(a.convertToTspans,t),o.textBB=i.bBox(A.node()),o.transform=b(o,{fontSize:I.size,onPathbar:!0}),o.transform.fontSize=I.size,T?A.transition().attrTween("transform",(function(t){var e=M(t,h,S,[g,y]);return function(t){return w(e(t))}})):A.attr("transform",w(o))}))}}}),xd=p({"src/traces/treemap/plot_one.js"(t,e){var r=x(),n=(td(),g(Qp)).interpolate,i=nd(),a=le(),o=Ha().TEXTPAD,s=eo().toMoveInsideBar,l=Ja().recordMinTextSize,c=cd(),u=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 A=i.isHierarchyRoot(_),k=!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+c.gapWithPathbar,D=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?I+z:-(P+z):0,O={x0:L,x1:L,y0:D,y1:D+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={},j={},N=null,U=function(t,e){return e?B[h(t)]:j[h(t)]};g.hasMultipleRoots&&A&&M++,y._maxDepth=M,y._backgroundColor=m.paper_bgcolor,y._entryDepth=_.data.depth,y._atRootLevel=A;var V=-C/2+S.l+S.w*(E.x[1]+E.x[0])/2,q=-I/2+S.t+S.h*(1-(E.y[1]+E.y[0])/2),H=function(t){return V+t},G=function(t){return q+t},W=G(0),Z=H(0),Y=function(t){return Z+t},X=function(t){return W+t};function $(t,e){return t+","+e}var K=Y(0),J=function(t){t.x=Math.max(K,t.x)},Q=y.pathbar.edgeshape,tt=y[v?"tiling":"marker"].pad,et=function(t){return-1!==y.textposition.indexOf(t)},rt=et("top"),nt=et("left"),it=et("right"),at=et("bottom"),ot=function(t,e){var r=t.x0,n=t.x1,i=t.y0,a=t.y1,c=t.textBB,u=rt||e.isHeader&&!at?"start":at?"end":"middle",h=et("right"),f=et("left")||e.onPathbar?-1:h?1:0;if(e.isHeader){if((r+=(v?tt:tt.l)-o)>=(n-=(v?tt:tt.r)-o)){var p=(r+n)/2;r=p,n=p}var d;at?i<(d=a-(v?tt:tt.b))&&d<a&&(i=d):i<(d=i+(v?tt:tt.t))&&d<a&&(a=d)}var g=s(r,n,i,a,c,{isHorizontal:!1,constrained:!0,angle:0,anchor:u,leftToRight:f});return g.fontSize=e.fontSize,g.targetX=H(g.targetX),g.targetY=G(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})},st=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||{}},lt=function(t,e,r,i,o){var s,l=U(t,e);if(l)s=l;else if(e)s=O;else if(F)if(t.parent){var c=N||r;c&&!e?s=R(t,c,i):(s={},a.extendFlat(s,st(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),c={},u=function(t,e,r,n){if(e)return B[h(x)]||O;var i=j[y.level]||r;return function(t){return t.data.depth-_.data.depth<M}(t)?R(t,i,n):{}}(t,e,r,o);a.extendFlat(c,{transform:ot({x0:u.x0,x1:u.x1,y0:u.y0,y1:u.y1,textBB:t.textBB,_text:t._text},{isHeader:i.isHeader(t,y)})}),s?c=s:t.parent&&a.extendFlat(c,st(t,e));var f=t.transform;return t.x0!==t.x1&&t.y0!==t.y1&&l(y.type,f,m),n(c,{transform:{scale:f.scale,rotate:f.rotate,textX:f.textX,textY:f.textY,anchorX:f.anchorX,anchorY:f.anchorY,targetX:f.targetX,targetY:f.targetY}})},ut=function(t,e,i,a,o){var s=a[0],l=a[1];k?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=O;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()},ht=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})};k&&(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){j[h(t)]={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1},t.transform&&(j[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)}))),N=d(t,e,_,T,{width:C,height:I,viewX:H,viewY:G,pathSlice:function(t){var e=H(t.x0),r=H(t.x1),n=G(t.y0),i=G(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&&(rt&&(l=Math.min(l,tt.t)),nt&&(l=Math.min(l,tt.l)),it&&(l=Math.min(l,tt.r)),at&&(l=Math.min(l,tt.b)));var c=function(t,e){return l?"a"+$(l,l)+" 0 0 1 "+$(t,e):""};return"M"+$(e,n+l)+c(l,-l)+"L"+$(r-l,n)+c(l,l)+"L"+$(r,i-l)+c(-l,l)+"L"+$(e+l,i)+c(-l,-l)+"Z"},toMoveInsideSlice:ot,prevEntry:F,makeUpdateSliceInterpolator:lt,makeUpdateTextInterpolator:ct,handleSlicesExit:ut,hasTransition:k,strTransform:ht}),y.pathbar.visible?u(t,e,_,w,{barDifY:D,width:L,height:P,viewX:Y,viewY:X,pathSlice:function(t){var e=Y(Math.max(Math.min(t.x0,t.x0),0)),r=Y(Math.min(Math.max(t.x1,t.x1),L)),n=X(t.y0),i=X(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},c={x:r,y:n},u={x:r,y:i},h={x:e,y:i};return">"===Q?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===Q?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===Q?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===Q&&(o.x-=a,s.x-=a),J(l),J(h),J(o),J(c),J(u),J(s),"M"+$(l.x,l.y)+"L"+$(c.x,c.y)+"L"+$(s.x,s.y)+"L"+$(u.x,u.y)+"L"+$(h.x,h.y)+"L"+$(o.x,o.y)+"Z"},toMoveInsideSlice:ot,makeUpdateSliceInterpolator:lt,makeUpdateTextInterpolator:ct,handleSlicesExit:ut,hasTransition:k,strTransform:ht}):w.remove()}}}),_d=p({"src/traces/treemap/draw.js"(t,e){var r=x(),n=nd(),i=Ja().clearMinTextSize,a=to().resizeText,o=xd();e.exports=function(t,e,s,l,c){var u,h,f=c.type,p=c.drawDescendants,d=t._fullLayout,m=d["_"+f+"layer"],g=!s;i(f,d),(u=m.selectAll("g.trace."+f).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(f,!0),u.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)}))}))):(u.each((function(e){o(t,e,this,s,p)})),d.uniformtext.mode&&a(t,m.selectAll(".trace"),f)),g&&u.exit().remove()}}}),bd=p({"src/traces/treemap/draw_descendants.js"(t,e){var r=x(),n=le(),i=Qe(),a=Se(),o=gd(),s=yd().styleOne,l=cd(),c=nd(),u=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,A=m.handleSlicesExit,k=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"),D=!z&&!I.marker.pad.t||z&&!I.marker.pad.b,O=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;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):(R=Math.min(R,e),F=Math.max(F,e))})),d=d.data(O,c.getPtId),I._maxVisibleLayers=isFinite(F)?F-R+1:0,d.enter().append("g").classed("slice",!0),A(d,f,{},[g,y],_),d.order();var B=null;if(T&&S){var j=c.getPtId(S);d.each((function(t){null===B&&c.getPtId(t)===j&&(B={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=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);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var d=c.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),A=n.ensureSingle(m,"path","surface",(function(t){t.style("pointer-events",E?"none":"all")}));T?A.transition().attrTween("d",(function(t){var e=k(t,f,N(),[g,y]);return function(t){return _(e(t))}})):A.attr("d",_),m.call(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),A.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=d?D?"":c.getPtLabel(o)||"":h(o,p,I,e,C)||"";var S=n.ensureSingle(m,"g","slicetext"),O=n.ensureSingle(S,"text","",(function(t){t.attr("data-notex",1)})),R=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font)),F=o._text||" ",B=d&&-1===F.indexOf("<br>");O.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(O.node()),o.transform=b(o,{fontSize:R.size,isHeader:d}),o.transform.fontSize=R.size,T?O.transition().attrTween("transform",(function(t){var e=M(t,f,N(),[g,y]);return function(t){return w(e(t))}})):O.attr("transform",w(o))})),B}}}),wd=p({"src/traces/treemap/plot.js"(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=p({"src/traces/treemap/index.js"(t,e){e.exports={moduleType:"trace",name:"treemap",basePlotModule:ld(),categories:[],animatable:!0,attributes:ud(),layoutAttributes:hd(),supplyDefaults:fd(),supplyLayoutDefaults:pd(),calc:dd().calc,crossTraceCalc:dd().crossTraceCalc,plot:wd(),style:yd().style,colorbar:pi(),meta:{}}}}),Ad=p({"lib/treemap.js"(t,e){e.exports=Td()}}),kd=p({"src/traces/icicle/base_plot.js"(t){var e=Ae();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=p({"src/traces/icicle/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Pe(),a=Aa().attributes,o=Xu(),s=lh(),l=ud(),c=cd(),u=R().extendFlat,h=zt().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:u({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:c.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:c.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=p({"src/traces/icicle/layout_attributes.js"(t,e){e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Ed=p({"src/traces/icicle/defaults.js"(t,e){var r=le(),n=Md(),i=H(),a=Aa().defaults,o=Ya().handleText,s=Ha().TEXTPAD,l=$u().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,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=u(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=p({"src/traces/icicle/layout_defaults.js"(t,e){var r=le(),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=p({"src/traces/icicle/calc.js"(t){var e=ph();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("icicle",t)}}}),Ld=p({"src/traces/icicle/partition.js"(t,e){var r=fh(),n=md();e.exports=function(t,e,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&n(h,e,{swapXY:s,flipX:a,flipY:o}),h}}}),Pd=p({"src/traces/icicle/style.js"(t,e){var r=x(),n=H(),i=le(),a=Ja().resizeText,o=ed();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).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=p({"src/traces/icicle/draw_descendants.js"(t,e){var r=x(),n=le(),i=Qe(),a=Se(),o=Ld(),s=Pd().styleOne,l=cd(),c=nd(),u=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,A=m.handleSlicesExit,k=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"),D=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(),O=1/0,R=-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):(O=Math.min(O,e),R=Math.max(R,e))})),d=d.data(D,c.getPtId),I._maxVisibleLayers=isFinite(R)?R-O+1:0,d.enter().append("g").classed("slice",!0),A(d,f,{},[g,y],_),d.order();var F=null;if(T&&S){var B=c.getPtId(S);d.each((function(t){null===F&&c.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var j=function(){return F||{x0:0,x1:g,y0:0,y1:y}},N=d;return T&&(N=N.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.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=k(t,f,j(),[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(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.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 A=n.ensureSingle(d,"g","slicetext"),S=n.ensureSingle(A,"text","",(function(t){t.attr("data-notex",1)})),D=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font));S.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":L?"start":"middle").call(i.font,D).call(a.convertToTspans,t),o.textBB=i.bBox(S.node()),o.transform=b(o,{fontSize:D.size}),o.transform.fontSize=D.size,T?S.transition().attrTween("transform",(function(t){var e=M(t,f,j(),[g,y]);return function(t){return w(e(t))}})):S.attr("transform",w(o))})),F}}}),Dd=p({"src/traces/icicle/plot.js"(t,e){var r=_d(),n=zd();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"icicle",drawDescendants:n})}}}),Od=p({"src/traces/icicle/index.js"(t,e){e.exports={moduleType:"trace",name:"icicle",basePlotModule:kd(),categories:[],animatable:!0,attributes:Md(),layoutAttributes:Sd(),supplyDefaults:Ed(),supplyLayoutDefaults:Cd(),calc:Id().calc,crossTraceCalc:Id().crossTraceCalc,plot:Dd(),style:Pd().style,colorbar:pi(),meta:{}}}}),Rd=p({"lib/icicle.js"(t,e){e.exports=Od()}}),Fd=p({"src/traces/funnelarea/base_plot.js"(t){var e=Ae();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=p({"src/traces/funnelarea/attributes.js"(t,e){var r=Xu(),n=U(),i=Aa().attributes,a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=R().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"}}}}),jd=p({"src/traces/funnelarea/layout_attributes.js"(t,e){var r=Ku().hiddenlabels;e.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Nd=p({"src/traces/funnelarea/defaults.js"(t,e){var r=le(),n=Bd(),i=Aa().defaults,a=Ya().handleText,o=$u().handleLabelsAndValues,s=$u().handleMarkerDefaults;e.exports=function(t,e,l,c){function u(i,a){return r.coerce(t,e,n,i,a)}var h=u("labels"),f=u("values"),p=o(h,f),d=p.len;if(e._hasLabels=p.hasLabels,e._hasValues=p.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),d){e._length=d,s(t,e,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),y||m&&"none"!==m){var v=u("textposition");a(t,e,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(e,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else e.visible=!1}}}),Ud=p({"src/traces/funnelarea/layout_defaults.js"(t,e){var r=le(),n=jd();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=p({"src/traces/funnelarea/calc.js"(t,e){var r=Qu();e.exports={calc:function(t,e){return r.calc(t,e)},crossTraceCalc:function(t){r.crossTraceCalc(t,{type:"funnelarea"})}}}}),qd=p({"src/traces/funnelarea/plot.js"(t,e){var r=x(),n=Qe(),i=le(),a=i.strScale,o=i.strTranslate,s=Se(),l=eo().toMoveInsideBar,c=Ja(),u=c.recordMinTextSize,h=c.clearMinTextSize,f=br(),p=eh(),d=p.attachFxHandlers,m=p.determineInsideTextFont,g=p.layoutAreas,y=p.prerenderTitles,v=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 c=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),c=e.vTotal,u=c,h=c*l/(1-l)/c,f=[];for(f.push(S()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var p=s.v/u;h+=p,f.push(S())}var d=1/0,m=-1/0;for(o=0;o<f.length;o++)a=f[o],d=Math.min(d,a[1]),m=Math.max(m,a[1]);for(o=0;o<f.length;o++)f[o][1]-=(m+d)/2;var g=f[f.length-1][0],y=e.r,v=(m-d)/2,x=y/g,_=y/v*n;for(e.r=_*v,o=0;o<f.length;o++)f[o][0]*=x,f[o][1]*=_;var b=[-(a=f[0])[0],a[1]],T=[a[0],a[1]],A=0;for(o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var k=f[A+=1][0],M=f[A][1];s.TL=[-k,M],s.TR=[k,M],s.BL=b,s.BR=T,s.pxmid=w(s.TR,s.BR),b=s.TL,T=s.TR}}function S(){var t=function(){var t=Math.sqrt(h);return{x:t,y:-t}}();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":c?"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 A=f.castOption(y.textposition,a.pts),k=x.selectAll("g.slicetext").data(a.text&&"none"!==A?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),f=i.ensureUniformFontSize(t,m(y,a,p.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,f).call(s.convertToTspans,t);var d,g,x,_=n.bBox(c.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,u(y.type,d,p),e[o].transform=d,i.setTransormAndDisplay(c,d)}))}}));var x=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);x.enter().append("g").classed("titletext",!0),x.exit().remove(),x.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 c=v(g,p._size);e.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Hd=p({"src/traces/funnelarea/style.js"(t,e){var r=x(),n=Tr(),i=Ja().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=p({"src/traces/funnelarea/index.js"(t,e){e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:Fd(),categories:["pie-like","funnelarea","showLegend"],attributes:Bd(),layoutAttributes:jd(),supplyDefaults:Nd(),supplyLayoutDefaults:Ud(),calc:Vd().calc,crossTraceCalc:Vd().crossTraceCalc,plot:qd(),style:Hd(),styleOne:Tr(),meta:{}}}}),Wd=p({"lib/funnelarea.js"(t,e){e.exports=Gd()}}),Zd=p({"stackgl_modules/index.js"(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){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)}}function i(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch{}return(a=function(){return!!t})()}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function l(t){return(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})(t)}var c=r(7507),u=r(3778),h="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=d,e.IS=50;var f=2147483647;function p(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(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 y(t)}return m(t,e,r)}function m(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=p(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(et(t,Uint8Array)){var e=new Uint8Array(t);return x(e.buffer,e.byteOffset,e.byteLength)}return v(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 "+l(t));if(et(t,ArrayBuffer)||t&&et(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(et(t,SharedArrayBuffer)||t&&et(t.buffer,SharedArrayBuffer)))return x(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 d.from(n,e,r);var i=function(t){if(d.isBuffer(t)){var e=0|_(t.length),r=p(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||rt(t.length)?p(0):v(t):"Buffer"===t.type&&Array.isArray(t.data)?v(t.data):void 0}(t);if(i)return i;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return d.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 "+l(t))}function g(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 y(t){return g(t),p(t<0?0:0|_(t))}function v(t){for(var e=t.length<0?0:0|_(t.length),r=p(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function x(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,d.prototype),n}function _(t){if(t>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function b(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||et(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 '+l(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 J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(t).length;default:if(i)return n?-1:J(t).length;e=(""+e).toLowerCase(),i=!0}}function w(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 R(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return L(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function T(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),rt(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=d.from(e,n)),d.isBuffer(e))return 0===e.length?-1:k(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):k(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function k(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 c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var h=!0,f=0;f<l;f++)if(c(t,a+f)!==c(e,f)){h=!1;break}if(h)return a}return-1}function M(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(rt(s))return a;t[r+a]=s}return a}function S(t,e,r,n){return tt(J(e,t.length-r),t,r,n)}function E(t,e,r,n){return tt(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function C(t,e,r,n){return tt(Q(e),t,r,n)}function I(t,e,r,n){return tt(function(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function L(t,e,r){return 0===e&&r===t.length?c.fromByteArray(t):c.fromByteArray(t.slice(e,r))}function P(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,c=void 0,u=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],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>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<=z)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=z));return r}(n)}d.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{return!1}}(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"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(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(t,e,r){return m(t,e,r)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(t,e,r){return function(t,e,r){return g(t),t<=0?p(t):void 0!==e?"string"==typeof r?p(t).fill(e,r):p(t).fill(e):p(t)}(t,e,r)},d.allocUnsafe=function(t){return y(t)},d.allocUnsafeSlow=function(t){return y(t)},d.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==d.prototype},d.compare=function(t,e){if(et(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),et(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(t)||!d.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},d.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}},d.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return d.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=d.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(et(a,Uint8Array))i+a.length>n.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!d.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},d.byteLength=b,d.prototype._isBuffer=!0,d.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)T(this,e,e+1);return this},d.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)T(this,e,e+3),T(this,e+1,e+2);return this},d.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)T(this,e,e+7),T(this,e+1,e+6),T(this,e+2,e+5),T(this,e+3,e+4);return this},d.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?P(this,0,t):w.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(t){if(!d.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===d.compare(this,t)},d.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+">"},h&&(d.prototype[h]=d.prototype.inspect),d.prototype.compare=function(t,e,r,n,i){if(et(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+l(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),c=this.slice(n,i),u=t.slice(e,r),h=0;h<s;++h)if(c[h]!==u[h]){a=c[h],o=u[h];break}return a<o?-1:o<a?1:0},d.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},d.prototype.indexOf=function(t,e,r){return A(this,t,e,r,!0)},d.prototype.lastIndexOf=function(t,e,r){return A(this,t,e,r,!1)},d.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 M(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return C(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var z=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 O(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 R(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+=nt[t[a]];return i}function F(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 B(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(!d.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 N(t,e,r,n,i){Y(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 U(t,e,r,n,i){Y(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 V(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 q(t,e,r,n,i){return e=+e,r>>>=0,i||V(t,0,r,4),u.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,i){return e=+e,r>>>=0,i||V(t,0,r,8),u.write(t,e,r,n,52,8),r+8}d.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,d.prototype),n},d.prototype.readUintLE=d.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},d.prototype.readUintBE=d.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readBigUInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(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))})),d.prototype.readBigUInt64BE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(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)})),d.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(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},d.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(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},d.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readBigInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(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))})),d.prototype.readBigInt64BE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(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)})),d.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),u.read(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),u.read(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),u.read(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),u.read(this,t,!1,52,8)},d.prototype.writeUintLE=d.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},d.prototype.writeUintBE=d.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},d.prototype.writeUint8=d.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},d.prototype.writeUint16LE=d.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},d.prototype.writeUint16BE=d.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},d.prototype.writeUint32LE=d.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},d.prototype.writeUint32BE=d.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},d.prototype.writeBigUInt64LE=it((function(t){return N(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.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},d.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},d.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},d.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},d.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},d.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},d.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},d.prototype.writeBigInt64LE=it((function(t){return N(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(t,e,r){return q(this,t,e,!0,r)},d.prototype.writeFloatBE=function(t,e,r){return q(this,t,e,!1,r)},d.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},d.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},d.prototype.copy=function(t,e,r,n){if(!d.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},d.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&&!d.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=d.isBuffer(t)?t:d.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 G={};function W(t,e,r){G[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=function(t,e,r){return e=o(e),function(t,e){if(e&&("object"==l(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,a()?Reflect.construct(e,r||[],o(t).constructor):e.apply(t,r))}(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&&s(t,e)}(i,r),function(t,e){return e&&n(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(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 Z(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 Y(t,e,r,n,i,a){if(t>r||t<e){var o,s="bigint"==typeof e?"n":"";throw o=a>3?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):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new G.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){X(e,"offset"),(void 0===t[e]||void 0===t[e+r])&&$(e,t.length-(r+1))}(n,i,a)}function X(t,e){if("number"!=typeof t)throw new G.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){throw Math.floor(t)!==t?(X(t,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1: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(l(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=Z(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Z(i)),i+="n"),n+" It must be ".concat(e,". Received ").concat(i)}),RangeError);var K=/[^+/0-9A-Za-z-_]/g;function J(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 Q(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 tt(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 et(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function rt(t){return t!=t}var nt=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 it(t){return typeof BigInt>"u"?at:t}function at(){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&&typeof navigator<"u"&&(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],c=t.mode||"turntable",u=n(),h=i(),f=a();return u.setDistanceLimits(l[0],l[1]),u.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:u,orbit:h,matrix:f},c)};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=typeof WeakMap>"u"?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 c=new Array(r+1);for(o=0;o<r;++o)c[o]=e[o];c[r]=1;var u=n(a,c),h=i(u[r+1]);0===h&&(h=1);var f=new Array(r+1);for(o=0;o<=r;++o)f[o]=i(u[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],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),u=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)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},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(c(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=typeof Uint8Array<"u"?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 c(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 c,u,h=0;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},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,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(f=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):c*(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,1+((t|=t>>>8)|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=typeof window<"u"&&typeof window.Buffer<"u"?window.Buffer:r(7790).Buffer}catch{}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 c(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,u=r;u<s;u+=n)l=c(t,u,u+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=c(t,u,t.length,e),u=0;u<o;u++)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 u=["","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 c=1;c<n;c++){for(var u=l>>>26,h=67108863&l,f=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=f;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=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?u[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 c=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:u[c-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(typeof o<"u"),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,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[a-s-1]=o}return c},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(!(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(!(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(!(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,c=0,u=0|o[0],h=8191&u,f=u>>>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,A=w>>>13,k=0|o[5],M=8191&k,S=k>>>13,E=0|o[6],C=8191&E,I=E>>>13,L=0|o[7],P=8191&L,z=L>>>13,D=0|o[8],O=8191&D,R=D>>>13,F=0|o[9],B=8191&F,j=F>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],H=8191&q,G=q>>>13,W=0|s[2],Z=8191&W,Y=W>>>13,X=0|s[3],$=8191&X,K=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>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,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;c=((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=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((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=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,Z)|0))<<13)|0;c=((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,Z)|0,i=(i=i+Math.imul(d,Y)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,Y)|0;var xt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(A,U)|0,a=Math.imul(A,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,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,K)|0;var _t=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;c=((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(A,H)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,K)|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=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((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,Z)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(A,Z)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,K)|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=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;c=((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,Z)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(S,Z)|0,a=a+Math.imul(S,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,K)|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=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((a=a+Math.imul(f,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,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,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(I,Z)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,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,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var At=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(z,Z)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,K)|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(A,rt)|0,a=a+Math.imul(A,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,ct)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ct)|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 kt=(c+(n=n+Math.imul(h,dt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;c=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(R,Z)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,K)|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(A,at)|0,a=a+Math.imul(A,ot)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(b,lt)|0,a=a+Math.imul(b,ct)|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=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,Y))+Math.imul(j,Z)|0,a=Math.imul(j,Y),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,K)|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,ct)|0)+Math.imul(A,lt)|0,a=a+Math.imul(A,ct)|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=(c+(n=n+Math.imul(y,dt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,dt)|0))<<13)|0;c=((a=a+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,K))+Math.imul(j,$)|0,a=Math.imul(j,K),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,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,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(A,ht)|0,a=a+Math.imul(A,ft)|0;var Et=(c+(n=n+Math.imul(_,dt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(b,dt)|0))<<13)|0;c=((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(j,Q)|0,a=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,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,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|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=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(A,dt)|0))<<13)|0;c=((a=a+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,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,ct)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ct)|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=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((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(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|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=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(I,dt)|0))<<13)|0;c=((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,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0;var Pt=(c+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(z,dt)|0))<<13)|0;c=((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(j,ht)|0,a=Math.imul(j,ft);var zt=(c+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Dt=(c+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(j,dt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=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]=At,l[9]=kt,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]=Dt,0!==c&&(l[19]=c,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),c=Math.max(0,a-t.length+1);c<=l;c++){var u=a-c,h=(0|t.words[u])*(0|e.words[c]),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),c=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var h=l,f=c,p=0;p<o;p++){var d=r[u+p],m=n[u+p],g=r[u+p+o],y=n[u+p+o],v=h*g-f*y;y=h*y+f*g,g=v,r[u+p]=d+g,n[u+p]=m+y,r[u+p+o]=d-g,n[u+p+o]=m-y,p!==s&&(v=l*h-c*f,f=l*f+c*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),c=new Array(n),u=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,c,n),this.transform(o,a,s,l,n,i),this.transform(c,a,u,h,n,i);for(var p=0;p<n;p++){var d=s[p]*u[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*u[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 c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0!==o)if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),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 c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,l);0===u.negative&&(n=u,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}):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),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;!(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;!(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),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(c)}},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 c=0,u=1;!(r.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;!(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 A(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(!(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(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,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 c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++s||0===n&&0===u)&&(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 A(t)},i(A,T),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.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)},A.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)},A.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],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),h=0;for(n=0;n<c;++n)n!==r&&(u[h++]=l[n]);if(1&r){var f=u[1];u[1]=u[0],u[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=[],c(t,t,u,!0),n}(t);case 2:return"function"==typeof e?c(t,t,e,!0):function(t,e){return n=[],c(t,e,u,!1),n}(t,e);case 3:return c(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 c=t[o];if(!s(e,c)){for(var u=0;u<2*e;++u)r[i++]=c[u];n[a++]=o}}return a}function c(t,e,r,n){var s=t.length,c=e.length;if(!(s<=0||c<=0)){var u=t[0].length>>>1;if(!(u<=0)){var h,f=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,f,p))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,f,p,0,s,f,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,f,p,0,c,d,m):o(u,r,n,s,f,p,c,d,m),i.free(d),i.free(m))}i.free(f),i.free(p)}return h}}}function u(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,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){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=c[e+v],_=c[e+v+t],b=u[y];if(!(_<d||m<x)){for(var w=e+1;w<t;++w){var T=a[w+p],A=a[w+t+p],k=c[w+v],M=c[w+t+v];if(A<k||M<T)continue t}var S=r(g,b);if(void 0!==S)return S}}}}(t,e,r,n,i,a,o,s,l,c,u):function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=s,p=h*s;f<l;++f,p+=h){var d=c[e+p],m=c[e+p+t],g=u[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],A=a[w+t+v],k=c[w+p],M=c[w+t+p];if(A<k||M<T)continue t}var S=r(b,g);if(void 0!==S)return S}}}}(t,e,r,n,i,a,o,s,l,c,u)}:function(t,e,r,n,i,a,o,s,l,c,u,h){return a-i>c-l?n?function(t,e,r,n,i,a,o,s,l,c,u){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=c[e+v],_=u[y];if(!(x<=d||m<x)){for(var b=e+1;b<t;++b){var w=a[b+p],T=a[b+t+p],A=c[b+v],k=c[b+t+v];if(T<A||k<w)continue t}var M=r(_,g);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,c,u,h):function(t,e,r,n,i,a,o,s,l,c,u){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=c[e+v],_=u[y];if(!(x<d||m<x)){for(var b=e+1;b<t;++b){var w=a[b+p],T=a[b+t+p],A=c[b+v],k=c[b+t+v];if(T<A||k<w)continue t}var M=r(g,_);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,c,u,h):n?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=s,p=h*s;f<l;++f,p+=h){var d=c[e+p],m=u[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],A=c[b+p],k=c[b+t+p];if(T<A||k<w)continue t}var M=r(m,_);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,c,u,h):function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=s,p=h*s;f<l;++f,p+=h){var d=c[e+p],m=u[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],A=c[b+p],k=c[b+t+p];if(T<A||k<w)continue t}var M=r(_,m);if(void 0!==M)return M}}}}(t,e,r,i,a,o,s,l,c,u,h)}}e.partial=r(!1),e.full=r(!0)},7150:function(t,e,r){t.exports=function(t,e,r,a,u,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(A(P++,0,0,a,0,E,r?16:0,-1/0,1/0),r||A(P++,0,0,E,0,a,1,-1/0,1/0);P>0;){var D=(P-=1)*_,O=w[D],R=w[D+1],F=w[D+2],B=w[D+3],j=w[D+4],N=w[D+5],U=P*b,V=T[U],q=T[U+1],H=1&N,G=!!(16&N),W=u,Z=S,Y=C,X=I;if(H&&(W=C,Z=I,Y=u,X=S),!(2&N&&(F=g(t,O,R,F,W,Z,q),R>=F)||4&N&&(R=y(t,O,R,F,W,Z,V),R>=F))){var $=F-R,K=j-B;if(G){if(t*$*($+K)<p){if(void 0!==(L=l.scanComplete(t,O,e,R,F,W,Z,B,j,Y,X)))return L;continue}}else{if(t*Math.min($,K)<h){if(void 0!==(L=o(t,O,e,H,R,F,W,Z,B,j,Y,X)))return L;continue}if(t*$*K<f){if(void 0!==(L=l.scanBipartite(t,O,e,H,R,F,W,Z,B,j,Y,X)))return L;continue}}var J=d(t,O,R,F,W,Z,V,q);if(R<J)if(t*(J-R)<h){if(void 0!==(L=s(t,O+1,e,R,J,W,Z,B,j,Y,X)))return L}else if(O===t-2){if(void 0!==(L=H?l.sweepBipartite(t,e,B,j,Y,X,R,J,W,Z):l.sweepBipartite(t,e,R,J,W,Z,B,j,Y,X)))return L}else A(P++,O+1,R,J,B,j,H,-1/0,1/0),A(P++,O+1,B,j,R,J,1^H,-1/0,1/0);if(J<F){var Q=c(t,O,B,j,Y,X),tt=Y[z*Q+O],et=m(t,O,Q,j,Y,X,tt);if(et<j&&A(P++,O,J,F,et,j,(4|H)+(G?16:0),tt,q),B<Q&&A(P++,O,J,F,B,Q,(2|H)+(G?16:0),V,tt),Q+1===et){if(void 0!==(L=G?M(t,O,e,J,F,W,Z,Q,Y,X[Q]):k(t,O,e,H,J,F,W,Z,Q,Y,X[Q])))return L}else if(Q<et){var rt;if(G){if(J<(rt=v(t,O,J,F,W,Z,tt))){var nt=m(t,O,J,rt,W,Z,tt);if(O===t-2){if(J<nt&&void 0!==(L=l.sweepComplete(t,e,J,nt,W,Z,Q,et,Y,X))||nt<rt&&void 0!==(L=l.sweepBipartite(t,e,nt,rt,W,Z,Q,et,Y,X)))return L}else J<nt&&A(P++,O+1,J,nt,Q,et,16,-1/0,1/0),nt<rt&&(A(P++,O+1,nt,rt,Q,et,0,-1/0,1/0),A(P++,O+1,Q,et,nt,rt,1,-1/0,1/0))}}else J<(rt=H?x(t,O,J,F,W,Z,tt):v(t,O,J,F,W,Z,tt))&&(O===t-2?L=H?l.sweepBipartite(t,e,Q,et,Y,X,J,rt,W,Z):l.sweepBipartite(t,e,J,rt,W,Z,Q,et,Y,X):(A(P++,O+1,J,rt,Q,et,H,-1/0,1/0),A(P++,O+1,Q,et,J,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),c=r(3545),u=r(8105),h=128,f=1<<22,p=1<<22,d=u("!(lo>=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo<p0"),y=u("hi<=p0"),v=u("lo<=p0&&p0<=hi"),x=u("lo<p0&&p0<=hi"),_=6,b=2,w=n.mallocInt32(1024),T=n.mallocDouble(1024);function A(t,e,r,n,i,a,o,s,l){var c=_*t;w[c]=e,w[c+1]=r,w[c+2]=n,w[c+3]=i,w[c+4]=a,w[c+5]=o;var u=b*t;T[u]=s,T[u+1]=l}function k(t,e,r,n,i,a,o,s,l,c,u){var h=2*t,f=l*h,p=c[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 _=c[f+x],b=c[f+x+t];if(y<_||b<g)continue t}var w;if(void 0!==(w=n?r(u,v):r(v,u)))return w}}}function M(t,e,r,n,i,a,o,s,l,c){var u=2*t,h=s*u,f=l[h+e];t:for(var p=n,d=n*u;p<i;++p,d+=u){var m=o[p];if(m!==c){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,c);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 c=r,u=o,h=o+r>>>1,f=2*t,p=h,d=s[f*h+e];c<u;){if(u-c<i){a(t,e,c,u,s,l),d=s[f*h+e];break}var m=u-c,g=Math.random()*m+c|0,y=s[f*g+e],v=Math.random()*m+c|0,x=s[f*v+e],_=Math.random()*m+c|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*(u-1),T=f*p,A=0;A<f;++A,++w,++T){var k=s[w];s[w]=s[T],s[T]=k}var M=l[u-1];for(l[u-1]=l[p],l[p]=M,w=f*(u-1),T=f*(p=n(t,e,c,u-1,s,l,d)),A=0;A<f;++A,++w,++T)k=s[w],s[w]=s[T],s[T]=k;if(M=l[u-1],l[u-1]=l[p],l[p]=M,h<p){for(u=p-1;c<u&&s[f*(u-1)+e]===d;)u-=1;u+=1}else{if(!(p<h))break;for(c=p+1;c<u&&s[f*c+e]===d;)c+=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 c=i[s],u=l,h=o*(l-1);u>r&&i[h+e]>c;--u,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[u];a[u]=a[u-1],a[u-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,c=l,u=r,h=e,f=r;n>f;++f,l+=s)if(i[l+h]===o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,f=r;n>f;++f,l+=s)if(i[l+h]<o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=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(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=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(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,h=r,f=e,p=t+e,d=r;n>d;++d,c+=l){var m=i[c+f],g=i[c+p];if(!(m>=o||s>=g))if(h===d)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=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):c(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 c=r[l-2],u=r[l-1];if(c<a)break;if(c===a&&u<o)break;r[l]=c,r[l+1]=u,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 c(t,u,h){var f=(u-t+1)/6|0,p=t+f,d=u-f,m=t+u>>1,g=m-f,y=m+f,v=p,x=g,_=m,b=y,w=d,T=t+1,A=u-1,k=0;s(v,x,h)&&(k=v,v=x,x=k),s(b,w,h)&&(k=b,b=w,w=k),s(v,_,h)&&(k=v,v=_,_=k),s(x,_,h)&&(k=x,x=_,_=k),s(v,b,h)&&(k=v,v=b,b=k),s(_,b,h)&&(k=_,_=b,b=k),s(x,w,h)&&(k=x,x=w,w=k),s(x,_,h)&&(k=x,x=_,_=k),s(b,w,h)&&(k=b,b=w,w=k);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,D=2*m,O=2*d,R=0;R<2;++R){var F=h[I+R],B=h[L+R],j=h[P+R];h[z+R]=F,h[D+R]=B,h[O+R]=j}i(g,t,h),i(y,u,h);for(var N=T;N<=A;++N)if(l(N,M,S,h))N!==T&&n(N,T,h),++T;else if(!l(N,E,C,h))for(;;){if(l(A,E,C,h)){l(A,M,S,h)?(a(N,T,A,h),++T,--A):(n(N,A,h),--A);break}if(--A<N)break}o(t,T-1,M,S,h),o(u,A+1,E,C,h),T-2-t<=e?r(t,T-2,h):c(t,T-2,h),u-(A+2)<=e?r(A+2,u,h):c(A+2,u,h),A-T<=e?r(T,A,h):c(T,A,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)),c.length<e&&(n.free(c),c=n.mallocInt32(e)),u.length<e&&(n.free(u),u=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 A=s[T],k=_*T;d[x++]=i[k+b],d[x++]=-(A+1),d[x++]=i[k+w],d[x++]=A}for(T=f;T<p;++T){A=v[T]+o;var M=_*T;d[x++]=y[M+b],d[x++]=-A,d[x++]=y[M+w],d[x++]=A}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(u,h,C--,I=I-o|0);else if(I>=0)m(l,c,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(u,h,C++,I)}else{for(I=-I-1|0,L=0;L<C;++L){var P;if(void 0!==(P=e(I,u[L])))return P}g(l,c,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,A=r;A<n;++A){var k=o[A]+1<<1,M=b*A;d[_++]=i[M+w],d[_++]=-k,d[_++]=i[M+T],d[_++]=k}for(A=s;A<y;++A){k=x[A]+1<<1;var S=b*A;d[_++]=v[S+w],d[_++]=1|-k,d[_++]=v[S+T],d[_++]=1|k}var E=_>>>1;a(d,E);var C=0,I=0,L=0;for(A=0;A<E;++A){var P=0|d[2*A+1],z=1&P;if(A<E-1&&P>>1==d[2*A+3]>>1&&(z=2,A+=1),P<0){for(var D=-(P>>1)-1,O=0;O<L;++O)if(void 0!==(R=e(f[O],D)))return R;if(0!==z)for(O=0;O<C;++O)if(void 0!==(R=e(l[O],D)))return R;if(1!==z)for(O=0;O<I;++O){var R;if(void 0!==(R=e(u[O],D)))return R}0===z?g(l,c,C++,D):1===z?g(u,h,I++,D):2===z&&g(f,p,L++,D)}else D=(P>>1)-1,0===z?m(l,c,C--,D):1===z?m(u,h,I--,D):2===z&&m(f,p,L--,D)}},scanBipartite:function(t,e,r,n,i,s,u,h,f,p,y,v){var x=0,_=2*t,b=e,w=e+t,T=1,A=1;n?A=o:T=o;for(var k=i;k<s;++k){var M=k+T,S=_*k;d[x++]=u[S+b],d[x++]=-M,d[x++]=u[S+w],d[x++]=M}for(k=f;k<p;++k){M=k+A;var E=_*k;d[x++]=y[E+b],d[x++]=-M}var C=x>>>1;a(d,C);var I=0;for(k=0;k<C;++k){var L=0|d[2*k+1];if(L<0){var P=!1;if((M=-L)>=o?(P=!n,M-=o):(P=!!n,M-=1),P)g(l,c,I++,M);else{var z=v[M],D=_*M,O=y[D+e+1],R=y[D+e+1+t];t:for(var F=0;F<I;++F){var B=l[F],j=_*B;if(!(R<u[j+e+1]||u[j+e+1+t]<O)){for(var N=e+2;N<t;++N)if(y[D+N+t]<u[j+N]||u[j+N+t]<y[D+N])continue t;var U,V=h[B];if(void 0!==(U=n?r(z,V):r(V,z)))return U}}}}else m(l,c,I--,L-T)}},scanComplete:function(t,e,r,n,i,s,c,u,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=u;x<h;++x){_=x+1;var w=g*x;d[m++]=f[w+y],d[m++]=-_}var T=m>>>1;a(d,T);var A=0;for(x=0;x<T;++x){var k=0|d[2*x+1];if(k<0)if((_=-k)>=o)l[A++]=_-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<A;++I){var L=l[I],P=c[L];if(P===M)break;var z=g*L;if(!(C<s[z+e+1]||s[z+e+1+t]<E)){for(var D=e+2;D<t;++D)if(f[S+D+t]<s[z+D]||s[z+D+t]<f[S+D])continue t;var O=r(P,M);if(void 0!==O)return O}}}else{for(_=k-o,I=A-1;I>=0;--I)if(l[I]===_){for(D=I+1;D<A;++D)l[D-1]=l[D];break}--A}}}};var n=r(1888),i=r(8828),a=r(4192),o=1<<28,s=1024,l=n.mallocInt32(s),c=n.mallocInt32(s),u=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 c(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 u=!!c(r,"delaunay",!0),h=!!c(r,"interior",!0),f=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!h&&!f||0===t.length)return[];var d=n(t,e);if(u||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 u&&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],c=1;c<l.length;c+=2)if(!((p=l[c])<s||e.isConstraint(s,p))){for(var u=l[c-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[u],t[h])<0&&r.push(s,p)}for(;r.length>0;){for(var p=r.pop(),d=(u=-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&&(u=m)}u<0||h<0||n(t[s],t[p],t[u],t[h])>=0||(e.flip(s,p),i(t,e,r,u,s,h),i(t,e,r,s,h,u),i(t,e,r,h,p,u),i(t,e,r,p,u,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],c=y[2];l<c?l<s&&(y[0]=l,y[1]=c,y[2]=s):c<s&&(y[0]=c,y[1]=s,y[2]=l)}r.sort(o);var u=new Array(n);for(i=0;i<u.length;++i)u[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,u,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),u[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,c=n.flags,u=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i,u[p];for(var d=0;d<3;++d){var m=f[3*p+d];m>=0&&0===c[m]&&(h[3*p+d]?l.push(m):(s.push(m),c[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}(u,c,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 c(t,e,r,a,o){for(var s=n.lt(e,a,l),c=n.gt(e,a,l),u=s;u<c;++u){for(var h=e[u],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 u(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,u),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,u),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 u=e[l],p=t[u[0]],d=t[u[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===_?c(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 c=i(r,o),u=0,h=c[e+1];for(s=0;s<h.length;++s)u+=h[s];var f=new Array(e);for(s=0;s<e;++s){h=c[s];var p=0;for(l=0;l<h.length;++l)p+=h[l];f[s]=p/u}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),c=r(5838),u=r(1278),h=r(3637);function f(t){var e=l(t);return[u(e,-1/0),u(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]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(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 c=e[l],h=f(c[0]),p=f(c[1]);s.push([u(h[0],-1/0),u(p[0],-1/0),u(h[1],1/0),u(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],c=t[n];c[0]===l[0]&&c[1]===l[1]&&(!r||c[2]===l[2])||(t[s++]=c)}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]=[u(Math.min(a[0],o[0]),-1/0),u(Math.min(a[1],o[1]),-1/0),u(Math.max(a[0],o[0]),1/0),u(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]],c=t[o[1]],u=t[s[0]],h=t[s[1]];a(l,c,u,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]],c=t[i[1]];a(l,c,s,s)&&o.push([r,n])}})),o}(t,e,n,p(t)),g=function(t,e,r,n,i){var a,u,f=t.map((function(t){return[o(t[0]),o(t[1])]}));for(a=0;a<r.length;++a){var p=r[a];u=p[0];var d=p[1],m=e[u],g=e[d],y=h(c(t[m[0]]),c(t[m[1]]),c(t[g[0]]),c(t[g[1]]));if(y){var v=t.length;t.push([l(y[0]),l(y[1])]),f.push(y),n.push([u,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[u=(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 A=_;_=b,b=A}x[0]=_;var k,M=x[1]=S[1];for(i&&(k=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([M,E,k]):e.push([M,E]),M=E}i?e.push([M,b,k]):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=u(a,h);if(0===o(f))return null;var p=u(h,s(t,r)),d=i(p,f),m=c(a,d);return l(t,m)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(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,c,u,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");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p+1)throw new Error(h+" map requires nshades to be at least size "+u.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=u.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=u.map((function(t,e){var r=u[e].index,n=u[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){c=e[m+1]-e[m],r=g[m],l=g[m+1];for(var v=0;v<c;v++){var x=v/c;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(u[u.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)),c=i(n(t,e,a));if(s===c){if(0===s){var u=l(t,e,r);return u===l(t,e,a)?0:u?1:-1}return 0}return 0===c?s>0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-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]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.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]),c=e(n[0],n[1]);return e(l,t[2])-e(c,n[2])||e(l+t[2],o)-e(c+n[2],s);case 4:var u=t[0],h=t[1],f=t[2],p=t[3],d=n[0],m=n[1],g=n[2],y=n[3];return u+h+f+p-(d+m+g+y)||e(u,h,f,p)-e(d,m,g,y,d)||e(u+h,u+f,u+p,h+f,h+p,f+p)-e(d+m,d+g,d+y,m+g,m+y,g+y)||e(u+h+f,u+h+p,u+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{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,c=(1+2*i)*l,u=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]=c*t[p]+u*e[p]+h*r[p]+f*n[p];return a}return c*t+u*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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*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),c=1,u=0;u<r;++u){for(var h=t[u],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[u]=new a(f,u),c=Math.max(p,c)}i(l,o),r=l.length;var g=new Array(r+s+1),y=new Array(r+s+1),v=(s+1)*(s+1)*c,x=new Array(s+1);for(u=0;u<=s;++u)x[u]=0;for(x[s]=v,g[0]=x.slice(),y[0]=-1,u=0;u<=s;++u)(f=x.slice())[u]=1,g[u+1]=f,y[u+1]=-1;for(u=0;u<r;++u){var _=l[u];g[u+s+1]=_.point,y[u+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(u=0;u<b.length;++u)f=(_=b[u])[0],_[0]=_[1],_[1]=f;return b}},2361:function(t){var e=!1;if(typeof Float64Array<"u"){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(typeof r>"u"&&(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,c=this._velocity,u=this.dimension,h=this.bounds;if(o<0)for(var f=u-1,p=0;p<u;++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<u;++p,--f)s[p]=l[f]+d*c[f]}else{f=u*(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<u;++p,--f)y[p]=l[f],x[p]=c[f]*g,v[p]=l[f+u],_[p]=c[f+u]*g,b=b&&y[p]===v[p]&&x[p]===_[p]&&0===x[p];if(b)for(p=0;p<u;++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<u;++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,c=this.dimension;if(a>=r-1)for(var u=s.length-1,h=(e[r-1],0);h<c;++h,--u)o[h]=l[u];else{u=c*(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<c;++h,--u)d[h]=s[u],g[h]=l[u]*p,m[h]=s[u+c],y[h]=l[u+c]*p,v=v&&d[h]===m[h]&&g[h]===y[h]&&0===g[h];if(v)for(h=0;h<c;++h)o[h]=0;else for(n.derivative(d,g,m,y,(t-f)/p,o),h=0;h<c;++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],c=s[1];this._time.push(e,t);for(var u=0;u<2;++u)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],c[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,c=l[0],u=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var p=a(c[f-1],u[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],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var p=arguments[f];n.push(a(l[f-1],c[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],c=s[1],u=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)n.push(a(l[h],c[h],n[o]+u*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 c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);return o<=0&&(i.left&&(a=c(t,e,r,n,i.left))||s>0&&(a=n(i.key,i.value)))?a:s>0&&i.right?c(t,e,r,n,i.right):void 0}function u(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=[],c=[];s;){var u=o(t,s.key);l.push(s),c.push(u),s=u<=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],c[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:c(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 u(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new u(this,t)}}),o.at=function(t){if(t<0)return new u(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 u(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new u(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 u(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 u(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 u(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 u(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 u(this,n);r=i<=0?r.left:r.right}return new u(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=u.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 u(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 c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new e(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}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&&((c=t[l-2]).left===a?c.left=o:c.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&&((c=t[l-2]).left===a?c.left=s:c.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&&((c=t[l-2]).left===a?c.left=o:c.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&&((c=t[l-2]).right===a?c.right=o:c.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&&((c=t[l-2]).right===a?c.right=s:c.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 c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).right===a?c.right=o:c.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]),c=ArrayBuffer,u=DataView;function h(t){return Array.isArray(t)||function(t){return c.isView(t)&&!(t instanceof u)}(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),c=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]})),u=!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,u=!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,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)r[d].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("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"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("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||u)&&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&&u&&(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,c=n[e],u=0;u<3;++u)if(e!==u){var h=a,f=s,p=o,d=l;c&1<<u&&(h=s,f=a,p=l,d=o),h[u]=r[0][u],f[u]=r[1][u],i[u]>0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=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,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,p=n[12],d=n[13],m=n[14],T=n[15],A=(s?2:1)*this.pixelRatio*(i[3]*p+i[7]*d+i[11]*m+i[15]*T)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=h[k];var M=g;for(k=0;k<3;++k)y(g[k],k,this.bounds,u,h);e=this.gl;var S,E,C,I,L,P,z,D,O,R,F,B,j=v;for(k=0;k<3;++k)this.backgroundEnable[k]?j[k]=h[k]:j[k]=0;for(this._background.draw(r,n,i,a,j,this.backgroundColor),this._lines.bind(r,n,i,this),k=0;k<3;++k){var N=[0,0,0];h[k]>0?N[k]=a[1][k]:N[k]=a[0][k];for(var U=0;U<2;++U){var V=(k+1+U)%3,q=(k+1+(1^U))%3;this.gridEnable[V]&&this._lines.drawGrid(V,q,this.bounds,N,this.gridColor[V],this.gridWidth[V]*this.pixelRatio)}for(U=0;U<2;++U)V=(k+1+U)%3,q=(k+1+(1^U))%3,this.zeroEnable[q]&&Math.min(a[0][q],a[1][q])<=0&&Math.max(a[0][q],a[1][q])>=0&&this._lines.drawZero(V,q,this.bounds,N,this.zeroLineColor[q],this.zeroLineWidth[q]*this.pixelRatio)}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var H=f(_,M[k].primalMinor),G=f(b,M[k].mirrorMinor),W=this.lineTickLength;for(U=0;U<3;++U){var Z=A/r[5*U];H[U]*=W[U]*Z,G[U]*=W[U]*Z}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,M[k].primalOffset,H,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,M[k].mirrorOffset,G,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}function Y(t){(C=[0,0,0])[t]=1}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),k=0;k<3;++k){var X=M[k].primalMinor,$=M[k].mirrorMinor,K=f(w,M[k].primalOffset);for(U=0;U<3;++U)this.lineTickEnable[k]&&(K[U]+=A*X[U]*Math.max(this.lineTickLength[U],0)/r[5*U]);var J=[0,0,0];if(J[k]=1,this.tickEnable[k]){for(-3600===this.tickAngle[k]?(this.tickAngle[k]=0,this.tickAlign[k]="auto"):this.tickAlign[k]=-1,E=1,"auto"===(S=[this.tickAlign[k],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),C=[0,0,0],P=$,void 0,void 0,void 0,void 0,void 0,void 0,D=((I=k)+2)%3,O=(L=X)[z=(I+1)%3],R=L[D],F=P[z],B=P[D],O>0&&B>0||O>0&&B<0||O<0&&B>0||O<0&&B<0?Y(z):(R>0&&F>0||R>0&&F<0||R<0&&F>0||R<0&&F<0)&&Y(D),U=0;U<3;++U)K[U]+=A*X[U]*this.tickPad[U]/r[5*U];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],K,this.tickColor[k],J,C,S)}if(this.labelEnable[k]){for(E=0,C=[0,0,0],this.labels[k].length>4&&(Y(k),E=1),"auto"===(S=[this.labelAlign[k],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),U=0;U<3;++U)K[U]+=A*X[U]*this.labelPad[U]/r[5*U];K[k]+=.5*(a[0][k]+a[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],K,this.labelColor[k],[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 c=(l+1)%3,u=(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[c]=d;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=c;c=u,u=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){u[2]=a[x][2];for(var _=0;_<2;++_){u[1]=a[_][1];for(var b=0;b<2;++b)u[0]=a[b][0],f(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],A=0;A<3;++A)c[x][A]=l[x][A]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]<c[w][2])&&(w=x)}if(w<0){w=0;for(var k=0;k<3;++k){for(var M=(k+2)%3,S=(k+1)%3,E=-1,C=-1,I=0;I<2;++I){var L=(z=I<<k)+(I<<M)+(1-I<<S),P=z+(1-I<<M)+(I<<S);o(c[z],c[L],c[P],h)<0||(I?E=1:C=1)}if(E<0||C<0)C>E&&(w|=1<<k);else{for(I=0;I<2;++I){L=(z=I<<k)+(I<<M)+(1-I<<S),P=z+(1-I<<M)+(I<<S);var z,D=d([l[z],l[L],l[P],l[z+(1<<M)+(1<<S)]]);I?E=D:C=D}C>E&&(w|=1<<k)}}}var O=7^w,R=-1;for(x=0;x<8;++x)x===w||x===O||(R<0||c[R][1]>c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(j=R^1<<x)!==w&&j!==O&&(F<0&&(F=j),(S=c[j])[0]<c[F][0]&&(F=j));var B=-1;for(x=0;x<3;++x){var j;(j=R^1<<x)!==w&&j!==O&&j!==F&&(B<0&&(B=j),(S=c[j])[0]>c[B][0]&&(B=j))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(F^R)]=R&F,N[n.log2(R^B)]=R&B;var U=7^B;U===w||U===O?(U=7^F,N[n.log2(B^U)]=U&B):N[n.log2(F^U)]=U&F;var V=g,q=w;for(k=0;k<3;++k)V[k]=q&1<<k?-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),c=new Array(8),u=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],c[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],c=s[0]/s[3]-n,u=s[1]/s[3]-i,h=l[0]/l[3]-n,f=l[1]/l[3]-i;o+=Math.abs(c*f-u*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],c=[0,0,0],u=[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,c[h]=f,u[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,u,c)};var n=r(2762),i=r(8116),a=r(1879).n,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[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,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,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,u=f(c,r);u[t]+=e[0][t],this.shader.uniforms.offset=u,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 u=h(s);u[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=u;var p=f(c,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 u=f(c,n);u[t]+=r[0][t],this.shader.uniforms.offset=u;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 c=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"]),u=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,c,u,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||c.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 h=u.prototype,f=[0,0];h.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,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},h.unbind=function(){this.vao.unbind()},h.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[e];h||(h=u[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 c=[0,0,0],u=[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],c[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)}u[d]=(o.length/3|0)-c[d]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=h,this.labelCount=f},h.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]))},h.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]))},h.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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length<i;)h="0"+h;return u+"."+h}return u}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||c,p=e.view||c,y=e.projection||c,v=e._ortho||!1,x=t.bounds,_=(h=h||a(f,p,y,x,v)).axis;o(u,p,f),o(u,y,u);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(u,u));s(u,u);for(var A=0;A<3;++A){var k=(A+1)%3,M=(A+2)%3,S=g;t:for(w=0;w<2;++w){var E=[];if(_[A]<0!=!!w){S[A]=x[w][A];for(var C=0;C<2;++C){S[k]=x[C^w][k];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,u,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!==A&&(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),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=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,c=0;c<3;++c)s[c]=o[c]=r[c];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 u=(o[0]/o[3]-s[0]/s[3])*n,h=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+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 c(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 u(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&&typeof t.shape<"u"){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=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(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=c(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?u(t,"uint16"):u(t,"float32"),this.length=c(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=c(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,c=1/0,u=-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),c=Math.min(_[1],c),u=Math.max(_[1],u),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,c,h],A=[l,u,f];e&&(e[0]=T,e[1]=A),0===o&&(o=1);var k=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=t.coneSize||(v?1:.5);t.absoluteConeSize&&(M=t.absoluteConeSize*k),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)*k,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 D=a.positions.length;a.cells.push([D-6,D-5,D-4],[D-3,D-2,D-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),c=r(9618),u=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,c,u){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=c,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=u,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=u({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 c(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 A=i[T];o.push(A[0],A[1],A[2],A[3]||0);var k,M=f;3===M.length?s.push(M[0],M[1],M[2],1):s.push(M[0],M[1],M[2],M[3]),k=p?[(p[T]-d)/(m-d),0]:[(v[2]-d)/(m-d),0],l.push(k[0],k[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 c={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};c.inverseModel=l(c.inverseModel,c.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(s(u,c.view,c.model),s(u,c.projection,u),l(u,u),o=0;o<3;++o)c.eyePosition[o]=u[12+o]/u[15];var f=u[15];for(o=0;o<3;++o)f+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],d=0;d<3;++d)p+=u[4*d+o]*this.lightPosition[d];c.lightPosition[o]=p/f}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=c,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),u=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,c(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,u,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 c=new s(e,r,o,l);return c.update(t),c};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 c(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],c=n[15],u=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=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=u[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 u=r[l],f=0;f<3;++f)if(isNaN(u[f])||!isFinite(u[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=u.slice())[s]+=d[0][s],i.push(u[0],u[1],u[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),c(this.bounds,p),o+=2+h(i,p,m,s)),d[1][s]>0&&((p=u.slice())[s]+=d[1][s],i.push(u[0],u[1],u[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),c(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 c=t.getExtension("WEBGL_draw_buffers");if(!l&&c&&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,c),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 u=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>u||r<0||r>u)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(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.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,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(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=c(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),u(r,e),h(x)}u(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=c(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(),u(n,a),h(s)),u(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 c=n("Error compiling %s shader %s:\n",l,s),u=n("%s%s",c,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])&&(c+=g[p]+"\n",f[p+1])){var y=f[p+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),c+=n("^^^ %s\n\n",y)}return{long:c.trim(),short:u.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}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);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),c=r(9618),u=r(7319),h=u.createShader,f=u.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,u=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]);u+=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]);u+=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]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(f[f.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var A=t.dashes.slice();for(A.unshift(0),e=1;e<A.length;++e)A[e]=A[e-1]+A[e];var k=c(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)k.set(e,0,r,0);1&l.le(A,A[A.length-1]*e/255)?k.set(e,0,0,0):k.set(e,0,0,255)}this.texture.setPixels(k)}},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){return o[0]=0,o[1]=r,o[2]=e,o[3]=t,s[0]}(t.value[0],t.value[1],t.value[2]),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]),c=1-a,u=[0,0,0],h=0;h<3;++h)u[h]=c*n[h]+a*i[h];var f=Math.min(a<.5?r:r+1,this.points.length-1);return new g(e,u,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],c=t[8],u=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)*(u*g-f*d)+(e*l-i*a)*(u*m-h*d)+(r*s-n*o)*(c*g-f*p)-(r*l-i*o)*(c*m-h*p)+(n*l-i*s)*(c*d-u*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,c=r*o,u=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]=u+y,t[2]=f-g,t[3]=0,t[4]=u-y,t[5]=1-c-d,t[6]=p+m,t[7]=0,t[8]=f+g,t[9]=p-m,t[10]=1-c-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,c=a+a,u=n*s,h=n*l,f=n*c,p=i*l,d=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return t[0]=1-(p+m),t[1]=h+v,t[2]=f-y,t[3]=0,t[4]=h-v,t[5]=1-(u+m),t[6]=d+g,t[7]=0,t[8]=f+y,t[9]=d-g,t[10]=1-(u+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],c=e[7],u=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*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,A=u*m-h*d,k=u*g-f*d,M=u*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*k+T*A;return I?(I=1/I,t[0]=(s*C-l*E+c*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-c*k)*I,t[5]=(r*C-i*M+a*k)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(u*T-f*_+p*x)*I,t[8]=(o*E-s*M+c*A)*I,t[9]=(n*M-r*E-a*A)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-u*w-p*v)*I,t[12]=(s*k-o*S-l*A)*I,t[13]=(r*S-n*k+i*A)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(u*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,c,u,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,a=x*(p*=d=1/Math.sqrt(h*h+f*f+p*p))-_*(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,c=p*a-h*s,u=h*o-f*a,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=s,t[9]=u,t[10]=p,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(l*m+c*g+u*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],c=e[6],u=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+_*c+b*p+w*y,t[3]=x*o+_*u+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+_*c+b*p+w*y,t[7]=x*o+_*u+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+_*c+b*p+w*y,t[11]=x*o+_*u+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+_*c+b*p+w*y,t[15]=x*o+_*u+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),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,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,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,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),o=1-(a=Math.cos(r)),s=e[0],l=e[1],c=e[2],u=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,A=I*C*o+E*i,k=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]=c*x+p*_+y*b,t[3]=u*x+d*_+v*b,t[4]=s*w+h*T+m*A,t[5]=l*w+f*T+g*A,t[6]=c*w+p*T+y*A,t[7]=u*w+d*T+v*A,t[8]=s*k+h*M+m*S,t[9]=l*k+f*M+g*S,t[10]=c*k+p*M+y*S,t[11]=u*k+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],c=e[8],u=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+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=c*i-a*n,t[9]=u*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],c=e[8],u=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-c*n,t[1]=o*i-u*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+c*i,t[9]=o*n+u*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],c=e[4],u=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+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=c*i-a*n,t[5]=u*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,c,u,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],c=e[6],u=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]=c,t[7]=u,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+c*g+p*y+e[14],t[15]=o*m+u*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,c){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),h=0;h<t.length;++h)u[h]=o(t[h],r,a,l,c);var f=0,p=1/0;for(h=0;h<u.length;++h){for(var d=0,m=0;m<2;++m)d+=Math.pow(u[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[]}(u,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}"]),c=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}"]),u=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:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:u,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),c=r(7608),u=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,c,u,h,f,p,d,m,g,y,v,x,_,b,T,A,k,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=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,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=A,this.pointIds=_,this.pointVAO=k,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 A=T.prototype;function k(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}A.isOpaque=function(){return!this.hasAlpha},A.isTransparent=function(){return this.hasAlpha},A.pickSlots=1,A.setPickBase=function(t){this.pickId=t},A.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 c=r[l],u=0;u<2;++u){var h=c[0];2===c.length&&(h=c[u]);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},A.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*k(i/255,e):255*a[3]}return u(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=[],c=[],f=[],p=[],d=[],m=[],g=[],y=[],v=[],x=[],_=[],b=[];this.cells=r,this.positions=n;var w=t.vertexNormals,T=t.cellNormals,A=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,A));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,D=1/0,O=-1/0;if(!I&&!P)if(L)if(t.vertexIntensityBounds)D=+t.vertexIntensityBounds[0],O=+t.vertexIntensityBounds[1];else for(var R=0;R<L.length;++R){var F=L[R];D=Math.min(D,F),O=Math.max(O,F)}else if(z)if(t.cellIntensityBounds)D=+t.cellIntensityBounds[0],O=+t.cellIntensityBounds[1];else for(R=0;R<z.length;++R)F=z[R],D=Math.min(D,F),O=Math.max(O,F);else for(R=0;R<n.length;++R)F=n[R][2],D=Math.min(D,F),O=Math.max(O,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,j=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 N=n[R],U=0;U<3;++U)isNaN(N[U])||!isFinite(N[U])||(this.bounds[0][U]=Math.min(this.bounds[0][U],N[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],N[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(N=n[Z=G[0]],U=0;U<3;++U)if(isNaN(N[U])||!isFinite(N[U]))continue t;y.push(N[0],N[1],N[2]),Y=S?S[Z]:E?E[R]:C,this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*k((L[Z]-D)/(O-D),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[Z]:L?[(L[Z]-D)/(O-D),0]:P?P[R]:z?[(z[R]-D)/(O-D),0]:[(N[2]-D)/(O-D),0],x.push(X[0],X[1]),B?_.push(B[Z]):_.push(j),b.push(R),H+=1;break;case 2:for(U=0;U<2;++U){N=n[Z=G[U]];for(var W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue t}for(U=0;U<2;++U)N=n[Z=G[U]],p.push(N[0],N[1],N[2]),Y=S?S[Z]:E?E[R]:C,this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*k((L[Z]-D)/(O-D),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[Z]:L?[(L[Z]-D)/(O-D),0]:P?P[R]:z?[(z[R]-D)/(O-D),0]:[(N[2]-D)/(O-D),0],m.push(X[0],X[1]),g.push(R);q+=1;break;case 3:for(U=0;U<3;++U)for(N=n[Z=G[U]],W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue t;for(U=0;U<3;++U){var Z,Y,X,$;N=n[Z=G[2-U]],i.push(N[0],N[1],N[2]),(Y=S?S[Z]:E?E[R]:C)?this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*k((L[Z]-D)/(O-D),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[Z]:L?[(L[Z]-D)/(O-D),0]:P?P[R]:z?[(z[R]-D)/(O-D),0]:[(N[2]-D)/(O-D),0],c.push(X[0],X[1]),$=w?w[Z]: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(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(f))}},A.drawTransparent=A.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=c(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u,h=new Array(16);for(l(h,s.view,s.model),l(h,s.projection,h),c(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&&((u=this.triShader).bind(),u.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((u=this.lineShader).bind(),u.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&&((u=this.pointShader).bind(),u.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((u=this.contourShader).bind(),u.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},A.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())},A.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]],c=this.positions[r[1]],u=this.positions[r[2]],h=[(l[0]+c[0]+u[0])/3,(l[1]+c[1]+u[1])/3,(l[2]+c[2]+u[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]]]}},A.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),c=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,u(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),A=i(t),k=i(t),M=a(t,[{buffer:d,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2},{buffer:A,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),D=i(t),O=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:D,type:t.FLOAT,size:2},{buffer:O,type:t.FLOAT,size:1}]),B=i(t),j=new T(t,p,r,s,l,c,h,f,d,k,m,w,A,M,S,I,E,C,L,P,R,z,D,O,F,B,a(t,[{buffer:B,type:t.FLOAT,size:3}]));return j.update(e),j}},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 c=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}),u=[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:c,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:c.modes,_ortho:e._ortho||e.projection&&"orthographic"===e.projection.type||!1,tick:function(){var e=n(),r=this.delay,i=e-2*r;c.idle(e-r),c.recalcMatrix(i),c.flush(e-(100+2*r));for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=t.clientWidth===f&&t.clientHeight===p;return f=t.clientWidth,p=t.clientHeight,a?!l:(h=Math.exp(c.computedRadius[0]),!0)},lookAt:function(t,e,r){c.lookAt(c.lastT(),t,e,r)},rotate:function(t,e,r){c.rotate(c.lastT(),t,e,r)},pan:function(t,e,r){c.pan(c.lastT(),t,e,r)},translate:function(t,e,r){c.translate(c.lastT(),t,e,r)}};return Object.defineProperties(d,{matrix:{get:function(){return c.computedMatrix},set:function(t){return c.setMatrix(c.lastT(),t),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(t){var e=c.computedUp.slice(),r=c.computedEye.slice(),i=c.computedCenter.slice();if(c.setMode(t),"turntable"===t){var a=n();c._active.lookAt(a,r,i,e),c._active.lookAt(a+500,r,i,[0,0,1]),c._active.flush(a)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(t){return c.lookAt(c.lastT(),null,t),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(t){return c.lookAt(c.lastT(),t),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(t){return c.lookAt(c.lastT(),null,null,t),c.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(t){return c.setDistance(c.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(t){return c.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,u="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,A=Math.PI*d.rotateSpeed,k=n();if(-1!==d._lastX&&-1!==d._lastY&&((s&&g&&!f&&!p&&!m||g&&!f&&!p&&m)&&c.rotate(k,w*A*_,-T*A*b,0),(l&&g&&!f&&!p&&!m||y||g&&f&&!p&&!m)&&c.pan(k,-d.translateSpeed*_*h,d.translateSpeed*b*h,0),u&&g&&!f&&!p&&!m||v||g&&!f&&p&&!m)){var M=-d.zoomSpeed*b/window.innerHeight*(k-c.lastT())*100;c.pan(k,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))c.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-c.lastT())/20;c.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),c=r(7169),u=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{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},A=t.axes||{},k=i(r,A);k.enable=!A.disable;var M=t.spikes||{},S=o(r,M),E=[],C=[],I=[],L=[],P=!0,z=!0,D={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},O=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),R=t.cameraObject||n(e,T),F={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:R,axes:k,axesPixels:null,spikes:S,bounds:v,objects:E,shape:O,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:D,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)}},B=[r.drawingBufferWidth/F.pixelRatio|0,r.drawingBufferHeight/F.pixelRatio|0];function j(){if(!F._stopped&&F.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*F.pixelRatio),a=0|Math.ceil(n*F.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 N(){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,O);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 U(){if(F.contextLost)return!0;r.isContextLost()&&(F.contextLost=!0,F.mouseListener.enabled=!1,F.selection.object=null,F.oncontextloss&&F.oncontextloss())}F.autoResize&&j(),window.addEventListener("resize",j),F.update=function(t){F._stopped||(t=t||{},P=!0,z=!0)},F.add=function(t){F._stopped||(t.axes=k,E.push(t),C.push(-1),P=!0,z=!0,N())},F.remove=function(t){if(!F._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),P=!0,z=!0,N())}},F.dispose=function(){if(!F._stopped&&(F._stopped=!0,window.removeEventListener("resize",j),e.removeEventListener("webglcontextlost",U),F.mouseListener.enabled=!1,!F.contextLost)){k.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,k=null,S=null,E=[]}},F._mouseRotating=!1,F._prevButtons=0,F.enableMouseListeners=function(){F.mouseListener=u(e,(function(t,e,r){if(!F._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&&F._prevButtons)F._mouseRotating=!0;else{F._mouseRotating&&(z=!0),F._mouseRotating=!1;for(var s=0;s<n;++s){var l=L[s].query(e,B[1]-r-1,F.pickRadius);if(l){if(l.distance>x.distance)continue;for(var c=0;c<i;++c){var u=E[c];if(C[c]===s){var h=u.pick(l);h&&(x.buttons=t,x.screen=l.coord,x.distance=l.distance,x.object=u,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)&&F.onselect&&F.onselect(x),1&t&&!(1&F._prevButtons)&&F.onclick&&F.onclick(x),F._prevButtons=t}}))},e.addEventListener("webglcontextlost",U);var V=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],q=[V[0].slice(),V[1].slice()];function H(){if(!U()){j();var t=F.camera.tick();D.view=F.camera.matrix,P=P||t,z=z||t,k.pixelRatio=F.pixelRatio,S.pixelRatio=F.pixelRatio;var e=E.length,n=V[0],i=V[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=F.pixelRatio,I.axes=F.axes,P=P||!!I.dirty,z=z||!!I.dirty;var s=I.bounds;if(s)for(var l=s[0],u=s[1],p=0;p<3;++p)n[p]=Math.min(n[p],l[p]),i[p]=Math.max(i[p],u[p])}var d=F.bounds;if(F.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||q[0][p]!==d[0][p]||q[1][p]!==d[1][p],q[0][p]=d[0][p],q[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);k.autoTicks?k.update({bounds:d,tickSpacing:v}):k.update({bounds:d})}var T=r.drawingBufferWidth,A=r.drawingBufferHeight;for(O[0]=T,O[1]=A,B[0]=0|Math.max(T/F.pixelRatio,1),B[1]=0|Math.max(A/F.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,c=t.zFar,u=t.fovy,p=o/s;e?(f(i,-p,p,-1,1,l,c),n._ortho=!0):(h(i,u,p,l,c),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]))}(F,w),o=0;o<e;++o)(I=E[o]).axesBounds=d,F.clipToBounds&&(I.clipBounds=d);x.object&&(F.snapToData?S.position=x.dataCoordinate:S.position=x.dataPosition,S.bounds=d),z&&(z=!1,function(){if(!U()){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=B,i.begin();for(var a=0;a<t;++a)if(C[a]===n){var o=E[a];o.drawPick&&(o.pixelRatio=1,o.drawPick(D))}i.end()}}}()),F.axesPixels=a(F.axes,D,T,A),F.onrender&&F.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,T,A),F.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(k.enable&&(M=M||k.isTransparent(),k.draw(D)),S.axes=k,x.object&&S.draw(D),r.disable(r.CULL_FACE),o=0;o<e;++o)(I=E[o]).axes=k,I.pixelRatio=F.pixelRatio,I.isOpaque&&I.isOpaque()&&I.draw(D),I.isTransparent&&I.isTransparent()&&(M=!0);if(M){for(_.shape=O,_.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),k.enable&&k.isTransparent()&&k.drawTransparent(D),o=0;o<e;++o)(I=E[o]).isOpaque&&I.isOpaque()&&I.draw(D);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),k.isTransparent()&&k.drawTransparent(D),o=0;o<e;++o){var I;(I=E[o]).isTransparent&&I.isTransparent()&&I.drawTransparent(D)}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,c(r),r.disable(r.BLEND)}for(P=!1,o=0;o<e;++o)E[o].dirty=!1}}}return F.enableMouseListeners(),function t(){F._stopped||F.contextLost||(H(),requestAnimationFrame(t))}(),F.redraw=function(){F._stopped||(P=!0,H())},F},createCamera:n}},783:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],p=r[0],d=r[1],m=r[2],g=r[3];return(a=c*p+u*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*c+l*p,t[1]=s*u+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 c,u,h=n(t,s);if(r&&1!==r){for(c=0;c<l.positions.length;++c)for(u=0;u<l.positions[c].length;++u)l.positions[c][u]/=r;for(c=0;c<h.positions.length;++c)for(u=0;u<h.positions[c].length;++u)h.positions[c][u]/=r}var f=[[1/0,1/0],[-1/0,-1/0]],p=h.positions.length;for(c=0;c<p;++c){var d=h.positions[c];for(u=0;u<2;++u)f[0][u]=Math.min(f[0][u],d[u]),f[1][u]=Math.max(f[1][u],d[u])}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"]),c=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}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},f={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};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),c=r(9366),u=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,c,u,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=c,this.pickOrthoShader=u,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),c=l.createPickOrtho(e),u=l.createPickProject(e),h=i(e),f=i(e),p=i(e),d=i(e),m=new x(e,r,n,o,h,f,p,d,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}]),s,c,u);return m.update(t),m};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],A=[0,0,0,1],k=[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}var P=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function z(t,e,r,n,i,a,o){var l=r.gl;if((a===r.projectHasAlpha||o)&&function(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||h,u=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=u,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,c,y),l.model=y;var x=(m+1)%3,_=(m+2)%3,P=C(w),z=C(T);P[x]=1,z[_]=1;var D=g(0,0,0,I(A,P)),O=g(0,0,0,I(k,z));if(Math.abs(D[1])>Math.abs(O[1])){var R=D;D=O,O=R,R=P,P=z,z=R;var F=x;x=_,_=F}D[0]<0&&(P[x]=-1),O[1]>0&&(z[_]=-1);var B=0,j=0;for(v=0;v<4;++v)B+=Math.pow(c[4*x+v],2),j+=Math.pow(c[4*_+v],2);P[x]/=Math.sqrt(B),z[_]/=Math.sqrt(j),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()}}(e,r,n,i),a===r.hasAlpha||o){t.bind();var c=t.uniforms;c.model=n.model||h,c.view=n.view||h,c.projection=n.projection||h,b[0]=2/l.drawingBufferWidth,b[1]=2/l.drawingBufferHeight,c.screenSize=b,c.highlightId=r.highlightId,c.highlightScale=r.highlightScale,c.fragClipBounds=P,c.clipBounds=r.axes.bounds,c.opacity=r.opacity,c.pickGroup=r.pickId/255,c.pixelRatio=i,r.vao.bind(),r.vao.draw(l.TRIANGLES,r.vertexCount),r.lineWidth>0&&(l.lineWidth(r.lineWidth*i),r.vao.draw(l.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=u(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=c(a,{family:s,weight:l,style:h,variant:f},i);return{mesh:(p=c(a,r,i))[0],lines:p[1],bounds:p[2],visible:o}}_.draw=function(t){z(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!1,!1)},_.drawTransparent=function(t){z(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!0,!1)},_.drawPick=function(t){z(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"},c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n<c.length;++n)i[n]=c[n][0],a[n]=c[n][1];var u=[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],A=0;A<3;++A)if(isNaN(T[A])||!isFinite(T[A]))continue t;var k=(N=D(f,n,l,this.pixelRatio)).mesh,M=N.lines,S=N.bounds;_+=3*k.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]),j=d(y)&&d(y[0]);t:for(n=0;n<w;++n){for(x+=1,T=s[n],A=0;A<3;++A){if(isNaN(T[A])||!isFinite(T[A]))continue t;h[A]=Math.max(h[A],T[A]),u[A]=Math.min(u[A],T[A])}k=(N=D(f,n,l,this.pixelRatio)).mesh,M=N.lines,S=N.bounds;var N,U=N.visible;if(U)if(d(p)){if(3===(V=B?n<p.length?p[n]:[0,0,0,0]:p).length){for(A=0;A<3;++A)R[A]=V[A];R[3]=1}else if(4===V.length){for(A=0;A<4;++A)R[A]=V[A];!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=j?n<y.length?y[n]:[0,0,0,0]:y).length){for(A=0;A<3;++A)F[A]=V[A];F[A]=1}else if(4===V.length){for(A=0;A<4;++A)F[A]=V[A];!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),W=Math.sin(H);for(T=s[n],A=0;A<3;++A)h[A]=Math.max(h[A],T[A]),u[A]=Math.min(u[A],T[A]);var Z=i,Y=a;Z=0,d(i)?Z=n<i.length?i[n]:0:i&&(Z=i),Y=0,d(a)?Y=n<a.length?a[n]:0:a&&(Y=a);var X=[Z*=Z>0?1-S[0][0]:Z<0?1+S[1][0]:1,Y*=Y>0?1-S[0][1]:Y<0?1+S[1][1]:1],$=k.cells||[],K=k.positions||[];for(A=0;A<$.length;++A)for(var J=$[A],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=K[J[Q]];L[2*z]=q*(G*et[0]-W*et[1]+X[0]),L[2*z+1]=q*(W*et[0]+G*et[1]+X[1]),z+=1}for($=M.edges,K=M.positions,A=0;A<$.length;++A)for(J=$[A],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=K[J[Q]],L[2*O]=q*(G*et[0]-W*et[1]+X[0]),L[2*O+1]=q*(W*et[0]+G*et[1]+X[1]),O+=1}}}this.bounds=[u,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];return new l(t,n(t,r,a,{}),i.mallocUint8(r*a*4))};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 c=l.prototype;Object.defineProperty(c,"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}}}),c.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))},c.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.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]),c=0|Math.min(Math.max(e+r,0),n[1]);if(o<=i||c<=l)return null;var u=[o-i,c-l],h=a(this.buffer,[u[0],u[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 c=0;c<s;c++){var u=t.get(l,c,0),h=t.get(l,c,1),f=t.get(l,c,2),p=t.get(l,c,3);if(u<255||h<255||f<255||p<255){var d=e-l,m=r-c,g=d*d+m*m;g<n&&(n=g,i=l,a=c)}}return[i,a,n]}(h.hi(u[0],u[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]))},c.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 c(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 u=c.prototype;function h(t,e){return t.name<e.name?-1:1}u.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)},u.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},u.update=function(t,e,r,c){if(!e||1===arguments.length){var u=t;t=u.vertex,e=u.fragment,r=u.uniforms,c=u.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||!c){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),c=c||s.attributes(p,g),p.deleteProgram(g)}(c=c.slice()).sort(h);var v,x=[],_=[],b=[];for(v=0;v<c.length;++v){var w=c[v];if(w.type.indexOf("mat")>=0){for(var T=0|w.type.charAt(w.type.length-1),A=new Array(T),k=0;k<T;++k)A[k]=b.length,_.push(w.name+"["+k+"]"),"number"==typeof w.location?b.push(w.location+k):Array.isArray(w.location)&&w.location.length===T&&"number"==typeof w.location[k]?b.push(0|w.location[k]):b.push(-1);x.push({name:w.name,type:w.type,locations:A})}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(c)},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 c(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,c=r.length;o<c;++o){var u=r[o],h=u.name,f=u.type,p=u.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 c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u<i;++u)s(t,e,r[u],n,i,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<i;++e)c[e].location=t[e];else for(e=0;e<i;++e)c[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 c=n[r[l]];t.vertexAttribPointer(c,i,e,a,o,s+l*i),t.enableVertexAttribArray(c)}};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 c(e){return function(n){for(var a=u("",e),o=0;o<a.length;++o){var l=a[o],c=l[0],h=l[1];if(s[h]){var f=n;if("string"==typeof c&&(0===c.indexOf(".")||0===c.indexOf("["))){var p=c;if(0===c.indexOf(".")&&(p=c.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 u(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,u(a,i)):r.push([a,i])}return r}function h(t,e,n){if("object"==typeof n){var u=f(n);Object.defineProperty(t,e,{get:a(u),set:c(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:l(n),set:c(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:c(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 c=parseInt(s[l]);l<s.length-1||o<i.length-1?(c in a||(l<s.length-1?a[c]=[]:a[c]={}),a=a[c]):a[c]=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 u(t).getShaderReference(e,r)},e.program=function(t,e,r,n,i){return u(t).getProgram(e,r,n,i)};var n=r(8866),i=r(2992),a=new(typeof WeakMap>"u"?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 c=l.prototype;function u(t){var e=a.get(t);return e||(e=new l(t),a.set(t,e)),e}c.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 c=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,c,[],1,this)}return l},c.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),c=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}]),u=a(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var h=new s(t,l,c,u);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,c=[0,0,0],u=[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=c,p=u,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){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},s=function(t,e,r){return t<e?e:t>r?r:t},l=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,c=t.maxLength||1e3,u=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,m,g,y,v=t.getVelocity||function(e){return function(t,e,r){var i=e.vectors,a=e.meshgrid,l=t[0],c=t[1],u=t[2],h=a[0].length,f=a[1].length,p=a[2].length,d=o(a[0],l),m=o(a[1],c),g=o(a[2],u),y=d+1,v=m+1,x=g+1;if(d=s(d,0,h-1),y=s(y,0,h-1),m=s(m,0,f-1),v=s(v,0,f-1),g=s(g,0,p-1),x=s(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,A,k,M=a[0][d],S=a[0][y],E=a[1][m],C=a[1][v],I=a[2][g],L=(l-M)/(S-M),P=(c-E)/(C-E),z=(u-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:A=g,k=x,w=m*p,T=v*p,_=d*p*f,b=y*p*f;break;case 4:A=g,k=x,_=d*p,b=y*p,w=m*p*h,T=v*p*h;break;case 3:w=m,T=v,A=g*f,k=x*f,_=d*f*p,b=y*f*p;break;case 2:w=m,T=v,_=d*f,b=y*f,A=g*f*h,k=x*f*h;break;case 1:_=d,b=y,A=g*h,k=x*h,w=m*h*p,T=v*h*p;break;default:_=d,b=y,w=m*h,T=v*h,A=g*h*f,k=x*h*f}var D=i[_+w+A],O=i[_+w+k],R=i[_+T+A],F=i[_+T+k],B=i[b+w+A],j=i[b+w+k],N=i[b+T+A],U=i[b+T+k],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,D,B,L),n.lerp(q,O,j,L),n.lerp(H,R,N,L),n.lerp(G,F,U,L);var W=n.create(),Z=n.create();n.lerp(W,V,H,P),n.lerp(Z,q,G,P);var Y=n.create();return n.lerp(Y,W,Z,z),Y}(e,t,p)},x=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=v(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=v(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=v(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},_=[],b=e[0][0],w=e[0][1],T=e[0][2],A=e[1][0],k=e[1][1],M=e[1][2],S=10*n.distance(e[0],e[1])/c,E=S*S,C=1,I=0,L=r.length;L>1&&(C=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,c=0;c<s;c++){var u=t[c],h=u[0],f=u[1],p=u[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=l(e),m=l(r),g=l(n),y=Math.min(d,m,g);return isFinite(y)?y:1}(r));for(var P=0;P<L;P++){var z=n.create();n.copy(z,r[P]);var D=[z],O=[],R=v(z),F=z;O.push(R);var B=[],j=x(z,R),N=n.length(j);isFinite(N)&&N>I&&(I=N),B.push(N),_.push({points:D,velocities:O,divergences:B});for(var U=0;U<100*c&&D.length<c&&(void 0,void 0,void 0,m=(d=z)[0],g=d[1],y=d[2],!(m<b||m>A||g<w||g>k||y<T||y>M));){U++;var V=n.clone(R),q=n.squaredLength(V);if(0===q)break;q>E&&n.scale(V,V,S/Math.sqrt(q)),n.add(V,V,z),R=v(V),n.squaredDistance(F,V)-E>-1e-4*E&&(D.push(V),F=V,O.push(R),j=x(V,R),N=n.length(j),isFinite(N)&&N>I&&(I=N),B.push(N)),z=V}}var H=function(t,e,r,a){for(var o=0,s=0;s<t.length;s++)for(var l=t[s].velocities,c=0;c<l.length;c++)o=Math.max(o,n.length(l[c]));var u=t.map((function(t){return function(t,e,r,a){for(var o=t.points,s=t.velocities,l=t.divergences,c=[],u=[],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 A=(T+1)%8;c.push(f[T],p[T],p[A],p[A],f[A],f[T]),h.push(v,y,y,y,v,v),d.push(m,g,g,g,m,m);var k=c.length;u.push([k-6,k-5,k-4],[k-3,k-2,k-1])}var M=f;f=p,p=M;var S=v;v=y,y=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:d}}(t,r,a,o)})),h=[],f=[],p=[],d=[];for(s=0;s<u.length;s++){var m=u[s],g=h.length;for(h=h.concat(m.positions),p=p.concat(m.vectors),d=d.concat(m.vertexIntensity),c=0;c<m.cells.length;c++){var y=m.cells[c],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}}(_,t.colormap,I,C);return h?H.tubeScale=h:(0===I&&(I=1),H.tubeScale=.5*u*C/I),H};var c=r(6740),u=r(6405).createMesh;t.exports.createTubeMesh=function(t,e){return u(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),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,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,c,u,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),c=r(5298),u=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],A=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[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=k[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,c,u,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=c,this._contourPickShader=u,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=u([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 c.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 c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[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},D=T.slice(),O=[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=O,n.vertexColor=this.vertexColor;var s=D;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 c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.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=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.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=k[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=u.projections[i],h.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){h.uniforms.permutation=k[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=k[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=u.projections[o],h.uniforms.clipBounds=u.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 j(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 N(t){if(Array.isArray(t)){if(Array.isArray(t))return[j(t[0]),j(t[1]),j(t[2])];var e=j(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=O;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=k[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=k[a],e.lineWidth(this.contourWidth[a]*this.pixelRatio);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(s.uniforms.height=this.contourLevels[a][c],l.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var p=i+u,d=s+f,g=h*(f?l:1-l),y=0;y<3;++y)c[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],c[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(_-c[x])>Math.abs(b-c[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();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.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=N(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=N(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 c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[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),k=x.get(1,o,y,1),M=x.get(2,o,y,0),S=x.get(2,o,y,1),E=T*S-k*M,C=M*w-S*b,I=b*k-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],D=1/0,O=-1/0,R=(a[0]-1)*(a[1]-1)*6,F=s.mallocFloat(n.nextPow2(10*R)),j=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 W=o+A[H][0],Z=y+A[H][1],Y=this._field[0].get(W+1,Z+1),X=this._field[1].get(W+1,Z+1);G=this._field[2].get(W+1,Z+1),E=_.get(W+1,Z+1,0),C=_.get(W+1,Z+1,1),I=_.get(W+1,Z+1,2),t.intensity&&($=t.intensity.get(W,Z));var $=t.intensity?t.intensity.get(W,Z):G+this.objectOffset[2];F[j++]=W,F[j++]=Z,F[j++]=Y,F[j++]=X,F[j++]=G,F[j++]=0,F[j++]=$,F[j++]=E,F[j++]=C,F[j++]=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]),D=Math.min(D,$),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]),O=Math.max(O,$),U+=1}}for(t.intensityBounds&&(D=+t.intensityBounds[0],O=+t.intensityBounds[1]),o=6;o<j;o+=10)F[o]=(F[o]-D)/(O-D);this._vertexCount=U,this._coordinateBuffer.update(F.subarray(0,j)),s.freeFloat(F),s.free(_.data),this.bounds=[P,z],this.intensity=t.intensity||this._field[2],(this.intensityBounds[0]!==D||this.intensityBounds[1]!==O)&&(r=!0),this.intensityBounds=[D,O]}if("levels"in t){var K=t.levels;for(K=Array.isArray(K[0])?K.slice():[[],[],K],o=0;o<3;++o)K[o]=K[o].slice(),K[o].sort((function(t,e){return t-e}));for(o=0;o<3;++o)for(y=0;y<K[o].length;++y)K[o][y]-=this.objectOffset[o];t:for(o=0;o<3;++o){if(K[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<K[o].length;++y)if(K[o][y]!==this.contourLevels[o][y]){r=!0;break t}}this.contourLevels=K}if(r){v=this._field,a=this.shape;for(var J=[],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(J.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),ct=st-lt,ut=ot[1],ht=0|Math.floor(ut),ft=ut-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?ct:1-ct;for(W=0|Math.min(Math.max(lt+V,0),a[0]),q=0;q<2;++q){var yt=q?ft:1-ft;if(Z=0|Math.min(Math.max(ht+q,0),a[1]),G=dt<2?this._field[mt].get(W,Z):(this.intensity.get(W,Z)-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)J.pop();U-=1}continue t}J.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(J.length);for(o=0;o<J.length;++o)_t[o]=J[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,c=(o+2)%3,u=this._field[o],h=this._field[l],p=this._field[c],d=f(u,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,A=1-T,k=+x[1],M=0|k,S=0|Math.min(M+1,i[1]),E=k-M,C=1-E,I=A*C,L=A*E,P=T*C,z=T*E,D=I*h.get(b,M)+L*h.get(b,S)+P*h.get(w,M)+z*h.get(w,S),O=I*p.get(b,M)+L*p.get(b,S)+P*p.get(w,M)+z*p.get(w,S);if(isNaN(D)||isNaN(O)){v&&(n-=1);break}a[2*n+0]=D,a[2*n+1]=O,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=c(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()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=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}}c===t.FLOAT&&!t.getExtension("OES_texture_float")&&(c=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||c!==t.UNSIGNED_BYTE?i.assign(x,e):u(x,e),p=g.subarray(0,y)}var _=m(t);return t.texImage2D(t.TEXTURE_2D,0,h,o[0],o[1],0,h,c,p),l||a.free(g),new f(t,_,o[0],o[1],h,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){return typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement||typeof ImageData<"u"&&t instanceof ImageData}var u=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=c(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,c,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=c.indexOf(o)<0;if(x&&c.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?u(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,c=!!a.normalized,u=a.stride||0,h=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,c,u,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),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,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),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-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),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,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],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-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],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-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,A=0,k=0,M=l,S=[],E=[],C=1,I=0,L=0,P=!1,z=!1,D="",O=a,R=n;"300 es"===(t=t||{}).version&&(O=s,R=o);var F={},B={};for(A=0;A<O.length;A++)F[O[A]]=!0;for(A=0;A<R.length;A++)B[R[A]]=!0;return function(t){return E=[],null!==t?function(t){A=0,t.toString&&(t=t.toString()),D+=t.replace(/\r\n/g,"\n"),T=D.length;for(var n;e=D[A],A<T;){switch(n=A,M){case u:A="/"===e&&"*"===r?(S.push(e),j(S.join("")),M=l,A+1):(S.push(e),r=e,A+1);break;case h:case f:A=N();break;case p:A=U();break;case d:A="."===e||/[eE]/.test(e)?(S.push(e),M=m,r=e,A+1):"x"===e&&1===S.length&&"0"===S[0]?(M=b,S.push(e),r=e,A+1):/[^\d]/.test(e)?(j(S.join("")),M=l,A):(S.push(e),r=e,A+1);break;case b:A=/[^a-fA-F0-9]/.test(e)?(j(S.join("")),M=l,A):(S.push(e),r=e,A+1);break;case m:"f"===e&&(S.push(e),r=e,A+=1),A=/[eE]/.test(e)||("-"===e||"+"===e)&&/[eE]/.test(r)?(S.push(e),r=e,A+1):/[^\d]/.test(e)?(j(S.join("")),M=l,A):(S.push(e),r=e,A+1);break;case c:A=q();break;case x:A=/[^\s]/g.test(e)?(j(S.join("")),M=l,A):(S.push(e),r=e,A+1);break;case l:S=S.length?[]:S,A="/"===r&&"*"===e?(L=k+A-1,M=u,r=e,A+1):"/"===r&&"/"===e?(L=k+A-1,M=h,r=e,A+1):"#"===e?(M=f,L=k+A,A):/\s/.test(e)?(M=x,L=k+A,A):(P=/\d/.test(e),z=/[^\w_]/.test(e),L=k+A,M=P?d:z?p:c,A)}n!==A&&("\n"===D[n]?(I=0,++C):++I)}return k+=A,D=D.slice(A),E}(t):(S.length&&j(S.join("")),M=_,j("(eof)"),E)};function j(t){t.length&&E.push({type:w[M],data:t,position:L,line:C,column:I})}function N(){return"\r"!==e&&"\n"!==e||"\\"===r?(S.push(e),r=e,A+1):(j(S.join("")),M=l,A)}function U(){if("."===r&&/\d/.test(e))return M=m,A;if("/"===r&&"*"===e)return M=u,A;if("/"===r&&"/"===e)return M=h,A;if("."===e&&S.length){for(;V(S););return M=m,A}if(";"===e||")"===e||"("===e){if(S.length)for(;V(S););return j(e),M=l,A+1}var t=2===S.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;V(S););return M=l,A}return S.push(e),r=e,A+1}function V(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 j(r),L+=r.length,(S=S.slice(r.length)).length}}function q(){if(/[^\d\w_]/.test(e)){var t=S.join("");return M=B[t]?v:F[t]?y:g,j(S.join("")),M=l,A}return S.push(e),r=e,A+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=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.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{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,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>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=u):(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>=u?(s=0,o=u):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,c+=i;c>0;t[r+p]=255&o,p+=d,o/=256,c-=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),u=0;u<=i;++u)l[u]=u;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(u=0;u<=i;++u){for(var d=l.slice(),m=0;m<=i;++m)m===u&&(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[u]=y,p[u]=y}for(p[i+1]=h,u=0;u<=i;++u){d=f[u].vertices;var v=f[u].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 c(i,o,p),w=!!e;for(u=i+1;u<r;++u)b.insert(t[u],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 c(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 u=c.prototype;u.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 c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?e:a[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=t;var p=this.orient();if(a[u]=f,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.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,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var b=y.adjacent,w=p.slice(),T=d.slice(),A=new a(w,T,!0);u.push(A);var k=b.indexOf(e);if(!(k<0))for(b[k]=A,T[m]=y,w[g]=-1,T[g]=e,d[g]=A,A.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,A,_))}}}}}for(f.sort(s),g=0;g+1<f.length;g+=2){var L=f[g],P=f[g+1],z=L.index,D=P.index;z<0||D<0||(L.cell.adjacent[L.index]=P.cell,P.cell.adjacent[P.index]=L.cell)}},u.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)}},u.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,c=0,u=0;u<=t;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(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 c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(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 c=s,u=s.slice();return c.sort(d),u.sort(m),new i(n,g(a),g(o),c,u)}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)?c(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)?c(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:u(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?u(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),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=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(u,t)||(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8)))return!1;var v=u[3],x=u[7],_=u[11],b=u[12],w=u[13],T=u[14],A=u[15];if(0!==v||0!==x||0!==_){if(f[0]=v,f[1]=x,f[2]=_,f[3]=A,!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,u),r[0]=c.length(p[0]),c.normalize(p[0],p[0]),i[0]=c.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=c.length(p[1]),c.normalize(p[1],p[1]),i[0]/=r[1],i[1]=c.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=c.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=c.length(p[2]),c.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],c.cross(d,p[1],p[2]),c.dot(p[0],d)<0)for(var k=0;k<3;k++)r[k]*=-1,p[k][0]*=-1,p[k][1]*=-1,p[k][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(),c=h(),u=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,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!f||!p||(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.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)},i=(n.create(),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),c=r(6582),u=r(7656),h=(r(2504),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,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)f[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&f[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=f[c];else i(o,f,d,(t-e[r])/u)}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(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*_}},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,c(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;u(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;u(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],c=t[l],u=o.length;u>1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=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 c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(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)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function m(t){c(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",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),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",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),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"),(t.scalarArguments||0)<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 o=t.getters||[],s=new Array(a),l=0;l<a;++l)o.indexOf(l)>=0?s[l]=!0:s[l]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,s)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var c,u=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,A=m-d*u|0,k=0,M=0,S=0,E=2*u|0,C=n(E),I=n(E),L=0,P=0,z=-1,D=-1,O=0,R=0|-u,F=0|u,B=0,j=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(k=0;k<u;++k)C[L++]=r(f[g],o,s,l),g+=T;if(g+=A,h>0){if(M=1,C[L++]=r(f[g],o,s,l),g+=T,u>0)for(k=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++),L+=1,g+=T,k=2;k<u;++k)c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++,U!==O&&e(I[L+z],V,w,v,U,O,o,s,l)),L+=1,g+=T;for(g+=A,L=0,q=z,z=D,D=q,q=R,R=F,F=q,q=j,j=N,N=q,M=2;M<h;++M){if(C[L++]=r(f[g],o,s,l),g+=T,u>0)for(k=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,O,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,k=2;k<u;++k)c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++,U!==B&&e(I[L+R],V,_,w,B,U,o,s,l),U!==O&&e(I[L+z],V,w,v,U,O,o,s,l)),L+=1,g+=T;1&M&&(L=0),q=z,z=D,D=q,q=R,R=F,F=q,q=j,j=N,N=q,g+=A}}i(I),i(C)}},"false,1,0":function(t,e,r,n,i){return function(a,o,s,l){var c,u=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,A=d-m*h|0,k=0,M=0,S=0,E=2*h|0,C=n(E),I=n(E),L=0,P=0,z=-1,D=-1,O=0,R=0|-h,F=0|h,B=0,j=-h-1|0,N=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+=A,u>0){if(k=1,C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++),L+=1,g+=T,M=2;M<h;++M)c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++,U!==O&&e(I[L+z],V,_,w,O,U,o,s,l)),L+=1,g+=T;for(g+=A,L=0,q=R,R=F,F=q,q=z,z=D,D=q,q=j,j=N,N=q,k=2;k<u;++k){if(C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,B,O,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)c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],t(k,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++,U!==O&&e(I[L+z],V,_,w,O,U,o,s,l),U!==B&&e(I[L+R],V,w,v,U,B,o,s,l)),L+=1,g+=T;1&k&&(L=0),q=R,R=F,F=q,q=z,z=D,D=q,q=j,j=N,N=q,g+=A}}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],c=-1*l,u=l;n|=0,o|=0;var h=0,f=l,p=a[0];for(h=0;h<s;++h)i[o]=.5*(e[n+c]-e[n+u]),n+=f,o+=p},fdTemplate2:function(t,e,r,n,i,a,o,s,l,c){var u=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,c|=0;var w=0,T=0,A=p,k=f-h*p,M=m,S=d-h*m,E=y,C=g-h*y;for(T=0;T<u;++T){for(w=0;w<h;++w)i[o]=.5*(e[n+v]-e[n+x]),s[c]=.5*(e[n+_]-e[n+b]),n+=A,o+=M,c+=E;n+=k,o+=S,c+=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,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,c,u])),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(),c=e[l];return c||(e[l]=c=t([i,a,o,s])),c(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,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,c,u])),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 c={},u={},h=l({funcName:"cdiff"}),f=l({funcName:"zero"});function p(t){return t in c?c[t]:c[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=u[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 u[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,c=0<=s&&s<t.shape[1],u=0<=s+1&&s+1<t.shape[1],h=a&&c?t.get(n,s):0,f=a&&u?t.get(n,s+1):0;return(1-l)*((1-i)*h+i*(o&&c?t.get(n+1,s):0))+l*((1-i)*f+i*(o&&u?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),c=r-l,u=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&&u&&d?t.get(i,l,f):0,y=o&&h&&d?t.get(i,l+1,f):0,v=s&&u&&d?t.get(i+1,l,f):0,x=s&&h&&d?t.get(i+1,l+1,f):0,_=o&&u&&m?t.get(i,l,f+1):0,b=o&&h&&m?t.get(i,l+1,f+1):0;return(1-p)*((1-c)*((1-a)*g+a*v)+c*((1-a)*y+a*x))+p*((1-c)*((1-a)*_+a*(s&&u&&m?t.get(i+1,l,f+1):0))+c*((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,c,u,h=0;t:for(e=0;e<1<<n;++e){for(c=1,u=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;c*=a[l],u+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;c*=1-a[l],u+=t.stride[l]*i[l]}h+=c*t.data[u]}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],c=r[1],u=r[2];n|=0;var h=0,f=0,p=0,d=u,m=c-s*u,g=l-o*c;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],c=t[1],u=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?(c=_,_=0):(c=64,_-=64),n=y+x*h+_*f,o=v+x*d+_*m;var b=0,w=0,T=0,A=p,k=h-u*p,M=f-l*h,S=g,E=d-u*g,C=m-l*d;for(T=0;T<c;++T){for(w=0;w<l;++w){for(b=0;b<u;++b)e[n]=i[o]*s,n+=A,o+=S;n+=k,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],c=r[0],u=r[1],h=a[0],f=a[1];n|=0,o|=0;var p=0,d=0,m=u,g=c-l*u,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],c=r[0],u=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*u+g*c,o=d+m*f+g*h;var y=0,v=0,x=u,_=c-l*u,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],c=t[2],u=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?(c=v,v=0):(c=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*u+_*h,o=y+v*m+x*p+_*d;var b=0,w=0,T=0,A=f,k=u-c*f,M=h-s*u,S=m,E=p-c*m,C=d-s*p;for(T=0;T<l;++T){for(w=0;w<s;++w){for(b=0;b<c;++b)e[n]=i[o],n+=A,o+=S;n+=k,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],c=t[2],u=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,_=u-c*f,b=h-s*u,w=m,T=p-c*m,A=d-s*p;for(v=0;v<l;++v){for(y=0;y<s;++y){for(g=0;g<c;++g)e[n]=i[o],n+=x,o+=w;n+=_,o+=T}n+=b,o+=A}}}},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,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,c,u])),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,c=[a,o.join(),s,l.join()].join(),u=e[c];return u||(e[c]=u=t([a,o,s,l])),u(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,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=e[h];return f||(e[h]=f=t([a,o,s,l,c,u])),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,c=[a,o.join(),s,l.join()].join(),u=e[c];return u||(e[c]=u=t([a,o,s,l])),u(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(),c=e[l];return c||(e[l]=c=t([i,a,o,s])),c(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,r,n=function(){return function(t,e,r,n,i){var a=t[0],o=t[1],s=t[2],l=r[0],c=r[1],u=r[2],h=[0,0,0];n|=0;var f=0,p=0,d=0,m=u,g=c-s*u,y=l-o*c;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=(e=n.bind(void 0,{funcName:"convert"}),r={},function(t,n){var i=t.dtype,a=t.order,o=[i,a.join()].join(),s=r[o];return s||(r[o]=s=e([i,a])),s(t.shape.slice(0),t.data,t.stride,0|t.offset,n)})},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,c,u,h,f){var p,d,m,g,y,v,x,_,b=r*o+a,w=t(c);for(p=r+1;p<=n;++p){for(d=p,m=b+=o,y=0,v=b,g=0;g<c;++g)w[y++]=i[v],v+=u;t:for(;d-- >r;){y=0,v=m-o;e:for(g=0;g<c;++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<c;++g)i[y]=i[v],y+=u,v+=u;m-=o}for(y=m,v=0,g=0;g<c;++g)i[y]=w[v++],y+=u}e(w)}}},o={"uint32,1,0":function(t,e,r){return function n(i,a,o,s,l,c,u,h,f,p,d){var m,g,y,v,x,_,b,w,T,A,k,M,S,E,C,I,L,P,z,D,O,R,F,B,j,N=(a-i+1)/6|0,U=i+N,V=a-N,q=i+a>>1,H=q-N,G=q+N,W=U,Z=H,Y=q,X=G,$=V,K=i+1,J=a-1,Q=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),at=e(nt);k=l*W,M=l*Z,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=W,W=Z,Z=g;break t}if(rt<0)break t;j+=p}k=l*X,M=l*$,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=X,X=$,$=g;break t}if(rt<0)break t;j+=p}k=l*W,M=l*Y,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=W,W=Y,Y=g;break t}if(rt<0)break t;j+=p}k=l*Z,M=l*Y,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=Z,Z=Y,Y=g;break t}if(rt<0)break t;j+=p}k=l*W,M=l*X,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=W,W=X,X=g;break t}if(rt<0)break t;j+=p}k=l*Y,M=l*X,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=Y,Y=X,X=g;break t}if(rt<0)break t;j+=p}k=l*Z,M=l*$,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=Z,Z=$,$=g;break t}if(rt<0)break t;j+=p}k=l*Z,M=l*Y,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=Z,Z=Y,Y=g;break t}if(rt<0)break t;j+=p}k=l*X,M=l*$,j=s;t:for(A=0;A<h;++A){if(w=M+j,(rt=o[b=k+j]-o[w])>0){g=X,X=$,$=g;break t}if(rt<0)break t;j+=p}for(k=l*W,M=l*Z,S=l*Y,E=l*X,C=l*$,I=l*U,L=l*q,P=l*V,B=0,j=s,A=0;A<h;++A)b=k+j,w=M+j,T=S+j,z=E+j,D=C+j,O=I+j,R=L+j,F=P+j,it[B]=o[w],at[B]=o[z],Q=Q&&it[B]===at[B],y=o[b],v=o[T],x=o[D],o[O]=y,o[R]=v,o[F]=x,++B,j+=f;for(k=l*H,M=l*i,j=s,A=0;A<h;++A)w=M+j,o[b=k+j]=o[w],j+=f;for(k=l*G,M=l*a,j=s,A=0;A<h;++A)w=M+j,o[b=k+j]=o[w],j+=f;if(Q)for(_=K;_<=J;++_){for(b=s+_*l,B=0,A=0;A<h&&0==(rt=o[b]-it[B]);++A)B+=d,b+=p;if(0!==rt)if(rt<0){if(_!==K)for(k=l*_,M=l*K,j=s,A=0;A<h;++A)w=M+j,m=o[b=k+j],o[b]=o[w],o[w]=m,j+=f;++K}else for(;;){for(b=s+J*l,B=0,A=0;A<h&&0==(rt=o[b]-it[B]);++A)B+=d,b+=p;if(!(rt>0)){if(rt<0){for(k=l*_,M=l*K,S=l*J,j=s,A=0;A<h;++A)w=M+j,T=S+j,m=o[b=k+j],o[b]=o[w],o[w]=o[T],o[T]=m,j+=f;++K,--J;break}for(k=l*_,M=l*J,j=s,A=0;A<h;++A)w=M+j,m=o[b=k+j],o[b]=o[w],o[w]=m,j+=f;--J;break}J--}}else for(_=K;_<=J;++_){for(b=s+_*l,B=0,A=0;A<h&&0==(tt=o[b]-it[B]);++A)B+=d,b+=p;if(tt<0){if(_!==K)for(k=l*_,M=l*K,j=s,A=0;A<h;++A)w=M+j,m=o[b=k+j],o[b]=o[w],o[w]=m,j+=f;++K}else{for(b=s+_*l,B=0,A=0;A<h&&0==(et=o[b]-at[B]);++A)B+=d,b+=p;if(et>0)for(;;){for(b=s+J*l,B=0,A=0;A<h&&0==(rt=o[b]-at[B]);++A)B+=d,b+=p;if(!(rt>0)){for(b=s+J*l,B=0,A=0;A<h&&0==(rt=o[b]-it[B]);++A)B+=d,b+=p;if(rt<0){for(k=l*_,M=l*K,S=l*J,j=s,A=0;A<h;++A)w=M+j,T=S+j,m=o[b=k+j],o[b]=o[w],o[w]=o[T],o[T]=m,j+=f;++K,--J}else{for(k=l*_,M=l*J,j=s,A=0;A<h;++A)w=M+j,m=o[b=k+j],o[b]=o[w],o[w]=m,j+=f;--J}break}if(--J<_)break}}}for(k=l*i,M=l*(K-1),B=0,j=s,A=0;A<h;++A)w=M+j,o[b=k+j]=o[w],o[w]=it[B],++B,j+=f;for(k=l*a,M=l*(J+1),B=0,j=s,A=0;A<h;++A)w=M+j,o[b=k+j]=o[w],o[w]=at[B],++B,j+=f;if(K-2-i<=32?t(i,K-2,o,s,l,c,u,h,f,p,d):n(i,K-2,o,s,l,c,u,h,f,p,d),a-(J+2)<=32?t(J+2,a,o,s,l,c,u,h,f,p,d):n(J+2,a,o,s,l,c,u,h,f,p,d),Q)return r(it),void r(at);if(K<U&&J>V){t:for(;;){for(b=s+K*l,B=0,j=s,A=0;A<h;++A){if(o[b]!==it[B])break t;++B,b+=f}++K}t:for(;;){for(b=s+J*l,B=0,j=s,A=0;A<h;++A){if(o[b]!==at[B])break t;++B,b+=f}--J}for(_=K;_<=J;++_){for(b=s+_*l,B=0,A=0;A<h&&0==(tt=o[b]-it[B]);++A)B+=d,b+=p;if(0===tt){if(_!==K)for(k=l*_,M=l*K,j=s,A=0;A<h;++A)w=M+j,m=o[b=k+j],o[b]=o[w],o[w]=m,j+=f;++K}else{for(b=s+_*l,B=0,A=0;A<h&&0==(et=o[b]-at[B]);++A)B+=d,b+=p;if(0===et)for(;;){for(b=s+J*l,B=0,A=0;A<h&&0==(rt=o[b]-at[B]);++A)B+=d,b+=p;if(0!==rt){for(b=s+J*l,B=0,A=0;A<h&&0==(rt=o[b]-it[B]);++A)B+=d,b+=p;if(rt<0){for(k=l*_,M=l*K,S=l*J,j=s,A=0;A<h;++A)w=M+j,T=S+j,m=o[b=k+j],o[b]=o[w],o[w]=o[T],o[T]=m,j+=f;++K,--J}else{for(k=l*_,M=l*J,j=s,A=0;A<h;++A)w=M+j,m=o[b=k+j],o[b]=o[w],o[w]=m,j+=f;--J}break}if(--J<_)break}}}}r(it),r(at),J-K<=32?t(K,J,o,s,l,c,u,h,f,p,d):n(K,J,o,s,l,c,u,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],c=0|o[1],u=0|a[1],h=c,f=c;l<=32?t(0,l-1,n,i,s,c,l,u,h,f,1):e(0,l-1,n,i,s,c,l,u,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),c=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,c)}},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=typeof Float64Array<"u";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,c=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=c(-i/l)):i=c(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],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"==typeof t&&t>=0&&(i+=c*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=u*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,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],c=this.stride[2],u=this.offset,h=0,f=Math.ceil;return"number"==typeof t&&((h=0|t)<0?(u+=s*(i-1),i=f(-i/h)):i=f(i/h),s*=h),"number"==typeof e&&((h=0|e)<0?(u+=l*(a-1),a=f(-a/h)):a=f(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(u+=c*(o-1),o=f(-o/h)):o=f(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},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,c){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}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],c=this.shape[2],u=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),c-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,c,u,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],c=this.stride[0],u=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+=c*(a-1),a=m(-a/d)):a=m(a/d),c*=d),"number"==typeof e&&((d=0|e)<0?(p+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=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,c,u,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,c,u,h){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,c,u],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],c=this.shape[1],u=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),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=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,c,u,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],c=this.shape[3],u=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*(c-1),c=v(-c/y)):c=v(c/y),d*=y),"number"==typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,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,c[t][0]):n(t,c[t],o)}var c={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,c.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,u=1;s>=0;--s)r[s]=u,u*=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=c[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,c=s[s.length-1],u=s[0],h=0;h<s.length;++h){l=c,c=u,u=s[(h+1)%s.length];for(var f=e[l],p=e[c],d=e[u],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[c],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 A=0;for(x=0;x<3;++x)A+=_[x]*_[x];if(A>a)for(b=1/Math.sqrt(A),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),c=0;c<3;++c)l[c]=e[s[c]];var u=new Array(3),h=new Array(3);for(c=0;c<3;++c)u[c]=l[1][c]-l[0][c],h[c]=l[2][c]-l[0][c];var f=new Array(3),p=0;for(c=0;c<3;++c){var d=(c+1)%3,m=(c+2)%3;f[c]=u[d]*h[m]-u[m]*h[d],p+=f[c]*f[c]}for(p=p>a?1/Math.sqrt(p):0,c=0;c<3;++c)f[c]*=p;i[o]=f}return i}},4081:function(t){t.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(h>0){var h=Math.sqrt(u+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,c);h=Math.sqrt(2*f-u+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),u(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 c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(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;u(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 c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},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],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=l(u-=a*p,h-=o*p,f-=s*p);u/=d,h/=d,f/=d;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*f,_=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*f);m/=_,g/=_,y/=_;var b=u*e+a*r,w=h*e+o*r,T=f*e+s*r;this.center.move(t,b,w,T);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+n),this.radius.set(t,Math.log(A))},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],u=i[1],h=i[5],f=i[9],p=i[2],d=i[6],m=i[10],g=e*a+r*u,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=c(x,_,b,w);T>1e-6?(x/=T,_/=T,b/=T,w/=T):(x=_=b=0,w=1);var A=this.computedRotation,k=A[0],M=A[1],S=A[2],E=A[3],C=k*w+E*x+M*b-S*_,I=M*w+E*_+S*x-k*b,L=S*w+E*b+k*_-M*x,P=E*w-k*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 D=c(C,I,L,P);D>1e-6?(C/=D,I/=D,L/=D,P/=D):(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]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],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]),u(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,c=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,c-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=typeof r<"u"?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,c=[];for(o=0;o<r;++o)a[0][o].length+a[1][o].length===0&&c.push([o]);function u(t,e){var r=a[e][t[e]];r.splice(r.indexOf(t),1)}function h(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 f(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=h(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],c=t,f=o[1],p=h(l,c,!0);if(n(e[l],e[c],e[f],e[p])<0)break;o.push(t),s=h(l,c)}return o}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=f(o,p);(l=m)[1]===l[l.length-1]?d.push.apply(d,m):(d.length>0&&c.push(d),d=m)}d.length>0&&c.push(d)}return c};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 c=r[p];for(s=0;s<c.length;++s){var u=c[s];0==--a[u]&&o.push(u)}}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=c(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]],c=o(-a[0],a[1]),u=o(-a[0],l[1]),h=o(l[0],a[1]),f=o(l[0],l[1]);n=s(n,s(s(c,u),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,A=0;A<T;++A){var k=_(e[q[A]]);if(0!==k){k<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=u(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 D=C[z];E[D].push(p),E[p].push(D),I[L]=I[P]=!0}else C[z]=p}function O(t){for(var e=t.length,r=0;r<e;++r)if(!I[t[r]])return!1;return!0}var R=[],F=u(m,-1);for(p=0;p<m;++p)g[p]!==p||O(d[p])?F[p]=-1:(R.push(p),F[p]=0);for(r=[];R.length>0;){var B=R.pop(),j=E[B];l(j,(function(t,e){return t-e}));var N,U=j.length,V=F[B];for(0===V&&(N=[q=d[B]]),p=0;p<U;++p){var q,H=j[p];F[H]>=0||(F[H]=1^V,R.push(H),0!==V)||O(q=d[H])||(q.reverse(),N.push(q))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(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 u=t[s],h=u.length,f=h-1,p=0;p<h;f=p++){var d=u[f],m=u[p];d[0]===m[0]?a.push([d,m]):r.push([d,m])}if(0===r.length)return 0===a.length?c: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,c=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(c<0)a=a.left;else{if(!(c>0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<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],c=[Math.min(o,l),Math.max(o,l)];i in e?e[i].push(c):e[i]=[c]}var u={},h=Object.keys(e);for(r=0;r<h.length;++r){var f=e[h[r]];u[h[r]]=a(f)}return function(t){return function(e,r){var n=t[e];return!!n&&!!n.queryPoint(r,s)}}(u)}function c(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 c=0,u=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];c+=m*m,u+=m*g,h+=g*g,f+=y*m,p+=y*g,d+=y*y}var v,x,_,b,w,T=Math.abs(c*h-u*u),A=u*p-h*f,k=u*f-c*p;if(A+k<=T)if(A<0)k<0&&f<0?(k=0,-f>=c?(A=1,v=c+2*f+d):v=f*(A=-f/c)+d):(A=0,p>=0?(k=0,v=d):-p>=h?(k=1,v=h+2*p+d):v=p*(k=-p/h)+d);else if(k<0)k=0,f>=0?(A=0,v=d):-f>=c?(A=1,v=c+2*f+d):v=f*(A=-f/c)+d;else{var M=1/T;v=(A*=M)*(c*A+u*(k*=M)+2*f)+k*(u*A+h*k+2*p)+d}else A<0?(_=h+p)>(x=u+f)?(b=_-x)>=(w=c-2*u+h)?(A=1,k=0,v=c+2*f+d):v=(A=b/w)*(c*A+u*(k=1-A)+2*f)+k*(u*A+h*k+2*p)+d:(A=0,_<=0?(k=1,v=h+2*p+d):p>=0?(k=0,v=d):v=p*(k=-p/h)+d):k<0?(_=c+f)>(x=u+p)?(b=_-x)>=(w=c-2*u+h)?(k=1,A=0,v=h+2*p+d):v=(A=1-(k=b/w))*(c*A+u*k+2*f)+k*(u*A+h*k+2*p)+d:(k=0,_<=0?(A=1,v=c+2*f+d):f>=0?(A=0,v=d):v=f*(A=-f/c)+d):(b=h+p-u-f)<=0?(A=0,k=1,v=h+2*p+d):b>=(w=c-2*u+h)?(A=1,k=0,v=c+2*f+d):v=(A=b/w)*(c*A+u*(k=1-A)+2*f)+k*(u*A+h*k+2*p)+d;var S=1-A-k;for(l=0;l<o.length;++l)s[l]=S*t[l]+A*i[l]+k*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 c=t[r-1];if(0===n(s,c)&&a(c)!==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||typeof e>"u")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 c(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 u(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?c:5===t?u: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 c=o[l.length];return c||(c=o[l.length]=s(l.length)),c(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?c:5===t?u: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]),c=n(s,o[0]),u=r(a[0],a[0]),h=n(u,i[0]),f=n(u,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,c),v=e(g,y);return v[v.length-1]}}function c(t,e,r,n){return function(i,a,o,s){var l=t(r(i[0],i[0]),r(i[1],i[1])),c=n(l,a[0]),u=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]),A=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,c),s[1])))),k=t(t(n(e(T,x),i[1]),t(n(e(b,h),-o[1]),n(e(y,u),s[1]))),t(n(e(v,d),i[1]),t(n(e(y,u),-a[1]),n(e(p,c),o[1])))),M=e(A,k);return M[M.length-1]}}function u(t,e,r,n){return function(i,a,o,s,l){var c=t(r(i[0],i[0]),t(r(i[1],i[1]),r(i[2],i[2]))),u=n(c,a[0]),h=n(c,o[0]),f=n(c,s[0]),p=n(c,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]),A=t(r(s[0],s[0]),t(r(s[1],s[1]),r(s[2],s[2]))),k=n(A,i[0]),M=n(A,a[0]),S=n(A,o[0]),E=n(A,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]),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]))),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(k,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,u),l[1]))),s[2]),t(n(t(n(e(M,y),i[1]),t(n(e(k,f),-a[1]),n(e(m,u),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(k,f),-o[1]),n(e(_,h),s[1]))),-a[2]),t(n(t(n(e(M,y),i[1]),t(n(e(k,f),-a[1]),n(e(m,u),s[1]))),o[2]),n(t(n(e(b,g),i[1]),t(n(e(_,h),-a[1]),n(e(m,u),o[1]))),-s[2]))))),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]))),i[2]),n(t(n(e(z,E),i[1]),t(n(e(I,p),-s[1]),n(e(k,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(k,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,u),l[1]))),o[2]),n(t(n(e(b,g),i[1]),t(n(e(_,h),-a[1]),n(e(m,u),o[1]))),-l[2])))),R=e(D,O);return R[R.length-1]}}function h(t,e,r,n){return function(i,a,o,s,l,c){var u=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(u,a[0]),f=n(u,o[0]),p=n(u,s[0]),d=n(u,l[0]),m=n(u,c[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,c[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]),A=n(w,a[0]),k=n(w,s[0]),M=n(w,l[0]),S=n(w,c[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,c[0]),D=t(t(r(l[0],l[0]),r(l[1],l[1])),t(r(l[2],l[2]),r(l[3],l[3]))),O=n(D,i[0]),R=n(D,a[0]),F=n(D,o[0]),B=n(D,s[0]),j=n(D,c[0]),N=t(t(r(c[0],c[0]),r(c[1],c[1])),t(r(c[2],c[2]),r(c[3],c[3]))),U=n(N,i[0]),V=n(N,a[0]),q=n(N,o[0]),H=n(N,s[0]),G=n(N,l[0]),W=t(t(t(n(t(t(n(t(n(e(G,j),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),c[1]))),o[2]),n(t(n(e(G,j),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),c[1]))),-s[2])),t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,k),c[1]))),l[2]),n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,k),l[1]))),-c[2]))),a[3]),t(n(t(t(n(t(n(e(G,j),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),c[1]))),a[2]),n(t(n(e(G,j),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),c[1]))),-s[2])),t(n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),c[1]))),l[2]),n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),-c[2]))),-o[3]),n(t(t(n(t(n(e(G,j),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),c[1]))),a[2]),n(t(n(e(G,j),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),c[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(A,v),c[1]))),l[2]),n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(A,v),l[1]))),-c[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,k),c[1]))),a[2]),n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),c[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(A,v),c[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(I,x),-o[1]),n(e(A,v),s[1]))),-c[2]))),-l[3]),n(t(t(n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,k),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(A,v),l[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(I,x),-o[1]),n(e(A,v),s[1]))),-l[2]))),c[3])),t(n(t(t(n(t(n(e(G,j),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),c[1]))),a[2]),n(t(n(e(G,j),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),c[1]))),-s[2])),t(n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),c[1]))),l[2]),n(t(n(e(B,P),a[1]),t(n(e(R,_),-s[1]),n(e(I,x),l[1]))),-c[2]))),i[3]),n(t(t(n(t(n(e(G,j),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),c[1]))),i[2]),n(t(n(e(G,j),i[1]),t(n(e(U,m),-l[1]),n(e(O,d),c[1]))),-s[2])),t(n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),c[1]))),l[2]),n(t(n(e(B,P),i[1]),t(n(e(O,d),-s[1]),n(e(C,p),l[1]))),-c[2]))),-a[3])))),t(t(t(n(t(t(n(t(n(e(G,j),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),c[1]))),i[2]),n(t(n(e(G,j),i[1]),t(n(e(U,m),-l[1]),n(e(O,d),c[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),l[2]),n(t(n(e(R,_),i[1]),t(n(e(O,d),-a[1]),n(e(y,h),l[1]))),-c[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),c[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),c[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),s[2]),n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),-c[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(O,d),-s[1]),n(e(C,p),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(O,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]))),c[3]),n(t(t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,k),c[1]))),a[2]),n(t(n(e(H,z),a[1]),t(n(e(V,b),-s[1]),n(e(I,x),c[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(A,v),c[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(I,x),-o[1]),n(e(A,v),s[1]))),-c[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,k),c[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),c[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),c[1]))),s[2]),n(t(n(e(L,k),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-c[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),c[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),c[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),s[2]),n(t(n(e(I,x),i[1]),t(n(e(C,p),-a[1]),n(e(y,h),s[1]))),-c[2]))),o[3])),t(n(t(t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(A,v),c[1]))),i[2]),n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),c[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),o[2]),n(t(n(e(A,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-c[2]))),-s[3]),n(t(t(n(t(n(e(L,k),a[1]),t(n(e(I,x),-o[1]),n(e(A,v),s[1]))),i[2]),n(t(n(e(L,k),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(A,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-s[2]))),c[3]))))),Z=t(t(t(n(t(t(n(t(n(e(G,j),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),c[1]))),o[2]),n(t(n(e(G,j),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),c[1]))),-s[2])),t(n(t(n(e(H,z),o[1]),t(n(e(q,S),-s[1]),n(e(L,k),c[1]))),l[2]),n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,k),l[1]))),-c[2]))),i[3]),t(n(t(t(n(t(n(e(G,j),s[1]),t(n(e(H,z),-l[1]),n(e(B,P),c[1]))),i[2]),n(t(n(e(G,j),i[1]),t(n(e(U,m),-l[1]),n(e(O,d),c[1]))),-s[2])),t(n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),c[1]))),l[2]),n(t(n(e(B,P),i[1]),t(n(e(O,d),-s[1]),n(e(C,p),l[1]))),-c[2]))),-o[3]),n(t(t(n(t(n(e(G,j),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),c[1]))),i[2]),n(t(n(e(G,j),i[1]),t(n(e(U,m),-l[1]),n(e(O,d),c[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),c[1]))),l[2]),n(t(n(e(F,M),i[1]),t(n(e(O,d),-o[1]),n(e(T,f),l[1]))),-c[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,k),c[1]))),i[2]),n(t(n(e(H,z),i[1]),t(n(e(U,m),-s[1]),n(e(C,p),c[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),c[1]))),s[2]),n(t(n(e(L,k),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-c[2]))),-l[3]),n(t(t(n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,k),l[1]))),i[2]),n(t(n(e(B,P),i[1]),t(n(e(O,d),-s[1]),n(e(C,p),l[1]))),-o[2])),t(n(t(n(e(F,M),i[1]),t(n(e(O,d),-o[1]),n(e(T,f),l[1]))),s[2]),n(t(n(e(L,k),i[1]),t(n(e(C,p),-o[1]),n(e(T,f),s[1]))),-l[2]))),c[3])),t(n(t(t(n(t(n(e(G,j),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),c[1]))),a[2]),n(t(n(e(G,j),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),c[1]))),-o[2])),t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(A,v),c[1]))),l[2]),n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(A,v),l[1]))),-c[2]))),i[3]),n(t(t(n(t(n(e(G,j),o[1]),t(n(e(q,S),-l[1]),n(e(F,M),c[1]))),i[2]),n(t(n(e(G,j),i[1]),t(n(e(U,m),-l[1]),n(e(O,d),c[1]))),-o[2])),t(n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),c[1]))),l[2]),n(t(n(e(F,M),i[1]),t(n(e(O,d),-o[1]),n(e(T,f),l[1]))),-c[2]))),-a[3])))),t(t(t(n(t(t(n(t(n(e(G,j),a[1]),t(n(e(V,b),-l[1]),n(e(R,_),c[1]))),i[2]),n(t(n(e(G,j),i[1]),t(n(e(U,m),-l[1]),n(e(O,d),c[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),l[2]),n(t(n(e(R,_),i[1]),t(n(e(O,d),-a[1]),n(e(y,h),l[1]))),-c[2]))),o[3]),n(t(t(n(t(n(e(q,S),a[1]),t(n(e(V,b),-o[1]),n(e(A,v),c[1]))),i[2]),n(t(n(e(q,S),i[1]),t(n(e(U,m),-o[1]),n(e(T,f),c[1]))),-a[2])),t(n(t(n(e(V,b),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),o[2]),n(t(n(e(A,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-c[2]))),-l[3])),t(n(t(t(n(t(n(e(F,M),a[1]),t(n(e(R,_),-o[1]),n(e(A,v),l[1]))),i[2]),n(t(n(e(F,M),i[1]),t(n(e(O,d),-o[1]),n(e(T,f),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(O,d),-a[1]),n(e(y,h),l[1]))),o[2]),n(t(n(e(A,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-l[2]))),c[3]),n(t(t(n(t(n(e(B,P),o[1]),t(n(e(F,M),-s[1]),n(e(L,k),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(A,v),l[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(I,x),-o[1]),n(e(A,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,k),l[1]))),i[2]),n(t(n(e(B,P),i[1]),t(n(e(O,d),-s[1]),n(e(C,p),l[1]))),-o[2])),t(n(t(n(e(F,M),i[1]),t(n(e(O,d),-o[1]),n(e(T,f),l[1]))),s[2]),n(t(n(e(L,k),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(O,d),-s[1]),n(e(C,p),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(O,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(A,v),l[1]))),i[2]),n(t(n(e(F,M),i[1]),t(n(e(O,d),-o[1]),n(e(T,f),l[1]))),-a[2])),t(n(t(n(e(R,_),i[1]),t(n(e(O,d),-a[1]),n(e(y,h),l[1]))),o[2]),n(t(n(e(A,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,k),a[1]),t(n(e(I,x),-o[1]),n(e(A,v),s[1]))),i[2]),n(t(n(e(L,k),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(A,v),i[1]),t(n(e(T,f),-a[1]),n(e(y,h),o[1]))),-s[2]))),l[3]))))),Y=e(W,Z);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,c,u,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,c);case 5:return o(e,r,l,c,u);case 6:return s(e,r,l,c,u,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){return(2===t?a:3===t?o:4===t?s:5===t?l:c)(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 c(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 u=[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,c){switch(l.length){case 0:return t(l,c);case 1:return e(l,c);case 2:return r(l,c);case 3:return n(l,c);case 4:return i(l,c);case 5:return a(l,c)}var u=o[l.length];return u||(u=o[l.length]=s(l.length)),u(l,c)}}!function(){for(;u.length<6;)u.push(i(u.length));t.exports=h.apply(void 0,u.concat([u,i]));for(var e=0;e<6;++e)t.exports[e]=u[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,c=(7+56*s)*s;function u(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])))),c=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])))),u=n(l,c);return u[u.length-1]}}function f(t,e,r,n){return function(i,a,o,s,l){var 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]))),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]))))),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]))),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(c,u);return h[h.length-1]}}function p(t){return(3===t?u: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],u=r[1]-n[1],h=t[2]-n[2],f=e[2]-n[2],p=r[2]-n[2],d=a*u,g=o*l,y=o*s,v=i*u,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=c*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,c){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,c)}for(var u=new Array(arguments.length),h=0;h<arguments.length;++h)u[h]=arguments[h];return t(u)}}!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],c=0;n(t[0],e,s),s[0]&&(o[c++]=s[0]);for(var u=1;u<r;++u){n(t[u],e,l);var h=s[1];i(h,l[0],s),s[0]&&(o[c++]=s[0]);var f=l[1],p=s[1],d=f+p,m=p-(d-f);s[1]=d,m&&(o[c++]=m)}return s[1]&&(o[c++]=s[1]),0===c&&(o[c++]=0),o.length=c,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),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)<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=t-(r-n)+(e-n);return i?[i,r]:[r]}(t[0],-e[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=t[l],f=u(h),p=-e[c],d=u(p);f<d?(a=h,(l+=1)<r&&(f=u(h=t[l]))):(a=p,(c+=1)<n&&(d=u(p=-e[c]))),l<r&&f<d||c>=n?(i=h,(l+=1)<r&&(f=u(h=t[l]))):(i=p,(c+=1)<n&&(d=u(p=-e[c])));for(var m,g,y=i+a,v=y-i,x=a-v,_=x,b=y;l<r&&c<n;)f<d?(i=h,(l+=1)<r&&(f=u(h=t[l]))):(i=p,(c+=1)<n&&(d=u(p=-e[c]))),(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(;c<n;)(x=(a=_)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(c+=1)<n&&(p=-e[c]);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=t-(r-n)+(e-n);return i?[i,r]:[r]}(t[0],e[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=t[l],f=u(h),p=e[c],d=u(p);f<d?(a=h,(l+=1)<r&&(f=u(h=t[l]))):(a=p,(c+=1)<n&&(d=u(p=e[c]))),l<r&&f<d||c>=n?(i=h,(l+=1)<r&&(f=u(h=t[l]))):(i=p,(c+=1)<n&&(d=u(p=e[c])));for(var m,g,y=i+a,v=y-i,x=a-v,_=x,b=y;l<r&&c<n;)f<d?(i=h,(l+=1)<r&&(f=u(h=t[l]))):(i=p,(c+=1)<n&&(d=u(p=e[c]))),(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(;c<n;)(x=(a=_)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(c+=1)<n&&(p=e[c]);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,typeof s>"u"&&(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),c=function(t,e){for(var r=t.length,o=e*(e+1)/2*r|0,s=i.mallocUint32(2*o),l=0,c=0;c<r;++c)for(var u=t[c],h=(e=u.length,0);h<e;++h)for(var f=0;f<h;++f){var p=u[f],d=u[h];s[l++]=0|Math.min(p,d),s[l++]=0|Math.max(p,d)}a(n(s,[l/2|0,2]));var m=2;for(c=2;c<l;c+=2)s[c-2]===s[c]&&s[c-1]===s[c+1]||(s[m++]=s[c],s[m++]=s[c+1]);return n(s,[m/2|0,2])}(t,s),u=function(t,e,r,a){for(var o=t.data,s=t.shape[0],l=i.mallocDouble(s),c=0,u=0;u<s;++u){var h=o[2*u],f=o[2*u+1];if(r[h]!==r[f]){var p=e[h],d=e[f];o[2*c]=h,o[2*c+1]=f,l[c++]=(d-a)/(d-p)}}return t.shape[0]=c,n(l,[c])}(c,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}(c,0|e.length),f=o(s)(t,c.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}(c),d=[].slice.call(u.data,0,u.shape[0]);return i.free(l),i.free(c.data),i.free(u.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,c=e[2*l+1];if(c===a)return l;a<c?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 c=(0|i[l[0]])+(i[l[1]]<<1);if(0===c||3===c)continue;switch(c){case 0:case 3: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,c=e[2*l+1];if(c===a)return l;a<c?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],c=l.length;if(3===c){if(0==(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7: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===c){var u;if(0==(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3: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,c=e[2*l+1];if(c===a)return l;a<c?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],c=l.length;if(4===c){if(0==(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2)+(i[l[3]]<<3))||15===u)continue;switch(u){case 0:case 15: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===c){if(0==(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7: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===c){var u;if(0==(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3: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]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=u[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,1+((t|=t>>>8)|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]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=u[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 c(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 u(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 u=e[i],h=u.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++]=u[m]);var g=c(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 c=new Array(e+1),u=0,h=0;h<o.length;++h)l&1<<h&&(c[u++]=o[h]);r.push(c)}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=c,e.incidence=u,e.dual=function(t,e){if(!e)return u(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 c=[],u=0;u<a;++u)o>>>u&1&&c.push(i[u]);e.push(c)}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),c=0,u=0;c<o;++c)c!==a&&(l[u++]=i[c]);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=[],c=r.ranks;for(n=0;n<c.length;++n)c[n]=-1;for(n=0;n<t.length;++n){var u=r.find(t[n][0]);c[u]<0?(c[u]=l.length,l.push([t[n].slice(0)])):l[c[u]].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 u=c(e,[a[o]]),f=o+1;f<a.length;++f)r.link(u,c(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(c(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),c=new Array(a),u=new Array(a),h=0;h<a;++h)s[h]=l[h]=-1,c[h]=1/0,u[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(u[t])return 1/0;var r=s[t],i=l[t];return r<0||i<0?1/0:function(t,e,r){return Math.abs(n(t,e,r))/Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}(e[t],e[r],e[i])}function g(t,e){var r=A[t],n=A[e];A[t]=n,A[e]=r,k[r]=e,k[n]=t}function y(t){return c[A[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=A[0];return g(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=A[t];return c[r]===e?t:(c[r]=-1/0,_(t),b(),c[r]=e,_((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),k[e]>=0&&w(k[e],m(e)),k[r]>=0&&w(k[r],m(r))}}var A=[],k=new Array(a);for(h=0;h<a;++h)(c[h]=m(h))<1/0?(k[h]=A.length,A.push(h)):k[h]=-1;var M=A.length;for(h=M>>1;h>=0;--h)x(h);for(;;){var S=b();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h<a;++h)u[h]||(k[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(!u[n]||i<0||i===n||(i=t[n=i],!u[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=k[e],i=k[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),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;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]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return l<c?l-c:s>u?s-u:l-u}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],c=l[0][0]<l[1][0];n[2*a]=new h(l[0][0],l,c,a),n[2*a+1]=new h(l[1][0],l,!c,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 u(v.segment[0][1],v.index,!0,!0)),y.push(new u(v.segment[1][1],v.index,!1,!1))):(y.push(new u(v.segment[1][1],v.index,!0,!1)),y.push(new u(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 c(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=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(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=c(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 u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.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],c=0;c<t.length;++c,s=l){var u=a(l=t[c],e);if(i<0&&u>0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}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 c=a(s=t[l],e);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}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 c=a(s=t[l],e);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(t,e,r){var n;!function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_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,c,u,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,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(f+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?f+r+l:"0"===c?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],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[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,typeof window<"u"&&(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,c,u,h,f){var p=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*f)/(r-n),e-.25-.25*(i+r-2*f)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*f)/(n-r),e-.25-.25*(a+n-2*f)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*f)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*f)/(i-a),e-.75-.25*(-i-r+2*f)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*f)/(r-n+i-a),e-.5]);break;case 6:u.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:u.push([t-.75-.25*(a+i-2*f)/(i-a),e-.75-.25*(a+n-2*f)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*f)/(a-i),e-.75-.25*(-a-n+2*f)/(a-n)]);break;case 9:u.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:u.push([t-.5-.5*(-n-r-a-i+4*f)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*f)/(a-i),e-.75-.25*(i+r-2*f)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*f)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*f)/(r-n),e-.25-.25*(-a-n+2*f)/(a-n)]);break;case 14:u.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,u=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),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(d[0],d[1],d[2]);var m=l(r,d)/i,g=l(n,d)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new f(t.zoomMin,t.zoomMax,e,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(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 c=0;c<16;++c)this.computedMatrix[c]=.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),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(u);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,A=-g*x,k=-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]=A*r[a]+k*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],D=E[6],O=E[10],R=L*O-P*D,F=P*z-I*O,B=I*D-L*z,j=c(R,F,B);for(R/=j,F/=j,B/=j,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){u=0;for(var N=0;N<3;++N)u+=E[a+4*N]*S[N];E[12+a]=-u}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,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,d),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+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,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=c(u-=a*p,h-=o*p,f-=s*p),m=(u/=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=c(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=c(x-=s*w,_-=l*w,b-=h*w),A=l*(b/=T)-h*(_/=T),k=h*(x/=T)-s*b,M=s*_-l*x,S=c(A,k,M);if(A/=S,k/=S,M/=S,this.center.jump(t,H,G,W),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*A+C*k+I*M;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(P,L)}else{var z=e[2],D=e[6],O=e[10],R=z*s+D*l+O*h,F=z*x+D*_+O*b,B=z*A+D*k+O*M;y=Math.asin(u(R)),v=Math.atan2(B,F)}this.angle.jump(t,v,y),this.recalcMatrix(t);var j=e[2],N=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,W=V[14]/q,Z=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*Z,G-N*Z,W-U*Z)},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=c(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=c(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=c(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=c(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=c(_,b,w),A=i*l+a*h+o*f,k=m*l+g*h+y*f,M=(_/=T)*l+(b/=T)*h+(w/=T)*f,S=Math.asin(u(A)),E=Math.atan2(M,k),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),D=Math.abs(I-2*Math.PI-E);P<z&&(I+=2*Math.PI),D<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,c=l-(l-r),u=r-c,h=s*u-(i-o*c-s*c-o*u);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=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",l=typeof BigInt64Array<"u",c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,h=c.BUFFER;function f(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[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 A(t){return l?new BigInt64Array(p(8*t),0,t):null}function k(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);u[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 A(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return k(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=A,e.mallocDataView=k,e.mallocBuffer=M,e.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[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;typeof document<"u"&&((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(c,u,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,A=Math.round(a*n),k=n,M=2*n,S=0,E=T*A+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,D=0,O="";function R(){if(""!==O){var t=e.measureText(O).width;e.fillText(O,k+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*A*(l-s)}if(!0===o.superscripts){var c=t.indexOf(d),h=r.indexOf(d),p=c>-1?parseInt(t[1+c]):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*A*(m-p)}if(!0===o.bolds){var g=t.indexOf(u)>-1,v=r.indexOf(u)>-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 j=w[C]+"\n";for(L=0,P=C*A,z=n,O="",I=0;I<j.length;++I){var N=I+D<_.length?_[I+D]:_[_.length-1];s===N?O+=j[I]:(R(),O=j[I],void 0!==N&&(B(s,N),s=N))}R(),D+=j.length;var U=0|Math.round(L+2*k);S<U&&(S=U)}var V=S,q=M+A*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),c="b",u="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,c=0,u=-s;c>-1&&!(-1===(c=r.indexOf(i,c))||(u=r.indexOf(a,c+o),-1===u)||u<=c);){for(var h=c;h<u+s;++h)if(h<c+o||h>=u)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=c+o,m=r.substr(p,u-p).indexOf(i);c=-1!==m?m:u+s}return n}function _(t,e,r,i){var c=function(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,i),u=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 c=t[l],u=0;u<2;++u)a[u]=0|Math.min(a[u],c[u]),o[u]=0|Math.max(o[u],c[u]);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)]}))}(c.positions,e,r),h=c.edges,f="ccw"===e.orientation;if(o(u,h),e.polygons||e.polygon||e.polyline){for(var p=l(h,u),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]=u[x[b]].slice();f&&_.reverse(),y[v]=_}d[m]=y}return d}return e.triangles||e.triangulate||e.triangle?{cells:s(u,h,{delaunay:!1,exterior:!1,interior:!0}),positions:u}:{edges:h,positions:u}}function b(t,e,r){try{return _(t,e,r,!0)}catch{}try{return _(t,e,r,!1)}catch{}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},1538:function(t){!function(){if(!(typeof ses<"u"&&ses.ok)||ses.ok()){typeof ses<"u"&&(ses.weakMapPermitHostObjects=g);var e=!1;if("function"==typeof WeakMap){var r=WeakMap;if(!(typeof navigator<"u"&&/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}}Object.prototype.hasOwnProperty;var a=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:",c=l+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var u=new ArrayBuffer(25),h=new Uint8Array(u);crypto.getRandomValues(h),c=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{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&&typeof Proxy<"u"&&(Proxy=void 0),n.prototype=m.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(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[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch{return}}}function x(t){return t.prototype=null,Object.freeze(t)}function _(){!p&&typeof console<"u"&&(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,r,n=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u<o;++u){var f=e[n]-a,p=e[n+c]-a;f>=0!=p>=0&&i.push(l[0]+.5+.5*(f+p)/(f-p)),n+=h,++l[0]}}};t.exports=(e=n.bind(void 0,{funcName:"zeroCrossings"}),r={},function(t,n,i){var a=t.dtype,o=t.order,s=[a,o.join()].join(),l=r[s];return l||(r[s]=l=e([a,o])),l(t.shape.slice(0),t.data,t.stride,0|t.offset,n,i)})},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{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=p({"node_modules/color-name/index.js"(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=p({"node_modules/color-normalize/node_modules/color-parse/index.js"(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,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(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===u&&(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],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=e[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(t,e){if(/%$/.test(t))return e===u?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=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}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=p({"node_modules/color-normalize/node_modules/color-rgba/index.js"(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,c=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];c<3;)(n=o+1/3*-(c-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[c++]=255*a;return i}(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}}}),Kd=p({"node_modules/clamp/index.js"(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}}}),Jd=p({"node_modules/dtype/index.js"(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=p({"node_modules/color-normalize/index.js"(t,e){var r=$d(),n=Kd(),i=Jd();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=p({"src/lib/str2rgbarray.js"(t,e){var r=Qd();e.exports=function(t){return t?r(t):[0,0,0,1]}}}),em=p({"src/lib/gl_format_color.js"(t,e){var r=A(),n=O(),i=Qd(),a=Ze(),o=q().defaultLine,s=E().isArrayOrTypedArray,l=i(o);function c(t,e){var r=t;return r[3]*=e,r}function u(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):u,f=g?function(t,e){return void 0===t[e]?l:i(o(t[e]))}:u,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[_]=c(d,m);else x=c(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=p({"src/constants/gl3d_dashes.js"(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=p({"src/constants/gl3d_markers.js"(t,e){e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}}),im=p({"src/traces/scatter3d/calc_errors.js"(t,e){var r=qt();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 c=i.c2l(t[s]),u=t[s]-l[0],h=t[s]+l[1];if(o[s]=[(i.c2l(u,!0)-c)*n,(i.c2l(h,!0)-c)*n],u>0){var f=i.c2l(u);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]],c=0;c<3;c++)if(i[c])for(var u=0;u<2;u++)l[u][c]=i[c][s][u];o[s]=l}return o}}}),am=p({"src/traces/scatter3d/convert.js"(t,e){var r=Zd().gl_line3d,n=Zd().gl_scatter3d,i=Zd().gl_error3d,a=Zd().gl_mesh3d,o=Zd().delaunay_triangulate,s=le(),l=tm(),c=em().formatColor,u=Xe(),h=rm(),f=nm(),p=ir(),d=$e().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){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]?T(t):t.map(T):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,f,g,y,T=this.scene.glplot.gl,k=h.solid;this.data=t;var M=function(t,e){var r,n,i,a,o,h,f=[],g=t.fullSceneLayout,y=t.dataScale,T=g.xaxis,A=g.yaxis,k=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,D=e.zcalendar;for(o=0;o<L;o++)r=T.d2l(E[o],0,P)*y[0],n=A.d2l(C[o],0,z)*y[1],i=k.d2l(I[o],0,D)*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 O(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),j=B?Math.min(R.length,L):L,N=B?function(t){return R[t]}:function(){return R};for(h=new Array(j),o=0;o<j;o++){var U={x:E[o],y:C[o],z:I[o]},V={xLabel:O("xaxis",E[o]),yLabel:O("yaxis",C[o]),zLabel:O("zaxis",I[o])},q={};d(q,e,o);var H=e._meta||{};h[o]=s.texttemplateString(N(o),V,F,q,U,H)}}if(a={position:f,mode:e.mode,text:h},"line"in e&&(a.lineColor=c(S,1,L),a.lineWidth=S.width,a.lineDashes=S.dash),"marker"in e){var G=u(e);a.scatterColor=c(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=c(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=c(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 W=["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 Z=e.projection[W[o]];(a.project[o]=Z.show)&&(a.projectOpacity[o]=Z.opacity,a.projectScale[o]=Z.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}(this.scene,t);"mode"in M&&(this.mode=M.mode),"lineDashes"in M&&M.lineDashes in h&&(k=h[M.lineDashes]),this.color=A(M.scatterColor)||A(M.lineColor),this.dataPoints=M.position,e={gl:this.scene.glplot.gl,position:M.position,color:M.lineColor,lineWidth:M.lineWidth||1,dashes:k[0],dashScale:k[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 S=t.opacity;if(t.marker&&void 0!==t.marker.opacity&&(S*=t.marker.opacity),f={gl:this.scene.glplot.gl,position:M.position,color:M.scatterColor,size:M.scatterSize,glyph:M.scatterMarker,opacity:S,orthographic:!0,lineWidth:M.scatterLineWidth,lineColor:M.scatterLineColor,project:M.project,projectScale:M.projectScale,projectOpacity:M.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(f):(this.scatterPlot=n(f),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),y={gl:this.scene.glplot.gl,position:M.position,glyph:M.text,color:M.textColor,size:M.textSize,angle:M.textAngle,alignment:M.textOffset,font:M.textFontFamily,fontWeight:M.textFontWeight,fontStyle:M.textFontStyle,fontVariant:M.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(y):(this.textMarkers=n(y),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),g={gl:this.scene.glplot.gl,position:M.position,color:M.errorColor,error:M.errorBounds,lineWidth:M.errorLineWidth,capSize:M.errorCapSize,opacity:t.opacity},this.errorBars?M.errorBounds?this.errorBars.update(g):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):M.errorBounds&&(this.errorBars=i(g),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),M.delaunayAxis>=0){var E=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n<t.length;++n){var c=t[n];isNaN(c[i])||!isFinite(c[i])||isNaN(c[a])||!isFinite(c[a])||(s.push([c[i],c[a]]),l.push(n))}var u=o(s);for(n=0;n<u.length;++n)for(var h=u[n],f=0;f<h.length;++f)h[f]=l[h[f]];return{positions:t,cells:u,meshColor:e}}(M.position,M.delaunayColor,M.delaunayAxis);E.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(E):(E.gl=T,this.delaunayMesh=a(E),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=p({"src/traces/scatter3d/attributes.js"(t,e){var r=Tn(),n=F(),i=Pe(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=U(),c=rm(),u=nm(),h=R().extendFlat,f=Pt().overrideAll,p=Zt(),d=r.line,m=r.marker,g=m.line,y=h({width:d.width,dash:{valType:"enumerated",values:p(c),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(u),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=p({"src/traces/scatter3d/defaults.js"(t,e){var r=qt(),n=le(),i=Ye(),a=Zn(),o=Yn(),s=$n(),l=om();e.exports=function(t,e,c,u){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");return r.getComponentMethod("calendars","handleTraceDefaults")(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,u);if(f){h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),i.hasMarkers(e)&&a(t,e,c,u,h,{noSelect:!0,noAngle:!0}),i.hasLines(e)&&(h("connectgaps"),o(t,e,c,u,h)),i.hasText(e)&&(h("texttemplate"),s(t,e,u,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||c,{axis:"z"}),v(t,e,p||d||c,{axis:"y",inherit:"z"}),v(t,e,p||d||c,{axis:"x",inherit:"z"})}else e.visible=!1}}}),lm=p({"src/traces/scatter3d/calc.js"(t,e){var r=ii(),n=ni();e.exports=function(t,e){var i=[{x:!1,y:!1,trace:e,t:{}}];return r(i,e),n(t,e),i}}}),cm=p({"node_modules/get-canvas-context/index.js"(t,e){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},typeof document>"u"&&!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{n=null}return n||null}}}),um=p({"node_modules/webgl-context/index.js"(t,e){var r=cm();e.exports=function(t){return r("webgl",t)}}}),hm=p({"src/lib/show_no_webgl_msg.js"(t,e){var r=H(),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=p({"src/plots/gl3d/layout/convert.js"(t,e){var r=tm(),n=le(),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=p({"src/plots/gl3d/layout/spikes.js"(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=p({"src/plots/gl3d/layout/tick_marks.js"(t,e){e.exports=function(t){for(var e=t.axesOptions,o=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[i[c]];if(u._length=(o[c].hi-o[c].lo)*o[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=o[c].lo/t.dataScale[c],u.range[1]=o[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*o[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var f=u.nticks||n.constrain(u._length/40,4,9);r.autoTicks(u,Math.abs(u.range[1]-u.range[0])/f)}for(var p=r.calcTicks(u,{msUTC:!0}),d=0;d<p.length;++d)p[d].x=p[d].x*t.dataScale[c],"date"===u.type&&(p[d].text=p[d].text.replace(/\<br\>/g," "));l[c]=p,u.tickmode=h}}for(e.ticks=l,c=0;c<3;++c)for(a[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]),d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c];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}(l)};var r=ir(),n=le(),i=["xaxis","yaxis","zaxis"],a=[0,0,0]}}),mm=p({"src/plots/gl3d/scene.js"(t,e){var r,n,i=Zd().gl_plot3d,a=i.createCamera,o=i.createScene,s=um(),l=lr(),c=qt(),u=le(),h=u.preserveDrawingBuffer(),f=ir(),p=Dr(),d=tm(),m=hm(),g=Ni(),y=fm(),v=pm(),x=dm(),_=nr().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=c.getComponentMethod("annotations3d","convert"),this.drawAnnotations=c.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 A=!0;T.tryCreatePlot=function(){var t=this,e=t.prepareOptions(),r=!0;try{t.glplot=o(e)}catch{if(t.staticMode||!A||h)r=!1;else{u.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{h=e.glOptions.preserveDrawingBuffer=!1,r=!1}}}return A=!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 c=Object.keys(e.traces),h=null,d=e.glplot.selection,m=0;m<c.length;++m)"skip"!==(t=e.traces[c[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)},A=p.castHoverinfo(_,e.fullLayout,w),k=(A||"").split("+"),M=A&&"all"===A;!_.hovertemplate&&!M&&(-1===k.indexOf("x")&&(T.xLabel=void 0),-1===k.indexOf("y")&&(T.yLabel=void 0),-1===k.indexOf("z")&&(T.zLabel=void 0),-1===k.indexOf("text")&&(d.textLabel=void 0),-1===k.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!==k.indexOf("u"))&&E.push("u: "+T.uLabel),T.vLabel=y("y",d.traceCoordinate[4],t.vhoverformat),(M||-1!==k.indexOf("v"))&&E.push("v: "+T.vLabel),T.wLabel=y("z",d.traceCoordinate[5],t.whoverformat),(M||-1!==k.indexOf("w"))&&E.push("w: "+T.wLabel),T.normLabel=d.traceCoordinate[6].toPrecision(3),(M||-1!==k.indexOf("norm"))&&E.push("norm: "+T.normLabel),"streamtube"===t.type&&(T.divergenceLabel=d.traceCoordinate[7].toPrecision(3),(M||-1!==k.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:u.castOption(_,w,"hovertemplate"),hovertemplateLabels:u.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):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],h=e["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var f,p=0;p<(h||l.length);p++)if(u.isArrayOrTypedArray(l[p]))for(var d=0;d<l[p].length;++d)f=s.d2l(l[p][d],0,c),!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,c),!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,c,u=e[n.id],h=r[n.id];n.fullLayout=e,n.fullSceneLayout=u,n.axesOptions.merge(e,u),n.spikeOptions.merge(u),n.setViewport(u),n.updateFx(u.dragmode,u.hovermode),n.camera.enableWheel=n.graphDiv._context._scrollZoom.gl3d,n.glplot.setClearColor(d(u.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=k[i],o=a.charAt(0),s=r[a],l=0;l<n.length;l++){var c=n[l];if(c.visible){var u=s.r2l(c[o]);!isNaN(u)&&isFinite(u)&&(e[0][i]=Math.min(e[0][i],u),e[1][i]=Math.max(e[1][i],u))}}}(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((c=(l=u[k[o]]).type)in v?(v[c].acc*=p[o],v[c].count+=1):v[c]={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 A=b[s],S=A.bounds,E=A._trace.data._pad||0;"ErrorBars"===A.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,D=u.aspectmode;if("cube"===D)z=[1,1,1];else if("manual"===D){var O=u.aspectratio;z=[O.x,O.y,O.z]}else{if("auto"!==D&&"data"!==D)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[c=(l=u[k[o]]).type];R[o]=Math.pow(F.acc,1/F.count)/p[o]}z="data"===D||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}u.aspectratio.x=h.aspectratio.x=z[0],u.aspectratio.y=h.aspectratio.y=z[1],u.aspectratio.z=h.aspectratio.z=z[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var B=u.domain||null,j=e._size||null;if(B&&j){var N=n.container.style;N.position="absolute",N.left=j.l+B.x[0]*j.w+"px",N.top=j.t+(1-B.y[1])*j.h+"px",N.width=j.w*(B.x[1]-B.x[0])+"px",N.height=j.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,r,n,i,a,o,s=this.getCamera(),l=u.nestedProperty(t,this.id+".camera").get(),c=!1;if(void 0===l)c=!0;else{for(var h=0;h<3;h++)for(var f=0;f<3;f++)if(e=s,i=f,void 0,void 0,o=["x","y","z"],!(r=l)[(a=["up","center","eye"])[n=h]]||e[a[n]][o[i]]!==r[a[n]][o[i]]){c=!0;break}(!l.projection||s.projection&&s.projection.type!==l.projection.type)&&(c=!0)}return c},T.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=u.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=u.nestedProperty(t,s.id+".camera")).get(),d[s.id+".camera"]=n),f&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(t,s.id+".aspectratio")).get(),d[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,l._preGUI,d),h&&(r.set(e),u.nestedProperty(l,s.id+".camera").set(e)),f&&(a.set(i),u.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;c.call("_storeDirectGUIEdit",m,a._preGUI,d),o.up=p,u.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,c=t[s];t[s]=t[l],t[l]=c}}(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,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,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[k[t]];f.setConvert(e,this.fullLayout),e.setScale=u.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=p({"src/plots/gl3d/layout/attributes.js"(t,e){e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),ym=p({"src/plots/gl3d/layout/axis_attributes.js"(t,e){var r=H(),n=Ie(),i=R().extendFlat,a=Pt().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=p({"src/plots/gl3d/layout/layout_attributes.js"(t,e){var r=ym(),n=Aa().attributes,i=R().extendFlat,a=le().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=p({"src/plots/gl3d/layout/axis_defaults.js"(t,e){var r=O().mix,n=le(),i=ye(),a=ym(),o=_i(),s=Ti(),l=["xaxis","yaxis","zaxis"],c=13600/187;e.exports=function(t,e,u){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]+u.scene,f._name=m,o(h,f,p,u),s(h,f,p,{font:u.font,letter:m[0],data:u.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:u.bgColor,calendar:u.calendar},u.fullLayout),p("gridcolor",r(f.color,u.bgColor,c).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=p({"src/plots/gl3d/layout/defaults.js"(t,e){var r=le(),n=H(),i=qt(),a=Hs(),o=xm(),s=vm(),l=we().getSubplotData,c="gl3d";function u(t,e,r,a){for(var s=r("bgcolor"),u=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,c,a.id);o(t,e,{font:a.font,scene:a.id,data:m,bgColor:u,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:c,attributes:s,handleDefaults:u,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=p({"src/plots/gl3d/index.js"(t){var e=Pt().overrideAll,r=j(),n=mm(),i=we().getSubplotData,a=le(),o=ke(),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],c=i(r,s,l),u=e[l],h=u.camera,f=u._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),u._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(c,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,c=a._scene,u=c.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":u,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"}),c.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=p({"src/traces/scatter3d/index.js"(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=p({"lib/scatter3d.js"(t,e){e.exports=wm()}}),Am=p({"src/traces/surface/attributes.js"(t,e){var r=H(),n=Pe(),i=Ce().axisHoverFormat,a=Ot().hovertemplateAttrs,o=U(),s=R().extendFlat,l=Pt().overrideAll;function c(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 u=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:c(),y:c(),z:c()},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");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes"}}),km=p({"src/traces/surface/defaults.js"(t,e){var r=qt(),n=le(),i=qe(),a=Am();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(){for(var t=[],e=0;e<32;e++){var r=e/31,n=.1+.9*(1-Math.pow(Math.sin(1*r*Math.PI),2));t.push([r,Math.max(0,Math.min(1,n))])}return t}():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 c,u;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(c=0;c<3;++c){var g="contours."+m[c],y=h(g+".show"),v=h(g+".highlight");if(y||v)for(u=0;u<3;++u)h(g+".project."+m[u]);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=p({"src/traces/surface/calc.js"(t,e){var r=We();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=p({"src/traces/surface/convert.js"(t,e){var r=Zd().gl_surface3d,n=Zd().ndarray,i=Zd().ndarray_linear_interpolate.d2,a=Do(),o=Oo(),s=le().isArrayOrTypedArray,l=em().parseColorScale,c=tm(),u=Ze().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 c=0;c<s;c++)r(a,[l,c],n),t.set(l,c,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,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/e,0,0,0,1/r,0,0,0,1],f=0;f<t.length;++f){this.surface.padField(u,t[f]);var p=n(new Float32Array(o*s),[o,s]);w(p,u,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=u(t);if(w.intensityBounds=[T.min,T.max],t.surfacecolor){var A=n(new Float32Array(f*p),[f,p]);for(g=0;g<f;g++)for(y=0;y<p;y++)A.set(g,y,t.surfacecolor[y][g]);b.push(A)}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 k=[!0,!0,!0],M=["x","y","z"];for(m=0;m<3;++m){var S=t.contours[M[m]];k[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]=c(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]=c(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=k,i.enableHighlight=k,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=p({"src/traces/surface/index.js"(t,e){e.exports={attributes:Am(),supplyDefaults:km().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:Mm(),plot:Sm(),moduleType:"trace",name:"surface",basePlotModule:bm(),categories:["gl3d","2dMap","showLegend"],meta:{}}}}),Cm=p({"lib/surface.js"(t,e){e.exports=Em()}}),Im=p({"src/traces/mesh3d/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Am(),o=U(),s=R().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=p({"src/traces/isosurface/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Im(),o=U(),s=R().extendFlat,l=Pt().overrideAll,c=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");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes"}}),Pm=p({"src/traces/isosurface/defaults.js"(t,e){var r=le(),n=qt(),i=Lm(),a=qe();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 c=o("x"),u=o("y"),h=o("z"),f=o("value");c&&c.length&&u&&u.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=p({"src/traces/streamtube/calc.js"(t,e){var r=le(),n=We();function i(t){var e,n,i,o,s,l,c,u,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,A=1/0,k="";for(v&&(c=m[0],h=g[0],p=y[0]),v>1&&(u=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]),A=Math.min(A,y[e]),!o&&m[e]!==c&&(o=!0,k+="x"),!s&&g[e]!==h&&(s=!0,k+="y"),!l&&y[e]!==p&&(l=!0,k+="z");o||(k+="x"),s||(k+="y"),l||(k+="z");var M=a(t._x),S=a(t._y),E=a(t._z);k=(k=(k=k.replace("x",(c>u?"-":"+")+"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(k[1]),D=I(k[3]),O=I(k[5]),R=L(k[1]).length,F=L(k[3]).length,B=L(k[5]).length,j=!1,N=function(t,e,r){return R*(F*t+e)+r},U=P(I(k[1])),V=P(I(k[3])),q=P(I(k[5]));for(e=0;e<B-1;e++){for(n=0;n<F-1;n++){for(i=0;i<R-1;i++){var H=N(e,n,i),G=N(e,n,i+1),W=N(e,n+1,i),Z=N(e+1,n,i);if(z[H]*U<z[G]*U&&D[H]*V<D[W]*V&&O[H]*q<O[Z]*q||(j=!0),j)break}if(j)break}if(j)break}return j&&(r.warn("Encountered arbitrary coordinates! Unable to input data grid."),C()),{xMin:_,yMin:w,zMin:A,xMax:x,yMax:b,zMax:T,Xs:M,Ys:S,Zs:E,len:v,fill:k}}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,c=0;e.starts&&(a=o(e.starts.x||[]),s=o(e.starts.y||[]),l=o(e.starts.z||[]),c=Math.min(a.length,s.length,l.length)),e._startsX=a||[],e._startsY=s||[],e._startsZ=l||[];var u,h=0,f=1/0;for(u=0;u<e._len;u++){var p=e._u[u],d=e._v[u],m=e._w[u],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"}),u=0;u<c;u++){var y=a[u];r.xMax=Math.max(r.xMax,y),r.xMin=Math.min(r.xMin,y);var v=s[u];r.yMax=Math.max(r.yMax,v),r.yMin=Math.min(r.yMin,v);var x=l[u];r.zMax=Math.max(r.zMax,x),r.zMin=Math.min(r.zMin,x)}e._slen=c,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}}}),Dm=p({"src/traces/isosurface/calc.js"(t,e){var r=We(),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 c=e._value[l];o=Math.min(o,c),s=Math.max(s,c)}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"})}}}),Om=p({"src/plots/gl3d/zip3.js"(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=p({"src/traces/isosurface/convert.js"(t,e){var r=Zd().gl_mesh3d,n=em().parseColorScale,i=le().isArrayOrTypedArray,a=tm(),o=Ze().extractOpts,s=Om(),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 c(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var u=c.prototype;u.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,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=t.index=h+s*u+s*o*c;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}},u.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},c=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=n(t),this.mesh.update(l)},u.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,c=t.surface.show,u=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,"")),A=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}},k=t._minValues,M=t._maxValues,S=t._vMin,E=t._vMax;function C(t,e,s){for(var l=o.length,c=r;c<l;c++)if(t===n[c]&&e===i[c]&&s===a[c])return c;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 D(t,e,r){for(var n=[],i=0;i<t.length;i++)n[i]=t[i]*(1-r)+r*e[i];return n}function O(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=D(a,r,o),c=D(a,n,o),u=D(a,i,o),h=e[0],f=e[1],p=e[2];return{xyzv:[[r,n,c],[c,l,r],[n,i,u],[u,c,n],[i,r,l],[l,u,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=[],c=0;c<3;c++){var u=e[c][0],h=e[c][1],f=e[c][2],p=e[c][3],d=r[c]>-1?r[c]:C(u,h,f);l[c]=d>-1?d:P(u,h,f,F(t,p))}z(l[0],l[1],l[2])}}function j(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 N(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=[N(e[0][3],n,i),N(e[1][3],n,i),N(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 c=!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 u=e[a[0]],h=e[a[1]],f=e[a[2]],p=j(f,u,n,i),d=j(f,h,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,h,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],f=e[a[2]],p=j(h,u,n,i),d=j(f,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(t,e,r,n){var i=!1,a=V(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(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 c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]];if(m)i=B(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=j(f,c,r,n),d=j(f,u,r,n),g=j(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 c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(h,c,r,n),d=j(h,u,r,n),g=j(f,u,r,n),y=j(f,c,r,n);m?(i=B(t,[c,y,p],[e[l[0]],-1,-1])||i,i=B(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(t,n,i){B(null,[e[t],e[n],e[i]],[r[t],r[n],r[i]])};n(0,1,2),n(2,3,0)}(0,[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 c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(u,c,r,n),d=j(h,c,r,n),g=j(f,c,r,n);m?(i=B(t,[c,p,d],[e[l[0]],-1,-1])||i,i=B(t,[c,d,g],[e[l[0]],-1,-1])||i,i=B(t,[c,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,c,u){var h=!1;return d&&(R(t,"A")&&(h=H(null,[e,r,n,a],c,u)||h),R(t,"B")&&(h=H(null,[r,n,i,l],c,u)||h),R(t,"C")&&(h=H(null,[r,a,o,l],c,u)||h),R(t,"D")&&(h=H(null,[n,a,s,l],c,u)||h),R(t,"E")&&(h=H(null,[r,n,a,l],c,u)||h)),m&&(h=H(t,[r,n,a,l],c,u)||h),h}function W(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 Z(t,e,r,n,i,a,o,s,l){return s?W(t,e,r,i,n,a,o,l):W(t,r,i,n,e,a,o,l)}function Y(t,e,r,n,i,a,o){var s,l,c,u,h=!1,f=function(){h=q(t,[s,l,c],[-1,-1,-1],i,a)||h,h=q(t,[c,u,s],[-1,-1,-1],i,a)||h},p=o[0],d=o[1],m=o[2];return p&&(s=D(V([A(e,r-0,n-0)])[0],V([A(e-1,r-0,n-0)])[0],p),l=D(V([A(e,r-0,n-1)])[0],V([A(e-1,r-0,n-1)])[0],p),c=D(V([A(e,r-1,n-1)])[0],V([A(e-1,r-1,n-1)])[0],p),u=D(V([A(e,r-1,n-0)])[0],V([A(e-1,r-1,n-0)])[0],p),f()),d&&(s=D(V([A(e-0,r,n-0)])[0],V([A(e-0,r-1,n-0)])[0],d),l=D(V([A(e-0,r,n-1)])[0],V([A(e-0,r-1,n-1)])[0],d),c=D(V([A(e-1,r,n-1)])[0],V([A(e-1,r-1,n-1)])[0],d),u=D(V([A(e-1,r,n-0)])[0],V([A(e-1,r-1,n-0)])[0],d),f()),m&&(s=D(V([A(e-0,r-0,n)])[0],V([A(e-0,r-0,n-1)])[0],m),l=D(V([A(e-0,r-1,n)])[0],V([A(e-0,r-1,n-1)])[0],m),c=D(V([A(e-1,r-1,n)])[0],V([A(e-1,r-1,n-1)])[0],m),u=D(V([A(e-1,r-0,n)])[0],V([A(e-1,r-0,n-1)])[0],m),f()),h}function X(t,e,r,n,i,a,o,s,l,c,u,h){var f=t;return h?(d&&"even"===t&&(f=null),G(f,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(f=null),G(f,l,s,o,a,i,n,r,e,c,u))}function $(t,e,r,n,i){for(var a=[],o=0,s=0;s<e.length;s++)for(var l=e[s],c=1;c<w;c++)for(var u=1;u<b;u++)a.push(Z(t,A(l,u-1,c-1),A(l,u-1,c),A(l,u,c-1),A(l,u,c),r,n,(l+u+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],c=1;c<_;c++)for(var u=1;u<w;u++)a.push(Z(t,A(c-1,l,u-1),A(c,l,u-1),A(c-1,l,u),A(c,l,u),r,n,(c+l+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],c=1;c<b;c++)for(var u=1;u<_;u++)a.push(Z(t,A(u-1,c-1,l),A(u-1,c,l),A(u,c-1,l),A(u,c,l),r,n,(u+c+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,A(a-1,i-1,n-1),A(a-1,i-1,n),A(a-1,i,n-1),A(a-1,i,n),A(a,i-1,n-1),A(a,i-1,n),A(a,i,n-1),A(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 c=e[l],u=1;u<w;u++)for(var h=1;h<b;h++)o.push(Y(t,c,h,u,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 c=e[l],u=1;u<_;u++)for(var h=1;h<w;h++)o.push(Y(t,u,c,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 c=e[l],u=1;u<b;u++)for(var h=1;h<_;h++)o.push(Y(t,h,u,c,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=A(e,r,n);P(t._x[i],t._y[i],t._z[i],t._value[i])}}();var e=null;if(u&&p&&(O(p),function(t,e,r){m=!0,Q(null,e,r),m=!1}(0,S,E)),c&&f){O(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-k)>Math.abs(T-M)?[k,T]:[T,M];tt(r,C[0],C[1])}}var I=[[Math.min(S,M),Math.max(S,M)],[Math.min(k,E),Math.max(k,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],c=t.slices[r];if(c.show&&c.fill){O(c.fill);var u=[],h=[],f=[];if(c.locations.length)for(var p=0;p<c.locations.length;p++){var d=l(c.locations[p],"x"===r?y:"y"===r?v:x);0===d.distRatio?u.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 u=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++),u.length>0&&(n[a]="x"===r?$(e,u,o,s,n[a]):"y"===r?K(e,u,o,s,n[a]):J(e,u,o,s,n[a]),a++)}var m=t.caps[r];m.show&&m.fill&&(O(m.fill),n[a]="x"===r?$(e,[0,_-1],o,s,n[a]):"y"===r?K(e,[0,b-1],o,s,n[a]):J(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 c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}}),Fm=p({"src/traces/isosurface/index.js"(t,e){e.exports={attributes:Lm(),supplyDefaults:Pm().supplyDefaults,calc:Dm(),colorbar:{min:"cmin",max:"cmax"},plot:Rm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:bm(),categories:["gl3d","showLegend"],meta:{}}}}),Bm=p({"lib/isosurface.js"(t,e){e.exports=Fm()}}),jm=p({"src/traces/volume/attributes.js"(t,e){var r=Pe(),n=Lm(),i=Am(),a=U(),o=R().extendFlat,s=Pt().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"}}),Nm=p({"src/traces/volume/defaults.js"(t,e){var r=le(),n=jm(),i=Pm().supplyIsoDefaults,a=km().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=p({"src/traces/volume/convert.js"(t,e){var r=Zd().gl_mesh3d,n=em().parseColorScale,i=le().isArrayOrTypedArray,a=tm(),o=Ze().extractOpts,s=Om(),l=Rm().findNearestOnAxis,c=Rm().generateIsoMeshes;function u(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var h=u.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,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=t.index=h+s*u+s*o*c;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=c(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},u=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[u.min,u.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 u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),Vm=p({"src/traces/volume/index.js"(t,e){e.exports={attributes:jm(),supplyDefaults:Nm(),calc:Dm(),colorbar:{min:"cmin",max:"cmax"},plot:Um(),moduleType:"trace",name:"volume",basePlotModule:bm(),categories:["gl3d","showLegend"],meta:{}}}}),qm=p({"lib/volume.js"(t,e){e.exports=Vm()}}),Hm=p({"src/traces/mesh3d/defaults.js"(t,e){var r=qt(),n=le(),i=qe(),a=Im();e.exports=function(t,e,o,s){function l(r,i){return n.coerce(t,e,a,r,i)}function c(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}c(["x","y","z"])?(c(["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=p({"src/traces/mesh3d/calc.js"(t,e){var r=We();e.exports=function(t,e){e.intensity&&r(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}}}),Wm=p({"src/traces/mesh3d/convert.js"(t,e){var r=Zd().gl_mesh3d,n=Zd().delaunay_triangulate,i=Zd().alpha_shape,a=Zd().convex_hull,o=em().parseColorScale,s=le().isArrayOrTypedArray,l=tm(),c=Ze().extractOpts,u=Om();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=u(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=u(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=c(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}}}),Zm=p({"src/traces/mesh3d/index.js"(t,e){e.exports={attributes:Im(),supplyDefaults:Hm(),calc:Gm(),colorbar:{min:"cmin",max:"cmax"},plot:Wm(),moduleType:"trace",name:"mesh3d",basePlotModule:bm(),categories:["gl3d","showLegend"],meta:{}}}}),Ym=p({"lib/mesh3d.js"(t,e){e.exports=Zm()}}),Xm=p({"src/traces/cone/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Im(),o=U(),s=R().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=p({"src/traces/cone/defaults.js"(t,e){var r=le(),n=qe(),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"),c=s("v"),u=s("w"),h=s("x"),f=s("y"),p=s("z");if(l&&l.length&&c&&c.length&&u&&u.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}}}),Km=p({"src/traces/cone/calc.js"(t,e){var r=We();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,c=0;c<o;c++){var u=n[c],h=i[c],f=a[c],p=Math.sqrt(u*u+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"})}}}),Jm=p({"src/traces/cone/convert.js"(t,e){var r=Zd().gl_cone3d,n=Zd().gl_cone3d.createConeMesh,i=le().simpleMap,a=em().parseColorScale,o=Ze().extractOpts,s=le().isArrayOrTypedArray,l=Om();function c(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var u=c.prototype;u.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 c=this.data.hovertext||this.data.text;return s(c)&&void 0!==c[e]?t.textLabel=c[e]:c&&(t.textLabel=c),!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,c={};function u(t,e){var r=n[e],a=s[h[e]];return i(t,(function(t){return r.d2l(t)*a}))}c.vectors=l(u(e.u,"xaxis"),u(e.v,"yaxis"),u(e.w,"zaxis"),e._len),c.positions=l(u(e.x,"xaxis"),u(e.y,"yaxis"),u(e.z,"zaxis"),e._len);var d=o(e);c.colormap=a(e),c.vertexIntensityBounds=[d.min/e._normMax,d.max/e._normMax],c.coneOffset=f[e.anchor];var m=e.sizemode;"scaled"===m?c.coneSize=e.sizeref||.5:"absolute"===m?c.coneSize=e.sizeref&&e._normMax?e.sizeref/e._normMax:.5:"raw"===m&&(c.coneSize=e.sizeref),c.coneSizemode=m;var g=r(c),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}u.update=function(t){this.data=t;var e=d(this.scene,t);this.mesh.update(e)},u.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 c(t,e.uid);return o.mesh=a,o.data=e,a._trace=o,t.glplot.add(a),o}}}),Qm=p({"src/traces/cone/index.js"(t,e){e.exports={moduleType:"trace",name:"cone",basePlotModule:bm(),categories:["gl3d","showLegend"],attributes:Xm(),supplyDefaults:$m(),colorbar:{min:"cmin",max:"cmax"},calc:Km(),plot:Jm(),eventData:function(t,e){return t.norm=e.traceCoordinate[6],t},meta:{}}}}),tg=p({"lib/cone.js"(t,e){e.exports=Qm()}}),eg=p({"src/traces/streamtube/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Im(),o=U(),s=R().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=p({"src/traces/streamtube/defaults.js"(t,e){var r=le(),n=qe(),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"),c=s("v"),u=s("w"),h=s("x"),f=s("y"),p=s("z");l&&l.length&&c&&c.length&&u&&u.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=p({"src/traces/streamtube/convert.js"(t,e){var r=Zd().gl_streamtube3d,n=r.createTubeMesh,i=le(),a=em().parseColorScale,o=Ze().extractOpts,s=Om(),l={xaxis:0,yaxis:1,zaxis:2};function c(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var u=c.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,c=t.dataScale,u=e._len,p={};function d(t,e){var r=n[e],a=c[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"),u),!u)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 A=0;A<_.length;A++)b[w++]=[x[T],v,_[A]];p.startingPositions=b}p.colormap=a(e),p.tubeSize=e.sizeref,p.maxLength=e.maxdisplayed;var k=d(e._xbnds,"xaxis"),M=d(e._ybnds,"yaxis"),S=d(e._zbnds,"zaxis"),E=f(m),C=f(g),I=f(y),L=[[k[0]-E[0],M[0]-C[0],S[0]-I[0]],[k[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 D=e.lightposition;return P.lightPosition=[D.x,D.y,D.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}u.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}},u.update=function(t){this.data=t;var e=p(this.scene,t);this.mesh.update(e)},u.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 c(t,e.uid);return o.mesh=a,o.data=e,a._trace=o,t.glplot.add(a),o}}}),ig=p({"src/traces/streamtube/index.js"(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=p({"lib/streamtube.js"(t,e){e.exports=ig()}}),og=p({"src/traces/scattergeo/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=wn(),a=Tn(),o=U(),s=Pe(),l=zt().dash,c=R().extendFlat,u=Pt().overrideAll,h=a.marker,f=a.line,p=h.line;["The library used by the *country names* `locationmode` option is changing in an upcoming version.","Country names in existing plots may not work in the new version."].join(" "),e.exports=u({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:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:c({},a.hovertext,{}),textfont:a.textfont,textposition:a.textposition,line:{color:f.color,width:f.width,dash:l},connectgaps:a.connectgaps,marker:c({symbol:h.symbol,opacity:h.opacity,angle:h.angle,angleref:c({},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:c({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:c({},o.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:r()},"calc","nested")}}),sg=p({"src/traces/scattergeo/defaults.js"(t,e){var r=le(),n=Ye(),i=Zn(),a=Yn(),o=$n(),s=Kn(),l=og();e.exports=function(t,e,c,u){function h(n,i){return r.coerce(t,e,l,n,i)}var f,p=h("locations");if(p&&p.length){var d,m=h("geojson");("string"==typeof m&&""!==m||r.isPlainObject(m))&&(d="geojson-id"),"geojson-id"===h("locationmode",d)&&h("featureidkey"),f=p.length}else{var g=h("lon")||[],y=h("lat")||[];f=Math.min(g.length,y.length)}f?(e._length=f,h("text"),h("hovertext"),h("hovertemplate"),h("mode"),n.hasMarkers(e)&&i(t,e,c,u,h,{gradient:!0}),n.hasLines(e)&&(a(t,e,c,u,h),h("connectgaps")),n.hasText(e)&&(h("texttemplate"),o(t,e,u,h)),h("fill"),"none"!==e.fill&&s(t,e,c,h),r.coerceSelectionMarkerOpacity(e,h)):e.visible=!1}}}),lg=p({"src/traces/scattergeo/format_labels.js"(t,e){var r=ir();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}}}),cg=p({"src/traces/scattergeo/calc.js"(t,e){var r=A(),n=k().BADNUM,i=ni(),a=ii(),o=ai(),s=le().isArrayOrTypedArray,l=le()._;function c(t){return t&&"string"==typeof t}e.exports=function(t,e){var u,h=s(e.locations),f=h?e.locations.length:e._length,p=new Array(f);u=e.geojson?function(t){return c(t)||r(t)}:c;for(var d=0;d<f;d++){var m=p[d]={};if(h){var g=e.locations[d];m.loc=u(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}}}),ug=p({"src/plots/geo/constants.js"(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=p({"node_modules/topojson-client/dist/topojson-client.js"(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,c=t.length,u=new Array(c);for(u[0]=(r+=t[0])*i+o,u[1]=(n+=t[1])*a+s;l<c;)u[l]=t[l],++l;return u}}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 c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);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)c(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 c(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=c(e.arcs);break;case"MultiPolygon":r=e.arcs.map(c);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 c=a===r?r:r.concat(a);n[c.start=r.start]=i[c.end=a.end]=c}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 u=a===r?r:a.concat(r);n[u.start=a.start]=i[u.end=r.end]=u}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)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(l)}(e.arcs)}}(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,c=1,u=l(i[0]);c<n;++c)(a=l(i[c]))>u&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function c(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 u(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,c=t.length,u=new Array(c),h=Math.round((t[0]-o)/i),f=Math.round((t[1]-s)/a);for(u[0]=h-r,r=h,u[1]=f-n,n=f;l<c;)u[l]=t[l],++l;return u}}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,u=0;u<l;++u)for(var h=u+1;h<l;++h){var f,p=s[u],d=s[h];(f=r[p])[o=c(f,d)]!==d&&f.splice(o,0,d),(f=r[d])[o=c(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,c,h=u(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(c in f)p[c]=m(f[c]);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=u,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=r||self).topojson=r.topojson||{})}}),fg=p({"src/lib/topojson_utils.js"(t,e){var r=e.exports={},n=ug().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=p({"src/lib/geojson_utils.js"(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=p({"node_modules/country-regex/index.js"(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=p({"node_modules/@turf/helpers/dist/cjs/index.cjs"(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 c(t,e,r={}){return i({type:"MultiLineString",coordinates:t},e,r)}function u(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 u(e).geometry;case"MultiLineString":return c(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=c,t.multiPoint=u,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=p({"node_modules/@turf/meta/dist/cjs/index.cjs"(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,c,u,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=!!(u=m?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var x=0;x<l;x++){var _=0,b=0;if(null!==(s=h?u.geometries[x]:u)){c=s.coordinates;var w=s.type;switch(f=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(c,p,v,_,b))return!1;p++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(!1===e(c[i],p,v,_,b))return!1;p++,"MultiPoint"===w&&_++}"LineString"===w&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(a=0;a<c[i].length-f;a++){if(!1===e(c[i][a],p,v,_,b))return!1;p++}"MultiLineString"===w&&_++,"Polygon"===w&&b++}"Polygon"===w&&_++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(b=0,a=0;a<c[i].length;a++){for(o=0;o<c[i][a].length-f;o++){if(!1===e(c[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,c,u,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,c=p?t.features[r].properties:d?t.properties:{},u=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,c,u,h))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===e(a.geometries[n],f,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,c,u,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 c=0;c<t.coordinates.length;c++){var u={type:s,coordinates:t.coordinates[c]};if(!1===r(e.feature.call(void 0,u,i),n,c))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,c=0,u=0,h=0;if(!1===r(t,(function(r,s,f,p,d){if(void 0===l||i>c||p>u||d>h)return l=r,c=i,u=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 c=n.coordinates;switch(n.type){case"Point":return e.point.call(void 0,c,l,r);case"MultiPoint":return a<0&&(a=c.length+a),e.point.call(void 0,c[a],l,r);case"LineString":return s<0&&(s=c.length+s),e.point.call(void 0,c[s],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),e.point.call(void 0,c[o][s],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s),e.point.call(void 0,c[a][s],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s),e.point.call(void 0,c[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 c=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),e.lineString.call(void 0,[c[s],c[s+1]],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),e.lineString.call(void 0,[c[o][s],c[o][s+1]],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s-1),e.lineString.call(void 0,[c[a][s],c[a][s+1]],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s-1),e.lineString.call(void 0,[c[a][o][s],c[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=p({"node_modules/@turf/area/dist/cjs/index.cjs"(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,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;t.area=n,t.default=l}}),vg=p({"node_modules/@turf/centroid/dist/cjs/index.cjs"(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=p({"node_modules/@turf/bbox/dist/cjs/index.cjs"(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=p({"src/lib/geo_location_utils.js"(t,e){var r=x(),n=dg(),{area:i}=yg(),{centroid:a}=vg(),{bbox:o}=xg(),s=Gt(),l=$(),c=S(),u=C(),h=mn(),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 c(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 c(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===c(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=c(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 c=t[n];(c.loc||0===c.loc)&&(o[c.loc]=c)}function h(t){var r=u(t,e.featureidkey||"id").get(),n=o[r];if(n){var c=t.geometry;if("Polygon"===c.type||"MultiPolygon"===c.type){var h={type:"Feature",id:r,geometry:c,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]},c=i(l);c>o&&(o=c,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=p({"src/traces/scattergeo/style.js"(t,e){var r=x(),n=Qe(),i=H(),a=mi(),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=p({"src/traces/scattergeo/plot.js"(t,e){var r=x(),n=le(),i=fg().getTopojsonFeatures,a=pg(),o=_g(),s=nr().findExtremes,l=k().BADNUM,c=oi().calcMarkerSize,u=Ye(),h=bg(),f=["The library used by the *country names* `locationmode` option is changing in an upcoming version.","Country names in existing plots may not work in the new version."].join(" "),p=!0;e.exports={calcGeoJSON:function(t,e){var r,a,u=t[0].trace,h=e[u.geo],f=h._subplot,p=u._length;if(n.isArrayOrTypedArray(u.locations)){var d=u.locationmode,m="geojson-id"===d?o.extractTraceFeature(t):i(u,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"===u.locationmode){var _=o.computeBbox(o.getTraceGeojson(u));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=c(u,p)}u._extremes.lon=s(h.lonaxis._ax,y,x),u._extremes.lat=s(h.lataxis._ax,v,x)},plot:function(t,e,i){p&&(p=!1,n.warn(f));var o=e.layers.frontplot.select(".scatterlayer"),s=n.makeTraceGroups(o,i,"trace scattergeo");function c(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(u.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)}u.hasMarkers(o)&&i.selectAll("path.point").data(n.identity).enter().append("path").classed("point",!0).each((function(t){c(t,this)})),u.hasText(o)&&i.selectAll("g").data(n.identity).enter().append("g").append("text").each((function(t){c(t,this)})),h(t,e)}))}}}}),Tg=p({"src/traces/scattergeo/hover.js"(t,e){var r=Dr(),n=k().BADNUM,i=gi(),a=le().fillText,o=og();e.exports=function(t,e,s){var l=t.cd,c=l[0].trace,u=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]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(o*o+l*l)-c,1-3/c)}),t),!1!==t.index){var m=l[t.index],g=m.lonlat,y=[u.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[c.geo]={_subplot:f};var _=c._module.formatLabels(m,c,x);return t.lonLabel=_.lonLabel,t.latLabel=_.latLabel,t.color=i(c,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),c=-1!==s.indexOf("lon"),u=-1!==s.indexOf("lat"),h=-1!==s.indexOf("text"),f=[];return l?f.push(e.loc):c&&u?f.push("("+p(r.latLabel)+", "+p(r.lonLabel)+")"):c?f.push(n.lon+p(r.lonLabel)):u&&f.push(n.lat+p(r.latLabel)),h&&a(e,t,f),f.join("<br>")}function p(t){return t+"°"}}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}}}),Ag=p({"src/traces/scattergeo/event_data.js"(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}}}),kg=p({"src/traces/scattergeo/select.js"(t,e){var r=Ye(),n=k().BADNUM;e.exports=function(t,e){var i,a,o,s,l,c=t.cd,u=t.xaxis,h=t.yaxis,f=[],p=c[0].trace;if(!r.hasMarkers(p)&&!r.hasText(p))return[];if(!1===e)for(l=0;l<c.length;l++)c[l].selected=0;else for(l=0;l<c.length;l++)(a=(i=c[l]).lonlat)[0]!==n&&(o=u.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=p({"node_modules/d3-array/dist/d3-array.js"(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=function(t){return function(r,n){return e(t(r),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}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o<i;)isNaN(r=s(t[o]))||(c+=(n=r-l)*(r-(l+=n/++a)));else for(;++o<i;)isNaN(r=s(e(t[o],o,t)))||(c+=(n=r-l)*(r-(l+=n/++a)));if(a>1)return c/(a-1)}function c(t,e){var r=l(t,e);return r&&Math.sqrt(r)}function u(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 h=Array.prototype,f=h.slice,p=h.map;function d(t){return function(){return t}}function m(t){return t}function g(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 y=Math.sqrt(50),v=Math.sqrt(10),x=Math.sqrt(2);function _(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>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function b(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>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),e<t?-i:i}function w(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function T(t,e,r){if(null==r&&(r=s),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 A(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 k(t){if(!(i=t.length))return[];for(var e=-1,r=A(t,M),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 M(t){return t.length}t.bisect=i,t.bisectRight=i,t.bisectLeft=a,t.ascending=e,t.bisector=r,t.cross=function(t,e,r){var n,i,a,s,l=t.length,c=e.length,u=new Array(l*c);for(null==r&&(r=o),n=a=0;n<l;++n)for(s=t[n],i=0;i<c;++i,++a)u[a]=r(s,e[i]);return u},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;a<s;++a)l[a]=t(n[a],a,n);var c=e(l),u=c[0],h=c[1],f=r(l,u,h);Array.isArray(f)||(f=b(u,h,f),f=g(Math.ceil(u/f)*f,h,f));for(var p=f.length;f[0]<=u;)f.shift(),--p;for(;f[p-1]>h;)f.pop(),--p;var d,m=new Array(p+1);for(a=0;a<=p;++a)(d=m[a]=[]).x0=a>0?f[a-1]:u,d.x1=a<p?f[a]:h;for(a=0;a<s;++a)u<=(o=l[a])&&o<=h&&m[i(f,o,0,p)].push(n[a]);return m}return n.value=function(e){return arguments.length?(t="function"==typeof e?e:d(e),n):t},n.domain=function(t){return arguments.length?(e="function"==typeof t?t:d([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r="function"==typeof t?t:Array.isArray(t)?d(f.call(t)):d(t),n):r},n},t.thresholdFreedmanDiaconis=function(t,r,n){return t=p.call(t,s).sort(e),Math.ceil((n-r)/(2*(T(t,.75)-T(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,r){return Math.ceil((r-e)/(3.5*c(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=w,t.max=function(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},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=s(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=s(e(t[a],a,t)))?--i:o+=r;if(i)return o/i},t.median=function(t,r){var n,i=t.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=s(t[a]))||o.push(n);else for(;++a<i;)isNaN(n=s(r(t[a],a,t)))||o.push(n);return T(o.sort(e),.5)},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},t.min=A,t.pairs=function(t,e){null==e&&(e=o);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},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.quantile=T,t.range=g,t.scan=function(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}},t.shuffle=function(t,e,r){for(var n,i,a=(r??t.length)-(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},t.sum=function(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},t.ticks=function(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=_(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},t.tickIncrement=_,t.tickStep=b,t.transpose=k,t.variance=l,t.zip=function(){return k(arguments)},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&typeof e<"u"?t:r.d3=r.d3||{})}}),Sg=p({"node_modules/d3-geo/dist/d3-geo.js"(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,c=l/2,u=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},A=Math.sqrt,k=Math.tan;function M(t){return t>1?0:t<-1?l:Math.acos(t)}function S(t){return t>1?c:t<-1?-c: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){D(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)D(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 D(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)z(t[r],e,1);e.polygonEnd()}function O(t,e){t&&L.hasOwnProperty(t.type)?L[t.type](t,e):I(t,e)}var R,F,B,j,N,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=W}function G(){Z(R,F)}function W(t,e){q.point=Z,R=t,F=e,B=t*=p,j=y(e=(e*=p)/2+u),N=w(e)}function Z(t,e){var r=(t*=p)-B,n=r>=0?1:-1,i=n*r,a=y(e=(e*=p)/2+u),o=w(e),s=N*o,l=j*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),B=t,j=a,N=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 K(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 J(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=A(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,ct,ut,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),ut[0]=et,ut[1]=nt},sphere:function(){et=-(nt=180),rt=-(it=90)}};function pt(t,e){ct.push(ut=[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=K(lt,r),i=K([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,c=d(o)>180;c^(s*at<l&&l<s*t)?(a=i[1]*f)>it&&(it=a):c^(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)),c?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 ct.push(ut=[et=t,nt=t]);e<rt&&(rt=e),e>it&&(it=e),lt=r,at=t}function mt(){ft.point=dt}function gt(){ut[0]=et,ut[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)),ut[0]=et,ut[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,At,kt,Mt,St,Et,Ct,It,Lt,Pt,zt,Dt,Ot,Rt,Ft,Bt,jt={sphere:C,point:Nt,lineStart:Vt,lineEnd:Gt,polygonStart:function(){jt.lineStart=Wt,jt.lineEnd=Zt},polygonEnd:function(){jt.lineStart=Vt,jt.lineEnd=Gt}};function Nt(t,e){t*=p;var r=y(e*=p);Ut(r*y(t),r*w(t),w(e))}function Ut(t,e,r){++Tt,kt+=(t-kt)/Tt,Mt+=(e-Mt)/Tt,St+=(r-St)/Tt}function Vt(){jt.point=qt}function qt(t,e){t*=p;var r=y(e*=p);Rt=r*y(t),Ft=r*w(t),Bt=w(e),jt.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(A((o=Ft*a-Bt*i)*o+(o=Bt*n-Rt*a)*o+(o=Rt*i-Ft*n)*o),Rt*n+Ft*i+Bt*a);At+=o,Et+=o*(Rt+(Rt=n)),Ct+=o*(Ft+(Ft=i)),It+=o*(Bt+(Bt=a)),Ut(Rt,Ft,Bt)}function Gt(){jt.point=Nt}function Wt(){jt.point=Yt}function Zt(){Xt(Dt,Ot),jt.point=Nt}function Yt(t,e){Dt=t,Ot=e,t*=p,e*=p,jt.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,c=A(o*o+s*s+l*l),u=S(c),h=c&&-u/c;Lt+=h*o,Pt+=h*s,zt+=h*l,At+=u,Et+=u*(Rt+(Rt=n)),Ct+=u*(Ft+(Ft=i)),It+=u*(Bt+(Bt=a)),Ut(Rt,Ft,Bt)}function $t(t){return function(){return t}}function Kt(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 Jt(t,e){return[d(t)>l?t+Math.round(-t/h)*h:t,e]}function Qt(t,e,r){return(t%=h)?e||r?Kt(ee(t),re(e,r)):ee(t):e||r?re(e,r):Jt}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,c=w(e),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),S(u*i+l*a)]}return o.invert=function(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),S(u*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 c,u=i;n>0?u>a:u<a;u-=l)c=Y([o,-s*y(u),-s*w(u)]),t.point(c[0],c[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 ce(t,e,r,n,i){var a,s,l=[],c=[];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)),c.push(r.o=new le(n,null,r,!1)),l.push(r=new le(s,t,null,!1)),c.push(r.o=new le(s,null,r,!0))}})),l.length){for(c.sort(e),ue(l),ue(c),a=0,s=c.length;a<s;++a)c[a].e=r=!r;for(var u,h,f=l[0];;){for(var p=f,d=!0;p.v;)if((p=p.n)===f)return;u=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(a=0,s=u.length;a<s;++a)i.point((h=u[a])[0],h[1]);else n(p.x,p.n.x,1,i);p=p.n}else{if(d)for(u=p.p.z,a=u.length-1;a>=0;--a)i.point((h=u[a])[0],h[1]);else n(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ue(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}}Jt.invert=Jt;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=c+o:-1===i&&(n=-c-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+u,T=w(b),A=y(b),k=0;k<v;++k,_=E,T=I,A=L,x=M){var M=m[k],E=fe(M),C=M[1]/2+u,I=w(C),L=y(C),P=E-_,z=P>=0?1:-1,D=z*P,O=D>l,R=T*I;if(he.add(g(R*z*w(D),A*L+R*y(D))),s+=O?P+z*h:P,O^_>=r^E>=r){var F=K(X(x),X(M));tt(F);var B=K(a,F);tt(B);var j=(O^P>=0?-1:1)*S(B[2]);(n>j||n===j&&(F[0]||F[1]))&&(f+=O^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,c=r(a),u=oe(),h=r(u),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),ce(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){c.point(t,e)}function g(){p.point=m,c.lineStart()}function y(){p.point=d,c.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(),c=u.result(),p=c.length;if(l.pop(),o.push(l),l=null,p){if(1&i){if((e=(r=c[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&&c.push(c.pop().concat(c.shift())),s.push(c.filter(me))}}return p}}function me(t){return t.length>1}function ge(t,e){return((t=t.x)[0]<0?t[1]-c-o:c-t[1])-((e=e.x)[0]<0?e[1]-c-o:c-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 u=a>0?l:-l,h=d(a-r);d(h-l)<o?(t.point(r,n=(n+s)/2>0?c:-c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&h>=l&&(d(r-i)<o&&(r-=i*o),d(a-u)<o&&(a-=u*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(u,n),e=0),t.point(r=a,n=s),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*c,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,-c]);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=K(X(t),X(r)),s=$(a,a),c=a[0],u=s-c*c;if(!u)return!n&&t;var h=e*s/u,f=-e*c/u,p=K(i,a),m=Q(i,h);J(m,Q(a,f));var g=p,y=$(m,g),v=$(g,g),x=y*y-v*($(m,m)-1);if(!(x<0)){var _=A(x),b=Q(g,(-y-_)/v);if(J(b,m),b=Y(b),!n)return b;var w,T=t[0],k=r[0],M=t[1],S=r[1];k<T&&(w=T,T=k,k=w);var E=k-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]<=k)){var I=Q(g,(-y+_)/v);return J(I,m),[b,Y(I)]}}}function c(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,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(f,p){var d,m=[f,p],g=a(f,p),y=n?g?0:c(f,p):g?c(f+(f<0?l:-l),p):0;if(!e&&(u=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|(u&&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 c=0,h=0;if(null==e||(c=l(e,o))!==(h=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+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 c(t,e){return u(t.x,e.x)}function u(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,u,h,f,p,d,m,g,y,v,x,_=o,b=oe(),w={point:T,lineStart:function(){w.point=A,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(A(f,p),d&&y&&b.rejoin(),l.push(b.result())),w.point=T,y&&_.lineEnd()},polygonStart:function(){_=b,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;r<n;++r)for(var a,o,s=u[r],l=1,c=s.length,h=s[0],f=h[0],p=h[1];l<c;++l)a=f,o=p,f=(h=s[l])[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&&ce(l,c,r,s,o),o.polygonEnd()),_=o,l=u=h=null}};function T(t,e){a(t,e)&&_.point(t,e)}function A(e,o){var s=a(e,o);if(u&&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))],c=[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],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=r-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=i-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=n-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)}if(o=a-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)}return c>0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,c,t,r,n,i)?s&&(_.lineStart(),_.point(e,o),x=!1):(y||(_.lineStart(),_.point(l[0],l[1])),_.point(c[0],c[1]),s||_.lineEnd(),x=!1)}m=e,g=o,y=s}return w}}var we,Te,Ae,ke=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),Ae=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=Ae*r-Te*n*a,l=Te*r+Ae*n*a;ke.add(g(A(o*o+s*s),l)),we=t,Te=r,Ae=n}function Ie(t){return ke.reset(),O(t,Me),+ke}var Le=[null,null],Pe={type:"LineString",coordinates:Le};function ze(t,e){return Le[0]=t,Le[1]=e,Ie(Pe)}var De={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}},Oe={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 je(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)if(je(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||!Oe.hasOwnProperty(t.type))&&Oe[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 je(t,e){return!!pe(t.map(Ne),Ue(e))}function Ne(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,c,u,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(c/x)*x,l,x).map(p)).concat(e.range(v(r/m)*m,t,m).filter((function(t){return d(t%y)>o})).map(u)).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(c).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],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),b.precision(_)):[[i,c],[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,u=Ve(s,a,90),h=qe(r,t,_),f=Ve(c,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 We,Ze,Ye,Xe,$e=r(),Ke=r(),Je={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Je.lineStart=Qe,Je.lineEnd=rr},polygonEnd:function(){Je.lineStart=Je.lineEnd=Je.point=C,$e.add(d(Ke)),Ke.reset()},result:function(){var t=$e/2;return $e.reset(),t}};function Qe(){Je.point=tr}function tr(t,e){Je.point=er,We=Ye=t,Ze=Xe=e}function er(t,e){Ke.add(Xe*t-Ye*e),Ye=t,Xe=e}function rr(){er(We,Ze)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(t,e){t<sr&&(sr=t),t>cr&&(cr=t),e<lr&&(lr=e),e>ur&&(ur=e)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var t=[[sr,lr],[cr,ur]];return cr=ur=-(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=Ar}function Ar(t,e){br.point=kr,wr(ar=t,or=e)}function kr(t,e){var r=t-ar,n=e-or,i=A(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=A(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,Dr,Or,Rr,Fr=r(),Br={point:C,lineStart:function(){Br.point=jr},lineEnd:function(){Pr&&Nr(zr,Dr),Br.point=C},polygonStart:function(){Pr=!0},polygonEnd:function(){Pr=null},result:function(){var t=+Fr;return Fr.reset(),t}};function jr(t,e){Br.point=Nr,zr=Or=t,Dr=Rr=e}function Nr(t,e){Or-=t,Rr-=e,Fr.add(A(Or*Or+Rr*Rr)),Or=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),O(r,t.stream(hr)),e(hr.result()),null!=n&&t.clipExtent(n),t}function Wr(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 Zr(t,e,r){return Wr(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 Kr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,h,f,p,m,y,v,x){var _=u-n,b=h-i,w=_*_+b*b;if(w>4*e&&v--){var T=s+p,k=l+m,M=c+y,E=A(T*T+k*k+M*M),C=S(M/=E),I=d(d(M)-1)<o||d(a-f)<o?(a+f)/2:g(k,T),L=t(I,C),P=L[0],z=L[1],D=P-n,O=z-i,R=b*D-_*O;(R*R/w>e||d((_*D+b*O)/w-.5)>.3||s*p+l*m+c*y<$r)&&(r(n,i,a,s,l,c,P,z,I,T/=E,k/=E,M,v,x),x.point(P,z),r(P,z,I,T,k,M,u,h,f,p,m,y,v,x))}}return function(e){var n,i,a,o,s,l,c,u,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(){u=NaN,m.point=v,e.lineStart()}function v(n,i){var a=X([n,i]),o=t(n,i);r(u,h,c,f,p,d,u=o[0],h=o[1],c=n,f=a[0],p=a[1],d=a[2],16,e),e.point(u,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=u,a=h,o=f,s=p,l=d,m.point=v}function w(){r(u,h,c,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 Jr=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,c=s*t,u=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)-c*(a*=i)+e,r-c*t-l*a]}return d.invert=function(t,e){return[n*(u*t-h*e+f),i*(p-h*t-u*e)]},d}function en(t){return rn((function(){return t}))()}function rn(t){var e,r,n,i,a,o,s,l,c,u,h=150,d=480,m=250,g=0,y=0,v=0,x=0,_=0,b=0,w=1,T=1,k=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=Kt(e,n),l=Kt(r,s),o=Kr(s,C),z()}function z(){return c=u=null,I}return I.stream=function(t){return c&&u===t?c:c=Jr(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(u=t)))))},I.preclip=function(t){return arguments.length?(M=t,k=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(k=t*p):(k=null,ye),z()):k*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=Kr(s,C=t*t),z()):A(C)},I.fitExtent=function(t,e){return Wr(I,t,e)},I.fitSize=function(t,e){return Zr(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=A(i)/n;function s(t,e){var r=A(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 cn(t){return function(e,r){var n=A(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 un=ln((function(t){return A(2/(1+t))}));un.invert=cn((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,_(k((c+e)/2))]}function pn(t){var e,r,n,i=en(t),a=i.center,o=i.scale,s=i.translate,c=i.clipExtent,u=null;function h(){var a=l*o(),s=i(ne(i.rotate()).invert([0,0]));return c(null==u?[[s[0]-a,s[1]-a],[s[0]+a,s[1]+a]]:t===fn?[[Math.max(s[0]-a,u),e],[Math.min(s[0]+a,r),n]]:[[u,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?u=e=r=n=null:(u=+t[0][0],e=+t[0][1],r=+t[1][0],n=+t[1][1]),h()):null==u?null:[[u,e],[r,n]]},h()}function dn(t){return k((c+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<-c+o&&(e=-c+o):e>c-o&&(e=c-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)*A(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))-c]},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)*A(t*t+r*r)]},a}hn.invert=cn((function(t){return t})),fn.invert=function(t,e){return[t,2*m(x(e))-c]},gn.invert=gn;var vn=1.340264,xn=-.081106,_n=893e-6,bn=.003796,wn=A(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 An(t,e){var r=y(e),n=y(t)*r;return[r*w(t)/n,w(e)/n]}function kn(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[_(k((c+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)]},An.invert=cn(m),kn.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=cn(S),Sn.invert=cn((function(t){return 2*m(t)})),En.invert=function(t,e){return[-e,2*m(x(t))-c]},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]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={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?c: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),c.stream(r)])},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.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(u),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(u),i=c.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(u),f()},h.fitExtent=function(t,e){return Wr(h,t,e)},h.fitSize=function(t,e){return Zr(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(),O(t,q),2*V},t.geoAzimuthalEqualArea=function(){return en(un).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=un,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),ct=[],O(t,ft),r=ct.length){for(ct.sort(bt),e=1,a=[n=ct[0]];e<r;++e)wt(n,(i=ct[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 ct=ut=null,et===1/0||rt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,rt],[nt,it]]},t.geoCentroid=function(t){Tt=At=kt=Mt=St=Et=Ct=It=Lt=Pt=zt=0,O(t,jt);var e=Lt,r=Pt,n=zt,i=e*e+r*r+n*n;return i<s&&(e=Et,r=Ct,n=It,At<o&&(e=kt,r=Mt,n=St),(i=e*e+r*r+n*n)<s)?[NaN,NaN]:[g(r,e)*f,S(n/A(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&&De.hasOwnProperty(t.type)?De[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(An).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=An,t.geoGraticule=He,t.geoGraticule10=function(){return He()()},t.geoIdentity=function(){var t,e,r,n,i,a,o,s=1,l=0,c=0,u=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*u,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+c]}return T.invert=function(r){var n=r[0]-l,i=r[1]-c;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],c=+t[1],b()):[l,c]},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?(u=t?-1:1,b()):u<0},T.reflectY=function(t){return arguments.length?(h=t?-1:1,b()):h<0},T.fitExtent=function(t,e){return Wr(T,t,e)},T.fitSize=function(t,e){return Zr(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),c=w(a),u=o*y(r),h=o*w(r),d=l*y(i),m=l*w(i),v=2*S(A(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*u+e*d,i=r*h+e*m,a=r*s+e*c;return[g(i,n)*f,g(a,A(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(kn).scale(175.295)},t.geoNaturalEarth1Raw=kn,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)),O(t,r(n))),n.result()}return a.area=function(t){return O(t,r(Je)),Je.result()},a.measure=function(t){return O(t,r(Br)),Br.result()},a.bounds=function(t){return O(t,r(hr)),hr.result()},a.centroid=function(t){return O(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=O,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&&typeof e<"u"?n(t,Mg()):n((r=r||self).d3=r.d3||{},r.d3)}}),Eg=p({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(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,c=Math.log,u=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),A=I(x),k=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*c(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?c((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),u=-t/2,h=50;if(!l)return[0,0];do{var f=u/2,p=o(f),d=m(f),g=d/p,v=-c(n(p));u-=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(u);return[a(e*x,l*o(u)),E(i*x/l)]},i}function D(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 O(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,h=0,f=50;do{var p=o(u),d=m(u),g=o(h),v=m(h),x=1+g,_=x*d-t,b=l+v*r-x*e*p-c,w=x*p/2,T=-d*v,A=e*x*d/2,k=r*g+e*p*v,M=T*A-k*w,S=(b*T-_*k)/M/2,E=(_*A-b*w)/M;n(E)>2&&(E/=2),u-=S,h-=E}while((n(S)>y||n(E)>y)&&--f>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}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,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}D.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),c=m(r/2),u=o(r/2),h=m(i),f=o(i),p=m(2*i),d=h*h,g=f*f,v=c*c,_=1-g*u*u,b=_?C(f*u)*I(s=1/_):s=0,w=2*b*f*c-t,T=b*h-e,A=s*(g*v+b*f*u*d),k=s*(.5*l*p-2*b*h*c),M=.25*s*(p*c-b*h*g*l),S=s*(d*u+b*v*f),E=k*M-S*A;if(!E)break;var L=(T*k-w*S)/E,P=(w*M-T*A)/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 c(t+I(t*t-1))}(n(e/i))/3:function(t){return c(t+I(t*t+1))}(n(t))/3,u=o(s),h=P(l),f=h*h-u*u;return[2*d(t)*a(L(l)*u,.25-f),2*d(e)*a(h*m(s),.25+f)]};var F=I(8),B=c(1+T);function j(t,e){var r=n(e);return r<b?[t,c(g(b+e/2))]:[t*o(r)*(2*T-1/m(r)),d(e)*(2*T*(r-b)-c(g(r/2)))]}function N(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]),c=I(s[0]*s[0]+s[1]*s[1]),u=r*p((l-_)/r)+_,h=a(m(l-=u),2-o(l));l=u+E(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=I(t*t+n*n);if(s>_){var l=a(n,t),c=r*p((l-_)/r)+_,u=l>c?-1:1,h=s*o(c-l),f=1/g(u*C((h-x)/I(x*(x-2*h)+s*s)));l=c+2*i((f+u*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,c,u;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-=c/=2,s-=u/=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,A=T*_-b*w,k=(n(A)<.5?.5:1)/A;if(o+=c=(d*w-p*T)*k,s+=u=(p*b-d*_)*k,n(c)<r&&n(u)<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 W(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 Z(t,e,r){function n(n,i){return[t*n*o(i=W(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}j.invert=function(t,e){if((a=n(e))<B)return[t,2*i(s(e))-_];var r,a,l=b,u=25;do{var h=o(l/2),f=g(l/2);l-=r=(F*(l-b)-c(f)-a)/(F-h*h/(2*f))}while(n(r)>v&&--u>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=Z(T/_,T,x),X=2.00276,$=1.11072;function K(t,e){var r=W(x,e);return[X*t/(1/o(e)+$/o(r)),(e+T*m(r))/X]}function J(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}K.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=Z(1,4/x,x);function nt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=C(r*s+e*i*u);else{var h=m(t/2),f=m(l/2);c=2*E(I(h*h+e*i*f*f))}return n(c)>y?[c,a(i*m(l),e*s-r*i*u)]:[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]),c=it(i[0].v[0],i[1].v[0],i[2].v[0]),u=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=c-d,f[0]-=s[r][0]*o(d),f[1]-=s[r][0]*m(d)):(d=u-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),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function ct(t,e){var r=I(1-m(e));return[2/A*t*r,A*(1-r)]}function ut(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}ct.invert=function(t,e){var r=(r=e/A-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)/A,ht*A*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*A));return[A*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),u=I(2/(1+l*l)),h=I((T*s+(n+r)*a)/(T*s+(n-r)*a));return[bt*(u*(h-1/h)-2*c(h)),bt*(u*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),A=I(b),k=v/(x+T*g*A),M=k*k,S=I(2/(1+M)),E=(T*x+(g+d)*A)/(T*x+(g-d)*A),C=I(E),L=C-1/C,P=C+1/C,z=S*L-2*c(C)-t,D=S*k*P-2*i(k)-e,O=v&&w*A*d*M/v,F=(T*g*x+A)/(2*(x+T*g*A)*(x+T*g*A)*A),B=-.5*k*S*S*S,j=B*O,N=B*F,U=(U=2*x+T*A*(g-d))*U*C,V=(T*g*x*A+b)/U,q=-T*d*v/(A*U),H=L*j-2*V/C+S*(V+V/E),G=L*N-2*q/C+S*(q+q/E),W=k*P*j-2*O/(1+M)+S*P*O+S*k*(V-V/E),Z=k*P*N-2*F/(1+M)+S*P*F+S*k*(q-q/E),Y=G*W-Z*H;if(!Y)break;var X=(D*G-z*Z)/Y,$=(z*W-D*H)/Y;a-=X,s=u(-_,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 At(t,e){var r=g(e/2);return[t*Tt*I(1-r*r),(1+Tt)*r]}function kt(t,e){var r=e/2,n=o(r);return[2*t/A*o(e)*n*n,A*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 c=e.geoAzimuthalEquidistantRaw(r,l),u=c[0],h=c[1],f=u*u+h*h;if(f>s){var d=I(f),g=a(h,u),v=i*p(g/i),b=g-v,w=t*o(b),T=(t*m(b)-b*m(w))/(_-w),A=It(b,T),k=(x-t)/Lt(A,w,x);u=d;var M,S=50;do{u-=M=(t+Lt(A,w,u)*k-d)/(A(u)*k)}while(n(M)>y&&--S>0);h=b*m(u),u<_&&(h-=T*(u-_));var E=m(v),C=o(v);c[0]=u*C-h*E,c[1]=u*E+h*C}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=I(c),h=a(l,r),f=i*p(h/i),d=h-f;r=u*o(d),l=u*m(d);for(var g=r-_,y=m(r),b=l/y,w=r<_?1/0:0,T=10;;){var A=t*m(b),k=t*o(b),M=m(k),S=_-k,E=(A-b*M)/S,C=It(b,E);if(n(w)<v||! --T)break;b-=w=(b*y-E*g-l)/(y-2*g*(S*(k+b*A*o(k)-M)-A*(A-b*M))/(S*S))}r=(u=t+Lt(C,k,r)*(x-t)/Lt(C,k,x))*o(h=f+b),l=u*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,c){function u(n,u){if(!u)return[t*n/x,0];var h=u*u,f=t+h*(e+h*(r+h*i)),p=u*(a-1+h*(s-c+h*l)),d=(f*f+p*p)/(2*p),g=n*E(f/d)/x;return[d*m(g),u*(1+h*c)+d*(1-o(g))]}return arguments.length<8&&(c=0),u.invert=function(u,h){var f,p,d=x*u/t,g=h,v=50;do{var _=g*g,b=t+_*(e+_*(r+_*i)),w=g*(a-1+_*(s-c+_*l)),T=b*b+w*w,A=2*w,k=T/A,M=k*k,S=E(b/k)/x,C=d*S,L=b*b,P=(2*e+_*(4*r+6*_*i))*g,z=a+_*(3*s+5*_*l),D=(2*(b*P+w*(z-1))*A-T*(2*(z-1)))/(A*A),O=o(C),R=m(C),F=k*O,B=k*R,j=d/x*(1/I(1-L/M))*(P*k-b*D)/M,N=B-u,U=g*(1+_*c)+k-F-h,V=D*R+F*j,q=F*S,H=1+D-(D*O-B*j),G=B*S,W=V*G-H*q;if(!W)break;d-=f=(U*V-N*H)/W,g-=p=(N*G-U*q)/W}while((n(f)>y||n(p)>y)&&--v>0);return[d,g]},u}At.invert=function(t,e){var r=e/(1+Tt);return[t&&t/(Tt*I(1-r*r)),2*i(r)]},kt.invert=function(t,e){var r=i(e/A),n=o(r),a=2*r;return[t*A/2/(o(a)*n*n),a]};var zt=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Dt=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Ot=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 jt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(i*e);t=n(a(c,u)),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,c=1+l,u=1+3*l,h=1-l,f=E(1/I(c)),p=h+s*c*f,d=(1-a)/p,g=I(d),v=d*c,b=I(v),w=g*h;if(0===t)return[0,-(w+s*b)];var T,A=o(e),k=1/A,M=2*a*A,S=(-p*A-(1-a)*((-3*s+f*u)*M))/(p*p),C=-k*M,L=-k*(s*c*S+d*u*M),P=-2*k*(h*(.5*S/g)-2*s*g*M),z=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 D=r,O=.5*r;r=.5*(O+D),i=50;do{var R=r*(P+C*I(v-r*r))+L*E(r/b)-z;if(!R)break;R<0?O=r:D=r,r=.5*(O+D)}while(n(D-O)>y&&--i>0)}else{r=y,i=25;do{var F=r*r,B=I(v-F),j=P+C*B,N=r*j+L*E(r/b)-z;r-=T=B?N/(j+(L-C*F)/B):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&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Nt(t,e){var r,a,l,c,u;if(e<y)return[(c=m(t))-(r=e*(t-c*(a=o(t)))/4)*a,a+r*c,1-e*c*c/2,t-r];if(e>=1-y)return r=(1-e)/4,a=P(t),c=function(t){return((t=s(2*t))-1)/(t+1)}(t),l=1/a,[c+r*((u=a*L(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-_+r*(u-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),u=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),u*=2;l=u*h[p]*t;do{l=(E(c=f[p]*m(a=l)/h[p])+l)/2}while(--p);return[m(l),c=o(l),c/o(l-a),l]}function Ut(t,e){if(!e)return t;if(1===e)return c(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),u=Ut(_,l*l),h=c(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*c(i*i+4*r)+.5*c(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)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+I(c*c-(r-1)*l*4))/2;return[Ut(i(1/I(u)),r)*d(t),Ut(i(I((u/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*u-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),c=o(a),u=o(t),h=C(e*l+r*c*u),f=m(h),p=n(f)>y?h/f:1;return[p*r*m(t),(n(t)>_?p:-p)*(e*c-r*l*u)]}return i.invert=Ht(-t),s.invert=function(t,r){var n=I(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*e,f=I(c*c+u*u-h*h),p=a(c*h+u*f,u*h-c*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,c=m(n);return[a(l,s*r-c*e),E(c*r+s*e)]}}jt.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,c=l/s<1,u=function(t,e){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=I(a),u=E(1/I(1+l)),h=1-l+a*(1+l)*u,f=(1-c)/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(c),b=o(_),w=1/b,T=2*c*b,A=(-h*b-(1-c)*((-3*a+u*(1+3*l))*T))/(h*h);return[x/4*(t*(-2*w*(.5*A/p*(1-l)-2*a*p*T)+-w*T*g)+-w*(a*(1+l)*A+f*(1+3*l)*T)*E(t/I(d))),_]}(c?l:s,c?s:l),h=u[0],f=u[1],p=o(f);return c&&(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=Nt(t,r),e?(a=(i=Nt(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=Nt(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*c(r*l[0]*l[0]+r*l[1]*l[1])))-_]};var Gt=E(1-1/3)*M,Wt=pt(0);function Zt(t){var e=Gt*S,r=ct(x,e)[0]-ct(-x,e)[0],i=Wt(0,e)[1],a=ct(0,e)[1],o=A-a,s=k/t,c=4/k,f=i+o*o*4/k;function p(p,d){var m,g=n(d);if(g>e){var y=h(t-1,u(0,l((p+x)/s)));(m=ct(p+=x*(t-1)/t-y*s,g))[0]=m[0]*k/r-k*(t-1)/(2*t)+y*k/t,m[1]=i+4*(m[1]-a)*o/k,d<0&&(m[1]=-m[1])}else m=Wt(p,d);return m[0]*=c,m[1]/=f,m}return p.invert=function(e,p){e/=c;var d=n(p*=f);if(d>i){var m=h(t-1,u(0,l((e+x)/s)));e=(e+x*(t-1)/t-m*s)*r/k;var g=ct.invert(e,.25*(d-i)*k/o+a);return g[0]-=x*(t-1)/t-m*s,p<0&&(g[1]=-g[1]),g}return Wt.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 Kt(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))),c=t*t,u=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),A=o(b),k=i+a(T,r-A),M=1+u-2*r*A;b-=y=(b-c*i-r*T+M*k-.5*g*e)/(2*r*T*k)}while(n(y)>v&&--w>0);p=s*I(M),d=h*k/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+u-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-c*i-r*p+(1+u-2*r*h)*d)/e)]},h}var Jt=.7109889596207567,Qt=.0528035274542;function te(t,e){return e>-Jt?((t=Y(t,e))[1]+=Qt,t):Q(t,e)}function ee(t,e){return n(e)>Jt?((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*c(1);function l(r){return I(1+t*o(2*r)+e*o(4*r))}function c(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 u(t){return l(t)*m(t)}var h=function(t,e){var n=r*q(c,s*m(e)/r,e/x);isNaN(n)&&(n=r*d(e));var u=i*l(n);return[u*a*t/x*o(n),u/a*m(n)]};return h.invert=function(t,e){var n=q(u,e*a/i);return[t*x/(o(n)*i*a*l(n)),E(r*c(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,c,u){if(u.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))u.nanEncountered=!0;else{if(!isNaN(p))return _=((g=(d=h*(n+4*f+i)/12)+(m=h*(i+4*p+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+_):Math.abs(_)<s?g+_:(v=ne(t,e,y=e+.5*h,n,f,i,d,.5*s,l,c+1,u),isNaN(v)?(u.nanEncountered=!0,NaN):(x=ne(t,y,r,i,p,a,m,.5*s,l,c+1,u),isNaN(x)?(u.nanEncountered=!0,NaN):v+x));u.nanEncountered=!0}}function ie(t,e,r,n,i){void 0===n&&(n=1e-8),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,c=[],u=0;u<=s;u++)c.push(a(u/s)*l);function h(t){var e=0,r=s,n=500;do{c[n]>t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[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 c=0;c<e;++c)l.push([s[0]+c*n,s[1]+c*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,c=i.length;l<c;++l){var u=i[l];if(u[0][0]<=e&&e<u[1][0]&&u[0][1]<=r&&r<u[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),c=l.stream;return l.stream=function(t){var r=l.rotate(),n=c(t),i=(l.rotate([0,0]),c(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,c=[],u=t[0].length;for(l=0;l<u;++l)n=(e=t[0][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.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],c.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(c)]}}(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>-Jt?Y.invert(t,e-Qt):Q.invert(t,e)},ee.invert=function(t,e){return n(e)>Jt?Y.invert(t,e+(e>0?Qt:-Qt)):Q.invert(t,e)};var 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]]]],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]]]],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/k*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[k/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/c(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*c(g(o)/r)/a,s]},i}function we(t,e){return[t,1.25*c(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),c=s*m(n),u=e,h=t[u],f=h[0],p=h[1];--u>=0;)f=(h=t[u])[0]+l*(i=f)-c*p,p=h[1]+l*p+c*i;return[f=l*(i=f)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,f=e,p=t[f],d=p[0],g=p[1],v=0,x=0;--f>=0;)v=d+c*(h=v)-u*x,x=g+c*x+u*h,d=(p=t[f])[0]+c*(h=d)-u*g,g=p[1]+c*g+u*h;var _,b,w=(v=d+c*(h=v)-u*x)*v+(x=g+c*x+u*h)*x;c-=_=((d=c*(h=d)-u*g-r)*v+(g=c*g+u*h-s)*x)/w,u-=b=(g*v-d*x)/w}while(n(_)+n(b)>y*y&&--l>0);if(l){var T=I(c*c+u*u),A=2*i(.5*T),k=m(A);return[a(c*k,T*o(A)),T?E(u*k/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 c=m(s),u=I(o(s)),h=m(s/2),f=o(s/2),p=m(a/6),d=o(a/6),g=.5*a*(1+u)-r,v=s/(f*d)-i,x=u?-.25*a*c/u:0,b=.5*(1+u),w=(1+.5*s*h/f)/(f*d),T=s/f*(p/6)/(d*d),A=x*T-w*b,k=(g*T-v*b)/A,M=(v*x-g*w)/A;if(s-=k,a-=M,n(k)<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,c=r*(.975534+s*(-.0143059*o-.119161+-.0547009*s))-t,u=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=(u*f-c*m)/g,_=(c*p-u*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 Ae=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],ke=[[.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 De(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 Oe(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))]},De.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))]},Oe.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,c=(1-l*l)/(r-l),u=s*s,h=c*c,f=1+u/h,p=1+h/u,g=(s*r/c-s/2)/f,y=(h*r/u+c/2)/p,v=y*y-(h*r*r/u+c*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 je=1.0148,Ne=.23185,Ue=-.14499,Ve=.02406,qe=je,He=5*Ne,Ge=7*Ue,We=1.790857183;function Ze(t,e){var r=e*e;return[t,e*(je+r*r*(Ne+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){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 $e(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 Je(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 s(t,e){var n=t.project.invert,i=t.transform,a=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),a=[i[0]*a[0]+i[1]*a[1]+i[2],i[3]*a[0]+i[4]*a[1]+i[5]]),n&&t===function(t){return r(t[0]*S,t[1]*S)}(o=n(a)))return o;for(var o,l=t.children,c=0,u=l&&l.length;c<u;++c)if(o=s(l[c],e))return o}!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=function(t,e){var r=$e(t[1],t[0]),n=$e(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 Xe([1,0,t[0][0],0,1,t[0][1]],Xe([s,0,0,0,s,0],Xe([o(i),m(i),0,-m(i),o(i),0],[1,0,-e[0][0],0,1,-e[0][1]])))}(n.map(r.project),n.map(e.project));e.transform=r.transform?Xe(r.transform,i):i;for(var s=r.edges,l=0,c=s.length;l<c;++l)tr(n[0],s[l][1])&&tr(n[1],s[l][0])&&(s[l]=e),tr(n[0],s[l][0])&&tr(n[1],s[l][1])&&(s[l]=e);for(l=0,c=(s=e.edges).length;l<c;++l)tr(n[0],s[l][0])&&tr(n[1],s[l][1])&&(s[l]=r),tr(n[0],s[l][1])&&tr(n[1],s[l][0])&&(s[l]=r)}else e.transform=r.transform;return e.children&&e.children.forEach((function(r){t(r,e)})),e}(t,{transform:null}),er(t)&&(i.invert=function(e,r){var n=s(t,[e,-r]);return n&&(n[0]*=S,n[1]*=S,n)});var l=e.geoProjection(i),c=l.stream;return l.stream=function(e){var r=l.rotate(),n=c(e),i=(l.rotate([0,0]),c(e));return l.rotate(r),n.sphere=function(){i.polygonStart(),i.lineStart(),Qe(i,t),i.lineEnd(),i.polygonEnd()},n},l.angle(null==n?-30:n*M)}function Qe(t,r,i){var a,o,s=r.edges,l=s.length,c={type:"MultiPoint",coordinates:r.face},u=r.face.filter((function(t){return 90!==n(t[1])})),h=e.geoBounds({type:"MultiPoint",coordinates:u}),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(c);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&&Qe(t,o,r))}function tr(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}function er(t){return t.project.invert||t.children&&t.children.some(er)}Ze.invert=function(t,e){e>We?e=We:e<-We&&(e=-We);var r,i=e;do{var a=i*i;i-=r=(i*(je+a*a*(Ne+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),c=1/o(a),u=i-2*e*a+a*a;a-=r=(l*u+2*(a-e))/(2+u*c*c+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 rr=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],nr=[[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 rr[t]}))})),ir=2/I(3);function ar(t,e){var r=ct(t,e);return[r[0]*ir,r[1]]}function or(t,e){for(var r=0,n=t.length,i=0;r<n;++r)i+=t[r]*e[r];return i}function sr(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 lr(t){return[a(t[1],t[0])*M,E(u(-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 ur(){}function hr(t,e){return{type:"FeatureCollection",features:t.features.map((function(t){return fr(t,e)}))}}function fr(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:pr(t.geometry,e)}}function pr(t,r){if(!t)return null;if("GeometryCollection"===t.type)return function(t,e){return{type:"GeometryCollection",geometries:t.geometries.map((function(t){return pr(t,e)}))}}(t,r);var n;switch(t.type){case"Point":case"MultiPoint":n=gr;break;case"LineString":case"MultiLineString":n=yr;break;case"Polygon":case"MultiPolygon":case"Sphere":n=vr;break;default:return null}return e.geoStream(t,r(n)),n.result()}ar.invert=function(t,e){return ct.invert(t/ir,e)};var dr=[],mr=[],gr={point:function(t,e){dr.push([t,e])},result:function(){var t=dr.length?dr.length<2?{type:"Point",coordinates:dr[0]}:{type:"MultiPoint",coordinates:dr}:null;return dr=[],t}},yr={lineStart:ur,point:function(t,e){dr.push([t,e])},lineEnd:function(){dr.length&&(mr.push(dr),dr=[])},result:function(){var t=mr.length?mr.length<2?{type:"LineString",coordinates:mr[0]}:{type:"MultiLineString",coordinates:mr}:null;return mr=[],t}},vr={polygonStart:ur,lineStart:ur,point:function(t,e){dr.push([t,e])},lineEnd:function(){var t=dr.length;if(t){do{dr.push(dr[0].slice())}while(++t<4);mr.push(dr),dr=[]}},polygonEnd:ur,result:function(){if(!mr.length)return null;var t=[],e=[];return mr.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],c=l[0],u=l[1],h=t[s],f=h[0],p=h[1];u>n^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),mr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function xr(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 c=r*w,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}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,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-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 _r(){return xr(Vt).scale(111.48)}function br(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,c=0,u=10;do{var h=g(c),f=1/o(c),p=l-2*a*c+c*c;c-=s=(h*p+2*(c-a))/(2+p*f*f+2*(c-a)*h)}while(n(s)>y&&--u>0);var d=r*(h=g(c)),v=g(n(a)<n(c+1/h)?.5*E(d):.5*C(d)+x/4)/m(c);return[e?2*i(e*v)/e:2*v,c]},r}var wr=[[.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 Tr(t,e){var r,i=h(18,36*n(e)/x),a=l(i),o=i-a,s=(r=wr[a])[0],c=r[1],u=(r=wr[++a])[0],f=r[1],p=(r=wr[h(19,++a)])[0],d=r[1];return[t*(u+o*(p-s)/2+o*o*(p-2*u+s)/2),(e>0?_:-_)*(f+o*(d-c)/2+o*o*(d-2*f+c)/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}wr.forEach((function(t){t[1]*=1.0144})),Tr.invert=function(t,e){var r=e/_,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=wr[o][1],c=wr[o+1][1],f=wr[h(19,o+2)][1],p=f-s,d=f-2*c+s,m=2*(n(r)-c)/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=wr[o][1],c=wr[o+1][1],f=wr[h(19,o+2)][1],i-=(x=(e>=0?_:-_)*(c+y*(f-s)/2+y*y*(f-2*c+s)/2)-e)*M}while(n(x)>v&&--b>0);break}}while(--o>=0);var w=wr[o][0],T=wr[o+1][0],A=wr[h(19,o+2)][0];return[t/(T+y*(A-w)/2+y*y*(A-2*T+w)/2),i*S]};var kr=1e-4,Mr=-180,Sr=Mr+kr,Er=180-kr,Cr=-90+kr,Ir=90-kr;function Lr(t){return t.length>0}function Pr(t){return Math.floor(1e4*t)/1e4}function zr(t){return-90===t||90===t?[0,t]:[Mr,Pr(t)]}function Dr(t){var e=t[0],r=t[1],n=!1;return e<=Sr?(e=Mr,n=!0):e>=Er&&(e=180,n=!0),r<=Cr?(r=-90,n=!0):r>=Ir&&(r=90,n=!0),n?[e,r]:t}function Or(t){return t.map(Dr)}function Rr(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],c=l[0],u=l[1];if(c<=Sr||c>=Er||u<=Cr||u>=Ir){a[o]=Dr(l);for(var h=o+1;h<s;++h){var f=a[h],p=f[0],d=f[1];if(p>Sr&&p<Er&&d>Cr&&d<Ir)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]=zr(u),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]=zr(a[0][1]),o=-1,s=a.length}}}}function Fr(t){var e,r,n,i,a,o,s=t.length,l={},c={};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]=c[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=c[n],o=l[a],delete l[n],delete c[a],n[0]===a[0]&&n[1]===a[1]){r.polygon.push(r.ring);continue}i?(delete c[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]]=c[r.ring[r.ring.length-1]]=r))):o?(delete l[a],delete c[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]]=c[r.ring[r.ring.length-1]]=r)):(r.ring.push(r.ring[0]),r.polygon.push(r.ring))}}function Br(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:Or(t.coordinates)};break;case"MultiLineString":e={type:"MultiLineString",coordinates:t.coordinates.map(Or)};break;case"Polygon":var a=[];Rr(t.coordinates,a,r=[]),Fr(r),e={type:"Polygon",coordinates:a};break;case"MultiPolygon":r=[],n=-1,i=t.coordinates.length;for(var o=new Array(i);++n<i;)Rr(t.coordinates[n],o[n]=[],r);Fr(r),e={type:"MultiPolygon",coordinates:o.filter(Lr)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function Nr(t,e){var r=g(e/2),n=m(b*r);return[t*(.74482-.34588*n*n),1.70711*r]}function Ur(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)),c=[-a[0],-a[1],-(o[0]>0?x-l:l)*M],u=e.geoProjection(t(s)).rotate(c),h=e.geoRotation(c),f=u.center;return delete u.rotate,u.center=function(t){return arguments.length?f(h(t)):h.invert(f())},u.clipAngle(90)}function Vr(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 qr(t,e){return Ur(Vr,t,e)}function Hr(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function c(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 c.invert=function(t,e){var i,c,u=e*e,h=o(I(u+(i=t+r)*i)),f=o(I(u+(i=t+n)*i));return[a(c=h-f,i=(h+f)*s),(e<0?-1:1)*C(I(i*i+c*c)*l)]},c}function Gr(t,e){return Ur(Hr,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,c=a/(r+a-1),u=c*(2/r-1),h=u*u,f=h+l,p=c-h,m=l+c;return[d(t)*x*(s*p+I(l*p*p-f*(c*c-h)))/f,d(e)*x*(u*m-s*I((l+1)*f-m*m))/f]}function Zr(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,c=a*(I(1+l)-s*a)/(1+l*r*r);return[d(t)*x*c,d(e)*x*I(1-c*(2*s+c))]}function Yr(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 Xr(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,c=a+s+2*l,u=i+3*o,h=t/_,f=h+1/h,p=d(n(t)-_)*I(f*f-4),m=p*p,g=(p*(c+s-1)+2*I(c*(a+s*m-1)+(1-a)*(a*(u*u+4*s)+12*l*s+4*s*s)))/(4*c+m);return[d(t)*_*g,d(e)*_*I(1+p*n(g)-g*g)]}function $r(t,e,r,n){var i=x/3;t=u(t,y),e=u(e,y),t=h(t,_),e=h(e,x-y),r=u(r,0),r=h(r,100-y);var s=(n=u(n,y))/100,l=C((r/100+1)*o(i))/i,c=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),c=I(1-l*l),u=I(2/(1+c*o(a*=i)));return[t*c*u*m(a),e*l*u]}return s.invert=function(o,s){var l=o/t,c=s/e,u=I(l*l+c*c),h=2*E(u/2);return[a(o*g(h),t*u)/i,u&&E(s*m(h)/(e*r*u))/n]},s}(p/I(f*c*l),1/(p*I(f*c*l)),c,l,f)}function Kr(){var t=65*S,r=60*S,n=20,i=200,a=e.geoProjectionMutator($r),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)}Nr.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,c=-n(e)*(1+s),u=c-2*a+r,h=-2*c+1+2*a+l,f=a/h+(2*u*u*u/(h*h*h)-9*c*u/(h*h))/27,p=(c-u*u/(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)-u/(3*h))]},Zr.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)))]},Yr.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))]},Xr.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 c=s*s,u=(8*s-c*(c+2)-5)/(2*c*(s-1)),h=(3*s-c*s-10)/(2*c*s),f=u*u,p=s*u,m=s+u,g=m*m,v=s+3*u,b=-2*m*(4*p*f+(1-4*c+3*c*c)*(1+h)+f*(14*c-6-o+(8*c-8-2*o)*h)+p*(12*c-8+(10*c-10-o)*h)),w=I(g*(c+f*o-1)+(1-c)*(c*(v*v+4*f)+f*(12*p+4*f)));s-=r=(a*(g+f-1)+2*w-i*(4*g+o))/(a*(2*u*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 Jr=4*x+3*I(3),Qr=2*I(2*x*I(3)/Jr),tn=Z(Qr*I(3)/x,Qr,Jr/6);function en(t,e){return[t*I(1-3*e*e/(x*x)),e]}function rn(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 nn(t,e){var r=D(t,e);return[(r[0]+t/_)/2,(r[1]+e)/2]}en.invert=function(t,e){return[t/I(1-3*e*e/(x*x)),e]},rn.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]},nn.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,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*c+i)-e,A=.5*s*(f*v+b*l*d*h)+.5/_,k=s*(p*u/4-b*c*g),M=.125*s*(u*g-b*c*f*p),S=.5*s*(h*d+b*v*l)+.5,E=k*M-S*A,L=(T*k-w*S)/E,P=(w*M-T*A)/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(D).scale(152.63)},t.geoAitoffRaw=D,t.geoArmadillo=function(){var t=20*S,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(O),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(),c=l(e),u=(s.rotate([0,0]),l(e)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*h)>=-180;)u.point(e,r*-a(o(e*S/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=O,t.geoAugust=function(){return e.geoProjection(R).scale(66.1603)},t.geoAugustRaw=R,t.geoBaker=function(){return e.geoProjection(j).scale(112.314)},t.geoBakerRaw=j,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(N),n=r(t),i=n.stream,s=.01,l=-o(s*S),c=m(s*S);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),u=i(e),h=(n.rotate([0,0]),i(e));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var e=0,r=360/t,n=2*x/t,i=90-180/t,u=_;e<t;++e,i-=r,u-=n)h.point(a(c*o(u),l)*M,E(c*m(u))*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()},u},n.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},t.geoBerghausRaw=N,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(K).scale(160.857)},t.geoBoggsRaw=K,t.geoBonne=function(){return J(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(ct).scale(95.6464).center([0,30])},t.geoCollignonRaw=ct,t.geoCraig=function(){return J(ut).scale(249.828).clipAngle(90)},t.geoCraigRaw=ut,t.geoCraster=function(){return e.geoProjection(ft).scale(156.19)},t.geoCrasterRaw=ft,t.geoCylindricalEqualArea=function(){return J(pt).parallel(38.58).scale(195.044)},t.geoCylindricalEqualAreaRaw=pt,t.geoCylindricalStereographic=function(){return J(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(At).scale(137.152)},t.geoFaheyRaw=At,t.geoFoucaut=function(){return e.geoProjection(kt).scale(135.264)},t.geoFoucautRaw=kt,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),c=l.stream,u=-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=c(e),f=(l.rotate([0,0]),c(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),u)*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(Dt).scale(153.93)},t.geoGinzburg5Raw=Dt,t.geoGinzburg6=function(){return e.geoProjection(Ot).scale(130.945)},t.geoGinzburg6Raw=Ot,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(jt)).scale(239.75)},t.geoGringortenRaw=jt,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(Zt),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=Zt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Kt),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=Kt,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(K,ce).scale(160.857)},t.geoInterruptedHomolosine=function(){return le(ee,ue).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 J(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(Ae,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ce(ke,[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(De).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=De,t.geoNaturalEarth2=function(){return e.geoProjection(Oe).scale(175.295)},t.geoNaturalEarth2Raw=Oe,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(Ze).scale(139.319)},t.geoPattersonRaw=Ze,t.geoPolyconic=function(){return e.geoProjection(Ye).scale(103.74)},t.geoPolyconicRaw=Ye,t.geoPolyhedral=Je,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=nr.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])})),Je(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(ar).translate([0,0]).scale(1).rotate(r[1]>0?[-r[0],0]:[180-r[0],180])};var r=nr.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])})),Je(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=nr.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(lr([.9486832980505138*i[0]+.31622776601683794*e[0],.9486832980505138*i[1]+.31622776601683794*e[1],.9486832980505138*i[2]+.31622776601683794*e[2]]),lr([.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=nr[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(sr(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])})),Je(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[or(l[0],i)<0?8+3*s:or(l[1],i)<0?8+3*s+1:or(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=fr;break;case"FeatureCollection":r=hr;break;default:r=pr}return r(t,n)},t.geoGringortenQuincuncial=function(){return xr(jt).scale(176.423)},t.geoPeirceQuincuncial=_r,t.geoPierceQuincuncial=_r,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=xr,t.geoRectangularPolyconic=function(){return J(br).scale(131.215)},t.geoRectangularPolyconicRaw=br,t.geoRobinson=function(){return e.geoProjection(Tr).scale(152.63)},t.geoRobinsonRaw=Tr,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 Br(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(Br)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return jr(t)}},t.geoTimes=function(){return e.geoProjection(Nr).scale(146.153)},t.geoTimesRaw=Nr,t.geoTwoPointAzimuthal=qr,t.geoTwoPointAzimuthalRaw=Vr,t.geoTwoPointAzimuthalUsa=function(){return qr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Gr,t.geoTwoPointEquidistantRaw=Hr,t.geoTwoPointEquidistantUsa=function(){return Gr([-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(Zr).scale(79.4183)},t.geoVanDerGrinten2Raw=Zr,t.geoVanDerGrinten3=function(){return e.geoProjection(Yr).scale(79.4183)},t.geoVanDerGrinten3Raw=Yr,t.geoVanDerGrinten4=function(){return e.geoProjection(Xr).scale(127.16)},t.geoVanDerGrinten4Raw=Xr,t.geoWagner=Kr,t.geoWagner7=function(){return Kr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=$r,t.geoWagner4=function(){return e.geoProjection(tn).scale(176.84)},t.geoWagner4Raw=tn,t.geoWagner6=function(){return e.geoProjection(en).scale(152.63)},t.geoWagner6Raw=en,t.geoWiechel=function(){return e.geoProjection(rn).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=rn,t.geoWinkel3=function(){return e.geoProjection(nn).scale(158.837)},t.geoWinkel3Raw=nn,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?n(t,Sg(),Mg()):n(r.d3=r.d3||{},r.d3,r.d3)}}),Cg=p({"src/plots/geo/zoom.js"(t,e){var r=x(),n=le(),i=qt(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,r){var a=t.id,o=t.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},f={};function p(t,e){h[a+"."+t]=n.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,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=c(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),u(t,e,i)})),n}function f(t,e){var n,i,a,o,h,f,p,d,m,g=c(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&&u(t,e,v)})),g}function p(t,e){var n,i={r:e.rotate(),k:e.scale()},h=c(0,e),f=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}(h,"zoomstart","zoom","zoomend"),p=0,g=h.on;function x(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}return h.on("zoomstart",(function(){r.select(this).style(s);var t=r.mouse(this),l=e.rotate(),c=l,u=e.translate(),x=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),c=Math.sin(n),u=Math.cos(n);return[o*l*u+i*s*c,i*l*u-o*s*c,o*s*u+i*l*c,o*l*c-i*s*u]}(l);n=d(e,t),g.call(h,"zoom",(function(){var a=r.mouse(this);if(e.scale(i.k=r.event.scale),n){if(d(e,a)){e.rotate(l).translate(u);var s=d(e,a),h=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(v(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,v(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}(n,s),p=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],c=e[3];return[r*o-n*s-i*l-a*c,r*s+n*o+i*c-a*l,r*l-n*c+i*o+a*s,r*c+n*l-i*s+a*o]}(x,h)),g=i.r=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],c=e[2],u=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,u)-Math.atan2(c,i))*o,x=(Math.atan2(f,u)-Math.atan2(c,-i))*o;return m(r[0],r[1],a,v)<=m(r[0],r[1],g,x)?[a,v,r[2]]:[g,x,r[2]]}(p,n,c);(!isFinite(g[0])||!isFinite(g[1])||!isFinite(g[2]))&&(g=c),e.rotate(g),c=g}}else n=d(e,t=a);!function(t){t({type:"zoom"})}(f.of(this,arguments))})),function(t){p++||t({type:"zoomstart"})}(f.of(this,arguments))})).on("zoomend",(function(){var n;r.select(this).style(l),g.call(h,"zoom",null),n=f.of(this,arguments),--p||n({type:"zoomend"}),u(t,e,x)})).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(h,f,"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),c=Math.sin(n);return i[o]=t[o]*l-t[s]*c,i[s]=t[s]*l+t[o]*c,i}function v(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=p({"src/plots/geo/geo.js"(t,e){var r=x(),n=Sg(),i=n.geoPath,a=n.geoDistance,o=Eg(),s=qt(),l=le(),c=l.strTranslate,u=H(),h=Qe(),f=Dr(),p=Ae(),d=ir(),m=nr().getAutoRange,g=fr(),y=En().prepSelect,v=En().clearOutline,_=En().selectOnClick,b=Cg(),w=ug(),T=_g(),A=fg(),k=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 c=!1,u=0;u<t.length;u++){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)&&(c=!0)}}if(this._hasMarkerAngles=c,s){var m=A.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=A.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],c=e._size,u=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 c=(n[s]||o[s])(),u=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?c:[]},p=0;p<h.length;p++){var d=h[p];"function"!=typeof c[d]&&(c[d]=f)}return c.isLonLatOverEdges=function(t){if(null===c(t))return!0;if(u){var e=c.rotate();return a(t,[-e[0],-e[1]])>u*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(t){return c.getPath().bounds(t)},c.precision(w.precision),t._isSatellite&&c.tilt(e.tilt).distance(e.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.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 A=(d.range[0]+d.range[1])/2,k=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:A,lat:k};else if(s._isClipped){x={lon:A,lat:k},_={lon:A,lat:k,roll:_.roll};var M=h.type,S=w.lonaxisSpan[M]/2||180,C=w.lataxisSpan[M]/2||90;b=[A-S,A+S],T=[k-C,k+C]}else x={lon:A,lat:k},_={lon:A,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 D=y.getBounds(E(d.range,g.range)),O=Math.min((L[1][0]-L[0][0])/(D[1][0]-D[0][0]),(L[1][1]-L[0][1])/(D[1][1]-D[0][1]));isFinite(O)?y.scale(O*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 c(t){return!!w.fillLayers[t]}var f=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(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):c(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)||c(r)?n.datum(k(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};d.setConvert(l,r);var c=d.calcTicks(l);!e.isScoped&&"lonaxis"===t&&c.pop();for(var u=c.length,h=new Array(u),f=0;f<u;f++)for(var p=c[f].x,m=h[f]=[],g=i[0];g<i[1]+2.5;g+=2.5)m.push(a(p,g));return{type:"MultiLineString",coordinates:h}}(r,e,t)).call(u.stroke,e[r].gridcolor).call(h.dashLine,e[r].griddash,e[r].gridwidth),l(r)?n.call(u.stroke,e[a+"color"]).call(h.dashLine,"",e[a+"width"]):c(r)&&n.call(u.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(u.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,c=t.clickmode;if(!n.isStatic){var u={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&&v(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),u.prepFn=function(t,e,r){y(t,e,r,u,o)},g.init(u)),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&&(c.indexOf("select")>-1&&_(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.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?c(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=p({"src/plots/geo/layout_attributes.js"(t,e){var r=q(),n=Aa().attributes,i=zt().dash,a=ug(),o=Pt().overrideAll,s=Zt(),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=p({"src/plots/geo/layout_defaults.js"(t,e){var r=le(),n=Hs(),i=we().getSubplotData,a=ug(),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})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],f=n("projection.type",h.projType),p=e._isAlbersUsa="albers usa"===f;p&&(u=e.scope="usa");var d=e._isScoped="world"!==u,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 A=a[w+"Span"],k=(A[f]||A["*"])/2,M=n("projection.rotation."+w.substr(0,3),h.projRotate[_]);b=[M-k,M+k]}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,D,O=(I+L)/2;if(!p){var R=d?h.projRotate:[O,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,D=38.7):(z=d?O:P,D=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",D),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"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(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=p({"src/plots/geo/index.js"(t,e){var r=we().getSubplotCalcData,n=le().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],c=r(n,a,l),u=e[l]._subplot;u||(u=i({id:l,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL,staticPlot:t._context.staticPlot}),e[l]._subplot=u),u.plot(c,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())}}}}}),Dg=p({"src/traces/scattergeo/index.js"(t,e){e.exports={attributes:og(),supplyDefaults:sg(),colorbar:pi(),formatLabels:lg(),calc:cg(),calcGeoJSON:wg().calcGeoJSON,plot:wg().plot,style:bg(),styleOnSelect:mi().styleOnSelect,hoverPoints:Tg(),eventData:Ag(),selectPoints:kg(),moduleType:"trace",name:"scattergeo",basePlotModule:zg(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}}),Og=p({"lib/scattergeo.js"(t,e){e.exports=Dg()}}),Rg=p({"src/traces/choropleth/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=og(),i=Pe(),a=U(),o=q().defaultLine,s=R().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=p({"src/traces/choropleth/defaults.js"(t,e){var r=le(),n=qe(),i=Rg();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("locations"),c=s("z");if(l&&l.length&&r.isArrayOrTypedArray(c)&&c.length){e._length=Math.min(l.length,c.length);var u,h=s("geojson");("string"==typeof h&&""!==h||r.isPlainObject(h))&&(u="geojson-id"),"geojson-id"===s("locationmode",u)&&s("featureidkey"),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)}else e.visible=!1}}}),Bg=p({"src/traces/choropleth/calc.js"(t,e){var r=A(),n=k().BADNUM,i=We(),a=ii(),o=ai();function s(t){return t&&"string"==typeof t}e.exports=function(t,e){var l,c=e._length,u=new Array(c);l=e.geojson?function(t){return s(t)||r(t)}:s;for(var h=0;h<c;h++){var f=u[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(u,e),i(t,e,{vals:e.z,containerStr:"",cLetter:"z"}),o(u,e),u}}}),jg=p({"src/traces/choropleth/style.js"(t,e){var r=x(),n=H(),i=Qe(),a=Ze();function o(t,e){var o=e[0].trace,s=e[0].node3.selectAll(".choroplethlocation"),l=o.marker||{},c=l.line||{},u=a.makeColorScaleFuncFromTrace(o);s.each((function(t){r.select(this).attr("fill",u(t.z)).call(n.stroke,t.mlc||c.color).call(i.dashLine,"",t.mlw||c.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)}}}}),Ng=p({"src/traces/choropleth/plot.js"(t,e){var r=x(),n=le(),i=_g(),a=fg().getTopojsonFeatures,o=nr().findExtremes,s=jg().style,l=["The library used by the *country names* `locationmode` option is changing in an upcoming version.","Country names in existing plots may not work in the new version."].join(" "),c=!0;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],s=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(t):a(r,s.topojson),h=[],f=[],p=0;p<c;p++){var d=t[p],m="geojson-id"===l?d.fOut:i.locationToFeature(l,d.loc,u);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){c&&(c=!1,n.warn(l));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=p({"src/traces/choropleth/hover.js"(t,e){var r=ir(),n=Rg(),i=le().fillText;e.exports=function(t,e,a){var o,s,l,c,u=t.cd,h=u[0].trace,f=t.subplot,p=[e,a],d=[e+360,a];for(s=0;s<u.length;s++)if(c=!1,(o=u[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains(p)&&(c=!c),o._polygons[l].contains(d)&&(c=!c);if(c)break}if(c&&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"),c=-1!==s.indexOf("location"),u=-1!==s.indexOf("z"),h=-1!==s.indexOf("text"),f=[];!l&&c?t.nameOverride=o:(l&&(t.nameOverride=e.name),c&&f.push(o)),u&&f.push(t.zLabel),h&&i(r,e,f),t.extraText=f.join("<br>")}}(t,h,o),[t]}}}),Vg=p({"src/traces/choropleth/event_data.js"(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=p({"src/traces/choropleth/select.js"(t,e){e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[];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=c.c2p(i),e.contains([a,o],null,r,t)?(u.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return u}}}),Hg=p({"src/traces/choropleth/index.js"(t,e){e.exports={attributes:Rg(),supplyDefaults:Fg(),colorbar:Uo(),calc:Bg(),calcGeoJSON:Ng().calcGeoJSON,plot:Ng().plot,style:jg().style,styleOnSelect:jg().styleOnSelect,hoverPoints:Ug(),eventData:Vg(),selectPoints:qg(),moduleType:"trace",name:"choropleth",basePlotModule:zg(),categories:["geo","noOpacity","showLegend"],meta:{}}}}),Gg=p({"lib/choropleth.js"(t,e){e.exports=Hg()}}),Wg=p({"src/traces/scattergl/hover.js"(t,e){var r=qt(),n=le(),i=gi();function a(t,e,a,o){var s=t.xa,l=t.ya,c=t.distance,u=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 A=o._origX,k=o._origY,M=n.extendFlat({},t,{color:i(o,f),x0:y-x,x1:y+x,xLabelVal:A?A[h]:f.x,y0:v-x,y1:v+x,yLabelVal:k?k[h]:f.y,cd:T,distance:c,spikeDistance:u,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,c=t.xa,u=t.ya,h=s.x,f=s.y,p=c.c2p(e),d=u.c2p(r),m=t.distance;if(s.tree){var g=c.p2c(p-m),y=c.p2c(p+m),v=u.p2c(d-m),x=u.p2c(d+m);i="x"===n?s.tree.range(Math.min(g,y),Math.min(u._rl[0],u._rl[1]),Math.max(g,y),Math.max(u._rl[0],u._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,A,k,M,S,E,C=m;if("x"===n){var I=!!l.xperiodalignment,L=!!l.yperiodalignment;for(A=0;A<i.length;A++){if(w=h[_=i[A]],k=Math.abs(c.c2p(w)-p),I){var P=c.c2p(l._xStarts[_]),z=c.c2p(l._xEnds[_]);k=p>=Math.min(P,z)&&p<=Math.max(P,z)?0:1/0}if(k<C){if(C=k,T=f[_],M=u.c2p(T)-d,L){var D=u.c2p(l._yStarts[_]),O=u.c2p(l._yEnds[_]);M=d>=Math.min(D,O)&&d<=Math.max(D,O)?0:1/0}E=Math.sqrt(k*k+M*M),b=i[A]}}}else for(A=i.length-1;A>-1;A--)w=h[_=i[A]],T=f[_],k=c.c2p(w)-p,M=u.c2p(T)-d,(S=Math.sqrt(k*k+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}}}),Zg=p({"src/traces/scattergl/constants.js"(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=p({"src/traces/scattergl/attributes.js"(t,e){var r=U(),n=F(),i=wn(),a=Tn(),o=Ce().axisHoverFormat,s=Pe(),l=Zt(),c=R().extendFlat,u=Pt().overrideAll,h=Zg().DASHES,f=a.line,p=a.marker,d=p.line,m=e.exports=u({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:c({},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:c({},s("marker.line"),{width:d.width})}),connectgaps:a.connectgaps,fill:c({},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=p({"src/traces/scattergl/helpers.js"(t){var e=Zg();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=p({"src/traces/scattergl/defaults.js"(t,e){var r=le(),n=qt(),i=Xg(),a=Yg(),o=bn(),s=Ye(),l=Hn(),c=Gn(),u=Zn(),h=Yn(),f=Kn(),p=$n();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){c(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)&&(u(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}}}),Kg=p({"src/traces/scattergl/format_labels.js"(t,e){var r=di();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)}}}),Jg=p({"node_modules/binary-search-bounds/search-bounds.js"(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=p({"node_modules/pick-by-alias/index.js"(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 c=e[i];if(Array.isArray(c))for(a=0;a<c.length;a++){var u=c[a];if(r&&(l[u]=!0),u in t){if(o[i]=t[u],r)for(var h=a;h<c.length;h++)l[c[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=p({"node_modules/parse-rect/index.js"(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&&(e={x:(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"})).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=p({"node_modules/array-bounds/index.js"(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=p({"node_modules/defined/index.js"(t,e){e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}}}),ny=p({"node_modules/flatten-vertex-data/index.js"(t,e){var r=Jd();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,c=t.length*l;(!e||"string"==typeof e)&&(e=new(r(e||"float32"))(c+n));var u=e.length-n;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+t.length+") does not match destination length "+u);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=p({"node_modules/is-obj/index.js"(t,e){e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}}}),ay=p({"node_modules/math-log2/index.js"(t,e){e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}}}),oy=p({"node_modules/@plotly/point-cluster/quad.js"(t,e){var r=Jg(),n=Kd(),i=ty(),a=ey(),o=Qg(),s=ry(),l=ny(),c=iy(),u=Jd(),h=ay();function f(t,e){let[r,i,a,o]=e,s=1/(a-r),l=1/(o-i),c=new Array(t.length);for(let e=0,a=t.length/2;e<a;e++)c[2*e]=n((t[2*e]-r)*s,0,1),c[2*e+1]=n((t[2*e+1]-i)*l,0,1);return c}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(u(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]=[]),c=x[o]||(x[o]=[]),u=v[o]||(v[o]=[]),h=l.length;if(++o>n||s>1073741824){for(let t=0;t<a.length;t++)l.push(a[t]),c.push(s),u.push(null,null,null,null);return h}if(l.push(a[0]),c.push(s),a.length<=1)return u.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,u.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(c(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,u,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,A]=f([l,u,d,m],p),k=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),k=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])))),k)}if(k=Math.min(k,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],c=w(t,e,s),u=w(n,i,s),h=r.ge(a,c),f=r.gt(a,u,h,a.length-1);o[s]=[h+l,f+l]}return o}(g,b,T,A,k);let M=[];return function e(r,n,i,a,o,s){if(null===o||null===s)return;if(g>r+i||b>n+i||T<r||A<n||a>=k||o===s)return;let c=y[a];void 0===s&&(s=c.length);for(let e=o;e<s;e++){let r=c[e],n=t[2*r],i=t[2*r+1];n>=l&&n<=d&&i>=u&&i<=m&&M.push(r)}let h=v[a],f=h[4*o+0],p=h[4*o+1],x=h[4*o+2],_=h[4*o+3],w=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}(h,o+1),S=.5*i,E=a+1;e(r,n,S,E,f,p||x||_||w),e(r,n+S,S,E,p,x||_||w),e(r+S,n,S,E,x,_||w),e(r+S,n+S,S,E,_,w)}(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=p({"node_modules/@plotly/point-cluster/index.js"(t,e){e.exports=oy()}}),ly=p({"node_modules/abs-svg-path/index.js"(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}))}}}),cy=p({"node_modules/svg-arc-to-cubic-bezier/cjs/index.js"(t,e){Object.defineProperty(t,"__esModule",{value:!0});var r=2*Math.PI,n=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}},i=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}]},a=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,o=t.py,s=t.cx,l=t.cy,c=t.rx,u=t.ry,h=t.xAxisRotation,f=void 0===h?0:h,p=t.largeArcFlag,d=void 0===p?0:p,m=t.sweepFlag,g=void 0===m?0:m,y=[];if(0===c||0===u)return[];var v=Math.sin(f*r/360),x=Math.cos(f*r/360),_=x*(e-s)/2+v*(o-l)/2,b=-v*(e-s)/2+x*(o-l)/2;if(0===_&&0===b)return[];c=Math.abs(c),u=Math.abs(u);var w=Math.pow(_,2)/Math.pow(c,2)+Math.pow(b,2)/Math.pow(u,2);w>1&&(c*=Math.sqrt(w),u*=Math.sqrt(w));var T=function(t,e,n,i,o,s,l,c,u,h,f,p){var d=Math.pow(o,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===c?-1:1))*o/s*p,_=v*-s/o*f,b=h*x-u*_+(t+n)/2,w=u*x+h*_+(e+i)/2,T=(f-x)/o,A=(p-_)/s,k=(-f-x)/o,M=(-p-_)/s,S=a(1,0,T,A),E=a(T,A,k,M);return 0===c&&E>0&&(E-=r),1===c&&E<0&&(E+=r),[b,w,S,E]}(e,o,s,l,c,u,d,g,v,x,_,b),A=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")}(T,4),k=A[0],M=A[1],S=A[2],E=A[3],C=Math.abs(E)/(r/4);Math.abs(1-C)<1e-7&&(C=1);var I=Math.max(Math.ceil(C),1);E/=I;for(var L=0;L<I;L++)y.push(i(S,E)),S+=E;return y.map((function(t){var e=n(t[0],c,u,x,v,k,M),r=e.x,i=e.y,a=n(t[1],c,u,x,v,k,M),o=a.x,s=a.y,l=n(t[2],c,u,x,v,k,M);return{x1:r,y1:i,x2:o,y2:s,x:l.x,y:l.y}}))},e.exports=t.default}}),uy=p({"node_modules/svg-path-bounds/node_modules/normalize-svg-path/index.js"(t,e){e.exports=function(t){for(var e,a=[],o=0,s=0,l=0,c=0,u=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],c=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?(u=2*f-u,h=2*p-h):(u=f,h=p),g=i(f,p,u,h,g[1],g[2]);break;case"Q":u=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,c)}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=cy();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=p({"node_modules/is-svg-path/index.js"(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=p({"node_modules/svg-path-bounds/index.js"(t,e){var r=Ke(),n=ly(),i=uy(),a=hy(),o=bu();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 c=t[s].slice(1),u=0;u<c.length;u+=2)c[u+0]<e[0]&&(e[0]=c[u+0]),c[u+1]<e[1]&&(e[1]=c[u+1]),c[u+0]>e[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}}}),py=p({"node_modules/normalize-svg-path/index.js"(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,c,u,h,f,p){if(p)T=p[0],A=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,_=(c==u?-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)),A=Math.asin(((f-w)/a).toFixed(9));(T=t<b?r-T:T)<0&&(T=2*r+T),(A=h<b?r-A:A)<0&&(A=2*r+A),u&&T>A&&(T-=2*r),!u&&A>T&&(A-=2*r)}if(Math.abs(A-T)>n){var k=A,M=h,S=f;A=T+n*(u&&A>T?1:-1);var E=o(h=b+i*Math.cos(A),f=w+a*Math.sin(A),i,a,l,0,u,M,S,[A,k,b,w])}var C=Math.tan((A-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(A),f-L*Math.cos(A),h,f];if(p)return P;E&&(P=P.concat(E));for(var z=0;z<P.length;){var D=s(P[z],P[z+1],l);P[z++]=D.x,P[z++]=D.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,c=0,u=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":c=y[1],u=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,c,u)}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=p({"node_modules/draw-svg-path/index.js"(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=p({"node_modules/bitmap-sdf/index.js"(t,e){var r=Kd();e.exports=function(t,e){e||(e={});var a,o,s,l,c,u,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,u=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,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t,a=(f=t.canvas).width,o=f.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,a=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),d=0,m=c.length;d<m;d++)l[d]=c[d*u+v]/255;else if(1!==u)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),A=Array(s);for(d=0,m=a*o;d<m;d++){var k=l[d];x[d]=1===k?0:0===k?n:Math.pow(Math.max(0,.5-k),2),_[d]=1===k?n:0===k?0:Math.pow(Math.max(0,k-.5),2)}i(x,a,o,b,w,A,T),i(_,a,o,b,w,A,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 c=0;c<r;c++)n[c]=t[c*e+l];for(a(n,i,o,s,r),c=0;c<r;c++)t[c*e+l]=i[c]}for(c=0;c<r;c++){for(l=0;l<e;l++)n[l]=t[c*e+l];for(a(n,i,o,s,e),l=0;l<e;l++)t[c*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=p({"node_modules/svg-path-sdf/index.js"(t,e){var r,n=fy(),i=Ke(),a=dy(),o=hy(),s=my(),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");var u,h;e||(e={}),e.shape?(u=e.shape[0],h=e.shape[1]):(u=l.width=e.w||e.width||200,h=l.height=e.h||e.height||200);var f=Math.min(u,h),p=e.stroke||0,d=e.viewbox||e.viewBox||n(t),m=[u/(d[2]-d[0]),h/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,h),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*u,.5*h),c.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);c.fill(y),p&&c.stroke(y)}else{var v=i(t);a(c,v),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*f})}}}),yy=p({"src/traces/scattergl/convert.js"(t,e){var r=A(),n=gy(),i=Qd(),a=qt(),o=le(),s=o.isArrayOrTypedArray,l=Qe(),c=xe(),u=em().formatColor,h=Ye(),f=Xe(),p=Xg(),d=Zg(),m=G().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=$e().appendArrayPointValue;function v(t,e){var n,i=t._fullLayout,a=e._length,l=e.textfont,c=e.textposition,u=s(c)?c:[c],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),A=T?Math.min(b.length,a):a,k=T?function(t){return b[t]}:function(){return b};for(n=0;n<A;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(k(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<u.length;n++){var I=u[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={},c=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(c||(n=p.isOpenSymbol(o.symbol)),c||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=u(o,o.opacity,a),w=u(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 A=b;for(b=Array(a),r=0;r<a;r++)b[r]=A}if(!s(x)){var k=x;for(x=Array(a),r=0;r<a;r++)x[r]=k}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++)c&&(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 T(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 k=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],c=!!l.symbolNoDot[o%100],u=!!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&&!c?s(1.1*M,f)+C:s(M,f),a=n(i,{w:k,h:k,viewBox:[-M,-M,M,M],stroke:u?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=T(e,e.error_x,i)),e.error_y&&e.error_y.visible&&(n.errorY=T(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 c=!1;for(i=0;i<n.length;i++)if(isNaN(n[i])){c=!0;break}var u=c||n.length>d.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(c&&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:u,positions:n}},errorBarPositions:function(t,e,n,i,o){var s=a.getComponentMethod("errorbars","makeComputeError"),l=c.getFromId(t,e.xaxis,"x"),u=c.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),c={x:0,y:1}[a],u={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+c],_=l(v,g),b=_[0],w=_[1];if(r(b)&&r(w)){var T=v-b,A=v+w;p[y+u[0]]=x-i.c2l(T),p[y+u[1]]=i.c2l(A)-x,p[y+u[2]]=0,p[y+u[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,u),f},textPosition:function(t,e,r,n){var i,a=e._length,o={};if(h.hasMarkers(e)){var l=r.font,c=r.align,u=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(c)?c.length>1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,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=p({"src/traces/scattergl/scene_update.js"(t,e){var r=le();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,c=n.selectBatch,u=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(u[h].length){var f=r.repeat([],n.count);f[h]=u[h],o.draw(f)}else c[h].length||o.draw(h);s[h]&&n.textOptions[h]&&s[h].render()}l&&l.draw(c),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=p({"src/traces/scattergl/calc.js"(t,e){var r=sy(),n=le(),i=xe(),a=nr().findExtremes,o=ri(),s=oi(),l=s.calcMarkerSize,c=s.calcAxisExpansion,u=s.setFirstScatter,h=ni(),f=yy(),p=vy(),d=k().BADNUM,m=Zg().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={},A=y.makeCalcdata(e,"x"),k=v.makeCalcdata(e,"y"),M=o(e,y,"x",A),S=o(e,v,"y",k),E=M.vals,C=S.vals;e._x=E,e._y=C,e.xperiodalignment&&(e._origX=A,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=k,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),D=p(t,x);return u(s,e),b?z.marker&&(P=z.marker.sizeAvg||Math.max(z.marker.size,3)):P=l(e,_),c(t,e,y,v,E,C,P),z.errorX&&g(e,y,z.errorX),z.errorY&&g(e,v,z.errorY),z.fill&&!D.fill2d&&(D.fill2d=!0),z.marker&&!D.scatter2d&&(D.scatter2d=!0),z.line&&!D.line2d&&(D.line2d=!0),(z.errorX||z.errorY)&&!D.error2d&&(D.error2d=!0),z.text&&!D.glText&&(D.glText=!0),z.marker&&(z.marker.snap=_),D.lineOptions.push(z.line),D.errorXOptions.push(z.errorX),D.errorYOptions.push(z.errorY),D.fillOptions.push(z.fill),D.markerOptions.push(z.marker),D.markerSelectedOptions.push(z.markerSel),D.markerUnselectedOptions.push(z.markerUnsel),D.textOptions.push(z.text),D.textSelectedOptions.push(z.textSel),D.textUnselectedOptions.push(z.textUnsel),D.selectBatch.push([]),D.unselectBatch.push([]),T._scene=D,T.index=D.count,T.x=E,T.y=C,T.positions=I,D.count++,[{x:!1,y:!1,t:T,trace:e}]}}}),_y=p({"src/traces/scattergl/edit_style.js"(t,e){var r=le(),n=H(),i=G().DESELECTDIM;e.exports={styleTextSelection:function(t){var e,a,o=t[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],f=c.unselectBatch[u],p=c.textOptions[u],d=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},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))}}c.glText[u].update(g)}}}}),by=p({"src/traces/scattergl/select.js"(t,e){var r=Ye(),n=_y().styleTextSelection;e.exports=function(t,e){var i=t.cd,a=t.xaxis,o=t.yaxis,s=[],l=i[0].trace,c=i[0].t,u=l._length,h=c.x,f=c.y,p=c._scene,d=c.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;_<u;_++)e.contains([c.xpx[_],c.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=p({"src/traces/scattergl/base_index.js"(t,e){var r=Wg();e.exports={moduleType:"trace",name:"scattergl",basePlotModule:Si(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Yg(),supplyDefaults:$g(),crossTraceDefaults:ti(),colorbar:pi(),formatLabels:Kg(),calc:xy(),hoverPoints:r.hoverPoints,selectPoints:by(),meta:{}}}}),Ty=p({"node_modules/color-id/index.js"(t,e){var r=Kd();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)+(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]}}}),Ay=p({"node_modules/object-assign/index.js"(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{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 c in a=Object(arguments[l]))n.call(a,c)&&(s[c]=a[c]);if(r){o=r(a);for(var u=0;u<o.length;u++)i.call(a,o[u])&&(s[o[u]]=a[o[u]])}}return s}}}),ky=p({"node_modules/glslify/browser.js"(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=p({"node_modules/update-diff/index.js"(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=p({"node_modules/is-iexplorer/index.js"(t,e){e.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}}),Ey=p({"node_modules/to-float32/index.js"(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=p({"node_modules/regl-scatter2d/bundle.js"(t,e){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)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(typeof Symbol<"u"&&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(),c=sy(),u=Ay(),h=ky(),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"}),u(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=u({},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 c=u({},s);c.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"]),c.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&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(c)}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,c=e.count;if(this.regl,!a)return n?[u({},e,{markerTexture:this.markerTextures[t],activation:s[t],count:n.length,elements:n,offset:0})]:[u({},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(c),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(u({},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=u({},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 u=e.count=Math.floor(t.length/2),h=e.bounds=u?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||u>n)?e.tree=c(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(u),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 c=t.addMarker(e[s]);a[c]||(a[c]=new Uint8Array(r.count)),a[c][s]=1}for(var u=0;u<a.length;u++)if(a[u]){var h={data:a[u],type:"uint8",usage:"static"};i[u]?i[u](h):i[u]=o.buffer(h),i[u].data=a[u]}}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,A=b.borderSize,k=b.sizeBuffer,M=new Uint8Array(2*w);if(T.length||A.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==A[S]?A:A[S])/l);k({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 D=0;D<I;D++){var O=L[D];E[8*D]=m[4*O],E[8*D+1]=m[4*O+1],E[8*D+2]=m[4*O+2],E[8*D+3]=m[4*O+3];var R=P[D];E[8*D+4]=m[4*R],E[8*D+5]=m[4*R+1],E[8*D+6]=m[4*R+2],E[8*D+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 c=0;c<t.length;c+=4)a.push(t.subarray(c,c+4));t=a}for(var u=0;u<t.length;u++){var h=t[u];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[u]=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 _=Ay();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=p({"node_modules/earcut/src/earcut.js"(t,e){function r(t,e,r){r=r||2;var i,o,s,l,c,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=[];for(a=0,o=e.length;a<o;a++)(s=n(t,e[a]*i,a<o-1?e[a+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),l.push(d(s));for(l.sort(u),a=0;a<l.length;a++)r=h(l[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)(c=t[x])<i&&(i=c),(f=t[x+1])<o&&(o=f),c>s&&(s=c),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=A(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=A(a,t[a],t[a+1],o);return o&&v(o,o.next)&&(k(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(k(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,u,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,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;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,c*=2}while(o>1)}(i)}(t,n,u,h);for(var d,m,g=t;t.prev!==t.next;)if(d=t.prev,m=t.next,h?s(t,n,u,h):o(t))e.push(d.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),k(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,u,h,2):2===f&&c(t,e,r,n,u,h):a(i(t),e,r,n,u,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,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,f=i>a?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c,d=n.next;d!==e;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&m(i,s,a,l,o,c,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,c=o.x,u=i.y,h=a.y,f=o.y,d=s<l?s<c?s:c:l<c?l:c,g=u<h?u<f?u:f:h<f?h:f,v=s>l?s>c?s:c:l>c?l:c,x=u>h?u>f?u: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,u,l,h,c,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,u,l,h,c,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,u,l,h,c,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,u,l,h,c,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),k(n),k(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,o,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=T(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,e,r,n,o,s,0),void a(u,e,r,n,o,s,0)}c=c.next}l=l.next}while(l!==t)}function u(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,c=r,u=r.x,h=r.y,p=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&m(a<h?i:o,a,u,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!==c);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 A(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 k(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 c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(S(t,c,u,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=p({"node_modules/array-normalize/index.js"(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 c=a-o;for(s=i;s<l;s+=e)isNaN(t[s])||(t[s]=0===c?.5:(t[s]-o)/c)}}return t}}}),Py=p({"node_modules/es6-weak-map/is-implemented.js"(t,e){e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch{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=p({"node_modules/es5-ext/function/noop.js"(t,e){e.exports=function(){}}}),Dy=p({"node_modules/es5-ext/object/is-value.js"(t,e){var r=zy()();e.exports=function(t){return t!==r&&null!==t}}}),Oy=p({"node_modules/es5-ext/object/set-prototype-of/is-implemented.js"(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=p({"node_modules/es5-ext/object/is-object.js"(t,e){var r=Dy(),n={function:!0,object:!0};e.exports=function(t){return r(t)&&n[typeof t]||!1}}}),Fy=p({"node_modules/es5-ext/object/valid-value.js"(t,e){var r=Dy();e.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}}}),By=p({"node_modules/es5-ext/object/create.js"(t,e){var r,n,i,a,o=Object.create;Oy()()||(r=jy()),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}}),jy=p({"node_modules/es5-ext/object/set-prototype-of/shim.js"(t,e){var r,n,i,a,o=Ry(),s=Fy(),l=Object.prototype.isPrototypeOf,c=Object.defineProperty,u={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{}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&&c(t.nullPolyfill,"__proto__",u),e},Object.defineProperty(i,"level",{configurable:!1,enumerable:!1,writable:!1,value:n.level})):null),By()}}),Ny=p({"node_modules/es5-ext/object/set-prototype-of/index.js"(t,e){e.exports=Oy()()?Object.setPrototypeOf:jy()}}),Uy=p({"node_modules/es5-ext/object/valid-object.js"(t,e){var r=Ry();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not an Object");return t}}}),Vy=p({"node_modules/es5-ext/string/random-uniq.js"(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=p({"node_modules/type/value/is.js"(t,e){e.exports=function(t){return null!=t}}}),Hy=p({"node_modules/type/object/is.js"(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=p({"node_modules/type/prototype/is.js"(t,e){var r=Hy();e.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch{return!1}}}}),Wy=p({"node_modules/type/function/is.js"(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{return!1}return!r(t)}}}),Zy=p({"node_modules/type/plain-function/is.js"(t,e){var r=Wy(),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!(!r(t)||n.test(i.call(t)))}}}),Yy=p({"node_modules/es5-ext/object/assign/is-implemented.js"(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=p({"node_modules/es5-ext/object/keys/is-implemented.js"(t,e){e.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}}),$y=p({"node_modules/es5-ext/object/keys/shim.js"(t,e){var r=Dy(),n=Object.keys;e.exports=function(t){return n(r(t)?Object(t):t)}}}),Ky=p({"node_modules/es5-ext/object/keys/index.js"(t,e){e.exports=Xy()()?Object.keys:$y()}}),Jy=p({"node_modules/es5-ext/object/assign/shim.js"(t,e){var r=Ky(),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=p({"node_modules/es5-ext/object/assign/index.js"(t,e){e.exports=Yy()()?Object.assign:Jy()}}),tv=p({"node_modules/es5-ext/object/normalize-options.js"(t,e){var r=Dy(),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=p({"node_modules/es5-ext/string/#/contains/is-implemented.js"(t,e){var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}}}),rv=p({"node_modules/es5-ext/string/#/contains/shim.js"(t,e){var r=String.prototype.indexOf;e.exports=function(t){return r.call(this,t,arguments[1])>-1}}}),nv=p({"node_modules/es5-ext/string/#/contains/index.js"(t,e){e.exports=ev()()?String.prototype.contains:rv()}}),iv=p({"node_modules/d/index.js"(t,e){var r=qy(),n=Zy(),i=Qy(),a=tv(),o=nv(),s=e.exports=function(t,e){var n,s,l,c,u;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=o.call(t,"c"),s=o.call(t,"e"),l=o.call(t,"w")):(n=l=!0,s=!1),u={value:e,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(t,e,s){var l,c,u,h;return"string"!=typeof t?(u=s,s=e,e=t,t=null):u=arguments[3],r(e)?n(e)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=e,e=s=void 0):e=void 0,r(t)?(l=o.call(t,"c"),c=o.call(t,"e")):(l=!0,c=!1),h={get:e,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),av=p({"node_modules/es5-ext/function/is-arguments.js"(t,e){var r=Object.prototype.toString,n=r.call(function(){return arguments}());e.exports=function(t){return r.call(t)===n}}}),ov=p({"node_modules/es5-ext/string/is-string.js"(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=p({"node_modules/ext/global-this/is-implemented.js"(t,e){e.exports=function(){return!("object"!=typeof globalThis||!globalThis)&&globalThis.Array===Array}}}),lv=p({"node_modules/ext/global-this/implementation.js"(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{return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),cv=p({"node_modules/ext/global-this/index.js"(t,e){e.exports=sv()()?globalThis:lv()}}),uv=p({"node_modules/es6-symbol/is-implemented.js"(t,e){var r=cv(),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{return!1}return!(!n[typeof e.iterator]||!n[typeof e.toPrimitive]||!n[typeof e.toStringTag])}}}),hv=p({"node_modules/es6-symbol/is-symbol.js"(t,e){e.exports=function(t){return!(!t||"symbol"!=typeof t&&(!t.constructor||"Symbol"!==t.constructor.name||"Symbol"!==t[t.constructor.toStringTag]))}}}),fv=p({"node_modules/es6-symbol/validate-symbol.js"(t,e){var r=hv();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}}}),pv=p({"node_modules/es6-symbol/lib/private/generate-name.js"(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=p({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(t,e){var r=iv(),n=cv().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=p({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(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=p({"node_modules/es6-symbol/polyfill.js"(t,e){var r,n,i,a=iv(),o=fv(),s=cv().Symbol,l=pv(),c=dv(),u=mv(),h=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof s)try{String(s()),i=!0}catch{}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))}))},c(r),u(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=p({"node_modules/es6-symbol/index.js"(t,e){e.exports=uv()()?cv().Symbol:gv()}}),vv=p({"node_modules/es5-ext/array/#/clear.js"(t,e){var r=Fy();e.exports=function(){return r(this).length=0,this}}}),xv=p({"node_modules/es5-ext/object/valid-callable.js"(t,e){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}}),_v=p({"node_modules/type/string/coerce.js"(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{return null}}}}),bv=p({"node_modules/type/lib/safe-to-string.js"(t,e){e.exports=function(t){try{return t.toString()}catch{try{return String(t)}catch{return null}}}}}),wv=p({"node_modules/type/lib/to-short-string.js"(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=p({"node_modules/type/lib/resolve-exception.js"(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))}}}),Av=p({"node_modules/type/value/ensure.js"(t,e){var r=Tv(),n=qy();e.exports=function(t){return n(t)?t:r(t,"Cannot use %v",arguments[1])}}}),kv=p({"node_modules/type/plain-function/ensure.js"(t,e){var r=Tv(),n=Zy();e.exports=function(t){return n(t)?t:r(t,"%v is not a plain function",arguments[1])}}}),Mv=p({"node_modules/es5-ext/array/from/is-implemented.js"(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=p({"node_modules/es5-ext/function/is-function.js"(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=p({"node_modules/es5-ext/math/sign/is-implemented.js"(t,e){e.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}}}),Cv=p({"node_modules/es5-ext/math/sign/shim.js"(t,e){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}}}),Iv=p({"node_modules/es5-ext/math/sign/index.js"(t,e){e.exports=Ev()()?Math.sign:Cv()}}),Lv=p({"node_modules/es5-ext/number/to-integer.js"(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=p({"node_modules/es5-ext/number/to-pos-integer.js"(t,e){var r=Lv(),n=Math.max;e.exports=function(t){return n(0,r(t))}}}),zv=p({"node_modules/es5-ext/array/from/shim.js"(t,e){var r=yv().iterator,n=av(),i=Sv(),a=Pv(),o=xv(),s=Fy(),l=Dy(),c=ov(),u=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],A=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(u(t)){for(g=new Array(y=t.length),d=0;d<y;++d)g[d]=t[d];return g}}g=[]}if(!u(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,A,_.value,d):_.value,e?(f.value=w,p(g,d,f)):g[d]=w,_=x.next(),++d;y=d}else if(c(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,A,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,A,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}}}),Dv=p({"node_modules/es5-ext/array/from/index.js"(t,e){e.exports=Mv()()?Array.from:zv()}}),Ov=p({"node_modules/es5-ext/object/copy.js"(t,e){var r=Dv(),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=p({"node_modules/es5-ext/object/_iterate.js"(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,c){var u,h=arguments[2],f=arguments[3];return l=Object(n(l)),r(c),u=o(l),f&&u.sort("function"==typeof f?i.call(f,l):void 0),"function"!=typeof t&&(t=u[t]),a.call(t,u,(function(t,r){return s.call(l,t)?a.call(c,h,l[t],t,l,r):e}))}}}}),Fv=p({"node_modules/es5-ext/object/for-each.js"(t,e){e.exports=Rv()("forEach")}}),Bv=p({"node_modules/es5-ext/object/map.js"(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}}}),jv=p({"node_modules/d/auto-bind.js"(t,e){var r,n=qy(),i=Av(),a=kv(),o=Ov(),s=tv(),l=Bv(),c=Function.prototype.bind,u=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=c.call(s,r.resolveContext?r.resolveContext(this):this),u(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)}))}}}),Nv=p({"node_modules/es6-iterator/index.js"(t,e){var r,n=vv(),i=Qy(),a=xv(),o=Fy(),s=iv(),l=jv(),c=yv(),u=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[c.toStringTag]||"Object")+"]"}))},l({_onAdd:s((function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void u(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}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),Uv=p({"node_modules/es6-iterator/array.js"(t,e){var r,n=Ny(),i=nv(),a=iv(),o=yv(),s=Nv(),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=p({"node_modules/es6-iterator/string.js"(t,e){var r,n=Ny(),i=iv(),a=yv(),o=Nv(),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=p({"node_modules/es6-iterator/is-iterable.js"(t,e){var r=av(),n=Dy(),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=p({"node_modules/es6-iterator/valid-iterable.js"(t,e){var r=qv();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not iterable");return t}}}),Gv=p({"node_modules/es6-iterator/get.js"(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)}}}),Wv=p({"node_modules/es6-iterator/for-of.js"(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 c,u,h,f,p,d,m,g,y=arguments[2];if(o(t)||r(t)?c="array":i(t)?c="string":t=a(t),n(e),h=function(){f=!0},"array"!==c)if("string"!==c)for(u=t.next();!u.done;){if(s.call(e,y,u.value,h),f)return;u=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}))}}}),Zv=p({"node_modules/es6-weak-map/is-native-implemented.js"(t,e){e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),Yv=p({"node_modules/es6-weak-map/polyfill.js"(t,e){var r,n=Dy(),i=Ny(),a=Uy(),o=Fy(),s=Vy(),l=iv(),c=Gv(),u=Wv(),h=yv().toStringTag,f=Zv(),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=c(e))),d(t,"__weakMapData__",l("c","$weakMap$"+s())),e&&u(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=p({"node_modules/es6-weak-map/index.js"(t,e){e.exports=Py()()?WeakMap:Yv()}}),$v=p({"node_modules/array-find-index/index.js"(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}}}),Kv=p({"node_modules/regl-line2d/index.js"(t,e){var r=Qd(),n=ey(),i=Ay(),a=Qg(),o=ny(),s=Iy(),l=Ly(),{float32:c,fract32:u}=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{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))),c=s(o,l);c=c.map((e=>e+i+(e+i<t[n]?0:a-t[n]))),e.push(...c),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=c(h);g.positionBuffer(y);var v=u(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=u(g.scale),g.translateFract=u(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}}}),Jv=p({"node_modules/regl-error2d/index.js"(t,e){var r=ey(),n=Qd(),i=My(),a=Qg(),o=Ay(),s=ny(),{float32:l,fract32:c}=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:u}),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:u.length}),o(_,{update:T,draw:b,destroy:A,regl:t,gl:y,canvas:y.canvas,groups:x}),_;function _(t){t?T(t):null===t&&A(),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,u=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),u+=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=c(e.scale),e.translateFract=c(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||u){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:c}=t;o&&(r.set(l,4*s),n.set(c,4*s),e.set(a,2*s))}));var h=l(e);f(h);var g=c(e,h);p(g),d(r),m(n)}}function A(){f.destroy(),p.destroy(),d.destroy(),m.destroy(),g.destroy()}};var u=[[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=p({"node_modules/unquote/index.js"(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=p({"node_modules/css-global-keywords/index.json"(){}}),ex=p({"node_modules/css-system-font-keywords/index.json"(){}}),rx=p({"node_modules/css-font-weight-keywords/index.json"(){}}),nx=p({"node_modules/css-font-style-keywords/index.json"(){}}),ix=p({"node_modules/css-font-stretch-keywords/index.json"(){}}),ax=p({"node_modules/parenthesis/index.js"(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=p({"node_modules/string-split-by/index.js"(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],c=a[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+e+c),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=p({"node_modules/css-font-size-keywords/index.json"(){}}),lx=p({"node_modules/css-font/lib/util.js"(t,e){var r=sx();e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==r.indexOf(t)}}}}),cx=p({"node_modules/css-font/parse.js"(t,e){var r=Qv(),n=tx(),i=ex(),a=rx(),o=nx(),s=ix(),l=ox(),c=lx().isSize;e.exports=h;var u=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(u[t])return u[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return u[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})),u[t]=h;if(-1===o.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===s.indexOf(e)){if(-1===a.indexOf(e)){if(c(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),u[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}}}),ux=p({"node_modules/css-font/stringify.js"(t,e){var r=Qg(),n=lx().isSize,i=p(tx()),a=p(ex()),o=p(rx()),s=p(nx()),l=p(ix()),c={normal:1,"small-caps":1},u={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="serif";function f(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function p(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&&f(t.system,a),t.system;if(f(t.style,s),f(t.variant,c),f(t.weight,o),f(t.stretch,l),null==t.size&&(t.size="1rem"),"number"==typeof t.size&&(t.size+="px"),!n)throw Error("Bad size value `"+t.size+"`");t.family||(t.family=h),Array.isArray(t.family)&&(t.family.length||(t.family=[h]),t.family=t.family.map((function(t){return u[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=p({"node_modules/css-font/index.js"(t,e){e.exports={parse:cx(),stringify:ux()}}}),fx=p({"node_modules/regl/dist/regl.unchecked.js"(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,n+"["+r+"]")}))):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=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function c(t){return"string"==typeof t?t.split():t}function u(t){return"string"==typeof t?document.querySelector(t):t}function h(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function f(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 p(){var t=h(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[f(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[f(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 d=p();d.zero=p();var m=3553,g=6408,y=5126,v=36160,x=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 _(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)||x(t.data))}var b=function(t){return Object.keys(t).map((function(e){return t[e]}))},w=function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},T=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||d.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:A(t,e[0],e[1],e[2],o,0);break;default:k(t,e,0,o,0)}return o};function A(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],c=0;c<r;++c)for(var u=l[c],h=0;h<n;++h)i[o++]=u[h]}function k(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],c=e[r+2],u=e[r+3];for(o=0;o<s;++o)A(t[o],l,c,u,n,i),i+=a}else for(o=0;o<s;++o)k(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,I=w,L=5121,P=5126,z=[];function D(t){return 0|M[Object.prototype.toString.call(t)]}function O(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 c=0;c<n;++c)t[s++]=e[i*l+a*c+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,j=5123,N=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function H(t){for(var e=d.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)||x(t)}var W=3553,Z=34067,Y=34069,X=6408,$=6406,K=6407,J=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ct=5121,ut=5123,ht=5125,ft=5126,pt=33071,dt=9728,mt=9984,gt=9987,yt=4352,vt=33984,xt=[mt,9986,9985,gt],_t=[0,J,Q,K,X],bt={};function wt(t){return"[object "+t+"]"}bt[J]=bt[$]=bt[et]=1,bt[rt]=bt[Q]=2,bt[K]=bt[nt]=3,bt[X]=bt[it]=4;var Tt=wt("HTMLCanvasElement"),At=wt("OffscreenCanvas"),kt=wt("CanvasRenderingContext2D"),Mt=wt("ImageBitmap"),St=wt("HTMLImageElement"),Et=wt("HTMLVideoElement"),Ct=Object.keys(M).concat([Tt,At,kt,Mt,St,Et]),It=[];It[ct]=1,It[ft]=4,It[at]=2,It[ut]=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 Dt(t){return Object.prototype.toString.call(t)}function Ot(t){return Dt(t)===Tt}function Rt(t){return Dt(t)===At}function Ft(t){if(!t)return!1;var e=Dt(t);return Ct.indexOf(e)>=0||Pt(t)||zt(t)||_(t)}function Bt(t){return 0|M[Object.prototype.toString.call(t)]}function jt(t,e){return d.allocType(t.type===at?ft:t.type,e)}function Nt(t,e){t.type===at?(t.data=H(e),d.freeType(e)):t.data=e}function Ut(t,e,r,n,i,a){var o;if(o=typeof Lt[t]<"u"?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}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 Vt=36161,qt=32854,Ht=[];function Gt(t,e,r){return Ht[t]*e*r}Ht[qt]=2,Ht[32855]=2,Ht[36194]=2,Ht[33189]=2,Ht[36168]=1,Ht[34041]=4,Ht[35907]=4,Ht[34836]=16,Ht[34842]=8,Ht[34843]=6;var Wt=36160,Zt=36161,Yt=3553,Xt=[];Xt[6408]=4,Xt[6407]=3;var $t=[];$t[5121]=1,$t[5126]=4,$t[36193]=2;var Kt=34963;function Jt(){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 Qt(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,c,u,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,u=0;u<t.length;u+=16){for(r=d[0],n=d[1],i=d[2],a=d[3],o=d[4],s=d[5],l=d[6],c=d[7],h=0;h<64;h++)m[h]=h<16?t[h+u]:ce(ce(ce(se(m[h-2]),m[h-7]),oe(m[h-15])),m[h-16]),f=ce(ce(ce(ce(c,ae(o)),re(o,s,l)),le[h]),m[h]),p=ce(ie(r),ne(r,n,i)),c=l,l=s,s=o,o=ce(a,f),a=i,i=n,n=r,r=ce(f,p);d[0]=ce(r,d[0]),d[1]=ce(n,d[1]),d[2]=ce(i,d[2]),d[3]=ce(a,d[3]),d[4]=ce(o,d[4]),d[5]=ce(s,d[5]),d[6]=ce(l,d[6]),d[7]=ce(c,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 te(t,e){return t>>>e|t<<32-e}function ee(t,e){return t>>>e}function re(t,e,r){return t&e^~t&r}function ne(t,e,r){return t&e^t&r^e&r}function ie(t){return te(t,2)^te(t,13)^te(t,22)}function ae(t){return te(t,6)^te(t,11)^te(t,25)}function oe(t){return te(t,7)^te(t,18)^ee(t,3)}function se(t){return te(t,17)^te(t,19)^ee(t,10)}var le=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 ce(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function ue(t){return Array.prototype.slice.call(t)}function he(t){return ue(t).join("")}var fe="xyzw".split(""),pe="dither",de="blend.enable",me="blend.color",ge="blend.equation",ye="blend.func",ve="depth.enable",xe="depth.func",_e="depth.range",be="depth.mask",we="colorMask",Te="cull.enable",Ae="cull.face",ke="frontFace",Me="lineWidth",Se="polygonOffset.enable",Ee="polygonOffset.offset",Ce="sample.alpha",Ie="sample.enable",Le="sample.coverage",Pe="stencil.enable",ze="stencil.mask",De="stencil.func",Oe="stencil.opFront",Re="stencil.opBack",Fe="scissor.enable",Be="scissor.box",je="viewport",Ne="profile",Ue="framebuffer",Ve="vert",qe="frag",He="elements",Ge="primitive",We="count",Ze="offset",Ye="instances",Xe="vao",$e="Width",Ke="Height",Je=Ue+$e,Qe=Ue+Ke,tr=je+$e,er=je+Ke,rr="drawingBuffer",nr=rr+$e,ir=rr+Ke,ar=[ye,ge,De,Oe,Re,Le,je,Be,Ee],or=34962,sr=34963,lr=35664,cr=35665,ur=35666,hr=35667,fr=35668,pr=35669,dr=35671,mr=35672,gr=35673,yr=35674,vr=35675,xr=35676,_r=35678,br=35680,wr=1028,Tr=1029,Ar=2305,kr=7680,Mr={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},Sr={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},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Cr={cw:2304,ccw:Ar};function Ir(t){return Array.isArray(t)||x(t)||_(t)}function Lr(t){return t.sort((function(t,e){return t===je?-1:e===je?1:t<e?-1:1}))}function Pr(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function zr(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Dr(t){return new Pr(!1,!1,!1,t)}function Or(t,e){var r=t.type;if(0===r){var n=t.data.length;return new Pr(!0,n>=1,n>=2,e)}if(4===r){var i=t.data;return new Pr(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new Pr(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<t.data.length;++l){var c=t.data[l];if(1===c.type)s=!0;else if(2===c.type)o=!0;else if(3===c.type)a=!0;else if(0===c.type){a=!0;var u=c.data;u>=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Pr(a,o,s,e)}return new Pr(3===r,2===r,1===r,e)}var Rr=new Pr(!1,!1,!1,(function(){}));function Fr(e,r,n,i,a,s,l,c,u,f,p,d,m,g,y,v){var x=f.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,A={dirty:!0,profile:v.profile},k={},M=[],E={},C={};function I(t){return t.replace(".","_")}function L(t,e,r){var n=I(t);M.push(t),k[n]=A[n]=!!r,E[n]=e}function P(t,e,r){var n=I(t);M.push(t),Array.isArray(r)?(A[n]=r.slice(),k[n]=r.slice()):A[n]=k[n]=r,C[n]=e}function z(t){return!!isNaN(t)}L(pe,3024),L(de,3042),P(me,"blendColor",[0,0,0,0]),P(ge,"blendEquationSeparate",[32774,32774]),P(ye,"blendFuncSeparate",[1,0,1,0]),L(ve,2929,!0),P(xe,"depthFunc",513),P(_e,"depthRange",[0,1]),P(be,"depthMask",!0),P(we,we,[!0,!0,!0,!0]),L(Te,2884),P(Ae,"cullFace",Tr),P(ke,ke,Ar),P(Me,Me,1),L(Se,32823),P(Ee,"polygonOffset",[0,0]),L(Ce,32926),L(Ie,32928),P(Le,"sampleCoverage",[1,!1]),L(Pe,2960),P(ze,"stencilMask",-1),P(De,"stencilFunc",[519,0,-1]),P(Oe,"stencilOpSeparate",[wr,kr,kr,kr]),P(Re,"stencilOpSeparate",[Tr,kr,kr,kr]),L(Fe,3089),P(Be,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(je,je,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var D={gl:e,context:m,strings:r,next:k,current:A,draw:d,elements:s,buffer:a,shader:p,attributes:f.state,vao:f,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Ir},O={primTypes:F,compareFuncs:Sr,blendFuncs:Mr,blendEquations:_,stencilOps:Er,glTypes:S,orientationType:Cr};w&&(O.backBuffer=[Tr],O.drawBuffer=h(i.maxDrawbuffers,(function(t){return 0===t?[0]:h(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,ue(arguments))}),{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,ue(arguments)),e.push(";")),t},toString:function(){return he([r.length>0?"var "+r.join(",")+";":"",he(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,ue(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 c=s(),u={};return{global:c,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 u[e]=t(o,{arg:i,toString:function(){return he(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var e=he(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return t(r,{then:function(){return r.apply(r,ue(arguments)),this},else:function(){return n.apply(n,ue(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),he(["if(",e,"){",i(),"}",t])}})},compile:function(){var t=['"use strict";',c,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e,n=he(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(e=Qt(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(D),o=e.shared={props:"a0"};Object.keys(D).forEach((function(t){o[t]=i.def(a,".",t)}));var s=e.next={},l=e.current={};Object.keys(C).forEach((function(t){Array.isArray(A[t])&&(s[t]=i.def(o.next,".",t),l[t]=i.def(o.current,".",t))}));var c=e.constants={};Object.keys(O).forEach((function(t){c[t]=i.def(JSON.stringify(O[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 u={};return e.scopeAttrib=function(t){var e=r.id(t);if(e in u)return u[e];var i=f.scope[e];return i||(i=f.scope[e]=new x),u[e]=n(i)},e}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 N(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,c=t.constants,u=c.drawBuffer,h=c.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(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",36160,",null);"),w&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function U(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");M.forEach((function(e){var n,u,f=I(e);if(!(f in r.state))if(f in o){n=o[f],u=a[f];var p=h(A[f].length,(function(t){return c.def(n,"[",t,"]")}));c(t.cond(p.map((function(t,e){return t+"!=="+u+"["+e+"]"})).join("||")).then(i,".",C[f],"(",p,");",p.map((function(t,e){return u+"["+e+"]="+t})).join(";"),";"))}else{n=c.def(l,".",f);var d=t.cond(n,"!==",s,".",f);c(d),f in E?d(t.cond(n).then(i,".enable(",E[f],");").else(i,".disable(",E[f],");"),s,".",f,"=",n,";"):d(i,".",C[f],"(",n,");",s,".",f,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function V(t,e,r,n){var i,a=t.shared,o=t.current,s=a.current,l=a.gl;Lr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(t,e);if(E[a]){var h=E[a];zr(c)?(i=t.link(u,{stable:!0}),e(t.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",i,";")):(e(t.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",u,";"))}else if(G(u)){var f=o[a];e(l,".",C[a],"(",u,");",u.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";")}else zr(c)?(i=t.link(u,{stable:!0}),e(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):e(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function q(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function H(t,e,r,n,i){var a,o,s,l=t.shared,c=t.stats,u=l.current,h=l.timer,f=r.profile;function p(){return typeof performance>"u"?"Date.now()":"performance.now()"}function d(t){t(a=e.def(),"=",p(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function m(t){t(c,".cpuTime+=",p(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function y(t){var r=e.def(u,".profile");e(u,".profile=",t,";"),e.exit(u,".profile=",r,";")}if(f){if(zr(f))return void(f.enable?(d(e),m(e.exit),y("true")):y("false"));y(s=f.append(t,e))}else s=e.def(u,".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(Rr))return;var c=t.scopeAttrib(s);o={},Object.keys(new x).forEach((function(t){o[t]=e.def(c,".",t)}))}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),c=i.state,u=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(",or,",",u,".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 c=i.divisor;e("if(",l,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function d(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",fe.map((function(t,e){return l+"."+t+"!=="+h[e]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",fe.map((function(t,e){return l+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?p():2===c?d():(e("if(",c,"===",1,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case lr:case hr:case dr:return 2;case cr:case fr:case mr:return 3;case ur:case pr:case gr:return 4;default:return 1}}(n.info.type),o)}))}function Z(t,e,n,i,a,o){for(var s,l=t.shared,c=l.gl,u=0;u<i.length;++u){var f,p=i[u],d=p.name,m=p.info.type,g=n.uniforms[d],y=t.link(p)+".location";if(g){if(!a(g))continue;if(zr(g)){var v=g.value;if(m===_r||m===br){var x=t.link(v._texture||v.color[0]._texture);e(c,".uniform1i(",y,",",x+".bind());"),e.exit(x,".unbind();")}else if(m===yr||m===vr||m===xr){var _=t.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;m===vr?b=3:m===xr&&(b=4),e(c,".uniformMatrix",b,"fv(",y,",false,",_,");")}else{switch(m){case 5126:s="1f";break;case lr:s="2f";break;case cr:s="3f";break;case ur:s="4f";break;case 35670:case 5124:s="1i";break;case dr:case hr:s="2i";break;case mr:case fr:s="3i";break;case gr:case pr:s="4i"}e(c,".uniform",s,"(",y,",",G(v)?Array.prototype.slice.call(v):v,");")}continue}f=g.append(t,e)}else{if(!a(Rr))continue;f=e.def(l.uniforms,"[",r.id(d),"]")}m===_r?e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}"):m===br&&e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}");var w=1;switch(m){case _r:case br:var T=e.def(f,"._texture");e(c,".uniform1i(",y,",",T,".bind());"),e.exit(T,".unbind();");continue;case 5124:case 35670:s="1i";break;case hr:case dr:s="2i",w=2;break;case fr:case mr:s="3i",w=3;break;case pr:case gr:s="4i",w=4;break;case 5126:s="1f";break;case lr:s="2f",w=2;break;case cr:s="3f",w=3;break;case ur:s="4f",w=4;break;case yr:s="Matrix2fv";break;case vr:s="Matrix3fv";break;case xr:s="Matrix4fv"}if("M"===s.charAt(0)){e(c,".uniform",s,"(",y,",");var A=Math.pow(m-yr+2,2),k=t.global.def("new Float32Array(",A,")");Array.isArray(f)?e("false,(",h(A,(function(t){return k+"["+t+"]="+f[t]})),",",k,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",h(A,(function(t){return k+"["+t+"]="+f+"["+t+"]"})),",",k,")"),e(");")}else if(w>1){for(var M=[],S=[],E=0;E<w;++E)Array.isArray(f)?S.push(f[E]):S.push(e.def(f+"["+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(c,".uniform",s,"(",y,",",S.join(","),");"),o&&e("}")}else{if(o){var C=e.def();e("if(!",t.batchId,"||",C,"!==",f,"){",C,"=",f,";")}e(c,".uniform",s,"(",y,",",f,");"),o&&e("}")}}}function Y(t,e,r,n){var i,a,o,s=t.shared,l=s.gl,c=s.draw,u=n.draw,h=(a=u.elements,o=e,a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),u.elementsActive&&o("if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);")):(i=o.def(),o(i,"=",c,".",He,";","if(",i,"){",l,".bindBuffer(",sr,",",i,".buffer.buffer);}","else if(",s.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+s.vao,".currentVAO.elements);",T?"":"if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);","}")),i);function f(i){var a=u[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(c,".",i)}var p,d,m=f(Ge),g=f(Ze),y=function(){var i,a=u.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(c,".",We),i}();if("number"==typeof y){if(0===y)return}else r("if(",y,"){"),r.exit("}");b&&(p=f(Ye),d=t.instancing);var v=h+".type",x=u.elements&&zr(u.elements)&&!u.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 X(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 $(t,e,r,n){q(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}))),Z(t,e,r,n.uniforms,(function(){return!0}),!1),Y(t,e,e,r)}function K(t,e,r,n){function i(){return!0}t.batchId="a1",q(t,e),W(t,e,r,n.attributes,i),Z(t,e,r,n.uniforms,i,!1),Y(t,e,e,r)}function J(t,e,r,n){q(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 c(t){return t.contextDep&&i||t.propDep}function u(t){return!c(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&&N(t,l,r.framebuffer),V(t,l,r.state,c),r.profile&&c(r.profile)&&H(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(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,u),W(t,l,r,n.attributes,c)),Z(t,s,r,n.uniforms,u,!1),Z(t,l,r,n.uniforms,c,!0),Y(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 X(K,0,r,t,2)})),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function Q(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,c=!1,u=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=Or(r,null);s=s||a.thisDep,c=c||a.propDep,l=l||a.contextDep}else{switch(i(u,".",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:c,ref:u,append:function(t,e){a.forEach((function(r){var i=n[r];if(o.isDynamic(i)){var a=t.invoke(e,i);e(u,".",r,"=",a,";")}}))}}),delete e.static[r]}}return{next:k,current:A,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,c=s.next,u=s.current;a(u,".dirty=false;"),N(t,e),N(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 f=r.def(s.attributes),p=r.def(0),d=t.cond(p,".buffer");d.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",or,",",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,"=",f,"[i];",d,"}"),b&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",f,"[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(c,".",n),s=t.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",u,".",n,"=",o,";"),r(s),e("if(",o,"!==",u,".",n,"){",s,"}")})),Object.keys(C).forEach((function(n){var i,o,s=C[n],f=A[n],p=t.block();if(p(l,".",s,"("),G(f)){var d=f.length;i=t.global.def(c,".",n),o=t.global.def(u,".",n),p(h(d,(function(t){return i+"["+t+"]"})),");",h(d,(function(t){return o+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",h(d,(function(t){return i+"["+t+"]!=="+o+"["+t+"]"})).join("||"),"){",p,"}")}else i=a.def(c,".",n),o=a.def(u,".",n),p(i,");",u,".",n,"=",i,";"),e("if(",i,"!==",o,"){",p,"}");r(p)})),t.compile()}(),compile:function(e,i,o,l,u){var d=B();d.stats=d.link(u),Object.keys(i.static).forEach((function(t){Q(d,i,t)})),ar.forEach((function(t){Q(d,e,t)}));var m=function(t,e,i,o){t.static,t.dynamic;var l=function(t,e){var r=t.static;if("string"==typeof r[qe]&&"string"==typeof r[Ve]){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),u=function(t){var e=t.static,r=t.dynamic;if(Ue in e){var n=e[Ue];return n?(n=c.getFramebuffer(n),Dr((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,"."+Je,r+".width"),e.set(a,"."+Qe,r+".height"),r}))):Dr((function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Je,n+"."+nr),e.set(n,"."+Qe,n+"."+ir),"null"}))}if(Ue in r){var i=r[Ue];return Or(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,"."+Je,o+"?"+o+".width:"+s+"."+nr),e.set(s,"."+Qe,o+"?"+o+".height:"+s+"."+ir),o}))}return null}(t),d=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,c=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Pr(!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,".",Je,"-",l));var s=a;return"height"in o||(s=e.def(r,".",Qe,"-",c)),[l,c,n,s]}))}if(t in n){var u=n[t],h=Or(u,(function(t,e){var r=t.invoke(e,u),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,".",Je,"-",i,")"),e.def('"height" in ',r,"?",r,".height|0:","(",n,".",Qe,"-",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 Pr(e.thisDep,e.contextDep,e.propDep,(function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Je),e.def(r,".",Qe)]})):null}var a=i(je);if(a){var o=a;a=new Pr(a.thisDep,a.contextDep,a.propDep,(function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,"."+tr,r[2]),e.set(n,"."+er,r[3]),r}))}return{viewport:a,scissor_box:i(Be)}}(t,u),m=function(t){var e=t.static,r=t.dynamic,n={},i=!1,a=function(){if(Xe in e){var t=e[Xe];return null!==t&&null===f.getVAO(t)&&(t=f.createVAO(t)),i=!0,n.vao=t,Dr((function(e){var r=f.getVAO(t);return r?e.link(r):"null"}))}if(Xe in r){i=!0;var a=r[Xe];return Or(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(He in e){var t=e[He];if(n.elements=t,Ir(t)){var l=n.elements=s.create(t,!0);t=s.getElements(l),o=!0}else t&&(t=s.getElements(t),o=!0);var c=Dr((function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null}));return c.value=t,c}if(He in r){o=!0;var u=r[He];return Or(u,(function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,u),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 Pr(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 c(t,s){if(t in e){var l=0|e[t];return s?n.offset=l:n.instances=l,Dr((function(t,e){return s&&(t.OFFSET=l),l}))}if(t in r){var c=r[t];return Or(c,(function(t,e){var r=t.invoke(e,c);return s&&(t.OFFSET=r),r}))}if(s){if(o)return Dr((function(t,e){return t.OFFSET=0,0}));if(i)return new Pr(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 Pr(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 u=c(Ze,!0),h=function(){if(Ge in e){var t=e[Ge];return n.primitive=t,Dr((function(e,r){return F[t]}))}if(Ge in r){var s=r[Ge];return Or(s,(function(t,e){var r=t.constants.primTypes,n=t.invoke(e,s);return e.def(r,"[",n,"]")}))}return o?zr(l)?l.value?Dr((function(t,e){return e.def(t.ELEMENTS,".primType")})):Dr((function(){return 4})):new Pr(l.thisDep,l.contextDep,l.propDep,(function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)})):i?new Pr(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(We in e){var t=0|e[We];return n.count=t,Dr((function(){return t}))}if(We in r){var s=r[We];return Or(s,(function(t,e){return t.invoke(e,s)}))}return o?zr(l)?l?u?new Pr(u.thisDep,u.contextDep,u.propDep,(function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)})):Dr((function(t,e){return e.def(t.ELEMENTS,".vertCount")})):Dr((function(){return-1})):new Pr(l.thisDep||u.thisDep,l.contextDep||u.contextDep,l.propDep||u.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 Pr(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao,".currentVAO?",t.shared.vao,".currentVAO.count:-1")})):null}(),d=c(Ye,!1);return{elements:l,primitive:h,count:p,instances:d,offset:u,vao:a,vaoActive:i,elementsActive:o,static:n}}(t),g=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]=Dr((function(){return s}))}else if(t in r){var l=r[t];n[i]=Or(l,(function(t,e){return o(t,e,t.invoke(e,l))}))}}switch(t){case Te:case de:case pe:case Pe:case ve:case Fe:case Se:case Ce:case Ie:case be:return a((function(t){return t}),(function(t,e,r){return r}));case xe:return a((function(t){return Sr[t]}),(function(t,e,r){var n=t.constants.compareFuncs;return e.def(n,"[",r,"]")}));case _e:return a((function(t){return t}),(function(t,e,r){return[e.def("+",r,"[0]"),e.def("+",r,"[1]")]}));case ye: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[Mr[e],Mr[n],Mr[r],Mr[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 ge: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 me:return a((function(t){return h(4,(function(e){return+t[e]}))}),(function(t,e,r){return h(4,(function(t){return e.def("+",r,"[",t,"]")}))}));case ze:return a((function(t){return 0|t}),(function(t,e,r){return e.def(r,"|0")}));case De:return a((function(t){var e=t.cmp||"keep",r=t.ref||0,n="mask"in t?t.mask:-1;return[Sr[e],r,n]}),(function(t,e,r){var n=t.constants.compareFuncs;return[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",kr),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case Oe:case Re:return a((function(e){var r=e.fail||"keep",n=e.zfail||"keep",i=e.zpass||"keep";return[t===Re?Tr:wr,Er[r],Er[n],Er[i]]}),(function(e,r,n){var i=e.constants.stencilOps;function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",kr)}return[t===Re?Tr:wr,a("fail"),a("zfail"),a("zpass")]}));case Ee: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 Ae:return a((function(t){var e=0;return"front"===t?e=wr:"back"===t&&(e=Tr),e}),(function(t,e,r){return e.def(r,'==="front"?',wr,":",Tr)}));case Me:return a((function(t){return t}),(function(t,e,r){return r}));case ke:return a((function(t){return Cr[t]}),(function(t,e,r){return e.def(r+'==="cw"?2304:'+Ar)}));case we:return a((function(t){return t.map((function(t){return!!t}))}),(function(t,e,r){return h(4,(function(t){return"!!"+r+"["+t+"]"}))}));case Le: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),y=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=Dr((function(){return e}));return n.id=e,n}if(t in a){var o=a[t];return Or(o,(function(t,e){var r=t.invoke(e,o);return e.def(t.shared.strings,".id(",r,")")}))}return null}var s,l=o(qe),c=o(Ve),u=null;return zr(l)&&zr(c)?(u=p.program(c.id,l.id,null,n),s=Dr((function(t,e){return t.link(u)}))):s=new Pr(l&&l.thisDep||c&&c.thisDep,l&&l.contextDep||c&&c.contextDep,l&&l.propDep||c&&c.propDep,(function(t,e){var r,n=t.shared.shader;r=l?l.append(t,e):e.def(n,".",qe);var i=n+".program("+(c?c.append(t,e):e.def(n,".",Ve))+","+r;return e.def(i+")")})),{frag:l,vert:c,progVar:s,program:u}}(t,0,l);function v(t){var e=d[t];e&&(g[t]=e)}v(je),v(I(Be));var b=Object.keys(g).length>0,w={framebuffer:u,draw:m,shader:y,state:g,dirty:b,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(w.profile=function(t){var e,r=t.static,n=t.dynamic;if(Ne in r){var i=!!r[Ne];(e=Dr((function(t,e){return i}))).enable=i}else if(Ne in n){var a=n[Ne];e=Or(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),w.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=Dr((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Dr((function(t){return t.link(i)})):("framebuffer"===a||"framebufferCube"===a)&&(r=Dr((function(t){return t.link(i.color[0])})))}else G(i)&&(r=Dr((function(t){return t.global.def("[",h(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]=Or(e,(function(t,r){return t.invoke(r,e)}))})),n}(i),w.drawVAO=w.scopeVAO=m.vao,!w.drawVAO&&y.program&&!l&&n.angle_instanced_arrays&&m.static.elements){var T=!0,A=y.program.attributes.map((function(t){var r=e.static[t];return T=T&&!!r,r}));if(T&&A.length>0){var k=f.getVAO(f.createVAO({attributes:A,elements:m.static.elements}));w.drawVAO=new Pr(null,null,null,(function(t,e){return t.link(k)})),w.useVAO=!0}}return l?w.useVAO=!0:w.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(Ir(n))s.state=1,s.buffer=a.getBuffer(a.create(n,or,!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 c=n.constant;s.buffer="null",s.state=2,"number"==typeof c?s.x=c:fe.forEach((function(t,e){e<c.length&&(s[t]=c[e])}))}else{l=Ir(n.buffer)?a.getBuffer(a.create(n.buffer,or,!1,!0)):a.getBuffer(n.buffer);var u=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=u,s.stride=h,s.divisor=m}}i[t]=Dr((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]=Or(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)},c=new x;c.state=1,Object.keys(c).forEach((function(t){l[t]=r.def(""+c[t])}));var u=l.buffer,h=l.type;function f(t){r(l[t],"=",n,".",t,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",u,"=",s,".createStream(",or,",",n,");",h,"=",u,".dtype;","}else{",u,"=",s,".getBuffer(",n,");","if(",u,"){",h,"=",u,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[fe[0]],"=",n,".constant;",fe.slice(1).map((function(t){return l[t]})).join("="),"=0;","}else{",fe.map((function(t,e){return l[t]+"="+n+".constant.length>"+e+"?"+n+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",or,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(e),w.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=Dr((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]=Or(e,(function(t,r){return t.invoke(r,e)}))})),n}(o),w}(e,i,o,l);return m.shader.program&&(m.shader.program.attributes.sort((function(t,e){return t.name<e.name?-1:1})),m.shader.program.uniforms.sort((function(t,e){return t.name<e.name?-1:1}))),function(t,e){var r=t.proc("draw",1);q(t,r),j(t,r,e.context),N(t,r,e.framebuffer),U(t,r,e),V(t,r,e.state),H(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)$(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 X($,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);")}(d,m),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),Lr(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}))})):zr(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),H(t,n,e,!0,!0),[He,Ze,We,Ye,Ge].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(Ve),s(qe),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(d,m),function(t,e){var r=t.proc("batch",2);t.batchId="0",q(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||N(t,r,a)):N(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),U(t,r,e),V(t,r,e.state,(function(t){return!s(t)})),(!e.profile||!s(e.profile))&&H(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)J(t,r,e,null);else{var c=l.append(t,r);if(r(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)J(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var u=t.global.def("{}"),h=r.def(c,".id"),f=r.def(u,"[",h,"]");r(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",t.link((function(t){return X(J,0,e,t,2)})),"(",c,");",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);")}(d,m),t(d.compile(),{destroy:function(){m.shader.program.destroy()}})}}}var Br="webglcontextlost",jr="webglcontextrestored";function Nr(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}return function(e){var r=function(e){var r,n,i,a,o=e||{},s={},l=[],h=[],f=typeof window>"u"?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=u(o.canvas):"container"in o&&(n=u(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=c(o.extensions)),"optionalExtensions"in o&&(h=c(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{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)}(e);if(!r)return null;var n=r.gl,i=n.getContextAttributes(),a=(n.isContextLost(),function(t,e){var r={};function n(e){var n,i=e.toLowerCase();try{n=r[i]=t.getExtension(i)}catch{}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 h=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]}}}(),f={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},p=r.cachedCode||{},A=a.extensions,k=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 c(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 u=[],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),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,r,a=i.length;if(0!==a){h.length=Math.max(h.length,a+1),u.length=Math.max(u.length,a+1),u[0]=0,h[0]=0;var o=0;for(t=0,r=0;r<i.length;++r){var c=i[r];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(o+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),n(c)):i[t++]=c,u[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+=u[d]-u[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}}}(0,A),M=l(),V=n.drawingBufferWidth,q=n.drawingBufferHeight,wt={tick:0,time:0,viewportWidth:V,viewportHeight:q,framebufferWidth:V,framebufferHeight:q,drawingBufferWidth:V,drawingBufferHeight:q,pixelRatio:r.pixelRatio},Tt={elements:null,primitive:4,count:-1,offset:0,instances:-1},At=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(m,o),t.texImage2D(m,0,g,1,1,0,g,y,null);var s=t.createFramebuffer();if(t.bindFramebuffer(v,s),t.framebufferTexture2D(v,36064,m,o,0),t.bindTexture(m,null),36053!==t.checkFramebufferStatus(v))a=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var l=d.allocType(y,4);t.readPixels(0,0,1,1,g,y,l),t.getError()?a=!1:(t.deleteFramebuffer(s),t.deleteTexture(o),a=1===l[0]),d.freeType(l)}}var c=!0;if(!(typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)))){var u=t.createTexture(),h=d.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,u),t.texImage2D(34069,0,g,3,3,0,g,5121,h),d.freeType(h),t.bindTexture(34067,null),t.deleteTexture(u),c=!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:c}}(n,A),Ct=function(t,e,r){var n=0,i={};function a(e){this.id=n++,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})}a.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},a.prototype.destroy=function(){c(this)};var o=[];function s(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function l(t,e,r,n,i,a){var o,l;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 c=1,u=1;u<o.length;++u)c*=o[u];t.dimension=c,s(t,l=C(e,o,t.dtype),r),a?t.persistentData=l:d.freeType(l)}else if("number"==typeof e[0]){t.dimension=i;var h=d.allocType(t.dtype,e.length);O(h,e),s(t,h,r),a?t.persistentData=h:d.freeType(h)}else x(e[0])&&(t.dimension=e[0].length,t.dtype=n||D(e[0])||P,s(t,l=C(e,[e.length,e[0].length],t.dtype),r),a?t.persistentData=l:d.freeType(l))}else if(x(e))t.dtype=n||D(e),t.dimension=i,s(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(_(e)){o=e.shape;var f=e.stride,p=e.offset,m=0,g=0,y=0,v=0;1===o.length?(m=o[0],g=1,y=f[0],v=0):2===o.length&&(m=o[0],g=o[1],y=f[0],v=f[1]),t.dtype=n||D(e.data)||P,t.dimension=g;var b=d.allocType(t.dtype,m*g);R(b,e.data,m,g,y,v,p),s(t,b,r),a?t.persistentData=b:d.freeType(b)}else e instanceof ArrayBuffer&&(t.dtype=L,t.dimension=i,s(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e))))}function c(r){var n;e.bufferCount--,n=r,Lt.destroyBuffer(n);var a=r.buffer;t.deleteBuffer(a),r.buffer=null,delete i[r.id]}return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(i).forEach((function(e){t+=i[e].stats.size})),t}),{create:function(n,o,s,u){e.bufferCount++;var h=new a(o);function f(e){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(e)||x(e)||_(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?l(h,i,n,o,s,u):(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 i[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(),x(t)||t instanceof ArrayBuffer)p(t,n);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var i=d.allocType(h.dtype,t.length);O(i,t),p(i,n),d.freeType(i)}else if(Array.isArray(t[0])||x(t[0])){r=I(t);var a=C(t,r,h.dtype);p(a,n),d.freeType(a)}}else if(_(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var m=Array.isArray(t.data)?h.dtype:D(t.data),g=d.allocType(m,s*l);R(g,t.data,s,l,c,u,t.offset),p(g,n),d.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){c(h)},f},createStream:function(t,e){var r=o.pop();return r||(r=new a(t)),r.bind(),l(r,e,35040,0,1,!1),r},destroyStream:function(t){o.push(t)},clear:function(){b(i).forEach(c),o.forEach(c)},getBuffer:function(t){return t&&t._buffer instanceof a?t._buffer:null},restore:function(){b(i).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:l}}(n,f,r),It=function(t,e,r,n){var i={},a=0,o={uint8:B,uint16:j};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=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;!c&&(!x(i)||_(i)&&!x(i.data))&&(h=e.oes_element_index_uint?N:j),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=u||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case B:case 5120:u=B;break;case j:case 5122:u=j;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var f=s;f<0&&(f=n.buffer.byteLength,u===j?f>>=1:u===N&&(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 u(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,u=0,h=0;Array.isArray(t)||x(t)||_(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?u=0|t.length:(u=s,h===j||5122===h?u*=2:(h===N||5124===h)&&(u*=4))),c(a,e,r,n,s,u,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(){u(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),c(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(){b(i).forEach(u)}}}(n,A,Ct,f),Lt=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c<s;++c)l[c]=new Jt;var u=0,h={},f={Record:Jt,scope:{},state:l,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&b(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 c=0;c<n.length;++c){var u,h=n[c],f=l[c]=new Jt,p=h.data||h;Array.isArray(p)||x(p)||_(p)?(e.buffers[c]&&(u=e.buffers[c],x(p)&&u._buffer.byteLength>=p.byteLength?u.subdata(p):(u.destroy(),e.buffers[c]=null)),e.buffers[c]||(u=e.buffers[c]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(u),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[c]=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(){b(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=++u,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,A,At,f,Ct,It,Tt),Ht=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 c(t,n,i){var s=35632===t?a:o,l=s[n];if(!l){var c=r.str(n);l=e.createShader(t),e.shaderSource(l,c),e.compileShader(l),s[n]=l}return l}var u={},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,u,h=c(35632,t.fragId),f=c(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(u=e.getActiveUniform(p,o))if(u.size>1)for(var y=0;y<u.size;++y){var v=u.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),e.getUniformLocation(p,v),u))}else l(g,new s(u.name,r.id(u.name),e.getUniformLocation(p,u.name),u));var x=e.getProgramParameter(p,35721);i.profile&&(t.stats.attributesCount=x);var _=t.attributes;for(o=0;o<x;++o)(u=e.getActiveAttrib(p,o))&&l(_,new s(u.name,r.id(u.name),e.getAttribLocation(p,u.name),u))}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);b(a).forEach(t),a={},b(o).forEach(t),o={},h.forEach((function(t){e.deleteProgram(t.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var f=c[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(c[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--}c[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[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:c,frag:-1,vert:-1}}(n,h,f,r),Qt=function(e,r,n,i,a,o,s){var l={"don't care":yt,"dont care":yt,nice:4354,fast:4353},c={repeat:10497,clamp:pt,mirror:33648},u={nearest:dt,linear:9729},h=t({mipmap:gt,"nearest mipmap nearest":mt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":gt},u),f={none:0,browser:37444},p={uint8:ct,rgba4:32819,rgb565:33635,"rgb5 a1":32820},m={alpha:$,luminance:J,"luminance alpha":Q,rgb:K,rgba:X,rgba4:32854,"rgb5 a1":tt,rgb565:36194},g={};r.ext_srgb&&(m.srgb=nt,m.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(m,{depth:et,"depth stencil":rt}),t(p,{uint16:ut,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&&(m[t]=e)}));var v=Object.keys(m);n.textureFormats=v;var A=[];Object.keys(m).forEach((function(t){var e=m[t];A[e]=t}));var k=[];Object.keys(p).forEach((function(t){var e=p[t];k[e]=t}));var M=[];Object.keys(u).forEach((function(t){M[u[t]]=t}));var S=[];Object.keys(h).forEach((function(t){var e=h[t];S[e]=t}));var E=[];Object.keys(c).forEach((function(t){E[c[t]]=t}));var C=v.reduce((function(t,e){var n=m[e];return n===J||n===$||n===J||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]=K,t}),{});function I(){this.internalformat=X,this.format=X,this.type=ct,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 L(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 P(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,c=t.internalformat=m[l];t.format=C[c],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 z(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function D(){I.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&&(P(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(x(r))t.channels=t.channels||4,t.data=r,!("type"in e)&&t.type===ct&&(t.type=Bt(r));else if(Pt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ct:case ut:case ht:case ft:var n=d.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(_(r)){var o=r.data;!Array.isArray(o)&&t.type===ct&&(t.type=Bt(o));var s,l,c,u,h,f,p=r.shape,m=r.stride;3===p.length?(c=p[2],f=m[2]):(c=1,f=1),s=p[0],l=p[1],u=m[0],h=m[1],t.alignment=1,t.width=s,t.height=l,t.channels=c,t.format=t.internalformat=_t[c],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=jt(t,o*s*l),u=0,h=0;h<s;++h)for(var f=0;f<o;++f)for(var p=0;p<l;++p)c[u++]=e[r*f+n*h+i*p+a];Nt(t,c)}(t,o,u,h,f,r.offset)}else if(Ot(r)||Rt(r)||function(t){return Dt(t)===kt}(r))Ot(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 Dt(t)===Mt}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(t){return Dt(t)===St}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(t){return Dt(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 b=w(r),A=1,k=0;k<b.length;++k)A*=b[k];var M=jt(t,A);T(r,b,"",M),Nt(t,M),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 R(t,r,n){var a=t.element,o=t.data,s=t.internalformat,l=t.format,c=t.type,u=t.width,h=t.height;z(t),a?e.texImage2D(r,n,l,l,c,a):t.compressed?e.compressedTexImage2D(r,n,s,u,h,0,o):t.needsCopy?(i(),e.copyTexImage2D(r,n,l,t.xOffset,t.yOffset,u,h,0)):e.texImage2D(r,n,l,u,h,0,l,c,o||null)}function F(t,r,n,a,o){var s=t.element,l=t.data,c=t.internalformat,u=t.format,h=t.type,f=t.width,p=t.height;z(t),s?e.texSubImage2D(r,o,n,a,u,h,s):t.compressed?e.compressedTexSubImage2D(r,o,n,a,c,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,u,h,l)}var B=[];function j(){return B.pop()||new D}function N(t){t.needsFree&&d.freeType(t.data),D.call(t),B.push(t)}function U(){I.call(this),this.genMipmaps=!1,this.mipmapHint=yt,this.mipmask=0,this.images=Array(16)}function V(t,e,r){var n=t.images[0]=j();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function q(t,e){var r=null;if(Ft(e))L(r=t.images[0]=j(),t),O(r,e),t.mipmask=1;else if(P(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)L(r=t.images[i]=j(),t),r.width>>=i,r.height>>=i,O(r,n[i]),t.mipmask|=1<<i;else L(r=t.images[0]=j(),t),O(r,e),t.mipmask=1;L(t,t.images[0]),t.compressed&&(t.internalformat===ot||t.internalformat===st||t.internalformat===lt||t.internalformat)}function wt(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;R(r[n],e,n)}}var Tt=[];function At(){var t=Tt.pop()||new U;I.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function Ct(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&N(e[r]),e[r]=null;Tt.push(t)}function It(){this.minFilter=dt,this.magFilter=dt,this.wrapS=pt,this.wrapT=pt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=yt}function Lt(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=u[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"==typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=c[s]}if("wrapT"in e){var f=e.wrapT;a=c[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 Vt(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 qt=0,Ht={},Gt=n.maxTextureUnits,Wt=Array(Gt).map((function(){return null}));function Zt(t){I.call(this),this.mipmask=0,this.internalformat=X,this.id=qt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new It,s.profile&&(this.stats={size:0})}function Yt(t){e.activeTexture(vt),e.bindTexture(t.target,t.texture)}function Xt(){var t=Wt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(W,null)}function $t(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(vt+n),e.bindTexture(i,null),Wt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Ht[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<Gt;++n){var i=Wt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}Wt[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&&$t(this)}}),s.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(Ht).forEach((function(e){t+=Ht[e].stats.size})),t}),{create2D:function(t,r){var n=new Zt(W);function i(t,e){var r=n.texInfo;It.call(r);var a=At();return"number"==typeof t?V(a,0|t,"number"==typeof e?0|e:0|t):t?(Lt(r,t),q(a,t)):V(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,L(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Yt(n),wt(a,W),Vt(r,W),Xt(),Ct(a),s.profile&&(n.stats.size=Ut(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=A[n.internalformat],i.type=k[n.type],i.mag=M[r.magFilter],i.min=S[r.minFilter],i.wrapS=E[r.wrapS],i.wrapT=E[r.wrapT],i}return Ht[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,c=j();return L(c,n),c.width=0,c.height=0,O(c,t),c.width=c.width||(n.width>>l)-o,c.height=c.height||(n.height>>l)-s,Yt(n),F(c,W,o,s,l),Xt(),N(c),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,Yt(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;e.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Xt(),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 c=new Zt(Z);Ht[c.id]=c,o.cubeCount++;var u=new Array(6);function h(t,e,r,n,i,a){var o,l=c.texInfo;for(It.call(l),o=0;o<6;++o)u[o]=At();if("number"!=typeof t&&t){if("object"==typeof t)if(e)q(u[0],t),q(u[1],e),q(u[2],r),q(u[3],n),q(u[4],i),q(u[5],a);else if(Lt(l,t),P(c,t),"faces"in t){var f=t.faces;for(o=0;o<6;++o)L(u[o],c),q(u[o],f[o])}else for(o=0;o<6;++o)q(u[o],t)}else{var p=0|t||1;for(o=0;o<6;++o)V(u[o],p,p)}for(L(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Yt(c),o=0;o<6;++o)wt(u[o],Y+o);for(Vt(l,Z),Xt(),s.profile&&(c.stats.size=Ut(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=A[c.internalformat],h.type=k[c.type],h.mag=M[l.magFilter],h.min=S[l.minFilter],h.wrapS=E[l.wrapS],h.wrapT=E[l.wrapT],o=0;o<6;++o)Ct(u[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=j();return L(l,c),l.width=0,l.height=0,O(l,e),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Yt(c),F(l,Y+t,a,o,s),Xt(),N(l),h},h.resize=function(t){var r=0|t;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Yt(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)e.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xt(),s.profile&&(c.stats.size=Ut(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var t=0;t<Gt;++t)e.activeTexture(vt+t),e.bindTexture(W,null),Wt[t]=null;b(Ht).forEach($t),o.cubeCount=0,o.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Gt;++t){var r=Wt[t];r&&(r.bindCount=0,r.unit=-1,Wt[t]=null)}b(Ht).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===W)e.texImage2D(W,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);Vt(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<Gt;++t){var r=Wt[t];r&&(r.bindCount=0,r.unit=-1,Wt[t]=null),e.activeTexture(vt+t),e.bindTexture(W,null),e.bindTexture(Z,null)}}}}(n,A,At,(function(){re.procs.poll()}),wt,f,r),te=function(t,e,r,n,i){var a={rgba4:qt,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 c(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=qt,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function u(e){var r=e.renderbuffer;t.bindRenderbuffer(Vt,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete l[e.id],n.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&u(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 c(t.createRenderbuffer());function u(e,r){var n=0,l=0,c=qt;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&&(c=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||c!==s.format)return u.width=s.width=n,u.height=s.height=l,s.format=c,t.bindRenderbuffer(Vt,s.renderbuffer),t.renderbufferStorage(Vt,c,n,l),i.profile&&(s.stats.size=Gt(s.format,s.width,s.height)),u.format=o[s.format],u}return l[s.id]=s,n.renderbufferCount++,u(e,r),u.resize=function(e,r){var n=0|e,a=0|r||n;return n===s.width&&a===s.height||(u.width=s.width=n,u.height=s.height=a,t.bindRenderbuffer(Vt,s.renderbuffer),t.renderbufferStorage(Vt,s.format,n,a),i.profile&&(s.stats.size=Gt(s.format,s.width,s.height))),u},u._reglType="renderbuffer",u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u},clear:function(){b(l).forEach(u)},restore:function(){b(l).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(Vt,e.renderbuffer),t.renderbufferStorage(Vt,e.format,e.width,e.height)})),t.bindRenderbuffer(Vt,null)}}}(n,A,0,f,r),ee=function(e,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var u=["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,Zt,r.renderbuffer._renderbuffer.renderbuffer))}function m(t){var e=Yt,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=Zt),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(Yt,s,null)}var l=a.create({width:t,height:e,format:n});return l._renderbuffer.refCount=0,new h(Zt,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&&u.push("half float","float16"),r.oes_texture_float&&u.push("float","float32");var x=0,_={};function w(){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 A(t){var r=t.framebuffer;e.deleteFramebuffer(r),t.framebuffer=null,o.framebufferCount--,delete _[t.id]}function k(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,Yt,null,0);e.framebufferTexture2D(Wt,33306,Yt,null,0),e.framebufferTexture2D(Wt,36096,Yt,null,0),e.framebufferTexture2D(Wt,36128,Yt,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 w;function i(t,e){var r,a=0,o=0,s=!0,u=!0,h=null,f=!0,d="rgba",v="uint8",x=1,_=null,b=null,w=null,A=!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:c.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(A=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,u=!1)),"stencil"in M&&("boolean"==typeof M.stencil?u=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=u=M.depthStencil:(w=M.depthStencil,s=!1,u=!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);a=a||E[0].width,o=o||E[0].height,_?C=m(_):s&&!u&&(C=g(a,o,A,"depth","uint32")),b?I=m(b):u&&!s&&(I=g(a,o,!1,"stencil","uint8")),w?L=m(w):!_&&!b&&u&&s&&(L=g(a,o,A,"depth stencil","depth stencil"));var P=null;for(r=0;r<E.length;++r)if(p(E[r]),E[r]&&E[r].texture){var z=Xt[E[r].texture._texture.format]*$t[E[r].texture._texture.type];null===P&&(P=z)}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,k(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,k(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){A(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 w)return e}return null},create:M,createCube:function(e){var r=Array(6);function n(e){var a,o,s={color:null},l=0,c=null,u="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)&&(c=p.color||p.colors,Array.isArray(c)),c||("colorCount"in p&&(f=0|p.colorCount),"colorType"in p&&(h=p.colorType),"colorFormat"in p&&(u=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(c)if(Array.isArray(c))for(o=[],a=0;a<c.length;++a)o[a]=c[a];else o=[c];else{o=Array(f);var d={radius:l,format:u,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(){b(_).forEach(A)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,b(_).forEach((function(t){t.framebuffer=e.createFramebuffer(),k(t)}))}})}(n,A,At,Qt,te,f),re=Fr(n,h,A,At,Ct,It,0,ee,{},Lt,Ht,Tt,wt,k,p,r),ne=function(t,e,r,n){function i(i){var a;a=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;x(i)?u=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),c=0|(i.height||n.framebufferHeight-s),u=i.data||null),r();var h=l*c*4;return u||(5121===a?u=new Uint8Array(h):5126===a&&(u=u||new Float32Array(h))),t.pixelStorei(3333,4),t.readPixels(o,s,l,c,6408,a,u),u}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},(function(){r=i(t)})),r}(t):i(t)}}(n,ee,re.procs.poll,wt),ie=re.next,ae=n.canvas,oe=[],se=[],le=[],ce=[r.onDestroy],ue=null;function he(){if(0===oe.length)return k&&k.update(),void(ue=null);ue=s.next(he),be();for(var t=oe.length-1;t>=0;--t){var e=oe[t];e&&e(wt,null,0)}n.flush(),k&&k.update()}function fe(){!ue&&oe.length>0&&(ue=s.next(he))}function pe(){ue&&(s.cancel(he),ue=null)}function de(t){t.preventDefault(),pe(),se.forEach((function(t){t()}))}function me(t){n.getError(),a.restore(),Ht.restore(),Ct.restore(),Qt.restore(),te.restore(),ee.restore(),Lt.restore(),k&&k.restore(),re.procs.refresh(),fe(),le.forEach((function(t){t()}))}function ge(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},c=re.compile(s,a,i,n,l),u=c.draw,h=c.batch,f=c.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 u.call(this,t);if(t.length)return h.call(this,t,t.length)}}),{stats:l,destroy:function(){c.destroy()}})}ae&&(ae.addEventListener(Br,de,!1),ae.addEventListener(jr,me,!1));var ye=ee.setFBO=ge({framebuffer:o.define.call(null,1,"framebuffer")});function ve(t,e){var r=0;re.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 xe(t){return oe.push(t),fe(),{cancel:function(){var e=Nr(oe,t);oe[e]=function t(){var e=Nr(oe,t);oe[e]=oe[oe.length-1],oe.length-=1,oe.length<=0&&pe()}}}}function _e(){var t=ie.viewport,e=ie.scissor_box;t[0]=t[1]=e[0]=e[1]=0,wt.viewportWidth=wt.framebufferWidth=wt.drawingBufferWidth=t[2]=e[2]=n.drawingBufferWidth,wt.viewportHeight=wt.framebufferHeight=wt.drawingBufferHeight=t[3]=e[3]=n.drawingBufferHeight}function be(){wt.tick+=1,wt.time=Te(),_e(),re.procs.poll()}function we(){Qt.refresh(),_e(),re.procs.refresh(),k&&k.update()}function Te(){return(l()-M)/1e3}we();var Ae=t(ge,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var r=0;r<6;++r)ye(t({framebuffer:e.framebuffer.faces[r]},e),ve);else ye(e,ve);else ve(0,e)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:ge({}),buffer:function(t){return Ct.create(t,34962,!1,!1)},elements:function(t){return It.create(t,!1)},texture:Qt.create2D,cube:Qt.createCube,renderbuffer:te.create,framebuffer:ee.create,framebufferCube:ee.createCube,vao:Lt.createVAO,attributes:i,frame:xe,on:function(t,e){var r;switch(t){case"frame":return xe(e);case"lost":r=se;break;case"restore":r=le;break;case"destroy":r=ce}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:At,hasExtension:function(t){return At.extensions.indexOf(t.toLowerCase())>=0},read:ne,destroy:function(){oe.length=0,pe(),ae&&(ae.removeEventListener(Br,de),ae.removeEventListener(jr,me)),Ht.clear(),ee.clear(),te.clear(),Lt.clear(),Qt.clear(),It.clear(),Ct.clear(),k&&k.clear(),ce.forEach((function(t){t()}))},_gl:n,_refresh:we,poll:function(){be(),k&&k.update()},now:Te,stats:f,getCachedCode:function(){return p},preloadCachedCode:function(t){Object.entries(t).forEach((function(t){p[t[0]]=t[1]}))}});return r.onDone(null,Ae),Ae}},"object"==typeof t&&typeof e<"u"?e.exports=n():r.createREGL=n()}}),px=p({"node_modules/gl-util/context.js"(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(!(typeof document<"u"))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{}return t.gl})),t.gl}}}),dx=p({"node_modules/font-atlas/index.js"(t,e){var r=ux(),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=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);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(c=0;c<s.length;c++)h.fillText(s[c],f,p),(f+=o[0])>e[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return i}}}),mx=p({"node_modules/bit-twiddle/twiddle.js"(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,1+((t|=t>>>8)|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=p({"node_modules/dup/dup.js"(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(typeof e>"u"&&(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=p({"node_modules/typedarray-pool/pool.js"(t){var e=mx(),r=gx(),n=ql().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=typeof Uint8ClampedArray<"u",a=typeof BigUint64Array<"u",o=typeof BigInt64Array<"u",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,c=s.BUFFER;function u(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 A(t){t=e.nextPow2(t);var r=e.log2(t),i=c[r];return i.length>0?i.pop():new n(t)}t.free=function(t){if(n.isBuffer(t))c[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){u(t.buffer)},t.freeArrayBuffer=u,t.freeBuffer=function(t){c[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 A(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=A,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,c[t].length=0}}}),vx=p({"node_modules/is-plain-obj/index.js"(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=p({"node_modules/parse-unit/index.js"(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=p({"node_modules/to-px/topx.js"(t,e){var r=xx();function n(t,e){var n=r(getComputedStyle(t).getPropertyValue(e));return n[0]*i(n[1],t)}function i(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 i=n(r,"font-size")/128;return e.removeChild(r),i}(t,e);case"em":return n(e,"font-size");case"rem":return n(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 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}e.exports=i}}),bx=p({"node_modules/detect-kerning/index.js"(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 c=0;c<i.length;c++){var u=i[c],h=r.measureText(u[0]).width+r.measureText(u[1]).width,f=r.measureText(u).width;if(Math.abs(h-f)>s*l){var p=(f-h)/s;o[u]=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=p({"node_modules/font-measure/index.js"(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||"",c=(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],c);var u=e.canvas||r.canvas,h=u.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);u.height=p,u.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,c)}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=p({"node_modules/gl-text/dist.js"(t,e){var r=hx(),n=Qg(),i=fx(),a=px(),o=Xv(),s=Qd(),l=dx(),c=yx(),u=ty(),h=vx(),f=xx(),p=_x(),d=bx(),m=Ay(),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=u(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{t=r.parse(w.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,c=t.variant;t=r.parse(r.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),c&&(t.variant=c)}var u=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]&&u==e.font[n].baseString||(a=!0,e.font[n]=w.fonts[u],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:u,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[u]=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,A=c.mallocFloat(2*this.count),k=0,M=0;k<this.counts.length;k++){var S=this.counts[k];if(T)for(var E=0;E<S;E++)A[M++]=t.position[2*k],A[M++]=t.position[2*k+1];else for(var C=0;C<S;C++)A[M++]=t.position[k][0],A[M++]=t.position[k][1]}this.position.call?this.position({type:"float",data:A}):this.position=this.regl.buffer({type:"float",data:A}),c.freeFloat(A)}else this.position.destroy&&this.position.destroy(),this.position={constant:t.position};if(t.text||a){var I=c.mallocUint8(this.count),L=c.mallocFloat(2*this.count);this.textWidth=[];for(var P=0,z=0;P<this.counts.length;P++){for(var D=this.counts[P],O=this.font[P]||this.font[0],R=this.fontAtlas[P]||this.fontAtlas[0],F=0;F<D;F++){var B=this.text.charAt(z),j=this.text.charAt(z-1);if(I[z]=R.ids[B],L[2*z]=O.width[B],F){var N=L[2*z-2],U=L[2*z],V=L[2*z-1]+.5*N+.5*U;if(this.kerning){var q=O.kerning[j+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"}),c.freeUint8(I),c.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),c=v(o*i),u=v(s*i);n.width=c,n.height=u,n.rows=s,n.cols=o,n.em&&n.texture({data:l({canvas:w.atlasCanvas,font:n.fontString,chars:n.chars,shape:[c,u],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,-1*(i+="number"==typeof t?t-n.baseline:-n[t])}))),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=c.mallocUint8(G);for(var W=(t.color.subarray||t.color.slice).bind(t.color),Z=0;Z<G;Z+=4)H.set(s(W(Z,Z+4),"uint8"),Z)}else{var Y=t.color.length;H=c.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 K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+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}}),Ax=p({"node_modules/@plotly/regl/dist/regl.unchecked.js"(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,n+"["+r+"]")}))):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=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function c(t){return"string"==typeof t?t.split():t}function u(t){return"string"==typeof t?document.querySelector(t):t}function h(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function f(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 p(){var t=h(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[f(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[f(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 d=p();d.zero=p();var m=3553,g=6408,y=5126,v=36160,x=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 _(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)||x(t.data))}var b=function(t){return Object.keys(t).map((function(e){return t[e]}))},w=function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},T=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||d.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:A(t,e[0],e[1],e[2],o,0);break;default:k(t,e,0,o,0)}return o};function A(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],c=0;c<r;++c)for(var u=l[c],h=0;h<n;++h)i[o++]=u[h]}function k(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],c=e[r+2],u=e[r+3];for(o=0;o<s;++o)A(t[o],l,c,u,n,i),i+=a}else for(o=0;o<s;++o)k(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,I=w,L=5121,P=5126,z=[];function D(t){return 0|M[Object.prototype.toString.call(t)]}function O(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 c=0;c<n;++c)t[s++]=e[i*l+a*c+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,j=5123,N=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function H(t){for(var e=d.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)||x(t)}var W=3553,Z=34067,Y=34069,X=6408,$=6406,K=6407,J=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ct=5121,ut=5123,ht=5125,ft=5126,pt=33071,dt=9728,mt=9984,gt=9987,yt=4352,vt=33984,xt=[mt,9986,9985,gt],_t=[0,J,Q,K,X],bt={};function wt(t){return"[object "+t+"]"}bt[J]=bt[$]=bt[et]=1,bt[rt]=bt[Q]=2,bt[K]=bt[nt]=3,bt[X]=bt[it]=4;var Tt=wt("HTMLCanvasElement"),At=wt("OffscreenCanvas"),kt=wt("CanvasRenderingContext2D"),Mt=wt("ImageBitmap"),St=wt("HTMLImageElement"),Et=wt("HTMLVideoElement"),Ct=Object.keys(M).concat([Tt,At,kt,Mt,St,Et]),It=[];It[ct]=1,It[ft]=4,It[at]=2,It[ut]=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 Dt(t){return Object.prototype.toString.call(t)}function Ot(t){return Dt(t)===Tt}function Rt(t){return Dt(t)===At}function Ft(t){if(!t)return!1;var e=Dt(t);return Ct.indexOf(e)>=0||Pt(t)||zt(t)||_(t)}function Bt(t){return 0|M[Object.prototype.toString.call(t)]}function jt(t,e){return d.allocType(t.type===at?ft:t.type,e)}function Nt(t,e){t.type===at?(t.data=H(e),d.freeType(e)):t.data=e}function Ut(t,e,r,n,i,a){var o;if(o=typeof Lt[t]<"u"?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}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 Vt=36161,qt=32854,Ht=[];function Gt(t,e,r){return Ht[t]*e*r}Ht[qt]=2,Ht[32855]=2,Ht[36194]=2,Ht[33189]=2,Ht[36168]=1,Ht[34041]=4,Ht[35907]=4,Ht[34836]=16,Ht[34842]=8,Ht[34843]=6;var Wt=36160,Zt=36161,Yt=3553,Xt=[];Xt[6408]=4,Xt[6407]=3;var $t=[];$t[5121]=1,$t[5126]=4,$t[36193]=2;var Kt=34963;function Jt(){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 Qt(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,c,u,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,u=0;u<t.length;u+=16){for(r=d[0],n=d[1],i=d[2],a=d[3],o=d[4],s=d[5],l=d[6],c=d[7],h=0;h<64;h++)m[h]=h<16?t[h+u]:ce(ce(ce(se(m[h-2]),m[h-7]),oe(m[h-15])),m[h-16]),f=ce(ce(ce(ce(c,ae(o)),re(o,s,l)),le[h]),m[h]),p=ce(ie(r),ne(r,n,i)),c=l,l=s,s=o,o=ce(a,f),a=i,i=n,n=r,r=ce(f,p);d[0]=ce(r,d[0]),d[1]=ce(n,d[1]),d[2]=ce(i,d[2]),d[3]=ce(a,d[3]),d[4]=ce(o,d[4]),d[5]=ce(s,d[5]),d[6]=ce(l,d[6]),d[7]=ce(c,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 te(t,e){return t>>>e|t<<32-e}function ee(t,e){return t>>>e}function re(t,e,r){return t&e^~t&r}function ne(t,e,r){return t&e^t&r^e&r}function ie(t){return te(t,2)^te(t,13)^te(t,22)}function ae(t){return te(t,6)^te(t,11)^te(t,25)}function oe(t){return te(t,7)^te(t,18)^ee(t,3)}function se(t){return te(t,17)^te(t,19)^ee(t,10)}var le=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 ce(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function ue(t){return Array.prototype.slice.call(t)}function he(t){return ue(t).join("")}var fe="xyzw".split(""),pe="dither",de="blend.enable",me="blend.color",ge="blend.equation",ye="blend.func",ve="depth.enable",xe="depth.func",_e="depth.range",be="depth.mask",we="colorMask",Te="cull.enable",Ae="cull.face",ke="frontFace",Me="lineWidth",Se="polygonOffset.enable",Ee="polygonOffset.offset",Ce="sample.alpha",Ie="sample.enable",Le="sample.coverage",Pe="stencil.enable",ze="stencil.mask",De="stencil.func",Oe="stencil.opFront",Re="stencil.opBack",Fe="scissor.enable",Be="scissor.box",je="viewport",Ne="profile",Ue="framebuffer",Ve="vert",qe="frag",He="elements",Ge="primitive",We="count",Ze="offset",Ye="instances",Xe="vao",$e="Width",Ke="Height",Je=Ue+$e,Qe=Ue+Ke,tr=je+$e,er=je+Ke,rr="drawingBuffer",nr=rr+$e,ir=rr+Ke,ar=[ye,ge,De,Oe,Re,Le,je,Be,Ee],or=34962,sr=34963,lr=35664,cr=35665,ur=35666,hr=35667,fr=35668,pr=35669,dr=35671,mr=35672,gr=35673,yr=35674,vr=35675,xr=35676,_r=35678,br=35680,wr=1028,Tr=1029,Ar=2305,kr=7680,Mr={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},Sr={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},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Cr={cw:2304,ccw:Ar};function Ir(t){return Array.isArray(t)||x(t)||_(t)}function Lr(t){return t.sort((function(t,e){return t===je?-1:e===je?1:t<e?-1:1}))}function Pr(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function zr(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Dr(t){return new Pr(!1,!1,!1,t)}function Or(t,e){var r=t.type;if(0===r){var n=t.data.length;return new Pr(!0,n>=1,n>=2,e)}if(4===r){var i=t.data;return new Pr(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new Pr(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<t.data.length;++l){var c=t.data[l];if(1===c.type)s=!0;else if(2===c.type)o=!0;else if(3===c.type)a=!0;else if(0===c.type){a=!0;var u=c.data;u>=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Pr(a,o,s,e)}return new Pr(3===r,2===r,1===r,e)}var Rr=new Pr(!1,!1,!1,(function(){}));function Fr(e,r,n,i,a,s,l,c,u,f,p,d,m,g,y,v){var x=f.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,A={dirty:!0,profile:v.profile},k={},M=[],E={},C={};function I(t){return t.replace(".","_")}function L(t,e,r){var n=I(t);M.push(t),k[n]=A[n]=!!r,E[n]=e}function P(t,e,r){var n=I(t);M.push(t),Array.isArray(r)?(A[n]=r.slice(),k[n]=r.slice()):A[n]=k[n]=r,C[n]=e}function z(t){return!!isNaN(t)}L(pe,3024),L(de,3042),P(me,"blendColor",[0,0,0,0]),P(ge,"blendEquationSeparate",[32774,32774]),P(ye,"blendFuncSeparate",[1,0,1,0]),L(ve,2929,!0),P(xe,"depthFunc",513),P(_e,"depthRange",[0,1]),P(be,"depthMask",!0),P(we,we,[!0,!0,!0,!0]),L(Te,2884),P(Ae,"cullFace",Tr),P(ke,ke,Ar),P(Me,Me,1),L(Se,32823),P(Ee,"polygonOffset",[0,0]),L(Ce,32926),L(Ie,32928),P(Le,"sampleCoverage",[1,!1]),L(Pe,2960),P(ze,"stencilMask",-1),P(De,"stencilFunc",[519,0,-1]),P(Oe,"stencilOpSeparate",[wr,kr,kr,kr]),P(Re,"stencilOpSeparate",[Tr,kr,kr,kr]),L(Fe,3089),P(Be,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(je,je,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var D={gl:e,context:m,strings:r,next:k,current:A,draw:d,elements:s,buffer:a,shader:p,attributes:f.state,vao:f,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Ir},O={primTypes:F,compareFuncs:Sr,blendFuncs:Mr,blendEquations:_,stencilOps:Er,glTypes:S,orientationType:Cr};w&&(O.backBuffer=[Tr],O.drawBuffer=h(i.maxDrawbuffers,(function(t){return 0===t?[0]:h(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,ue(arguments))}),{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,ue(arguments)),e.push(";")),t},toString:function(){return he([r.length>0?"var "+r.join(",")+";":"",he(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,ue(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 c=s(),u={};return{global:c,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 u[e]=t(o,{arg:i,toString:function(){return he(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var e=he(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return t(r,{then:function(){return r.apply(r,ue(arguments)),this},else:function(){return n.apply(n,ue(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),he(["if(",e,"){",i(),"}",t])}})},compile:function(){var t=['"use strict";',c,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e,n=he(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(e=Qt(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(D),o=e.shared={props:"a0"};Object.keys(D).forEach((function(t){o[t]=i.def(a,".",t)}));var s=e.next={},l=e.current={};Object.keys(C).forEach((function(t){Array.isArray(A[t])&&(s[t]=i.def(o.next,".",t),l[t]=i.def(o.current,".",t))}));var c=e.constants={};Object.keys(O).forEach((function(t){c[t]=i.def(JSON.stringify(O[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 u={};return e.scopeAttrib=function(t){var e=r.id(t);if(e in u)return u[e];var i=f.scope[e];return i||(i=f.scope[e]=new x),u[e]=n(i)},e}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 N(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,c=t.constants,u=c.drawBuffer,h=c.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(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",36160,",null);"),w&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function U(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");M.forEach((function(e){var n,u,f=I(e);if(!(f in r.state))if(f in o){n=o[f],u=a[f];var p=h(A[f].length,(function(t){return c.def(n,"[",t,"]")}));c(t.cond(p.map((function(t,e){return t+"!=="+u+"["+e+"]"})).join("||")).then(i,".",C[f],"(",p,");",p.map((function(t,e){return u+"["+e+"]="+t})).join(";"),";"))}else{n=c.def(l,".",f);var d=t.cond(n,"!==",s,".",f);c(d),f in E?d(t.cond(n).then(i,".enable(",E[f],");").else(i,".disable(",E[f],");"),s,".",f,"=",n,";"):d(i,".",C[f],"(",n,");",s,".",f,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function V(t,e,r,n){var i,a=t.shared,o=t.current,s=a.current,l=a.gl;Lr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(t,e);if(E[a]){var h=E[a];zr(c)?(i=t.link(u,{stable:!0}),e(t.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",i,";")):(e(t.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",u,";"))}else if(G(u)){var f=o[a];e(l,".",C[a],"(",u,");",u.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";")}else zr(c)?(i=t.link(u,{stable:!0}),e(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):e(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function q(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function H(t,e,r,n,i){var a,o,s,l=t.shared,c=t.stats,u=l.current,h=l.timer,f=r.profile;function p(){return typeof performance>"u"?"Date.now()":"performance.now()"}function d(t){t(a=e.def(),"=",p(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function m(t){t(c,".cpuTime+=",p(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function y(t){var r=e.def(u,".profile");e(u,".profile=",t,";"),e.exit(u,".profile=",r,";")}if(f){if(zr(f))return void(f.enable?(d(e),m(e.exit),y("true")):y("false"));y(s=f.append(t,e))}else s=e.def(u,".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(Rr))return;var c=t.scopeAttrib(s);o={},Object.keys(new x).forEach((function(t){o[t]=e.def(c,".",t)}))}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),c=i.state,u=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(",or,",",u,".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 c=i.divisor;e("if(",l,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function d(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",fe.map((function(t,e){return l+"."+t+"!=="+h[e]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",fe.map((function(t,e){return l+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?p():2===c?d():(e("if(",c,"===",1,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case lr:case hr:case dr:return 2;case cr:case fr:case mr:return 3;case ur:case pr:case gr:return 4;default:return 1}}(n.info.type),o)}))}function Z(t,e,n,i,a,o){for(var s,l=t.shared,c=l.gl,u=0;u<i.length;++u){var f,p=i[u],d=p.name,m=p.info.type,g=n.uniforms[d],y=t.link(p)+".location";if(g){if(!a(g))continue;if(zr(g)){var v=g.value;if(m===_r||m===br){var x=t.link(v._texture||v.color[0]._texture);e(c,".uniform1i(",y,",",x+".bind());"),e.exit(x,".unbind();")}else if(m===yr||m===vr||m===xr){var _=t.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;m===vr?b=3:m===xr&&(b=4),e(c,".uniformMatrix",b,"fv(",y,",false,",_,");")}else{switch(m){case 5126:s="1f";break;case lr:s="2f";break;case cr:s="3f";break;case ur:s="4f";break;case 35670:case 5124:s="1i";break;case dr:case hr:s="2i";break;case mr:case fr:s="3i";break;case gr:case pr:s="4i"}e(c,".uniform",s,"(",y,",",G(v)?Array.prototype.slice.call(v):v,");")}continue}f=g.append(t,e)}else{if(!a(Rr))continue;f=e.def(l.uniforms,"[",r.id(d),"]")}m===_r?e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}"):m===br&&e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}");var w=1;switch(m){case _r:case br:var T=e.def(f,"._texture");e(c,".uniform1i(",y,",",T,".bind());"),e.exit(T,".unbind();");continue;case 5124:case 35670:s="1i";break;case hr:case dr:s="2i",w=2;break;case fr:case mr:s="3i",w=3;break;case pr:case gr:s="4i",w=4;break;case 5126:s="1f";break;case lr:s="2f",w=2;break;case cr:s="3f",w=3;break;case ur:s="4f",w=4;break;case yr:s="Matrix2fv";break;case vr:s="Matrix3fv";break;case xr:s="Matrix4fv"}if("M"===s.charAt(0)){e(c,".uniform",s,"(",y,",");var A=Math.pow(m-yr+2,2),k=t.global.def("new Float32Array(",A,")");Array.isArray(f)?e("false,(",h(A,(function(t){return k+"["+t+"]="+f[t]})),",",k,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",h(A,(function(t){return k+"["+t+"]="+f+"["+t+"]"})),",",k,")"),e(");")}else if(w>1){for(var M=[],S=[],E=0;E<w;++E)Array.isArray(f)?S.push(f[E]):S.push(e.def(f+"["+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(c,".uniform",s,"(",y,",",S.join(","),");"),o&&e("}")}else{if(o){var C=e.def();e("if(!",t.batchId,"||",C,"!==",f,"){",C,"=",f,";")}e(c,".uniform",s,"(",y,",",f,");"),o&&e("}")}}}function Y(t,e,r,n){var i,a,o,s=t.shared,l=s.gl,c=s.draw,u=n.draw,h=(a=u.elements,o=e,a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),u.elementsActive&&o("if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);")):(i=o.def(),o(i,"=",c,".",He,";","if(",i,"){",l,".bindBuffer(",sr,",",i,".buffer.buffer);}","else if(",s.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+s.vao,".currentVAO.elements);",T?"":"if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);","}")),i);function f(i){var a=u[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(c,".",i)}var p,d,m=f(Ge),g=f(Ze),y=function(){var i,a=u.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(c,".",We),i}();if("number"==typeof y){if(0===y)return}else r("if(",y,"){"),r.exit("}");b&&(p=f(Ye),d=t.instancing);var v=h+".type",x=u.elements&&zr(u.elements)&&!u.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 X(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 $(t,e,r,n){q(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}))),Z(t,e,r,n.uniforms,(function(){return!0}),!1),Y(t,e,e,r)}function K(t,e,r,n){function i(){return!0}t.batchId="a1",q(t,e),W(t,e,r,n.attributes,i),Z(t,e,r,n.uniforms,i,!1),Y(t,e,e,r)}function J(t,e,r,n){q(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 c(t){return t.contextDep&&i||t.propDep}function u(t){return!c(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&&N(t,l,r.framebuffer),V(t,l,r.state,c),r.profile&&c(r.profile)&&H(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(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,u),W(t,l,r,n.attributes,c)),Z(t,s,r,n.uniforms,u,!1),Z(t,l,r,n.uniforms,c,!0),Y(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 X(K,0,r,t,2)})),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function Q(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,c=!1,u=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=Or(r,null);s=s||a.thisDep,c=c||a.propDep,l=l||a.contextDep}else{switch(i(u,".",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:c,ref:u,append:function(t,e){a.forEach((function(r){var i=n[r];if(o.isDynamic(i)){var a=t.invoke(e,i);e(u,".",r,"=",a,";")}}))}}),delete e.static[r]}}return{next:k,current:A,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,c=s.next,u=s.current;a(u,".dirty=false;"),N(t,e),N(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 f=r.def(s.attributes),p=r.def(0),d=t.cond(p,".buffer");d.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",or,",",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,"=",f,"[i];",d,"}"),b&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",f,"[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(c,".",n),s=t.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",u,".",n,"=",o,";"),r(s),e("if(",o,"!==",u,".",n,"){",s,"}")})),Object.keys(C).forEach((function(n){var i,o,s=C[n],f=A[n],p=t.block();if(p(l,".",s,"("),G(f)){var d=f.length;i=t.global.def(c,".",n),o=t.global.def(u,".",n),p(h(d,(function(t){return i+"["+t+"]"})),");",h(d,(function(t){return o+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",h(d,(function(t){return i+"["+t+"]!=="+o+"["+t+"]"})).join("||"),"){",p,"}")}else i=a.def(c,".",n),o=a.def(u,".",n),p(i,");",u,".",n,"=",i,";"),e("if(",i,"!==",o,"){",p,"}");r(p)})),t.compile()}(),compile:function(e,i,o,l,u){var d=B();d.stats=d.link(u),Object.keys(i.static).forEach((function(t){Q(d,i,t)})),ar.forEach((function(t){Q(d,e,t)}));var m=function(t,e,i,o){t.static,t.dynamic;var l=function(t,e){var r=t.static;if("string"==typeof r[qe]&&"string"==typeof r[Ve]){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),u=function(t){var e=t.static,r=t.dynamic;if(Ue in e){var n=e[Ue];return n?(n=c.getFramebuffer(n),Dr((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,"."+Je,r+".width"),e.set(a,"."+Qe,r+".height"),r}))):Dr((function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Je,n+"."+nr),e.set(n,"."+Qe,n+"."+ir),"null"}))}if(Ue in r){var i=r[Ue];return Or(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,"."+Je,o+"?"+o+".width:"+s+"."+nr),e.set(s,"."+Qe,o+"?"+o+".height:"+s+"."+ir),o}))}return null}(t),d=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,c=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Pr(!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,".",Je,"-",l));var s=a;return"height"in o||(s=e.def(r,".",Qe,"-",c)),[l,c,n,s]}))}if(t in n){var u=n[t],h=Or(u,(function(t,e){var r=t.invoke(e,u),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,".",Je,"-",i,")"),e.def('"height" in ',r,"?",r,".height|0:","(",n,".",Qe,"-",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 Pr(e.thisDep,e.contextDep,e.propDep,(function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Je),e.def(r,".",Qe)]})):null}var a=i(je);if(a){var o=a;a=new Pr(a.thisDep,a.contextDep,a.propDep,(function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,"."+tr,r[2]),e.set(n,"."+er,r[3]),r}))}return{viewport:a,scissor_box:i(Be)}}(t,u),m=function(t){var e=t.static,r=t.dynamic,n={},i=!1,a=function(){if(Xe in e){var t=e[Xe];return null!==t&&null===f.getVAO(t)&&(t=f.createVAO(t)),i=!0,n.vao=t,Dr((function(e){var r=f.getVAO(t);return r?e.link(r):"null"}))}if(Xe in r){i=!0;var a=r[Xe];return Or(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(He in e){var t=e[He];if(n.elements=t,Ir(t)){var l=n.elements=s.create(t,!0);t=s.getElements(l),o=!0}else t&&(t=s.getElements(t),o=!0);var c=Dr((function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null}));return c.value=t,c}if(He in r){o=!0;var u=r[He];return Or(u,(function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,u),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 Pr(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 c(t,s){if(t in e){var l=0|e[t];return s?n.offset=l:n.instances=l,Dr((function(t,e){return s&&(t.OFFSET=l),l}))}if(t in r){var c=r[t];return Or(c,(function(t,e){var r=t.invoke(e,c);return s&&(t.OFFSET=r),r}))}if(s){if(o)return Dr((function(t,e){return t.OFFSET=0,0}));if(i)return new Pr(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 Pr(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 u=c(Ze,!0),h=function(){if(Ge in e){var t=e[Ge];return n.primitive=t,Dr((function(e,r){return F[t]}))}if(Ge in r){var s=r[Ge];return Or(s,(function(t,e){var r=t.constants.primTypes,n=t.invoke(e,s);return e.def(r,"[",n,"]")}))}return o?zr(l)?l.value?Dr((function(t,e){return e.def(t.ELEMENTS,".primType")})):Dr((function(){return 4})):new Pr(l.thisDep,l.contextDep,l.propDep,(function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)})):i?new Pr(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(We in e){var t=0|e[We];return n.count=t,Dr((function(){return t}))}if(We in r){var s=r[We];return Or(s,(function(t,e){return t.invoke(e,s)}))}return o?zr(l)?l?u?new Pr(u.thisDep,u.contextDep,u.propDep,(function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)})):Dr((function(t,e){return e.def(t.ELEMENTS,".vertCount")})):Dr((function(){return-1})):new Pr(l.thisDep||u.thisDep,l.contextDep||u.contextDep,l.propDep||u.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 Pr(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao,".currentVAO?",t.shared.vao,".currentVAO.count:-1")})):null}(),d=c(Ye,!1);return{elements:l,primitive:h,count:p,instances:d,offset:u,vao:a,vaoActive:i,elementsActive:o,static:n}}(t),g=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]=Dr((function(){return s}))}else if(t in r){var l=r[t];n[i]=Or(l,(function(t,e){return o(t,e,t.invoke(e,l))}))}}switch(t){case Te:case de:case pe:case Pe:case ve:case Fe:case Se:case Ce:case Ie:case be:return a((function(t){return t}),(function(t,e,r){return r}));case xe:return a((function(t){return Sr[t]}),(function(t,e,r){var n=t.constants.compareFuncs;return e.def(n,"[",r,"]")}));case _e:return a((function(t){return t}),(function(t,e,r){return[e.def("+",r,"[0]"),e.def("+",r,"[1]")]}));case ye: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[Mr[e],Mr[n],Mr[r],Mr[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 ge: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 me:return a((function(t){return h(4,(function(e){return+t[e]}))}),(function(t,e,r){return h(4,(function(t){return e.def("+",r,"[",t,"]")}))}));case ze:return a((function(t){return 0|t}),(function(t,e,r){return e.def(r,"|0")}));case De:return a((function(t){var e=t.cmp||"keep",r=t.ref||0,n="mask"in t?t.mask:-1;return[Sr[e],r,n]}),(function(t,e,r){var n=t.constants.compareFuncs;return[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",kr),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case Oe:case Re:return a((function(e){var r=e.fail||"keep",n=e.zfail||"keep",i=e.zpass||"keep";return[t===Re?Tr:wr,Er[r],Er[n],Er[i]]}),(function(e,r,n){var i=e.constants.stencilOps;function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",kr)}return[t===Re?Tr:wr,a("fail"),a("zfail"),a("zpass")]}));case Ee: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 Ae:return a((function(t){var e=0;return"front"===t?e=wr:"back"===t&&(e=Tr),e}),(function(t,e,r){return e.def(r,'==="front"?',wr,":",Tr)}));case Me:return a((function(t){return t}),(function(t,e,r){return r}));case ke:return a((function(t){return Cr[t]}),(function(t,e,r){return e.def(r+'==="cw"?2304:'+Ar)}));case we:return a((function(t){return t.map((function(t){return!!t}))}),(function(t,e,r){return h(4,(function(t){return"!!"+r+"["+t+"]"}))}));case Le: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),y=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=Dr((function(){return e}));return n.id=e,n}if(t in a){var o=a[t];return Or(o,(function(t,e){var r=t.invoke(e,o);return e.def(t.shared.strings,".id(",r,")")}))}return null}var s,l=o(qe),c=o(Ve),u=null;return zr(l)&&zr(c)?(u=p.program(c.id,l.id,null,n),s=Dr((function(t,e){return t.link(u)}))):s=new Pr(l&&l.thisDep||c&&c.thisDep,l&&l.contextDep||c&&c.contextDep,l&&l.propDep||c&&c.propDep,(function(t,e){var r,n=t.shared.shader;r=l?l.append(t,e):e.def(n,".",qe);var i=n+".program("+(c?c.append(t,e):e.def(n,".",Ve))+","+r;return e.def(i+")")})),{frag:l,vert:c,progVar:s,program:u}}(t,0,l);function v(t){var e=d[t];e&&(g[t]=e)}v(je),v(I(Be));var b=Object.keys(g).length>0,w={framebuffer:u,draw:m,shader:y,state:g,dirty:b,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(w.profile=function(t){var e,r=t.static,n=t.dynamic;if(Ne in r){var i=!!r[Ne];(e=Dr((function(t,e){return i}))).enable=i}else if(Ne in n){var a=n[Ne];e=Or(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),w.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=Dr((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Dr((function(t){return t.link(i)})):("framebuffer"===a||"framebufferCube"===a)&&(r=Dr((function(t){return t.link(i.color[0])})))}else G(i)&&(r=Dr((function(t){return t.global.def("[",h(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]=Or(e,(function(t,r){return t.invoke(r,e)}))})),n}(i),w.drawVAO=w.scopeVAO=m.vao,!w.drawVAO&&y.program&&!l&&n.angle_instanced_arrays&&m.static.elements){var T=!0,A=y.program.attributes.map((function(t){var r=e.static[t];return T=T&&!!r,r}));if(T&&A.length>0){var k=f.getVAO(f.createVAO({attributes:A,elements:m.static.elements}));w.drawVAO=new Pr(null,null,null,(function(t,e){return t.link(k)})),w.useVAO=!0}}return l?w.useVAO=!0:w.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(Ir(n))s.state=1,s.buffer=a.getBuffer(a.create(n,or,!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 c=n.constant;s.buffer="null",s.state=2,"number"==typeof c?s.x=c:fe.forEach((function(t,e){e<c.length&&(s[t]=c[e])}))}else{l=Ir(n.buffer)?a.getBuffer(a.create(n.buffer,or,!1,!0)):a.getBuffer(n.buffer);var u=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=u,s.stride=h,s.divisor=m}}i[t]=Dr((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]=Or(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)},c=new x;c.state=1,Object.keys(c).forEach((function(t){l[t]=r.def(""+c[t])}));var u=l.buffer,h=l.type;function f(t){r(l[t],"=",n,".",t,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",u,"=",s,".createStream(",or,",",n,");",h,"=",u,".dtype;","}else{",u,"=",s,".getBuffer(",n,");","if(",u,"){",h,"=",u,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[fe[0]],"=",n,".constant;",fe.slice(1).map((function(t){return l[t]})).join("="),"=0;","}else{",fe.map((function(t,e){return l[t]+"="+n+".constant.length>"+e+"?"+n+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",or,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(e),w.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=Dr((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]=Or(e,(function(t,r){return t.invoke(r,e)}))})),n}(o),w}(e,i,o,l);return m.shader.program&&(m.shader.program.attributes.sort((function(t,e){return t.name<e.name?-1:1})),m.shader.program.uniforms.sort((function(t,e){return t.name<e.name?-1:1}))),function(t,e){var r=t.proc("draw",1);q(t,r),j(t,r,e.context),N(t,r,e.framebuffer),U(t,r,e),V(t,r,e.state),H(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)$(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 X($,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);")}(d,m),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),Lr(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}))})):zr(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),H(t,n,e,!0,!0),[He,Ze,We,Ye,Ge].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(Ve),s(qe),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(d,m),function(t,e){var r=t.proc("batch",2);t.batchId="0",q(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||N(t,r,a)):N(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),U(t,r,e),V(t,r,e.state,(function(t){return!s(t)})),(!e.profile||!s(e.profile))&&H(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)J(t,r,e,null);else{var c=l.append(t,r);if(r(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)J(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var u=t.global.def("{}"),h=r.def(c,".id"),f=r.def(u,"[",h,"]");r(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",t.link((function(t){return X(J,0,e,t,2)})),"(",c,");",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);")}(d,m),t(d.compile(),{destroy:function(){m.shader.program.destroy()}})}}}var Br="webglcontextlost",jr="webglcontextrestored";function Nr(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}return function(e){var r=function(e){var r,n,i,a,o=e||{},s={},l=[],h=[],f=typeof window>"u"?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=u(o.canvas):"container"in o&&(n=u(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=c(o.extensions)),"optionalExtensions"in o&&(h=c(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{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)}(e);if(!r)return null;var n=r.gl,i=n.getContextAttributes(),a=(n.isContextLost(),function(t,e){var r={};function n(e){var n,i=e.toLowerCase();try{n=r[i]=t.getExtension(i)}catch{}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 h=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]}}}(),f={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},p=r.cachedCode||{},A=a.extensions,k=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 c(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 u=[],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),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,r,a=i.length;if(0!==a){h.length=Math.max(h.length,a+1),u.length=Math.max(u.length,a+1),u[0]=0,h[0]=0;var o=0;for(t=0,r=0;r<i.length;++r){var c=i[r];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(o+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),n(c)):i[t++]=c,u[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+=u[d]-u[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}}}(0,A),M=l(),V=n.drawingBufferWidth,q=n.drawingBufferHeight,wt={tick:0,time:0,viewportWidth:V,viewportHeight:q,framebufferWidth:V,framebufferHeight:q,drawingBufferWidth:V,drawingBufferHeight:q,pixelRatio:r.pixelRatio},Tt={elements:null,primitive:4,count:-1,offset:0,instances:-1},At=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(m,o),t.texImage2D(m,0,g,1,1,0,g,y,null);var s=t.createFramebuffer();if(t.bindFramebuffer(v,s),t.framebufferTexture2D(v,36064,m,o,0),t.bindTexture(m,null),36053!==t.checkFramebufferStatus(v))a=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var l=d.allocType(y,4);t.readPixels(0,0,1,1,g,y,l),t.getError()?a=!1:(t.deleteFramebuffer(s),t.deleteTexture(o),a=1===l[0]),d.freeType(l)}}var c=!0;if(!(typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)))){var u=t.createTexture(),h=d.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,u),t.texImage2D(34069,0,g,3,3,0,g,5121,h),d.freeType(h),t.bindTexture(34067,null),t.deleteTexture(u),c=!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:c}}(n,A),Ct=function(t,e,r){var n=0,i={};function a(e){this.id=n++,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})}a.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},a.prototype.destroy=function(){c(this)};var o=[];function s(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function l(t,e,r,n,i,a){var o,l;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 c=1,u=1;u<o.length;++u)c*=o[u];t.dimension=c,s(t,l=C(e,o,t.dtype),r),a?t.persistentData=l:d.freeType(l)}else if("number"==typeof e[0]){t.dimension=i;var h=d.allocType(t.dtype,e.length);O(h,e),s(t,h,r),a?t.persistentData=h:d.freeType(h)}else x(e[0])&&(t.dimension=e[0].length,t.dtype=n||D(e[0])||P,s(t,l=C(e,[e.length,e[0].length],t.dtype),r),a?t.persistentData=l:d.freeType(l))}else if(x(e))t.dtype=n||D(e),t.dimension=i,s(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(_(e)){o=e.shape;var f=e.stride,p=e.offset,m=0,g=0,y=0,v=0;1===o.length?(m=o[0],g=1,y=f[0],v=0):2===o.length&&(m=o[0],g=o[1],y=f[0],v=f[1]),t.dtype=n||D(e.data)||P,t.dimension=g;var b=d.allocType(t.dtype,m*g);R(b,e.data,m,g,y,v,p),s(t,b,r),a?t.persistentData=b:d.freeType(b)}else e instanceof ArrayBuffer&&(t.dtype=L,t.dimension=i,s(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e))))}function c(r){var n;e.bufferCount--,n=r,Lt.destroyBuffer(n);var a=r.buffer;t.deleteBuffer(a),r.buffer=null,delete i[r.id]}return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(i).forEach((function(e){t+=i[e].stats.size})),t}),{create:function(n,o,s,u){e.bufferCount++;var h=new a(o);function f(e){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(e)||x(e)||_(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?l(h,i,n,o,s,u):(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 i[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(),x(t)||t instanceof ArrayBuffer)p(t,n);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var i=d.allocType(h.dtype,t.length);O(i,t),p(i,n),d.freeType(i)}else if(Array.isArray(t[0])||x(t[0])){r=I(t);var a=C(t,r,h.dtype);p(a,n),d.freeType(a)}}else if(_(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var m=Array.isArray(t.data)?h.dtype:D(t.data),g=d.allocType(m,s*l);R(g,t.data,s,l,c,u,t.offset),p(g,n),d.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){c(h)},f},createStream:function(t,e){var r=o.pop();return r||(r=new a(t)),r.bind(),l(r,e,35040,0,1,!1),r},destroyStream:function(t){o.push(t)},clear:function(){b(i).forEach(c),o.forEach(c)},getBuffer:function(t){return t&&t._buffer instanceof a?t._buffer:null},restore:function(){b(i).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:l}}(n,f,r),It=function(t,e,r,n){var i={},a=0,o={uint8:B,uint16:j};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=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;!c&&(!x(i)||_(i)&&!x(i.data))&&(h=e.oes_element_index_uint?N:j),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=u||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case B:case 5120:u=B;break;case j:case 5122:u=j;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var f=s;f<0&&(f=n.buffer.byteLength,u===j?f>>=1:u===N&&(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 u(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,u=0,h=0;Array.isArray(t)||x(t)||_(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?u=0|t.length:(u=s,h===j||5122===h?u*=2:(h===N||5124===h)&&(u*=4))),c(a,e,r,n,s,u,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(){u(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),c(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(){b(i).forEach(u)}}}(n,A,Ct,f),Lt=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c<s;++c)l[c]=new Jt;var u=0,h={},f={Record:Jt,scope:{},state:l,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&b(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 c=0;c<n.length;++c){var u,h=n[c],f=l[c]=new Jt,p=h.data||h;Array.isArray(p)||x(p)||_(p)?(e.buffers[c]&&(u=e.buffers[c],x(p)&&u._buffer.byteLength>=p.byteLength?u.subdata(p):(u.destroy(),e.buffers[c]=null)),e.buffers[c]||(u=e.buffers[c]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(u),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[c]=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(){b(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=++u,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,A,At,f,Ct,It,Tt),Ht=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 c(t,n,i){var s=35632===t?a:o,l=s[n];if(!l){var c=r.str(n);l=e.createShader(t),e.shaderSource(l,c),e.compileShader(l),s[n]=l}return l}var u={},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,u,h=c(35632,t.fragId),f=c(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(u=e.getActiveUniform(p,o))if(u.size>1)for(var y=0;y<u.size;++y){var v=u.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),e.getUniformLocation(p,v),u))}else l(g,new s(u.name,r.id(u.name),e.getUniformLocation(p,u.name),u));var x=e.getProgramParameter(p,35721);i.profile&&(t.stats.attributesCount=x);var _=t.attributes;for(o=0;o<x;++o)(u=e.getActiveAttrib(p,o))&&l(_,new s(u.name,r.id(u.name),e.getAttribLocation(p,u.name),u))}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);b(a).forEach(t),a={},b(o).forEach(t),o={},h.forEach((function(t){e.deleteProgram(t.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var f=c[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(c[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--}c[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[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:c,frag:-1,vert:-1}}(n,h,f,r),Qt=function(e,r,n,i,a,o,s){var l={"don't care":yt,"dont care":yt,nice:4354,fast:4353},c={repeat:10497,clamp:pt,mirror:33648},u={nearest:dt,linear:9729},h=t({mipmap:gt,"nearest mipmap nearest":mt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":gt},u),f={none:0,browser:37444},p={uint8:ct,rgba4:32819,rgb565:33635,"rgb5 a1":32820},m={alpha:$,luminance:J,"luminance alpha":Q,rgb:K,rgba:X,rgba4:32854,"rgb5 a1":tt,rgb565:36194},g={};r.ext_srgb&&(m.srgb=nt,m.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(m,{depth:et,"depth stencil":rt}),t(p,{uint16:ut,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&&(m[t]=e)}));var v=Object.keys(m);n.textureFormats=v;var A=[];Object.keys(m).forEach((function(t){var e=m[t];A[e]=t}));var k=[];Object.keys(p).forEach((function(t){var e=p[t];k[e]=t}));var M=[];Object.keys(u).forEach((function(t){M[u[t]]=t}));var S=[];Object.keys(h).forEach((function(t){var e=h[t];S[e]=t}));var E=[];Object.keys(c).forEach((function(t){E[c[t]]=t}));var C=v.reduce((function(t,e){var n=m[e];return n===J||n===$||n===J||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]=K,t}),{});function I(){this.internalformat=X,this.format=X,this.type=ct,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 L(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 P(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,c=t.internalformat=m[l];t.format=C[c],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 z(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function D(){I.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&&(P(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(x(r))t.channels=t.channels||4,t.data=r,!("type"in e)&&t.type===ct&&(t.type=Bt(r));else if(Pt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ct:case ut:case ht:case ft:var n=d.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(_(r)){var o=r.data;!Array.isArray(o)&&t.type===ct&&(t.type=Bt(o));var s,l,c,u,h,f,p=r.shape,m=r.stride;3===p.length?(c=p[2],f=m[2]):(c=1,f=1),s=p[0],l=p[1],u=m[0],h=m[1],t.alignment=1,t.width=s,t.height=l,t.channels=c,t.format=t.internalformat=_t[c],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=jt(t,o*s*l),u=0,h=0;h<s;++h)for(var f=0;f<o;++f)for(var p=0;p<l;++p)c[u++]=e[r*f+n*h+i*p+a];Nt(t,c)}(t,o,u,h,f,r.offset)}else if(Ot(r)||Rt(r)||function(t){return Dt(t)===kt}(r))Ot(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 Dt(t)===Mt}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(t){return Dt(t)===St}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(t){return Dt(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 b=w(r),A=1,k=0;k<b.length;++k)A*=b[k];var M=jt(t,A);T(r,b,"",M),Nt(t,M),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 R(t,r,n){var a=t.element,o=t.data,s=t.internalformat,l=t.format,c=t.type,u=t.width,h=t.height;z(t),a?e.texImage2D(r,n,l,l,c,a):t.compressed?e.compressedTexImage2D(r,n,s,u,h,0,o):t.needsCopy?(i(),e.copyTexImage2D(r,n,l,t.xOffset,t.yOffset,u,h,0)):e.texImage2D(r,n,l,u,h,0,l,c,o||null)}function F(t,r,n,a,o){var s=t.element,l=t.data,c=t.internalformat,u=t.format,h=t.type,f=t.width,p=t.height;z(t),s?e.texSubImage2D(r,o,n,a,u,h,s):t.compressed?e.compressedTexSubImage2D(r,o,n,a,c,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,u,h,l)}var B=[];function j(){return B.pop()||new D}function N(t){t.needsFree&&d.freeType(t.data),D.call(t),B.push(t)}function U(){I.call(this),this.genMipmaps=!1,this.mipmapHint=yt,this.mipmask=0,this.images=Array(16)}function V(t,e,r){var n=t.images[0]=j();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function q(t,e){var r=null;if(Ft(e))L(r=t.images[0]=j(),t),O(r,e),t.mipmask=1;else if(P(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)L(r=t.images[i]=j(),t),r.width>>=i,r.height>>=i,O(r,n[i]),t.mipmask|=1<<i;else L(r=t.images[0]=j(),t),O(r,e),t.mipmask=1;L(t,t.images[0]),t.compressed&&(t.internalformat===ot||t.internalformat===st||t.internalformat===lt||t.internalformat)}function wt(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;R(r[n],e,n)}}var Tt=[];function At(){var t=Tt.pop()||new U;I.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function Ct(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&N(e[r]),e[r]=null;Tt.push(t)}function It(){this.minFilter=dt,this.magFilter=dt,this.wrapS=pt,this.wrapT=pt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=yt}function Lt(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=u[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"==typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=c[s]}if("wrapT"in e){var f=e.wrapT;a=c[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 Vt(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 qt=0,Ht={},Gt=n.maxTextureUnits,Wt=Array(Gt).map((function(){return null}));function Zt(t){I.call(this),this.mipmask=0,this.internalformat=X,this.id=qt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new It,s.profile&&(this.stats={size:0})}function Yt(t){e.activeTexture(vt),e.bindTexture(t.target,t.texture)}function Xt(){var t=Wt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(W,null)}function $t(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(vt+n),e.bindTexture(i,null),Wt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Ht[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<Gt;++n){var i=Wt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}Wt[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&&$t(this)}}),s.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(Ht).forEach((function(e){t+=Ht[e].stats.size})),t}),{create2D:function(t,r){var n=new Zt(W);function i(t,e){var r=n.texInfo;It.call(r);var a=At();return"number"==typeof t?V(a,0|t,"number"==typeof e?0|e:0|t):t?(Lt(r,t),q(a,t)):V(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,L(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Yt(n),wt(a,W),Vt(r,W),Xt(),Ct(a),s.profile&&(n.stats.size=Ut(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=A[n.internalformat],i.type=k[n.type],i.mag=M[r.magFilter],i.min=S[r.minFilter],i.wrapS=E[r.wrapS],i.wrapT=E[r.wrapT],i}return Ht[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,c=j();return L(c,n),c.width=0,c.height=0,O(c,t),c.width=c.width||(n.width>>l)-o,c.height=c.height||(n.height>>l)-s,Yt(n),F(c,W,o,s,l),Xt(),N(c),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,Yt(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;e.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Xt(),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 c=new Zt(Z);Ht[c.id]=c,o.cubeCount++;var u=new Array(6);function h(t,e,r,n,i,a){var o,l=c.texInfo;for(It.call(l),o=0;o<6;++o)u[o]=At();if("number"!=typeof t&&t){if("object"==typeof t)if(e)q(u[0],t),q(u[1],e),q(u[2],r),q(u[3],n),q(u[4],i),q(u[5],a);else if(Lt(l,t),P(c,t),"faces"in t){var f=t.faces;for(o=0;o<6;++o)L(u[o],c),q(u[o],f[o])}else for(o=0;o<6;++o)q(u[o],t)}else{var p=0|t||1;for(o=0;o<6;++o)V(u[o],p,p)}for(L(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Yt(c),o=0;o<6;++o)wt(u[o],Y+o);for(Vt(l,Z),Xt(),s.profile&&(c.stats.size=Ut(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=A[c.internalformat],h.type=k[c.type],h.mag=M[l.magFilter],h.min=S[l.minFilter],h.wrapS=E[l.wrapS],h.wrapT=E[l.wrapT],o=0;o<6;++o)Ct(u[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=j();return L(l,c),l.width=0,l.height=0,O(l,e),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Yt(c),F(l,Y+t,a,o,s),Xt(),N(l),h},h.resize=function(t){var r=0|t;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Yt(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)e.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xt(),s.profile&&(c.stats.size=Ut(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var t=0;t<Gt;++t)e.activeTexture(vt+t),e.bindTexture(W,null),Wt[t]=null;b(Ht).forEach($t),o.cubeCount=0,o.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Gt;++t){var r=Wt[t];r&&(r.bindCount=0,r.unit=-1,Wt[t]=null)}b(Ht).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===W)e.texImage2D(W,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);Vt(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<Gt;++t){var r=Wt[t];r&&(r.bindCount=0,r.unit=-1,Wt[t]=null),e.activeTexture(vt+t),e.bindTexture(W,null),e.bindTexture(Z,null)}}}}(n,A,At,(function(){re.procs.poll()}),wt,f,r),te=function(t,e,r,n,i){var a={rgba4:qt,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 c(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=qt,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function u(e){var r=e.renderbuffer;t.bindRenderbuffer(Vt,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete l[e.id],n.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&u(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 c(t.createRenderbuffer());function u(e,r){var n=0,l=0,c=qt;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&&(c=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||c!==s.format)return u.width=s.width=n,u.height=s.height=l,s.format=c,t.bindRenderbuffer(Vt,s.renderbuffer),t.renderbufferStorage(Vt,c,n,l),i.profile&&(s.stats.size=Gt(s.format,s.width,s.height)),u.format=o[s.format],u}return l[s.id]=s,n.renderbufferCount++,u(e,r),u.resize=function(e,r){var n=0|e,a=0|r||n;return n===s.width&&a===s.height||(u.width=s.width=n,u.height=s.height=a,t.bindRenderbuffer(Vt,s.renderbuffer),t.renderbufferStorage(Vt,s.format,n,a),i.profile&&(s.stats.size=Gt(s.format,s.width,s.height))),u},u._reglType="renderbuffer",u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u},clear:function(){b(l).forEach(u)},restore:function(){b(l).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(Vt,e.renderbuffer),t.renderbufferStorage(Vt,e.format,e.width,e.height)})),t.bindRenderbuffer(Vt,null)}}}(n,A,0,f,r),ee=function(e,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var u=["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,Zt,r.renderbuffer._renderbuffer.renderbuffer))}function m(t){var e=Yt,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=Zt),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(Yt,s,null)}var l=a.create({width:t,height:e,format:n});return l._renderbuffer.refCount=0,new h(Zt,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&&u.push("half float","float16"),r.oes_texture_float&&u.push("float","float32");var x=0,_={};function w(){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 A(t){var r=t.framebuffer;e.deleteFramebuffer(r),t.framebuffer=null,o.framebufferCount--,delete _[t.id]}function k(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,Yt,null,0);e.framebufferTexture2D(Wt,33306,Yt,null,0),e.framebufferTexture2D(Wt,36096,Yt,null,0),e.framebufferTexture2D(Wt,36128,Yt,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 w;function i(t,e){var r,a=0,o=0,s=!0,u=!0,h=null,f=!0,d="rgba",v="uint8",x=1,_=null,b=null,w=null,A=!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:c.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(A=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,u=!1)),"stencil"in M&&("boolean"==typeof M.stencil?u=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=u=M.depthStencil:(w=M.depthStencil,s=!1,u=!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);a=a||E[0].width,o=o||E[0].height,_?C=m(_):s&&!u&&(C=g(a,o,A,"depth","uint32")),b?I=m(b):u&&!s&&(I=g(a,o,!1,"stencil","uint8")),w?L=m(w):!_&&!b&&u&&s&&(L=g(a,o,A,"depth stencil","depth stencil"));var P=null;for(r=0;r<E.length;++r)if(p(E[r]),E[r]&&E[r].texture){var z=Xt[E[r].texture._texture.format]*$t[E[r].texture._texture.type];null===P&&(P=z)}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,k(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,k(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){A(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 w)return e}return null},create:M,createCube:function(e){var r=Array(6);function n(e){var a,o,s={color:null},l=0,c=null,u="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)&&(c=p.color||p.colors,Array.isArray(c)),c||("colorCount"in p&&(f=0|p.colorCount),"colorType"in p&&(h=p.colorType),"colorFormat"in p&&(u=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(c)if(Array.isArray(c))for(o=[],a=0;a<c.length;++a)o[a]=c[a];else o=[c];else{o=Array(f);var d={radius:l,format:u,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(){b(_).forEach(A)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,b(_).forEach((function(t){t.framebuffer=e.createFramebuffer(),k(t)}))}})}(n,A,At,Qt,te,f),re=Fr(n,h,A,At,Ct,It,0,ee,{},Lt,Ht,Tt,wt,k,p,r),ne=function(t,e,r,n){function i(i){var a;a=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;x(i)?u=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),c=0|(i.height||n.framebufferHeight-s),u=i.data||null),r();var h=l*c*4;return u||(5121===a?u=new Uint8Array(h):5126===a&&(u=u||new Float32Array(h))),t.pixelStorei(3333,4),t.readPixels(o,s,l,c,6408,a,u),u}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},(function(){r=i(t)})),r}(t):i(t)}}(n,ee,re.procs.poll,wt),ie=re.next,ae=n.canvas,oe=[],se=[],le=[],ce=[r.onDestroy],ue=null;function he(){if(0===oe.length)return k&&k.update(),void(ue=null);ue=s.next(he),be();for(var t=oe.length-1;t>=0;--t){var e=oe[t];e&&e(wt,null,0)}n.flush(),k&&k.update()}function fe(){!ue&&oe.length>0&&(ue=s.next(he))}function pe(){ue&&(s.cancel(he),ue=null)}function de(t){t.preventDefault(),pe(),se.forEach((function(t){t()}))}function me(t){n.getError(),a.restore(),Ht.restore(),Ct.restore(),Qt.restore(),te.restore(),ee.restore(),Lt.restore(),k&&k.restore(),re.procs.refresh(),fe(),le.forEach((function(t){t()}))}function ge(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},c=re.compile(s,a,i,n,l),u=c.draw,h=c.batch,f=c.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 u.call(this,t);if(t.length)return h.call(this,t,t.length)}}),{stats:l,destroy:function(){c.destroy()}})}ae&&(ae.addEventListener(Br,de,!1),ae.addEventListener(jr,me,!1));var ye=ee.setFBO=ge({framebuffer:o.define.call(null,1,"framebuffer")});function ve(t,e){var r=0;re.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 xe(t){return oe.push(t),fe(),{cancel:function(){var e=Nr(oe,t);oe[e]=function t(){var e=Nr(oe,t);oe[e]=oe[oe.length-1],oe.length-=1,oe.length<=0&&pe()}}}}function _e(){var t=ie.viewport,e=ie.scissor_box;t[0]=t[1]=e[0]=e[1]=0,wt.viewportWidth=wt.framebufferWidth=wt.drawingBufferWidth=t[2]=e[2]=n.drawingBufferWidth,wt.viewportHeight=wt.framebufferHeight=wt.drawingBufferHeight=t[3]=e[3]=n.drawingBufferHeight}function be(){wt.tick+=1,wt.time=Te(),_e(),re.procs.poll()}function we(){Qt.refresh(),_e(),re.procs.refresh(),k&&k.update()}function Te(){return(l()-M)/1e3}we();var Ae=t(ge,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var r=0;r<6;++r)ye(t({framebuffer:e.framebuffer.faces[r]},e),ve);else ye(e,ve);else ve(0,e)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:ge({}),buffer:function(t){return Ct.create(t,34962,!1,!1)},elements:function(t){return It.create(t,!1)},texture:Qt.create2D,cube:Qt.createCube,renderbuffer:te.create,framebuffer:ee.create,framebufferCube:ee.createCube,vao:Lt.createVAO,attributes:i,frame:xe,on:function(t,e){var r;switch(t){case"frame":return xe(e);case"lost":r=se;break;case"restore":r=le;break;case"destroy":r=ce}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:At,hasExtension:function(t){return At.extensions.indexOf(t.toLowerCase())>=0},read:ne,destroy:function(){oe.length=0,pe(),ae&&(ae.removeEventListener(Br,de),ae.removeEventListener(jr,me)),Ht.clear(),ee.clear(),te.clear(),Lt.clear(),Qt.clear(),It.clear(),Ct.clear(),k&&k.clear(),ce.forEach((function(t){t()}))},_gl:n,_refresh:we,poll:function(){be(),k&&k.update()},now:Te,stats:f,getCachedCode:function(){return p},preloadCachedCode:function(t){Object.entries(t).forEach((function(t){p[t[0]]=t[1]}))}});return r.onDone(null,Ae),Ae}},"object"==typeof t&&typeof e<"u"?e.exports=n():r.createREGL=n()}}),kx=p({"src/lib/prepare_regl.js"(t,e){var r=hm(),n=Ax();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{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=p({"src/traces/scattergl/plot.js"(t,e){var r=Cy(),n=Kv(),i=Jv(),a=Tx(),o=le(),s=Or().selectMode,l=kx(),c=Ye(),u=hi(),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,c=i.r*n,u=i.t*n,h=i.w*n,f=i.h*n;return[s+e.domain[0]*h,l+r.domain[0]*f,a-c-(1-e.domain[1])*h,o-u-(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(u(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 A=v.glText.length-b;v.glText.splice(b,A).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 k=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(k)}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],c=[];o._ownfill&&c.push(e),o._nexttrace&&c.push(e+1),c.length&&(v.fillOrder[e]=c);var u,h,f=[],p=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;u<p.length&&isNaN(p[u+1]);)u+=2;for(h=p.length-2;h>u&&isNaN(p[h+1]);)h-=2;0!==p[u+1]&&(f=[p[u],0]),f=f.concat(p.slice(u,h+2)),0!==p[h+1]&&(f=f.concat([p[h],0]))}else if("tozerox"===o.fill){for(u=0;u<p.length&&isNaN(p[u]);)u+=2;for(h=p.length-2;h>u&&isNaN(p[h]);)h-=2;0!==p[u]&&(f=[0,p[u+1]]),f=f.concat(p.slice(u,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,D=L.x,O=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 j=L.xpx=new Array(z),N=L.ypx=new Array(z);for(g=0;g<z;g++)j[g]=x.c2p(D[g]),N[g]=_.c2p(O[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||{};c.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=p({"src/traces/scattergl/index.js"(t,e){var r=wy();r.plot=Mx(),e.exports=r}}),Ex=p({"lib/scattergl.js"(t,e){e.exports=Sx()}}),Cx=p({"src/traces/splom/attributes.js"(t,e){var r=Tn(),n=Pe(),i=Ce().axisHoverFormat,a=Ot().hovertemplateAttrs,o=Yg(),s=ve().idRegex,l=ye().templatedArray,c=R().extendFlat,u=r.marker,h=u.line,f=c(n("marker.line",{editTypeOverride:"calc"}),{width:c({},h.width,{editType:"calc"}),editType:"calc"}),p=c(n("marker"),{symbol:u.symbol,angle:u.angle,size:c({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.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:c({},o.text,{}),hovertext:c({},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=p({"src/traces/parcoords/merge_length.js"(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=p({"src/traces/splom/defaults.js"(t,e){var r=le(),n=je(),i=Cx(),a=Ye(),o=Zn(),s=Ix(),l=Xg().isOpenSymbol;function c(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,u,h){function f(n,a){return r.coerce(t,e,i,n,a)}var p=n(t,e,{name:"dimensions",handleItemDefaults:c}),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,u,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,c=e.showlowerhalf,u=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 _=!u&&!c,b=!u&&!l;for(e._axesDim={},i=0;i<s;i++){var w=o[i],T=0===i,A=i===s-1,k=T&&_||A&&b?void 0:d[i],M=T&&b||A&&_?void 0:m[i];x(k,M,w,y),x(M,k,w,v),g[i]=[k,M],e._axesDim[k]=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&&c||i===a&&(u||!c||!l))&&(r._splomSubplots[S]=1)}(!c||!u&&l&&c)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,e,h,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}),Px=p({"src/traces/splom/scene_update.js"(t,e){var r=le();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=p({"src/traces/splom/calc.js"(t,e){var r=le(),n=xe(),i=oi().calcMarkerSize,a=oi().calcAxisExpansion,o=ni(),s=yy().markerSelection,l=yy().markerStyle,c=Px(),u=k().BADNUM,h=Zg().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 A(t,n){for(var i=t.makeCalcdata({v:n.values,vcalendar:e.calendar},"v"),a=0;a<i.length;a++)i[a]=i[a]===u?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?(A(m,d),g&&"category"===g.type&&(g._categories=m._categories.slice())):A(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 k=c(t,e);return k.matrix||(k.matrix=!0),k.matrixOptions=_,k.selectedOptions=s(t,e,e.selected),k.unselectedOptions=s(t,e,e.unselected),[{x:!1,y:!1,t:{},trace:e}]}}}),Dx=p({"node_modules/performance-now/lib/performance-now.js"(t,e){(function(){var t,r,n,i,a,o;typeof performance<"u"&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:typeof c<"u"&&null!==c&&c.hrtime?(e.exports=function(){return(t()-a)/1e6},r=c.hrtime,i=(t=function(){var t;return 1e9*(t=r())[0]+t[1]})(),o=1e9*c.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)}}),Ox=p({"node_modules/raf/index.js"(t,e){var r,n,i,a,o,s=Dx(),l=window,c=["moz","webkit"],u="AnimationFrame",h=l["request"+u],f=l["cancel"+u]||l["cancelRequest"+u];for(r=0;!h&&r<c.length;r++)h=l[c[r]+"Request"+u],f=l[c[r]+"Cancel"+u]||l[c[r]+"CancelRequest"+u];(!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=p({"node_modules/array-range/index.js"(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=p({"node_modules/regl-splom/index.js"(t,e){var r=Cy(),n=Qg(),i=ey(),a=Ox(),o=Rx(),s=ty(),l=ny();function c(t,e){if(!(this instanceof c))return new c(t,e);this.traces=[],this.passes={},this.regl=t,this.scatter=r(t),this.canvas=this.scatter.canvas}function u(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,l,c,u,h=t[e],f=t[r];return h.length>2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),f.length>2?(s=f[0],c=f[2],l=f[1],u=f[3]):f.length?(s=l=f[0],c=u=f[1]):(s=f.x,l=f.y,c=f.x+f.width,u=f.y+f.height),[s,i,c,o]}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=c,c.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)},c.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},c.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"}),c=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&&(c.color=o.color),null!=o.size&&(c.size=o.size),null!=o.marker&&(c.marker=o.marker),null!=o.borderColor&&(c.borderColor=o.borderColor),null!=o.borderSize&&(c.borderSize=o.borderSize),null!=o.opacity&&(c.opacity=o.opacity),o.viewport&&(c.viewport=s(o.viewport)),null!=o.diagonal&&(c.diagonal=o.diagonal),null!=o.upper&&(c.upper=o.upper),null!=o.lower&&(c.lower=o.lower),o.data){c.buffer(l(o.data)),c.columns=o.data.length,c.count=o.data[0].length,c.bounds=[];for(let t=0;t<c.columns;t++)c.bounds[t]=i(o.data[t],1)}o.range&&(c.range=o.range,a=c.range&&"number"!=typeof c.range[0]),o.domain&&(c.domain=o.domain);let p=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===c.columns&&"number"==typeof o.padding[o.padding.length-1]?(c.padding=o.padding.map(f),p=!0):c.padding=f(o.padding));let d=c.columns,m=c.count,g=c.viewport.width,y=c.viewport.height,v=c.viewport.x,x=c.viewport.y,_=g/d,b=y/d;c.passes=[];for(let t=0;t<d;t++)for(let e=0;e<d;e++){if(!c.diagonal&&e===t||!c.upper&&t>e||!c.lower&&t<e)continue;let r=u(c.id,t,e),n=this.passes[r]||(this.passes[r]={});if(o.data&&(o.transpose?n.positions={x:{buffer:c.buffer,offset:e,count:m,stride:d},y:{buffer:c.buffer,offset:t,count:m,stride:d}}:n.positions={x:{buffer:c.buffer,offset:e*m,count:m},y:{buffer:c.buffer,offset:t*m,count:m}},n.bounds=h(c.bounds,t,e)),o.domain||o.viewport||o.data){let r=p?h(c.padding,t,e):c.padding;if(c.domain){let[i,a,o,s]=h(c.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=c.color),o.size&&(n.size=c.size),o.marker&&(n.marker=c.marker),o.borderSize&&(n.borderSize=c.borderSize),o.borderColor&&(n.borderColor=c.borderColor),o.opacity&&(n.opacity=c.opacity),o.range&&(n.range=a?h(c.range,t,e):c.range||n.bounds),c.passes.push(r)}return this},c.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},c.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=p({"src/traces/splom/plot.js"(t,e){var r=Fx(),n=le(),i=xe(),a=Or().selectMode;function o(t,e){var o,s,l,c,u,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),u=0;u<_.length;u++){l=_[u];var T=w.ranges[u]=new Array(4),A=w.domains[u]=new Array(4);(o=i.getFromId(t,p._diag[l][0]))&&(T[0]=o._rl[0],T[2]=o._rl[1],A[0]=o.domain[0],A[2]=o.domain[1]),(s=i.getFromId(t,p._diag[l][1]))&&(T[1]=s._rl[0],T[3]=s._rl[1],A[1]=s.domain[0],A[3]=s.domain[1])}var k=t._context.plotGlPixelRatio,M=f.l*k,S=f.b*k,E=f.w*k,C=f.h*k;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,D={};for(l=0;l<z.length;l++)D[z[l]]=!0;var O=[];for(l=0;l<P;l++)D[l]||O.push(l);m.unselectBatch=O}var R=d.xpx=new Array(b),F=d.ypx=new Array(b);for(u=0;u<_.length;u++){if(l=_[u],o=i.getFromId(t,p._diag[l][0]))for(R[u]=new Array(P),c=0;c<P;c++)R[u][c]=o.c2p(y[u][c]);if(s=i.getFromId(t,p._diag[l][1]))for(F[u]=new Array(P),c=0;c<P;c++)F[u][c]=s.c2p(y[u][c])}if(m.selectBatch.length||m.unselectBatch.length){var B=n.extendFlat({},g,m.unselectedOptions,w),j=n.extendFlat({},g,m.selectedOptions,w);m.matrix.update(B,j),L=!1}}else d.xpx=d.ypx=null;if(L){var N=n.extendFlat({},g,w);m.matrix.update(N,null)}}}e.exports=function(t,e,r){if(r.length)for(var n=0;n<r.length;n++)o(t,r[n][0])}}}),jx=p({"src/traces/splom/helpers.js"(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}}}),Nx=p({"src/traces/splom/hover.js"(t,e){var r=jx(),n=Wg().calcHover,i=ir().getFromId,a=R().extendFlat;function o(t,e,i,a){var o=t.cd[0].trace,s=t.scene.matrixOptions.cdata,l=t.xa,c=t.ya,u=l.c2p(e),h=c.c2p(i),f=t.distance,p=r.getDimIndex(o,l),d=r.getDimIndex(o,c);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)-u,A=c.c2p(w)-h,k=Math.sqrt(T*T+A*A);(a||k<x)&&(x=g=k,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),c="y"===(n||"").charAt(0),u=o(t,e,r);if((l||c)&&"axis"===s.hoversubplots&&u[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){c?p.xa=i(f,m,"x"):p.ya=i(f,m,"y");var g=o(p,e,r,l||c);u=u.concat(g)}}return u}}}}),Ux=p({"src/traces/splom/select.js"(t,e){var r=le(),n=r.pushUnique,i=Ye(),a=jx();e.exports=function(t,e){var o=t.cd,s=o[0].trace,l=o[0].t,c=t.scene,u=c.matrixOptions.cdata,h=t.xaxis,f=t.yaxis,p=[];if(!c)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=u[m],_=u[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 A=c.matrixOptions;return b.length||w.length?!c.selectBatch.length&&!c.unselectBatch.length&&c.matrix.update(c.unselectedOptions,r.extendFlat({},A,c.selectedOptions,c.viewOpts)):c.matrix.update(A,null),c.selectBatch=b,c.unselectBatch=w,p}}}),Vx=p({"src/traces/splom/edit_style.js"(t,e){var r=le(),n=ni(),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=p({"src/traces/splom/base_index.js"(t,e){var r=qt(),n=ka();e.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:Cx(),supplyDefaults:Lx(),colorbar:pi(),calc:zx(),plot:Bx(),hoverPoints:Nx().hoverPoints,selectPoints:Ux(),editStyle:Vx(),meta:{}},r.register(n)}}),Hx=p({"src/traces/splom/base_plot.js"(t,e){var r=Kv(),n=qt(),i=kx(),a=we().getModuleCalcData,o=Si(),s=xe().getFromId,l=ir().shouldShowZeroLine,c="splom",u={};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],c=a[o]=new Array(4),u=s(t,e._diag[l][0]);u&&(c[0]=u.r2l(u.range[0]),c[2]=u.r2l(u.range[1]));var h=s(t,e._diag[l][1]);h&&(c[1]=h.r2l(h.range[0]),c[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 c=e[t+"color"],u=e[t+"width"],h=String(c+u);h in o?o[h].data.push(NaN,NaN,n,i,s,l):o[h]={data:[n,i,s,l],join:"rect",thickness:u*r,color:c,viewport:a,range:a,overlay:!1}}for(e in n._splomSubplots){var c,u,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++)c=g+f.l2p(d[e].x),s("grid",f,c,x,c,x+v);if(p.showgrid)for(e=0;e<m.length;e++)s("grid",p,g,u=x+b+_*m[e].x,g+y,u);l(t,f,p)&&(c=g+f.l2p(0),s("zeroline",f,c,x,c,x+v)),l(t,p,f)&&s("zeroline",p,g,u=x+b+0,g+y,u)}var w=[];for(e in o)w.push(o[e]);return w}(t))}e.exports={name:c,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(c),o=a(t.calcdata,r)[0];i(t,["ANGLE_instanced_arrays","OES_element_index_uint"],u)&&(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 c=n._splomScenes[l.uid];c&&c.destroy&&c.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:u}}}),Gx=p({"src/traces/splom/index.js"(t,e){var r=qx();r.basePlotModule=Hx(),e.exports=r}}),Wx=p({"lib/splom.js"(t,e){e.exports=Gx()}}),Zx=p({"src/traces/parcoords/attributes.js"(t,e){var r=Pe(),n=Ie(),i=F(),a=Aa().attributes,o=R().extendFlat,s=ye().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=p({"src/traces/parcoords/constants.js"(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=p({"src/lib/gup.js"(t,e){var r=Gt();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=p({"src/traces/parcoords/axisbrush.js"(t,e){var r=Yx(),n=x(),i=Xx().keyFun,a=Xx().repeat,o=le().sorterAsc,s=le().strTranslate,l=r.bar.snapRatio;function c(t,e){return t*(1-l)+e*l}var u=r.bar.snapClose;function h(t,e){return t*(1-u)+e*u}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],u=l,f=a;i*f<i*o;f+=i){var p=f+i,d=e[p];if(i*r<i*h(l,d))return c(l,u);if(i*r<i*d||p===o)return c(d,l);u=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 v(t){t.attr("stroke-dasharray",m)}function _(t,e){var i=n.select(t).selectAll(".highlight, .highlight-shadow");v(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(),c=g(l,s),u=NaN,h=NaN,f=NaN;for(n=0;n<=c.length;n++){var p=c[n];if(p&&p[0]<=e&&e<=p[1]){u=n;break}if(h=n?n-1:NaN,p&&p[0]>e){f=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(f)?isNaN(h)?f:h:e-c[h][1]<c[f][0]-e?h:f),!isNaN(a)){var d=c[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 A(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,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.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 c=a.newExtent[1]>a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?_(t.parentNode,s):(s(),_(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,t)})))}function k(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(k)).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(A).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(v);var c=t.selectAll(".highlight").data(a);c.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"),c.attr("y1",(function(t){return t.height})).call(v)}(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(k)):[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]}}}}),Kx=p({"src/traces/parcoords/defaults.js"(t,e){var r=le(),n=Ee().hasColorscale,i=qe(),a=Aa().defaults,o=je(),s=ir(),l=Zx(),c=$x(),u=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"),u=a("visible");if(o&&o.length||(u=e.visible=!1),u){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=c.cleanRanges(f,e))}}e.exports=function(t,e,s,c){function p(n,i){return r.coerce(t,e,l,n,i)}var d=t.dimensions;Array.isArray(d)&&d.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),d.splice(u));var m=o(t,e,{name:"dimensions",layout:c,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,c,p);a(e,c,p),(!Array.isArray(m)||!m.length)&&(e.visible=!1),h(e,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.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")}}}),Jx=p({"src/traces/parcoords/calc.js"(t,e){var r=le().isArrayOrTypedArray,n=Ze(),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 c=n[1],u="cmyk"===(i=c.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>u?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_=f({"node_modules/color-parse/index.js"(){var r,n;n=null!=(r=Yd())?t(s(r)):{},t_=m(e(n,"default",{value:r,enumerable:!0}),r),e_=Qx,r_={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),o_=f({"node_modules/color-space/rgb.js"(){n_={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),s_=f({"node_modules/color-space/hsl.js"(){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,c=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];c<3;)(n=o+1/3*-(c-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[c++]=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 c_(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}d(l_,{default:()=>c_});var u_=f({"node_modules/color-rgba/index.js"(){a_(),o_(),s_()}}),h_=p({"src/traces/parcoords/helpers.js"(t){var e=le().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_=p({"src/traces/parcoords/lines.js"(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=le(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={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 c=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*c,a.offset=2*l*n,e(a),l*n+c<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,c=r[64*a+l];63===l&&0===o&&(c*=-1),n[i++]=c}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,c,u,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,c*=d,u*=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,A=t.layoutWidth*d,k=t.deselectedLines.color,M=t.deselectedLines.opacity;return a.extendFlat({key:h,resolution:[x,_],viewBoxPos:[s+y,l],viewBoxSize:[c,u],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:[k[0]/255,k[1]/255,k[2]/255,"auto"!==M?k[3]*M:Math.max(1/255,Math.pow(1/t.lines.color.length,1/3))],scissorX:(n===e?0:s+y)+(b-y)+A*v.x[0],scissorWidth:(n===r?x-s+y:c+.5)+(n===e?s+y:0),scissorY:l+w+T*v.y[0],scissorHeight:u,viewportX:b-y+A*v.x[0],viewportY:w+T*v.y[0],viewportWidth:x,viewportHeight:_},p)}function _(t){var e=s-1,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,A=e.pick,k=e.regl,M=k._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}(k),L=k.texture(u),P=[];D(e);var z=k({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:k.prop("scissorX"),y:k.prop("scissorY"),width:k.prop("scissorWidth"),height:k.prop("scissorHeight")}},viewport:{x:k.prop("viewportX"),y:k.prop("viewportY"),width:k.prop("viewportWidth"),height:k.prop("viewportHeight")},dither:!1,vert:r,frag:n,primitive:"lines",lineWidth:E,attributes:I,uniforms:{resolution:k.prop("resolution"),viewBoxPos:k.prop("viewBoxPos"),viewBoxSize:k.prop("viewBoxSize"),dim0A:k.prop("dim0A"),dim1A:k.prop("dim1A"),dim0B:k.prop("dim0B"),dim1B:k.prop("dim1B"),dim0C:k.prop("dim0C"),dim1C:k.prop("dim1C"),dim0D:k.prop("dim0D"),dim1D:k.prop("dim1D"),loA:k.prop("loA"),hiA:k.prop("hiA"),loB:k.prop("loB"),hiB:k.prop("hiB"),loC:k.prop("loC"),hiC:k.prop("hiC"),loD:k.prop("loD"),hiD:k.prop("hiD"),palette:L,contextColor:k.prop("contextColor"),maskTexture:k.prop("maskTexture"),drwLayer:k.prop("drwLayer"),maskHeight:k.prop("maskHeight")},offset:k.prop("offset"),count:k.prop("count")});function D(t){o=t.model,l=t.viewModel,y=l.dimensions.slice(),b=y[0]?y[0].values.length:0;var e=o.lines,r=A?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&&!A&&(L=k.texture(a.extendFlat({data:d(o.unitToColor,255)},u)))}return{render:function(t,e,r){var n,i,a,l=t.length,c=1/0,u=-1/0;for(n=0;n<l;n++)t[n].dim0.canvasX<c&&(c=t[n].dim0.canvasX,i=n),t[n].dim1.canvasX>u&&(u=t[n].dim1.canvasX,a=n);0===l&&h(k,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 c=e%8,u=(e-c)/8,h=Math.pow(2,c),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+u]&=~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=k.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:A?2:1,p,E);C.clearOnly=r;var L=e?o.lines.blockLineCount:b;f(k,z,C,L,b,I)}}},readPixel:function(t,e){return k.read({x:t,y:e,width:1,height:1,data:c}),c},readPixels:function(t,e,r,n){var i=new Uint8Array(4*r*n);return k.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:D}}}}),p_=p({"src/traces/parcoords/parcoords.js"(t,e){var r=x(),n=le(),i=n.isArrayOrTypedArray,a=n.numberFormat,o=(u_(),g(l_)).default,s=ir(),l=n.strRotate,c=n.strTranslate,u=Se(),h=Qe(),f=Ze(),p=Xx(),d=p.keyFun,m=p.repeat,y=p.unwrap,v=h_(),_=Yx(),b=$x(),w=f_();function T(t,e,r){return n.aggNums(t,null,e,r)}function A(t,e){return M(T(Math.min,t,e),T(Math.max,t,e))}function k(t){var e=t.range;return e?M(e[0],e[1]):A(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=k(n);return i?r.scale.ordinal().domain(i.map(function(t,e){return e?function(r,n){return e[n]??t(r)}: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=k(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=v.convertTypedArray(a.lineColor),c=s.line,u={color:o(s.unselected.line.color),opacity:s.unselected.line.opacity},h=f.extractOpts(c),p=h.reversescale?f.flipScale(a.cscale):a.cscale,d=s.domain,m=s.dimensions,g=t.width,x=s.labelangle,b=s.labelside,w=s.labelfont,T=s.tickfont,A=s.rangefont,M=n.extendDeepNoArrays({},c,{color:l.map(r.scale.linear().domain(k({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(v.isVisible).length,dimensions:m,tickDistance:_.tickDistance,unitToColor:C(p),lines:M,deselectedLines:u,labelAngle:x,labelSide:b,labelFont:w,tickFont:T,rangeFont:A,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,c=o.dimensions,u=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=c.filter(v.isVisible).map((function(s,c){var g=function(t,e){return r.scale.linear().domain(k(t)).range([e,1-e])}(s,f),y=m[s.label];m[s.label]=(y||0)+1;var x=s.label+(y?"__"+y:""),w=s.constraintrange,T=w&&w.length;T&&!i(w[0])&&(w=[w]);var A=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 D=1;D<L.length;D++)if(L[D]<L[D-1]){for(var O=L.map(P).sort(z),R=0;R<L.length;R++)L[R]=O[R].val,C[R]=O[R].text;break}}else L=void 0;return M=v.convertTypedArray(M),{key:x,label:s.label,tickFormat:s.tickformat,tickvals:L,ticktext:C,ordinal:v.isOrdinal(s),multiselect:s.multiselect,xIndex:c,crossfilterDimensionIndex:c,visibleIndex:s._index,height:l,values:M,paddedUnitValues:M.map(g),unitTickvals:L&&L.map(g),xScale:h,x:h(c),canvasX:h(c)*u,unitToPaddedPx:p,domainScale:S(l,_.verticalPadding,s,L,C),ordinalScale:E(s),parent:d,model:o,brush:b.makeBrush(t,T,A,(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 D(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 O(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,g=f._glcontainer,x=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=A(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 k=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,k,a));g.each((function(t,e){return n.extendFlat(t,S[e])}));var E=g.selectAll(".gl-canvas").each((function(t){t.viewModel=S[0],t.viewModel.plotGlPixelRatio=x,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(k.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 c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,f={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==C&&(u?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 c(t.model.translateX,t.model.translateY)}));var j=B.selectAll("."+_.cn.parcoordsControlView).data(m,d);j.enter().append("g").classed(_.cn.parcoordsControlView,!0),j.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var N=j.selectAll("."+_.cn.yAxis).data((function(t){return t.dimensions}),d);N.enter().append("g").classed(_.cn.yAxis,!0),j.each((function(t){O(N,t,x)})),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)}})),N.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),N.call(r.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;k.linePickActive(!1),t.x=Math.max(-_.overdrag,Math.min(t.model.width+_.overdrag,r.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,N.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})),O(N,e,x),N.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),r.select(this).attr("transform",c(t.x,0)),N.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,O(N,e,x),r.select(this).attr("transform",(function(t){return c(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),k.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),N.exit().remove();var U=N.selectAll("."+_.cn.axisOverlays).data(m,d);U.enter().append("g").classed(_.cn.axisOverlays,!0),U.selectAll("."+_.cn.axis).remove();var V=U.selectAll("."+_.cn.axis).data(m,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 v.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(m,d);q.enter().append("g").classed(_.cn.axisHeading,!0);var H=q.selectAll("."+_.cn.axisTitle).data(m,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),u.convertToTspans(n,t)})).attr("transform",(function(t){var e=D(t.model.labelAngle,t.model.labelSide),r=_.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=D(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(m,d);G.enter().append("g").classed(_.cn.axisExtent,!0);var W=G.selectAll("."+_.cn.axisExtentTop).data(m,d);W.enter().append("g").classed(_.cn.axisExtentTop,!0),W.attr("transform",c(0,-_.axisExtentOffset));var Z=W.selectAll("."+_.cn.axisExtentTopText).data(m,d);Z.enter().append("text").classed(_.cn.axisExtentTopText,!0).call(z),Z.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(m,d);Y.enter().append("g").classed(_.cn.axisExtentBottom,!0),Y.attr("transform",(function(t){return c(0,t.model.height+_.axisExtentOffset)}));var X=Y.selectAll("."+_.cn.axisExtentBottomText).data(m,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_=p({"src/traces/parcoords/plot.js"(t,e){var r=p_(),n=kx(),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={},c={},u={},h={},f=s._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=t.data[i].dimensions,c[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=c[e][r],a=n.map((function(t){return t.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[o]){var f=i.constraintrange;l[o]=f||null}var p=t._fullData[u[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,c[e].filter(i));l[e].sort(n),c[e].filter((function(t){return!i(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[h[e]]])}})}}).reglPrecompiled=a}}),m_=p({"src/traces/parcoords/base_plot.js"(t){var e=x(),r=we().getModuleCalcData,n=d_(),i=ke();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_=p({"src/traces/parcoords/base_index.js"(t,e){e.exports={attributes:Zx(),supplyDefaults:Kx(),calc:Jx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:m_(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),y_=p({"src/traces/parcoords/index.js"(t,e){var r=g_();r.plot=d_(),e.exports=r}}),v_=p({"lib/parcoords.js"(t,e){e.exports=y_()}}),x_=p({"src/traces/parcats/attributes.js"(t,e){var r=R().extendFlat,n=U(),i=F(),a=Pe(),o=Ot().hovertemplateAttrs,s=Aa().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}}}),__=p({"src/traces/parcats/defaults.js"(t,e){var r=le(),n=Ee().hasColorscale,i=qe(),a=Aa().defaults,o=je(),s=x_(),l=Ix(),c=E().isTypedArraySpec;function u(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,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete t.categoryarray,delete t.ticktext),!u&&"array"===h&&(e.categoryorder="trace")}}e.exports=function(t,e,c,h){function f(n,i){return r.coerce(t,e,s,n,i)}var p=o(t,e,{name:"dimensions",handleItemDefaults:u}),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,c,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_=p({"src/traces/parcats/calc.js"(t,e){var r=Xx().wrap,n=Ee().hasColorscale,i=We(),a=ie(),o=Qe(),s=le(),l=A();function c(t,e,r,n){return{dimensionInd:t,categoryInd:e,categoryValue:r,displayInd:e,categoryLabel:n,valueInds:[],count:0,dragY:null}}function u(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;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,A,k=p[0].values.length,M={},S=y.map((function(t){return t.inds}));for(g=0,_=0;_<k;_++){var E=[];for(b=0;b<S.length;b++)E.push(S[b][_]);m=d[_%d.length],g+=m;var C=(w=_,T=void 0,A=void 0,s.isArrayOrTypedArray(x.color)?A=T=x.color[w%x.color.length]:T=x.color,{color:v(T),rawColor:A}),I=E+"-"+C.rawColor;void 0===M[I]&&(M[I]=h(E,C.color,C.rawColor)),f(M[I],_,m)}var L=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(_=0;_<k;_++)for(m=d[_%d.length],b=0;b<L.length;b++){var P=L[b].containerInd,z=y[b].inds[_],D=L[b].categories;if(void 0===D[z]){var O=e.dimensions[P]._categoryarray[z],R=e.dimensions[P]._ticktext[z];D[z]=c(b,z,O,R)}u(D[z],_,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}}(L,M,g))}}}),w_=p({"src/traces/parcats/parcats.js"(t,e){var r=x(),n=(td(),g(Qp)).interpolateNumber,i=Dn(),a=Dr(),o=le(),s=o.strTranslate,l=Qe(),c=O(),u=Se();function h(t,e,n,i){var a=e._context.staticPlot,c=t.map(j.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 g=h.selectAll("g.trace.parcats").data(c,f),v=g.enter().append("g").attr("class","trace parcats");g.attr("transform",(function(t){return s(t.x,t.y)})),v.append("g").attr("class","paths");var x=g.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",m).on("mouseout",y).on("click",b),v.append("g").attr("class","dimensions");var T=g.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})),A(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"})),k(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),u.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)),g.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")})),g.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 m(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){o.raiseToTop(this),T(r.select(this));var e=v(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,u=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<=u&&u<=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 x=t.parcatsViewModel.x+i,b=t.parcatsViewModel.y+s,w=c.mostReadable(t.model.color,["black","white"]),A=t.model.count,k=A/t.parcatsViewModel.model.count,M={countLabel:A,probabilityLabel:k.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:x-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<x?"right":"left",hovertemplate:(f.line||{}).hovertemplate,hovertemplateLabels:M,eventData:[{data:f._input,fullData:f,count:A,probability:k}]},{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=v(t),n=_(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:r.event,constraints:n})}}function v(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=v(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 c.mostReadable(t.model.color,["black","white"])})).attr("stroke-width",.3)}function A(t){t.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function k(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,v(t))}))}));var c={};c[a.dimensionInd]=a.categoryValue,o.emit(e,{points:l,event:n,constraints:c})}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,v(t))}));var c={};c[a.dimensionInd]=a.categoryValue,void 0!==i.rawColor&&(c.color=i.rawColor),o.emit(e,{points:l,event:n,constraints:c})}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"),c=l.node().getBoundingClientRect(),u=l.datum(),h=u.parcatsViewModel,f=h.model.dimensions[u.model.dimensionInd],p=h.trace,d=c.top+c.height/2;h.dimensions.length>1&&f.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.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,u=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))}))}(u),E(u,"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))}(u),S(u,"plotly_hover",r.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?e=C(n,s,u):"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(),u=r.select(n).datum(),h=u.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=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(t){t.color===u.color&&(v+=t.count)}));var x=h.model.count,_=0;f.pathSelection.each((function(t){t.model.color===u.color&&(_+=t.model.count)}));var b=v/y,w=v/_,T=v/x,A={countLabel:v,categoryLabel:g,probabilityLabel:b.toFixed(3)},k=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&k.push(["Count:",A.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(k.push("P(color ∩ "+g+"): "+A.probabilityLabel),k.push("P("+g+" | color): "+w.toFixed(3)),k.push("P(color | "+g+"): "+T.toFixed(3)));var M=k.join("<br>"),S=c.mostReadable(u.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:A,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:b,categorycount:x,colorcount:_,bandcolorcount:v}]}}(n,s,u):"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,u)),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),A(e.dimensionSelection.selectAll("g.category")),k(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,c=a.categories,u=c[l-1],h=c[l+1];void 0!==u&&s<u.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.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 c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],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})),k(l),a.each((function(){o.raiseToTop(this)})),a.exit().remove()}function j(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,c=e.height,u=Math.floor(l*(s.x[1]-s.x[0])),h=Math.floor(c*(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:u,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 N(t,e,r,i,a){var o,s,l=[],c=[];for(s=0;s<r.length-1;s++)o=n(r[s]+t[s],t[s+1]),l.push(o(a)),c.push(o(1-a));var u="M "+t[0]+","+e[0];for(u+="l"+r[0]+",0 ",s=1;s<r.length;s++)u+="C"+l[s-1]+","+e[s-1]+" "+c[s-1]+","+e[s]+" "+t[s]+","+e[s],u+="l"+r[s]+",0 ";for(u+="l0,"+i+" ",u+="l -"+r[r.length-1]+",0 ",s=r.length-2;s>=0;s--)u+="C"+c[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),u+="l-"+r[s]+",0 ";return u+"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})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.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(c.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<c.length;m++){var g,y,v=c[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 A=t.dimensions[T].categories[w],k=A.bands.length,M=A.bands[k-1];if(void 0===M||v.rawColor!==M.rawColor){var S=void 0===M?0:M.y+M.height;A.bands.push({key:S,color:v.color,rawColor:v.rawColor,height:g,width:A.width,count:v.count,y:S,categoryViewModel:A,parcatsViewModel:t})}else{var E=A.bands[k-1];E.height+=g,E.count+=v.count}}y="hspline"===t.pathShape?N(s,x,l,g,.5):N(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,c,u=[],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})),c=0;c<f;c++)l=g[c].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,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,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_=p({"src/traces/parcats/plot.js"(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)}}}),A_=p({"src/traces/parcats/base_plot.js"(t){var e=we().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()}}}),k_=p({"src/traces/parcats/index.js"(t,e){e.exports={attributes:x_(),supplyDefaults:__(),calc:b_(),plot:T_(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:A_(),categories:["noOpacity"],meta:{}}}}),M_=p({"lib/parcats.js"(t,e){e.exports=k_()}}),S_=p({"src/plots/mapbox/constants.js"(t,e){var r=Zt(),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_=p({"src/plots/mapbox/layout_attributes.js"(t,e){var r=le(),n=H().defaultLine,i=Aa().attributes,a=F(),o=Tn().textposition,s=Pt().overrideAll,l=ye().templatedArray,c=S_(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.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:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.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:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),C_=p({"src/traces/scattermapbox/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=wn(),a=og(),o=Tn(),s=E_(),l=U(),c=Pe(),u=R().extendFlat,h=Pt().overrideAll,f=E_(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},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:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({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},c("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:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),I_=p({"src/traces/scattermapbox/constants.js"(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_=p({"src/traces/scattermapbox/defaults.js"(t,e){var r=le(),n=Ye(),i=Zn(),a=Yn(),o=$n(),s=Kn(),l=C_(),c=I_().isSupportedFont;e.exports=function(t,e,u,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,u,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,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),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:c(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,u,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}),P_=p({"src/traces/scattermapbox/format_labels.js"(t,e){var r=ir();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_=p({"src/plots/mapbox/convert_text_opts.js"(t,e){var r=le();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,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),D_=p({"src/traces/scattermapbox/convert.js"(t,e){var r=A(),n=le(),i=k().BADNUM,a=pg(),o=Ze(),s=Qe(),l=Xe(),c=Ye(),u=I_().isSupportedFont,h=z_(),f=$e().appendArrayPointValue,p=Se().NEWLINES,d=Se().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"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),A=c.hasMarkers(u),k=c.hasText(u),M=A&&"circle"===u.marker.symbol,S=A&&"circle"!==u.marker.symbol,E=u.cluster&&u.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":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var y,x=[];for(e=0;e<t.length;e++){var _=t[e],b=_.lonlat;if(!v(b)){var w={};i&&(w.mcc=_.mcc=i(_.mc)),a&&(w.mrc=_.mrc=a(_.ms)),c&&(w.mo=c(_.mo)),f&&(w.selected=_.selected||0),x.push({type:"Feature",id:e+1,geometry:{type:"Point",coordinates:b},properties:w})}}if(f)for(y=s.makeSelectedPointStyleFns(u),e=0;e<x.length;e++){var T=x[e].properties;y.selectedOpacityFn&&(T.mo=g(y.selectedOpacityFn(T))),y.selectedColorFn&&(T.mcc=y.selectedColorFn(T)),y.selectedSizeFn&&(T.mrc=y.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:x},mcc:p||y&&y.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:d||y&&y.selectedSizeFn?{type:"identity",property:"mrc"}:function(t){return t/2}(h.size),mo:m||y&&y.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(e);L.geojson=D.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(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":_(u),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":D.mcc,"circle-radius":D.mrc,"circle-opacity":D.mo})}if(M&&E&&(L.filter=["!",["has","point_count"]]),(S||k)&&(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,u="auto"!==s?g(s,!0):y,h=c.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,A=i._module.formatLabels(_,i,r),k={};f(k,i,_.i);var M=i._meta||{};b=n.texttemplateString(T,A,r._d3locale,k,_,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:u(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":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(P.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),P.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(P.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),k)){var O=(u.marker||{}).size,R=h(u.textposition,O);n.extendFlat(P.layout,{"text-size":u.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":_(u)}),n.extendFlat(P.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),O_=p({"src/traces/scattermapbox/plot.js"(t,e){var r=le(),n=D_(),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),c=!!this.clusterEnabled,u=this;function h(t){c?function(t){for(var e=a.cluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function f(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.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||u.addSource(n,i),u.addLayer(n,i,s)}}(t)}var p=this.isHidden,d=!0!==e.visible;d?p||h():p?d||f():c!==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(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.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,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)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_=p({"src/traces/scattermapbox/hover.js"(t,e){var r=Dr(),n=le(),i=gi(),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,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(e,t,c),c.join("<br>")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.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(c,(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]),c=s.y-f.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),A=f.c2p(w),k=_.mrc||1;t.x0=T-k,t.x1=T+k,t.y0=A-k,t.y1=A+k;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),F_=p({"src/traces/scattermapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),B_=p({"src/traces/scattermapbox/select.js"(t,e){var r=le(),n=Ye(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))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)?(c.push({pointNumber:a,lon:f[0],lat:f[1]}),h.selected=1):h.selected=0}}return c}}}),j_=p({"node_modules/@plotly/mapbox-gl/dist/mapbox-gl-unminified.js"(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),typeof window<"u"&&(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(typeof e>"u"&&(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=typeof self<"u"?self:{},l=Math.pow(2,53)-1;function c(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}}var u=c(.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 A(t){T[t]||(typeof console<"u"&&console.warn(t),T[t]=!0)}function k(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 typeof WorkerGlobalScope<"u"&&typeof self<"u"&&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{return!1}}var P,z,D,O,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,j={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)}},N={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||!O||(q?H(t):D=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,O),t.isContextLost())return;U.supported=!0}catch{}t.deleteTexture(e),V=!0}s.document&&((O=s.document.createElement("img")).onload=function(){D&&H(D),D=null,q=!0},O.onerror=function(){V=!0,D=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}W.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},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return Z(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},W.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=K(t),n=j.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)||N.ACCESS_TOKEN;return N.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},W.prototype.canonicalizeTileURL=function(t,e){var r=K(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},W.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&Z(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},W.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=K(N.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),!N.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||N.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),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return Y.test(t)}var $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(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 J(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{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(N.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=N.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{A("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{A("Unable to write to LocalStorage")}},et.prototype.processRequests=function(t){},et.prototype.postEvent=function(t,e,n,i){var a=this;if(N.EVENTS_URL){var o=K(N.EVENTS_URL);o.params.push("access_token="+(i||N.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,c={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=At(c,(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,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(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){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(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(N.ACCESS_TOKEN),n=r?r.u:N.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,ct=lt.postMapLoadEvent.bind(lt),ut="mapbox-tiles",ht=500,ft=50;function pt(){s.caches&&!rt&&(rt=s.caches.open(ut))}function dt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var mt,gt=1/0;function yt(){return null==mt&&(mt=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),mt}var vt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(vt);var xt=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),_t=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function bt(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:_t(),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&&A(r),i&&l)return c(i);var u=Date.now();s.fetch(n).then((function(r){if(r.ok){var n=o?r.clone():null;return c(r,n,u)}return e(new xt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,o,l){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(o&&l&&function(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{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(dt(t.url),r)})).catch((function(t){return A(t.message)}))})))}}(n,o,l),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?function(t,e){if(pt(),!rt)return e(null);var r=dt(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)}(n,l):l(null,null),{cancel:function(){a=!0,i||r.abort()}}}var wt=function(t,e){if(!function(t){return/^file:/.test(t)||/^file:/.test(_t())&&!/^\w+:/.test(t)}(t.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return bt(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 xt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Tt=function(t,e){return wt(p(t,{type:"arrayBuffer"}),e)},At=function(t,e){return wt(p(t,{method:"POST"}),e)};function kt(t){var e=s.document.createElement("a");return e.href=t,e.protocol===s.document.location.protocol&&e.host===s.document.location.host}var Mt,St,Et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Mt=[],St=0;var Ct=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),St>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Mt.push(r),r}St++;var n=!1,i=function(){if(!n)for(n=!0,St--;Mt.length&&St<N.MAX_PARALLEL_IMAGE_REQUESTS;){var t=Mt.shift(),e=t.requestParameters,r=t.callback;t.cancelled||(t.cancel=Ct(e,r).cancel)}},a=Tt(t,(function(t,r,n,a){i(),t?e(t):r&&(yt()?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=Et}))},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):Et}(r,e,n,a))}));return{cancel:function(){a.cancel(),i()}}};function It(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Lt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var Pt=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},zt=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}(Pt),Dt=function(){};Dt.prototype.on=function(t,e){return this._listeners=this._listeners||{},It(t,e,this._listeners),this},Dt.prototype.off=function(t,e){return Lt(t,e,this._listeners),Lt(t,e,this._oneTimeListeners),this},Dt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},It(t,e,this._oneTimeListeners),this},Dt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Pt(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];Lt(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 zt&&console.error(t.error);return this},Dt.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)},Dt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Ot={$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"}}},Rt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ft(t){var e=t.key,r=t.value;return r?[new Rt(e,r,"constants have been deprecated as of v8")]:[]}function Bt(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 jt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Nt(t){if(Array.isArray(t))return t.map(Nt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Nt(t[r]);return e}return jt(t)}var Ut=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),Vt=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}};Vt.prototype.concat=function(t){return new Vt(this,t)},Vt.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.")},Vt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var qt={kind:"null"},Ht={kind:"number"},Gt={kind:"string"},Wt={kind:"boolean"},Zt={kind:"color"},Yt={kind:"object"},Xt={kind:"value"},$t={kind:"collator"},Kt={kind:"formatted"},Jt={kind:"resolvedImage"};function Qt(t,e){return{kind:"array",itemType:t,N:e}}function te(t){if("array"===t.kind){var e=te(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ee=[qt,Ht,Gt,Wt,Zt,Kt,Yt,Qt(Xt),Jt];function re(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!re(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=ee;r<n.length;r+=1)if(!re(n[r],e))return null}return"Expected "+te(t)+" but found "+te(e)+" instead."}function ne(t,e){return e.some((function(e){return e.kind===t.kind}))}function ie(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 ae=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("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),f=1;switch(u){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{}})).parseCSSColor,oe=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};oe.parse=function(t){if(t){if(t instanceof oe)return t;if("string"==typeof t){var e=ae(t);if(e)return new oe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},oe.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+")"},oe.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]},oe.black=new oe(0,0,0,1),oe.white=new oe(1,1,1,1),oe.transparent=new oe(0,0,0,0),oe.red=new oe(1,0,0,1);var se=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"})};se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var le=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ce=function(t){this.sections=t};ce.fromString=function(t){return new ce([new le(t,null,null,null,null)])},ce.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}))},ce.factory=function(t){return t instanceof ce?t:ce.fromString(t)},ce.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ce.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 ue=function(t){this.name=t.name,this.available=t.available};function he(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?typeof n>"u"||"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 fe(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 oe)return!0;if(t instanceof se)return!0;if(t instanceof ce)return!0;if(t instanceof ue)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!fe(r[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!fe(t[n]))return!1;return!0}return!1}function pe(t){if(null===t)return qt;if("string"==typeof t)return Gt;if("boolean"==typeof t)return Wt;if("number"==typeof t)return Ht;if(t instanceof oe)return Zt;if(t instanceof se)return $t;if(t instanceof ce)return Kt;if(t instanceof ue)return Jt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=pe(i[n]);if(e){if(e===a)continue;e=Xt;break}e=a}return Qt(e||Xt,r)}return Yt}function de(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof oe||t instanceof ce||t instanceof ue?t.toString():JSON.stringify(t)}ue.prototype.toString=function(){return this.name},ue.fromString=function(t){return t?new ue({name:t,available:!1}):null},ue.prototype.serialize=function(){return["image",this.name]};var me=function(t,e){this.type=t,this.value=e};me.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!fe(t[1]))return e.error("invalid value");var r=t[1],n=pe(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 me(n,r)},me.prototype.evaluate=function(){return this.value},me.prototype.eachChild=function(){},me.prototype.outputDefined=function(){return!0},me.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof oe?["rgba"].concat(this.value.toArray()):this.value instanceof ce?this.value.serialize():this.value};var ge=function(t){this.name="ExpressionEvaluationError",this.message=t};ge.prototype.toJSON=function(){return this.message};var ye={string:Gt,number:Ht,boolean:Wt,object:Yt},ve=function(t,e){this.type=t,this.args=e};ve.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 ye)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=ye[s],n++}else a=Xt;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=Qt(a,o)}else r=ye[i];for(var l=[];n<t.length;n++){var c=e.parse(t[n],n,Xt);if(!c)return null;l.push(c)}return new ve(r,l)},ve.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!re(this.type,pe(r)))return r;if(e===this.args.length-1)throw new ge("Expected value to be of type "+te(this.type)+", but found "+te(pe(r))+" instead.")}return null},ve.prototype.eachChild=function(t){this.args.forEach(t)},ve.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ve.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 xe=function(t){this.type=Kt,this.sections=t};xe.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,Ht)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Qt(Gt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Zt)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=e.parse(t[a],1,Xt);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 xe(n)},xe.prototype.evaluate=function(t){return new ce(this.sections.map((function(e){var r=e.content.evaluate(t);return pe(r)===Jt?new le("",r,null,null,null):new le(de(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},xe.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)}},xe.prototype.outputDefined=function(){return!1},xe.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 _e=function(t){this.type=Jt,this.input=t};_e.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Gt);return r?new _e(r):e.error("No image name provided.")},_e.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=ue.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},_e.prototype.eachChild=function(t){t(this.input)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return["image",this.input.serialize()]};var be={"to-boolean":Wt,"to-color":Zt,"to-number":Ht,"to-string":Gt},we=function(t,e){this.type=t,this.args=e};we.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=be[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,Xt);if(!o)return null;i.push(o)}return new we(n,i)},we.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 oe)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.":he(e[0],e[1],e[2],e[3])))return new oe(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ge(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 c=Number(o);if(!isNaN(c))return c}throw new ge("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?ce.fromString(de(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ue.fromString(de(this.args[0].evaluate(t))):de(this.args[0].evaluate(t))},we.prototype.eachChild=function(t){this.args.forEach(t)},we.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},we.prototype.serialize=function(){if("formatted"===this.type.kind)return new xe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new _e(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Te=["Unknown","Point","LineString","Polygon"],Ae=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Ae.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Ae.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Te[this.feature.type]:this.feature.type:null},Ae.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Ae.prototype.canonicalID=function(){return this.canonical},Ae.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Ae.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=oe.parse(t)),e};var ke=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};ke.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ke.prototype.eachChild=function(t){this.args.forEach(t)},ke.prototype.outputDefined=function(){return!1},ke.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ke.parse=function(t,e){var r,n=t[0],i=ke.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,c=0,u=s;c<u.length;c+=1){var h=u[c],f=h[0],p=h[1];l=new $e(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 ke(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;return e=t[0],Array.isArray(e)?"("+e.map(te).join(", ")+")":"("+te(e.type)+"...)"})).join(" | "),A=[],k=1;k<t.length;k++){var M=e.parse(t[k],1+A.length);if(!M)return null;A.push(te(M.type))}e.error("Expected arguments of type "+T+", but found ("+A.join(", ")+") instead.")}return null},ke.register=function(t,e){for(var r in ke.definitions=e,e)t[r]=ke};var Me=function(t,e,r){this.type=$t,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};Me.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,Wt);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Wt);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Gt))?null:new Me(n,i,a)},Me.prototype.evaluate=function(t){return new se(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Me.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Me.prototype.outputDefined=function(){return!1},Me.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 Se=8192;function Ee(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 Ce(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ie(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*Se),Math.round(n*i*Se)]}function Le(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 Pe(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 ze(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(Le(t,a[o],a[o+1]))return!1;Pe(t,a[o],a[o+1])&&(r=!r)}return r}function De(t,e){for(var r=0;r<e.length;r++)if(ze(t,e[r]))return!0;return!1}function Oe(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],c=n[1]-r[1],u=i*c-l*a,h=o*c-l*s;return u>0&&h<0||u<0&&h>0}function Re(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)&&!(!Oe(t,e,r,n)||!Oe(r,n,t,e))}function Fe(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(Re(t,e,a[o],a[o+1]))return!0;return!1}function Be(t,e){for(var r=0;r<t.length;++r)if(!ze(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Fe(t[n],t[n+1],e))return!1;return!0}function je(t,e){for(var r=0;r<e.length;r++)if(Be(t,e[r]))return!0;return!1}function Ne(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var a=[],o=0;o<t[i].length;o++){var s=Ie(t[i][o],r);Ee(e,s),a.push(s)}n.push(a)}return n}function Ue(t,e,r){for(var n=[],i=0;i<t.length;i++){var a=Ne(t[i],e,r);n.push(a)}return n}function Ve(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}Ee(e,t)}function qe(t,e,r,n){for(var i=Math.pow(2,n.z)*Se,a=[n.x*Se,n.y*Se],o=[],s=0,l=t;s<l.length;s+=1)for(var c=0,u=l[s];c<u.length;c+=1){var h=u[c],f=[h.x+a[0],h.y+a[1]];Ve(f,e,r,i),o.push(f)}return o}function He(t,e,r,n){for(var i=Math.pow(2,n.z)*Se,a=[n.x*Se,n.y*Se],o=[],s=0,l=t;s<l.length;s+=1){for(var c=[],u=0,h=l[s];u<h.length;u+=1){var f=h[u],p=[f.x+a[0],f.y+a[1]];Ee(e,p),c.push(p)}o.push(c)}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)Ve(y[g],e,r,i)}return o}var Ge=function(t,e){this.type=Wt,this.geojson=t,this.geometries=e};function We(t){if(t instanceof ke){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 Ge)return!1;var e=!0;return t.eachChild((function(t){e&&!We(t)&&(e=!1)})),e}function Ze(t){if(t instanceof ke&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Ze(t)&&(e=!1)})),e}function Ye(t,e){if(t instanceof ke&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ye(t,e)&&(r=!1)})),r}Ge.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(fe(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 Ge(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Ge(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Ge(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ge.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=Ne(e.coordinates,n,i),o=qe(t.geometry(),r,n,i);if(!Ce(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!ze(l[s],a))return!1}if("MultiPolygon"===e.type){var c=Ue(e.coordinates,n,i),u=qe(t.geometry(),r,n,i);if(!Ce(r,n))return!1;for(var h=0,f=u;h<f.length;h+=1)if(!De(f[h],c))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=Ne(e.coordinates,n,i),o=He(t.geometry(),r,n,i);if(!Ce(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Be(l[s],a))return!1}if("MultiPolygon"===e.type){var c=Ue(e.coordinates,n,i),u=He(t.geometry(),r,n,i);if(!Ce(r,n))return!1;for(var h=0,f=u;h<f.length;h+=1)if(!je(f[h],c))return!1}return!0}(t,this.geometries)}return!1},Ge.prototype.eachChild=function(){},Ge.prototype.outputDefined=function(){return!0},Ge.prototype.serialize=function(){return["within",this.geojson]};var Xe=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Xe.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 Xe(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)},Xe.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Xe.prototype.eachChild=function(){},Xe.prototype.outputDefined=function(){return!1},Xe.prototype.serialize=function(){return["var",this.name]};var $e=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Vt),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 Ke(t){if(t instanceof Xe)return Ke(t.boundExpression);if(t instanceof ke&&"error"===t.name)return!1;if(t instanceof Me)return!1;if(t instanceof Ge)return!1;var e=t instanceof we||t instanceof ve,r=!0;return t.eachChild((function(t){r=e?r&&Ke(t):r&&t instanceof me})),!!r&&We(t)&&Ye(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Je(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 ge("Input is not a number.");o=s-1}return 0}$e.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)},$e.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ve(e,[t]):"coerce"===r?new we(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 me)&&"resolvedImage"!==a.type.kind&&Ke(a)){var l=new Ae;try{a=new me(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 typeof t>"u"?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.")},$e.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 $e(this.registry,n,e||null,i,this.errors)},$e.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 Ut(n,t))},$e.prototype.checkSubtype=function(t,e){var r=re(t,e);return r&&this.error(r),r};var Qe=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 tr(t,e,r){return t*(1-r)+e*r}Qe.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,Ht);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,c=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 u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Qe(i,r,n)},Qe.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[Je(e,n)].evaluate(t)},Qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Qe.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Qe.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 er=Object.freeze({__proto__:null,number:tr,color:function(t,e,r){return new oe(tr(t.r,e.r,r),tr(t.g,e.g,r),tr(t.b,e.b,r),tr(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return tr(t,e[n],r)}))}}),rr=.95047,nr=1.08883,ir=4/29,ar=6/29,or=3*ar*ar,sr=ar*ar*ar,lr=Math.PI/180,cr=180/Math.PI;function ur(t){return t>sr?Math.pow(t,1/3):t/or+ir}function hr(t){return t>ar?t*t*t:or*(t-ir)}function fr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function pr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function dr(t){var e=pr(t.r),r=pr(t.g),n=pr(t.b),i=ur((.4124564*e+.3575761*r+.1804375*n)/rr),a=ur((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-ur((.0193339*e+.119192*r+.9503041*n)/nr)),alpha:t.a}}function mr(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*hr(e),r=rr*hr(r),n=nr*hr(n),new oe(fr(3.2404542*r-1.5371385*e-.4985314*n),fr(-.969266*r+1.8760108*e+.041556*n),fr(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function gr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var yr={forward:dr,reverse:mr,interpolate:function(t,e,r){return{l:tr(t.l,e.l,r),a:tr(t.a,e.a,r),b:tr(t.b,e.b,r),alpha:tr(t.alpha,e.alpha,r)}}},vr={forward:function(t){var e=dr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*cr;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*lr,r=t.c;return mr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:gr(t.h,e.h,r),c:tr(t.c,e.c,r),l:tr(t.l,e.l,r),alpha:tr(t.alpha,e.alpha,r)}}},xr=Object.freeze({__proto__:null,lab:yr,hcl:vr}),_r=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],c=s[1];this.labels.push(l),this.outputs.push(c)}};function br(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.interpolationFactor=function(t,e,r,i){var a=0;if("exponential"===t.name)a=br(e,t.base,r,i);else if("linear"===t.name)a=br(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(br(e,1,r,i))}return a},_r.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,Ht)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Zt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u<a.length;u+=2){var h=a[u],f=a[u+1],p=u+3,d=u+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,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new _r(c,r,n,i,l):e.error("Type "+te(c)+" is not interpolatable.")},_r.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=Je(e,n),o=e[a],s=e[a+1],l=_r.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?er[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?vr.reverse(vr.interpolate(vr.forward(c),vr.forward(u),l)):yr.reverse(yr.interpolate(yr.forward(c),yr.forward(u),l))},_r.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},_r.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},_r.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 wr=function(t,e){this.type=t,this.args=e};wr.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 c=n&&i.some((function(t){return re(n,t.type)}));return new wr(c?Xt:r,i)},wr.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 ue&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},wr.prototype.eachChild=function(t){this.args.forEach(t)},wr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},wr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Tr=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Tr.prototype.evaluate=function(t){return this.result.evaluate(t)},Tr.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},Tr.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 Tr(r,o):null},Tr.prototype.outputDefined=function(){return this.result.outputDefined()},Tr.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 Ar=function(t,e,r){this.type=t,this.index=e,this.input=r};Ar.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,Ht),n=e.parse(t[2],2,Qt(e.expectedType||Xt));if(!r||!n)return null;var i=n.type;return new Ar(i.itemType,r,n)},Ar.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ge("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ge("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ge("Array index must be an integer, but found "+e+" instead.");return r[e]},Ar.prototype.eachChild=function(t){t(this.index),t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var kr=function(t,e){this.type=Wt,this.needle=t,this.haystack=e};kr.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,Xt),n=e.parse(t[2],2,Xt);return r&&n?ne(r.type,[Wt,Gt,Ht,qt,Xt])?new kr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},kr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(pe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(pe(r))+" instead.");return r.indexOf(e)>=0},kr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},kr.prototype.outputDefined=function(){return!0},kr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Mr=function(t,e,r){this.type=Ht,this.needle=t,this.haystack=e,this.fromIndex=r};Mr.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,Xt),n=e.parse(t[2],2,Xt);if(!r||!n)return null;if(!ne(r.type,[Wt,Gt,Ht,qt,Xt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Mr(r,n,i):null}return new Mr(r,n)},Mr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(pe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(pe(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Mr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Mr.prototype.outputDefined=function(){return!1},Mr.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 Sr=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};Sr.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 c=e.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(var u=0,h=s;u<h.length;u+=1){var f=h[u];if("number"!=typeof f&&"string"!=typeof f)return c.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,pe(f)))return null}else r=pe(f);if(typeof i[String(f)]<"u")return c.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,Xt);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 Sr(r,n,d,i,a,m)},Sr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(pe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Sr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Sr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Sr.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,c=r;l<c.length;l+=1){var u=c[l],h=u[0],f=u[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 Er=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};Er.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,Wt);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 Er(r,n,s):null},Er.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)},Er.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)},Er.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},Er.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Cr=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function Ir(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 Lr(t,e,r,n){return 0===n.compare(e,r)}function Pr(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Wt,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,Xt);if(!a)return null;if(!Ir(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+te(a.type)+"'.");var o=e.parse(t[2],2,Xt);if(!o)return null;if(!Ir(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+te(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+te(a.type)+"' and '"+te(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new ve(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new ve(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,$t)))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=pe(a),l=pe(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ge('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 c=pe(a),u=pe(o);if("string"!==c.kind||"string"!==u.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}()}Cr.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,Xt),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!ne(r.type,[Qt(Xt),Gt,Xt]))return e.error("Expected first argument to be of type array or string, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Cr(r.type,r,n,i):null}return new Cr(r.type,r,n)},Cr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ie(e,["string","array"]))throw new ge("Expected first argument to be of type array or string, but found "+te(pe(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Cr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Cr.prototype.outputDefined=function(){return!1},Cr.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 zr=Pr("==",(function(t,e,r){return e===r}),Lr),Dr=Pr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Lr(0,e,r,n)})),Or=Pr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Rr=Pr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Fr=Pr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Br=Pr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),jr=function(t,e,r,n,i){this.type=Gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};jr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ht);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,Gt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Gt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ht)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ht))?null:new jr(r,i,a,o,s)},jr.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))},jr.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)},jr.prototype.outputDefined=function(){return!1},jr.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 Nr=function(t){this.type=Ht,this.input=t};Nr.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 "+te(r.type)+" instead."):new Nr(r):null},Nr.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 ge("Expected value to be of type string or array, but found "+te(pe(e))+" instead.")},Nr.prototype.eachChild=function(t){t(this.input)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ur={"==":zr,"!=":Dr,">":Rr,"<":Or,">=":Br,"<=":Fr,array:ve,at:Ar,boolean:ve,case:Er,coalesce:wr,collator:Me,format:xe,image:_e,in:kr,"index-of":Mr,interpolate:_r,"interpolate-hcl":_r,"interpolate-lab":_r,length:Nr,let:Tr,literal:me,match:Sr,number:ve,"number-format":jr,object:ve,slice:Cr,step:Qe,string:ve,"to-boolean":we,"to-color":we,"to-number":we,"to-string":we,var:Xe,within:Ge};function Vr(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=he(r,n,i,o);if(s)throw new ge(s);return new oe(r/255*o,n/255*o,i/255*o,o)}function qr(t,e){return t in e}function Hr(t,e){var r=e[t];return typeof r>"u"?null:r}function Gr(t){return{type:t}}function Wr(t){return{result:"success",value:t}}function Zr(t){return{result:"error",value:t}}function Yr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Xr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function $r(t){return!!t.expression&&t.expression.interpolated}function Kr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Jr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Qr(t){return t}function tn(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,c=t.type||($r(e)?"exponential":"interval");if(a&&((t=Bt({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],oe.parse(t[1])]}))),t.default?t.default=oe.parse(t.default):t.default=oe.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!xr[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===c)r=an;else if("interval"===c)r=nn;else if("categorical"===c){r=rn,n=Object.create(null);for(var u=0,h=t.stops;u<h.length;u+=1){var f=h[u];n[f[0]]=f[1]}i=typeof t.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');r=on}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,tn(p[b],e)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:_r.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(t){return t[0]})),evaluate:function(r,n){var i=r.zoom;return an({stops:v,base:t.base},e,i).evaluate(i,n)}}}if(l){var T="exponential"===c?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:_r.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?en(t.default,e.default):r(t,e,s,n,i)}}}function en(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function rn(t,e,r,n,i){return en(typeof r===i?n[r]:void 0,t.default,e.default)}function nn(t,e,r){if("number"!==Kr(r))return en(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=Je(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function an(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Kr(r))return en(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=Je(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],c=er[e.type]||Qr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=xr[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.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 c(r,n,o)}}:c(s,l,o)}function on(t,e,r){return"color"===e.type?r=oe.parse(r):"formatted"===e.type?r=ce.fromString(r.toString()):"resolvedImage"===e.type?r=ue.fromString(r.toString()):Kr(r)!==e.type&&("enum"!==e.type||!e.values[r])&&(r=void 0),en(r,t.default,e.default)}ke.register(Ur,{error:[{kind:"error"},[Gt],function(t,e){var r=e[0];throw new ge(r.evaluate(t))}],typeof:[Gt,[Xt],function(t,e){return te(pe(e[0].evaluate(t)))}],"to-rgba":[Qt(Ht,4),[Zt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Zt,[Ht,Ht,Ht],Vr],rgba:[Zt,[Ht,Ht,Ht,Ht],Vr],has:{type:Wt,overloads:[[[Gt],function(t,e){return qr(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return qr(r.evaluate(t),n.evaluate(t))}]]},get:{type:Xt,overloads:[[[Gt],function(t,e){return Hr(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return Hr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Xt,[Gt],function(t,e){return Hr(e[0].evaluate(t),t.featureState||{})}],properties:[Yt,[],function(t){return t.properties()}],"geometry-type":[Gt,[],function(t){return t.geometryType()}],id:[Xt,[],function(t){return t.id()}],zoom:[Ht,[],function(t){return t.globals.zoom}],"heatmap-density":[Ht,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ht,[],function(t){return t.globals.lineProgress||0}],accumulated:[Xt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ht,Gr(Ht),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Ht,Gr(Ht),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Ht,overloads:[[[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[Ht],function(t,e){return-e[0].evaluate(t)}]]},"/":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[Ht,[],function(){return Math.LN2}],pi:[Ht,[],function(){return Math.PI}],e:[Ht,[],function(){return Math.E}],"^":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[Ht,[Ht],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Ht,[Ht],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Ht,[Ht],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Ht,[Ht],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Ht,[Ht],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Ht,[Ht],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Ht,[Ht],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Ht,Gr(Ht),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Ht,Gr(Ht),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Ht,[Ht],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Ht,[Ht],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ht,[Ht],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Ht,[Ht],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Wt,[Gt,Xt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Wt,[Xt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Wt,[Gt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Wt,[Gt,Xt],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-<":[Wt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Wt,[Gt,Xt],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->":[Wt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Wt,[Gt,Xt],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-<=":[Wt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Wt,[Gt,Xt],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->=":[Wt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Wt,[Xt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Wt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Wt,[Qt(Gt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Wt,[Qt(Xt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Wt,[Gt,Qt(Xt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Wt,[Gt,Qt(Xt)],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:Wt,overloads:[[[Wt,Wt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Gr(Wt),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:Wt,overloads:[[[Wt,Wt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[Gr(Wt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Wt,[Wt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Wt,[Gt],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[Gt,[Gt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Gt,[Gt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Gt,Gr(Xt),function(t,e){return e.map((function(e){return de(e.evaluate(t))})).join("")}],"resolved-locale":[Gt,[$t],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var sn=function(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new Ae,this._defaultValue=e?"color"===(r=e).type&&Jr(r.default)?new oe(0,0,0,0):"color"===r.type?oe.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function ln(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ur}function cn(t,e){var r=new $e(Ur,[],e?function(t){var e={color:Zt,string:Gt,number:Ht,enum:Gt,boolean:Wt,formatted:Kt,resolvedImage:Jt};return"array"===t.type?Qt(e[t.value]||Xt,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?Wr(new sn(n,e)):Zr(r.errors)}sn.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)},sn.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 ge("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,typeof console<"u"&&console.warn(t.message)),this._defaultValue}};var un=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ze(e.expression)};un.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},un.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var hn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ze(e.expression),this.interpolationType=n};function fn(t,e){if("error"===(t=cn(t,e)).result)return t;var r=t.value.expression,n=We(r);if(!n&&!Yr(e))return Zr([new Ut("","data expressions not supported")]);var i=Ye(r,["zoom"]);if(!i&&!Xr(e))return Zr([new Ut("","zoom expressions not supported")]);var a=dn(r);if(!a&&!i)return Zr([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ut)return Zr([a]);if(a instanceof _r&&!$r(e))return Zr([new Ut("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Wr(new un(n?"constant":"source",t.value));var o=a instanceof _r?a.interpolation:void 0;return Wr(new hn(n?"camera":"composite",t.value,a.labels,o))}hn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},hn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},hn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?_r.interpolationFactor(this.interpolationType,t,e,r):0};var pn=function(t,e){this._parameters=t,this._specification=e,Bt(this,tn(this._parameters,this._specification))};function dn(t){var e=null;if(t instanceof Tr)e=dn(t.result);else if(t instanceof wr)for(var r=0,n=t.args;r<n.length;r+=1){var i=n[r];if(e=dn(i))break}else(t instanceof Qe||t instanceof _r)&&t.input instanceof ke&&"zoom"===t.input.name&&(e=t);return e instanceof Ut||t.eachChild((function(t){var r=dn(t);r instanceof Ut?e=r:!e&&r?e=new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new Ut("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function mn(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],l=Kr(r);if("object"!==l)return[new Rt(e,r,"object expected, "+l+" found")];for(var c in r){var u=c.split(".")[0],h=n[u]||n["*"],f=void 0;if(i[u])f=i[u];else if(n[u])f=Vn;else if(i["*"])f=i["*"];else{if(!n["*"]){s.push(new Rt(e,r[c],'unknown property "'+c+'"'));continue}f=Vn}s=s.concat(f({key:(e&&e+".")+c,value:r[c],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:c},r))}for(var p in n)i[p]||n[p].required&&void 0===n[p].default&&void 0===r[p]&&s.push(new Rt(e,r,'missing required property "'+p+'"'));return s}function gn(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||Vn;if("array"!==Kr(e))return[new Rt(a,e,"array expected, "+Kr(e)+" found")];if(r.length&&e.length!==r.length)return[new Rt(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Rt(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"===Kr(r.value)&&(s=r.value);for(var l=[],c=0;c<e.length;c++)l=l.concat(o({array:e,arrayIndex:c,value:e[c],valueSpec:s,style:n,styleSpec:i,key:a+"["+c+"]"}));return l}function yn(t){var e=t.key,r=t.value,n=t.valueSpec,i=Kr(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new Rt(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Rt(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Rt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function vn(t){var e,r,n,i=t.valueSpec,a=jt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Kr(t.value.stops)&&"array"===Kr(t.value.stops[0])&&"object"===Kr(t.value.stops[0][0]),u=mn({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 Rt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(gn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Kr(r)&&0===r.length&&e.push(new Rt(t.key,r,"array must have at least one stop")),e},default:function(t){return Vn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Rt(t.key,t.value,'missing required property "property"')),"identity"!==a&&!t.value.stops&&u.push(new Rt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!$r(t.valueSpec)&&u.push(new Rt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Yr(t.valueSpec)?u.push(new Rt(t.key,t.value,"property functions not supported")):s&&!Xr(t.valueSpec)&&u.push(new Rt(t.key,t.value,"zoom functions not supported"))),("categorical"===a||c)&&void 0===t.value.property&&u.push(new Rt(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],a=t.value,s=t.key;if("array"!==Kr(a))return[new Rt(s,a,"array expected, "+Kr(a)+" found")];if(2!==a.length)return[new Rt(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Kr(a[0]))return[new Rt(s,a,"object expected, "+Kr(a[0])+" found")];if(void 0===a[0].zoom)return[new Rt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Rt(s,a,"object stop key must have value")];if(n&&n>jt(a[0].zoom))return[new Rt(s,a[0].zoom,"stop zoom values must appear in ascending order")];jt(a[0].zoom)!==n&&(n=jt(a[0].zoom),r=void 0,o={}),e=e.concat(mn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:yn,value:f}}))}else e=e.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return ln(Nt(a[1]))?e.concat([new Rt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Vn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=Kr(t.value),l=jt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Rt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Rt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Yr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Rt(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new Rt(t.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new Rt(t.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new Rt(t.key,c,"integer expected, found "+l)]}}function xn(t){var e=("property"===t.expressionContext?fn:cn)(Nt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Rt(""+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 Rt(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&&!Ze(r))return[new Rt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ze(r))return[new Rt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ye(r,["zoom","feature-state"]))return[new Rt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!We(r))return[new Rt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function _n(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(jt(r))&&i.push(new Rt(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(jt(r))&&i.push(new Rt(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function bn(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(!bn(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}pn.deserialize=function(t){return new pn(t._parameters,t._specification)},pn.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var wn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Tn(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};bn(t)||(t=Mn(t));var e=cn(t,wn);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:kn(t)}}function An(t,e){return t<e?-1:t>e?1:0}function kn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(kn(t[e]))return!0;return!1}function Mn(t){if(!t)return!0;var e=t[0];return t.length<=1?"any"!==e:"=="===e?Sn(t[1],t[2],"=="):"!="===e?In(Sn(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Sn(t[1],t[2],e):"any"===e?function(t){return["any"].concat(t.map(Mn))}(t.slice(1)):"all"===e?["all"].concat(t.slice(1).map(Mn)):"none"===e?["all"].concat(t.slice(1).map(Mn).map(In)):"in"===e?En(t[1],t.slice(2)):"!in"===e?In(En(t[1],t.slice(2))):"has"===e?Cn(t[1]):"!has"===e?In(Cn(t[1])):"within"!==e||t}function Sn(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 En(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(An)]]:["filter-in-small",t,["literal",e]]}}function Cn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function In(t){return["!",t]}function Ln(t){return bn(Nt(t.value))?xn(Bt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Pn(t)}function Pn(t){var e=t.value,r=t.key;if("array"!==Kr(e))return[new Rt(r,e,"array expected, "+Kr(e)+" found")];var n,i=t.styleSpec,a=[];if(e.length<1)return[new Rt(r,e,"filter array must have at least 1 element")];switch(a=a.concat(_n({key:r+"[0]",value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),jt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===jt(e[1])&&a.push(new Rt(r,e,'"$type" cannot be use with operator "'+e[0]+'"'));case"==":case"!=":3!==e.length&&a.push(new Rt(r,e,'filter array for operator "'+e[0]+'" must have 3 elements'));case"in":case"!in":e.length>=2&&"string"!==(n=Kr(e[1]))&&a.push(new Rt(r+"[1]",e[1],"string expected, "+n+" found"));for(var o=2;o<e.length;o++)n=Kr(e[o]),"$type"===jt(e[1])?a=a.concat(_n({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 Rt(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(Pn({key:r+"["+s+"]",value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=Kr(e[1]),2!==e.length?a.push(new Rt(r,e,'filter array for "'+e[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new Rt(r+"[1]",e[1],"string expected, "+n+" found"));break;case"within":n=Kr(e[1]),2!==e.length?a.push(new Rt(r,e,'filter array for "'+e[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new Rt(r+"[1]",e[1],"object expected, "+n+" found"))}return a}function zn(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 Vn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var c,u=t.valueSpec||s[o];if(!u)return[new Rt(r,a,'unknown property "'+o+'"')];if("string"===Kr(a)&&Yr(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(a)))return[new Rt(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&h.push(new Rt(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Jr(Nt(a))&&"identity"===jt(a.type)&&h.push(new Rt(r,a,'"text-font" does not support identity functions'))),h.concat(Vn({key:t.key,value:a,valueSpec:u,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function Dn(t){return zn(t,"paint")}function On(t){return zn(t,"layout")}function Rn(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;!r.type&&!r.ref&&e.push(new Rt(n,r,'either "type" or "ref" is required'));var o,s=jt(r.type),l=jt(r.ref);if(r.id)for(var c=jt(r.id),u=0;u<t.arrayIndex;u++){var h=i.layers[u];jt(h.id)===c&&e.push(new Rt(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 Rt(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){jt(t.id)===l&&(o=t)})),o?o.ref?e.push(new Rt(n,r.ref,"ref cannot reference another ref layer")):s=jt(o.type):e.push(new Rt(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&&jt(f.type);f?"vector"===p&&"raster"===s?e.push(new Rt(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===p&&"raster"!==s?e.push(new Rt(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==p||r["source-layer"]?"raster-dem"===p&&"hillshade"!==s?e.push(new Rt(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 Rt(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Rt(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Rt(n,r.source,'source "'+r.source+'" not found'))}else e.push(new Rt(n,r,'missing required property "source"'));return e=e.concat(mn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Vn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Ln,layout:function(t){return mn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return On(Bt({layerType:s},t))}}})},paint:function(t){return mn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Dn(Bt({layerType:s},t))}}})}}}))}function Fn(t){var e=t.value,r=t.key,n=Kr(e);return"string"!==n?[new Rt(r,e,"string expected, "+n+" found")]:[]}var Bn={promoteId:function(t){var e=t.key,r=t.value;if("string"===Kr(r))return Fn({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,Fn({key:e+"."+i,value:r[i]}));return n}};function jn(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new Rt(r,e,'"type" is required')];var a,o=jt(e.type);switch(o){case"vector":case"raster":case"raster-dem":return mn({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:Bn});case"geojson":if(a=mn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Bn}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],c=l[0],u=l[1],h="string"==typeof c?[c,["accumulated"],["get",s]]:c;a.push.apply(a,xn({key:r+"."+s+".map",value:u,expressionContext:"cluster-map"})),a.push.apply(a,xn({key:r+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return a;case"video":return mn({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return mn({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new Rt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return _n({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Nn(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=Kr(e);if(void 0===e)return a;if("object"!==o)return a.concat([new Rt("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(Vn({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?a.concat(Vn({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a.concat([new Rt(s,e[s],'unknown property "'+s+'"')])}return a}var Un={"*":function(){return[]},array:gn,boolean:function(t){var e=t.value,r=t.key,n=Kr(e);return"boolean"!==n?[new Rt(r,e,"boolean expected, "+n+" found")]:[]},number:yn,color:function(t){var e=t.key,r=t.value,n=Kr(r);return"string"!==n?[new Rt(e,r,"color expected, "+n+" found")]:null===ae(r)?[new Rt(e,r,'color expected, "'+r+'" found')]:[]},constants:Ft,enum:_n,filter:Ln,function:vn,layer:Rn,object:mn,source:jn,light:Nn,string:Fn,formatted:function(t){return 0===Fn(t).length?[]:xn(t)},resolvedImage:function(t){return 0===Fn(t).length?[]:xn(t)}};function Vn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Jr(jt(e))?vn(t):r.expression&&ln(Nt(e))?xn(t):r.type&&Un[r.type]?Un[r.type](t):mn(Bt({},t,{valueSpec:r.type?n[r.type]:r}))}function qn(t){var e=t.value,r=t.key,n=Fn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Rt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Rt(r,e,'"glyphs" url must include a "{range}" token'))),n}function Hn(t,e){void 0===e&&(e=Ot);var r=[];return r=r.concat(Vn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:qn,"*":function(){return[]}}})),t.constants&&(r=r.concat(Ft({key:"constants",value:t.constants,style:t,styleSpec:e}))),Gn(r)}function Gn(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Wn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Gn(t.apply(this,e))}}Hn.source=Wn(jn),Hn.light=Wn(Nn),Hn.layer=Wn(Rn),Hn.filter=Wn(Ln),Hn.paintProperty=Wn(Dn),Hn.layoutProperty=Wn(On);var Zn=Hn,Yn=Zn.light,Xn=Zn.paintProperty,$n=Zn.layoutProperty;function Kn(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 zt(new Error(a.message))),r=!0}return r}var Jn=ti,Qn=3;function ti(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[Qn+a],s=i[Qn+a+1];n.push(o===s?null:i.subarray(o,s))}var l=i[Qn+n.length],c=i[Qn+n.length+1];this.keys=i.subarray(l,c),this.bboxes=i.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var u=0;u<this.d*this.d;u++)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}ti.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)},ti.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ti.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},ti.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},ti.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var f=l[h];if(void 0===o[f]){var p=4*f;(s?s(u[p+0],u[p+1],u[p+2],u[p+3]):t<=u[p+2]&&e<=u[p+3]&&r>=u[p+0]&&n>=u[p+1])?(o[f]=!0,a.push(c[f])):o[f]=!1}}},ti.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),f=l;f<=u;f++)for(var p=c;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}},ti.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ti.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ti.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Qn+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[Qn+o]=a,i.set(s,a),a+=s.length}return i[Qn+t.length]=a,i.set(this.keys,a),a+=this.keys.length,i[Qn+t.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var ei=s.ImageData,ri=s.ImageBitmap,ni={};function ii(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ni[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var ai in ii("Object",Object),Jn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Jn.deserialize=function(t){return new Jn(t.buffer)},ii("Grid",Jn),ii("Color",oe),ii("Error",Error),ii("ResolvedImage",ue),ii("StylePropertyFunction",pn),ii("StyleExpression",sn,{omit:["_evaluator"]}),ii("ZoomDependentExpression",hn),ii("ZoomConstantExpression",un),ii("CompoundExpression",ke,{omit:["_evaluate"]}),Ur)Ur[ai]._classRegistryKey||ii("Expression_"+ai,Ur[ai]);function oi(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function si(t){return ri&&t instanceof ri}function li(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(oi(t)||si(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof ei)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(li(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 c=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var u in t)if(t.hasOwnProperty(u)&&!(ni[l].omit.indexOf(u)>=0)){var h=t[u];c[u]=ni[l].shallow.indexOf(u)>=0?h:li(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function ci(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||oi(t)||si(t)||ArrayBuffer.isView(t)||t instanceof ei)return t;if(Array.isArray(t))return t.map(ci);if("object"==typeof t){var e=t.$name||"Object",r=ni[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]=ni[e].shallow.indexOf(o)>=0?s:ci(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var ui=function(){this.first=!0};ui.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 hi={"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 fi(t){for(var e=0,r=t;e<r.length;e+=1)if(mi(r[e].charCodeAt(0)))return!0;return!1}function pi(t){return!(hi.Arabic(t)||hi["Arabic Supplement"](t)||hi["Arabic Extended-A"](t)||hi["Arabic Presentation Forms-A"](t)||hi["Arabic Presentation Forms-B"](t))}function di(t){return!(t<11904||!(hi["Bopomofo Extended"](t)||hi.Bopomofo(t)||hi["CJK Compatibility Forms"](t)||hi["CJK Compatibility Ideographs"](t)||hi["CJK Compatibility"](t)||hi["CJK Radicals Supplement"](t)||hi["CJK Strokes"](t)||hi["CJK Symbols and Punctuation"](t)||hi["CJK Unified Ideographs Extension A"](t)||hi["CJK Unified Ideographs"](t)||hi["Enclosed CJK Letters and Months"](t)||hi["Halfwidth and Fullwidth Forms"](t)||hi.Hiragana(t)||hi["Ideographic Description Characters"](t)||hi["Kangxi Radicals"](t)||hi["Katakana Phonetic Extensions"](t)||hi.Katakana(t)||hi["Vertical Forms"](t)||hi["Yi Radicals"](t)||hi["Yi Syllables"](t)))}function mi(t){return 746===t||747===t||!(t<4352)&&!!(hi["Bopomofo Extended"](t)||hi.Bopomofo(t)||hi["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||hi["CJK Compatibility Ideographs"](t)||hi["CJK Compatibility"](t)||hi["CJK Radicals Supplement"](t)||hi["CJK Strokes"](t)||hi["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&12336!==t||hi["CJK Unified Ideographs Extension A"](t)||hi["CJK Unified Ideographs"](t)||hi["Enclosed CJK Letters and Months"](t)||hi["Hangul Compatibility Jamo"](t)||hi["Hangul Jamo Extended-A"](t)||hi["Hangul Jamo Extended-B"](t)||hi["Hangul Jamo"](t)||hi["Hangul Syllables"](t)||hi.Hiragana(t)||hi["Ideographic Description Characters"](t)||hi.Kanbun(t)||hi["Kangxi Radicals"](t)||hi["Katakana Phonetic Extensions"](t)||hi.Katakana(t)&&12540!==t||!(!hi["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)||!(!hi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||hi["Unified Canadian Aboriginal Syllabics"](t)||hi["Unified Canadian Aboriginal Syllabics Extended"](t)||hi["Vertical Forms"](t)||hi["Yijing Hexagram Symbols"](t)||hi["Yi Syllables"](t)||hi["Yi Radicals"](t))}function gi(t){return!(mi(t)||function(t){return!!(hi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||hi["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)||hi["Letterlike Symbols"](t)||hi["Number Forms"](t)||hi["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)||hi["Control Pictures"](t)&&9251!==t||hi["Optical Character Recognition"](t)||hi["Enclosed Alphanumerics"](t)||hi["Geometric Shapes"](t)||hi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||hi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||hi["CJK Symbols and Punctuation"](t)||hi.Katakana(t)||hi["Private Use Area"](t)||hi["CJK Compatibility Forms"](t)||hi["Small Form Variants"](t)||hi["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 yi(t){return hi.Arabic(t)||hi["Arabic Supplement"](t)||hi["Arabic Extended-A"](t)||hi["Arabic Presentation Forms-A"](t)||hi["Arabic Presentation Forms-B"](t)}function vi(t){return t>=1424&&t<=2303||hi["Arabic Presentation Forms-A"](t)||hi["Arabic Presentation Forms-B"](t)}function xi(t,e){return!(!e&&vi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||hi.Khmer(t))}function _i(t){for(var e=0,r=t;e<r.length;e+=1)if(vi(r[e].charCodeAt(0)))return!0;return!1}var bi="deferred",wi="loading",Ti="loaded",Ai=null,ki="unavailable",Mi=null,Si=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(ki="error"),Ai&&Ai(t)};function Ei(){Ci.fire(new Pt("pluginStateChange",{pluginStatus:ki,pluginURL:Mi}))}var Ci=new Dt,Ii=function(){return ki},Li=function(){if(ki!==bi||!Mi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ki=wi,Ei(),Mi&&Tt({url:Mi},(function(t){t?Si(t):(ki=Ti,Ei())}))},Pi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ki===Ti||null!=Pi.applyArabicShaping},isLoading:function(){return ki===wi},setState:function(t){ki=t.pluginStatus,Mi=t.pluginURL},isParsed:function(){return null!=Pi.applyArabicShaping&&null!=Pi.processBidirectionalText&&null!=Pi.processStyledBidirectionalText},getPluginURL:function(){return Mi}},zi=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 ui,this.transition={})};zi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!xi(n[r].charCodeAt(0),e))return!1;return!0}(t,Pi.isLoaded())},zi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},zi.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 Di=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Jr(t))return new pn(t,e);if(ln(t)){var r=fn(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=oe.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Di.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Di.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Oi=function(t){this.property=t,this.value=new Di(t,void 0)};Oi.prototype.transitioned=function(t,e){return new Fi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},Oi.prototype.untransitioned=function(){return new Fi(this.property,this.value,null,{},0)};var Ri=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Ri.prototype.getValue=function(t){return w(this._values[t].value.value)},Ri.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Oi(this._values[t].property)),this._values[t].value=new Di(this._values[t].property,null===e?void 0:w(e))},Ri.prototype.getTransition=function(t){return w(this._values[t].transition)},Ri.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Oi(this._values[t].property)),this._values[t].transition=w(e)||void 0},Ri.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},Ri.prototype.transitioned=function(t,e){for(var r=new Bi(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},Ri.prototype.untransitioned=function(){for(var t=new Bi(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 Fi=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)};Fi.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 Bi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Bi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Ui(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},Bi.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 ji=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};ji.prototype.getValue=function(t){return w(this._values[t].value)},ji.prototype.setValue=function(t,e){this._values[t]=new Di(this._values[t].property,null===e?void 0:w(e))},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)}return t},ji.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Ui(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 Ni=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Ni.prototype.isConstant=function(){return"constant"===this.value.kind},Ni.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Ni.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var Ui=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Ui.prototype.get=function(t){return this._values[t]};var Vi=function(t){this.specification=t};Vi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Vi.prototype.interpolate=function(t,e,r){var n=er[this.specification.type];return n?n(t,e,r):t};var qi=function(t,e){this.specification=t,this.overrides=e};qi.prototype.possiblyEvaluate=function(t,e,r,n){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Ni(this,{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)},e):new Ni(this,t.expression,e)},qi.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 Ni(this,{kind:"constant",value:void 0},t.parameters);var n=er[this.specification.type];return n?new Ni(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},qi.prototype.evaluate=function(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)};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.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new Ni(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 Ni(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 Ni(this,{kind:"constant",value:s},e)}return new Ni(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}(qi),Gi=function(t){this.specification=t};Gi.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 zi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new zi(Math.floor(e.zoom),e)),t.expression.evaluate(new zi(Math.floor(e.zoom+1),e)),e)}},Gi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Gi.prototype.interpolate=function(t){return t};var Wi=function(t){this.specification=t};Wi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Wi.prototype.interpolate=function(){return!1};var Zi=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 Di(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Oi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};ii("DataDrivenProperty",qi),ii("DataConstantProperty",Vi),ii("CrossFadedDataDrivenProperty",Hi),ii("CrossFadedProperty",Gi),ii("ColorRampProperty",Wi);var Yi="-transition",Xi=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 ji(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Ri(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 Ui(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($n,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return x(t,Yi)?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(Xn,n,t,e,r))return!1}if(x(t,Yi))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)&&Kn(this,t.call(Zn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Ot,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 Ni&&Yr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Dt),$i={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ki=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},Ji=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Qi(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=function(t){return $i[t].BYTES_PER_ELEMENT}(t.type),a=r=ta(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:ta(r,Math.max(n,e)),alignment:e}}function ta(t,e){return Math.ceil(t/e)*e}Ji.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ji.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},Ji.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ji.prototype.clear=function(){this.length=0},Ji.prototype.resize=function(t){this.reserve(t),this.length=t},Ji.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)}},Ji.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};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._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}(Ji);ea.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",ea);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._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}(Ji);ra.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",ra);var na=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}(Ji);na.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",na);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._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}(Ji);ia.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",ia);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.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}(Ji);aa.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){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]=c,this.uint16[h+9]=u,t},e}(Ji);oa.prototype.bytesPerElement=20,ii("StructArrayLayout10ui20",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),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,c,u,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,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]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,t},e}(Ji);sa.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",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.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}(Ji);la.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",la);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.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}(Ji);ca.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",ca);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.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 c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Ji);ua.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",ua);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)},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}(Ji);ha.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",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),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}(Ji);fa.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",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.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}(Ji);pa.prototype.bytesPerElement=12,ii("StructArrayLayout2ub2f12",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.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}(Ji);da.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",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),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,c,u,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,c,u,h,f,p,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,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]=c,this.uint16[v+12]=u,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}(Ji);ma.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",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.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,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,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]=c,this.uint16[C+9]=u,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]=A,this.float32[I+13]=k,this.float32[I+14]=M,this.float32[I+15]=S,this.float32[I+16]=E,t},e}(Ji);ga.prototype.bytesPerElement=68,ii("StructArrayLayout8i15ui1ul4f68",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){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}(Ji);ya.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",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.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}(Ji);va.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",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.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}(Ji);xa.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",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.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}(Ji);_a.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",_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.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}(Ji);ba.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",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.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}(Ji);wa.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",wa);var Ta=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}(Ki);Ta.prototype.size=20;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.get=function(t){return new Ta(this,t)},e}(ua);ii("CollisionBoxArray",Aa);var ka=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}(Ki);ka.prototype.size=48;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.get=function(t){return new ka(this,t)},e}(ma);ii("PlacedSymbolArray",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={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}(Ki);Sa.prototype.size=68;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}(ga);ii("SymbolInstanceArray",Ea);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.getoffsetX=function(t){return this.float32[1*t+0]},e}(ya);ii("GlyphOffsetArray",Ca);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.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}(va);ii("SymbolLineVertexArray",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={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}(Ki);La.prototype.size=8;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}(xa);ii("FeatureIndexArray",Pa);var za=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,Da=function(t){void 0===t&&(t=[]),this.segments=t};function Oa(t,e){return 256*(t=h(Math.floor(t),0,255))+h(Math.floor(e),0,255)}Da.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Da.MAX_VERTEX_ARRAY_LENGTH&&A("Max vertices per segment is "+Da.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Da.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},Da.prototype.get=function(){return this.segments},Da.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()}},Da.simpleSegment=function(t,e,r,n){return new Da([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Da.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ii("SegmentVector",Da);var Ra=Qi([{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"}]),Fa=e((function(t){t.exports=function(t,e){var r,n,i,a,o,s,l,c;for(r=3&t.length,n=t.length-r,i=e,o=3432918353,s=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,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(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*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}})),Ba=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}})),ja=Fa,Na=Fa,Ua=Ba;ja.murmur3=Na,ja.murmur2=Ua;var Va=function(){this.ids=[],this.positions=[],this.indexed=!1};Va.prototype.add=function(t,e,r,n){this.ids.push(Ha(t)),this.positions.push(e,r,n)},Va.prototype.getPositions=function(t){for(var e=Ha(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},Va.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Ga(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},Va.deserialize=function(t){var e=new Va;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var qa=Math.pow(2,53)-1;function Ha(t){var e=+t;return!isNaN(e)&&e<=qa?e:ja(String(t))}function Ga(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;Wa(t,a,o),Wa(e,3*a,3*o),Wa(e,3*a+1,3*o+1),Wa(e,3*a+2,3*o+2)}o-r<n-o?(Ga(t,e,r,o),r=o+1):(Ga(t,e,o+1,n),n=o)}}function Wa(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}ii("FeaturePositionMap",Va);var Za=function(t,e){this.gl=t.gl,this.location=e},Ya=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}(Za),Xa=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}(Za),$a=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}(Za),Ka=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}(Za),Ja=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}(Za),Qa=function(t){function e(e,r){t.call(this,e,r),this.current=oe.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}(Za),to=new Float32Array(16),eo=function(t){function e(e,r){t.call(this,e,r),this.current=to}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}(Za);function ro(t){return[Oa(255*t.r,255*t.g),Oa(255*t.b,255*t.a)]}var no=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};no.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},no.prototype.getBinding=function(t,e,r){return"color"===this.type?new Qa(t,e):new Xa(t,e)};var io=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};io.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},io.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)},io.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new Ja(t,e):new Xa(t,e)};var ao=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};ao.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new zi(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)},ao.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)},ao.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=ro(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))}},ao.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))},ao.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var oo=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};oo.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.expression.evaluate(new zi(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new zi(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)},oo.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)},oo.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=ro(r),a=ro(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))}},oo.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))},oo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},oo.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)},oo.prototype.getBinding=function(t,e,r){return new Xa(t,e)};var so=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};so.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)},so.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)},so.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],c=n[o];if(s&&l&&c)for(var u=t;u<e;u++)this.zoomInPaintVertexArray.emplace(u,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(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}},so.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Ra.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Ra.members,this.expression.isStateDependent))},so.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var lo=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 Ni&&Yr(a.property.specification)){var o=uo(i,t.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new io(s.value,o):new no(s.value,o,l),n.push("/u_"+i);else if("source"===s.kind||h){var f=ho(i,l,"source");this.binders[i]=h?new so(s,l,c,e,f,t.id):new ao(s,o,l,f),n.push("/a_"+i)}else{var p=ho(i,l,"composite");this.binders[i]=new oo(s,o,l,c,e,p),n.push("/z_"+i)}}}this.cacheKey=n.sort().join("")};lo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof ao||e instanceof oo?e.maxValue:0},lo.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof ao||o instanceof oo||o instanceof so)&&o.populatePaintArray(t,e,r,n,i)}},lo.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof io&&n.setConstantPatternPositions(t,e)}},lo.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 c=l[s],u=r.feature(c.index);for(var h in this.binders){var f=this.binders[h];if((f instanceof ao||f instanceof oo||f instanceof so)&&!0===f.expression.isStateDependent){var p=n.paint.get(h);f.expression=p.value,f.updatePaintArray(c.start,c.end,u,t[o],i),a=!0}}}return a},lo.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof no||r instanceof io)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},lo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof ao||r instanceof oo)for(var n=0;n<r.paintVertexAttributes.length;n++)t.push(r.paintVertexAttributes[n].name);else if(r instanceof so)for(var i=0;i<Ra.members.length;i++)t.push(Ra.members[i].name)}return t},lo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof no||r instanceof io||r instanceof oo)for(var n=0,i=r.uniformNames;n<i.length;n+=1){var a=i[n];t.push(a)}}return t},lo.prototype.getPaintVertexBuffers=function(){return this._buffers},lo.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof no||i instanceof io||i instanceof oo)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},lo.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,c=o.binding;this.binders[l].setUniform(c,n,r.get(l),s)}},lo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof so){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof ao||r instanceof oo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},lo.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof ao||r instanceof oo||r instanceof so)&&r.upload(t)}this.updatePaintBuffers()},lo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof ao||e instanceof oo||e instanceof so)&&e.destroy()}};var co=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 lo(a,e,r)}this.needsUpload=!1,this._featureMap=new Va,this._bufferOffset=0};function uo(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 ho(t,e,r){var n={color:{source:aa,composite:wa},number:{source:ya,composite:aa}},i=function(t){return{"line-pattern":{source:oa,composite:oa},"fill-pattern":{source:oa,composite:oa},"fill-extrusion-pattern":{source:oa,composite:oa}}[t]}(t);return i&&i[r]||n[e][r]}co.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},co.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}},co.prototype.get=function(t){return this.programConfigurations[t]},co.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},co.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},ii("ConstantBinder",no),ii("CrossFadedConstantBinder",io),ii("SourceExpressionBinder",ao),ii("CrossFadedCompositeBinder",so),ii("CompositeExpressionBinder",oo),ii("ProgramConfiguration",lo,{omit:["_buffers"]}),ii("ProgramConfigurationSet",co);var fo=8192,po=Math.pow(2,14)-1,mo=-po-1;function go(t){for(var e=fo/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,mo,po),o.y=h(l,mo,po),(s<o.x||s>o.x+1||l<o.y||l>o.y+1)&&A("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function yo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?go(t):[]}}function vo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var xo=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 ea,this.indexArray=new da,this.segments=new Da,this.programConfigurations=new co(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function _o(t,e){for(var r=0;r<t.length;r++)if(Co(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(Co(t,e[n]))return!0;return!!Ao(t,e)}function bo(t,e,r){return!(!Co(t,e)&&!Mo(e,t,r))}function wo(t,e){if(1===t.length)return Eo(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Co(t,n[i]))return!0;for(var a=0;a<t.length;a++)if(Eo(e,t[a]))return!0;for(var o=0;o<e.length;o++)if(Ao(t,e[o]))return!0;return!1}function To(t,e,r){if(t.length>1){if(Ao(t,e))return!0;for(var n=0;n<e.length;n++)if(Mo(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(Mo(t[i],e,r))return!0;return!1}function Ao(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(ko(n,i,e[a],e[a+1]))return!0;return!1}function ko(t,e,r,n){return k(t,r,n)!==k(e,r,n)&&k(t,e,r)!==k(t,e,n)}function Mo(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(So(t,e[i-1],e[i])<n)return!0;return!1}function So(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 Eo(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 Co(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 Io(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=k(t,e,r[0]);return a!==k(t,e,r[1])||a!==k(t,e,r[2])||a!==k(t,e,r[3])}function Lo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Po(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zo(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 c=t[l];s.push(c.sub(o))}return s}xo.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],c=l.feature,u=l.id,h=l.index,f=l.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d=yo(c,p);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),d,r)){var m=a?a.evaluate(d,{},r):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:f,index:h,geometry:p?d.geometry:go(c),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,A=t[w].feature;this.addFeature(x,b,w,r),e.featureIndex.insert(A,b,w,T,this.index)}},xo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},xo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,za),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},xo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xo.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],c=l.x,u=l.y;if(!(c<0||c>=fo||u<0||u>=fo)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=h.vertexLength;vo(this.layoutVertexArray,c,u,-1,-1),vo(this.layoutVertexArray,c,u,1,-1),vo(this.layoutVertexArray,c,u,1,1),vo(this.layoutVertexArray,c,u,-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)},ii("CircleBucket",xo,{omit:["layers"]});var Do=new Zi({"circle-sort-key":new qi(Ot.layout_circle["circle-sort-key"])}),Oo={paint:new Zi({"circle-radius":new qi(Ot.paint_circle["circle-radius"]),"circle-color":new qi(Ot.paint_circle["circle-color"]),"circle-blur":new qi(Ot.paint_circle["circle-blur"]),"circle-opacity":new qi(Ot.paint_circle["circle-opacity"]),"circle-translate":new Vi(Ot.paint_circle["circle-translate"]),"circle-translate-anchor":new Vi(Ot.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Vi(Ot.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Vi(Ot.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qi(Ot.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qi(Ot.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qi(Ot.paint_circle["circle-stroke-opacity"])}),layout:Do},Ro=typeof Float32Array<"u"?Float32Array:Array;function Fo(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 Bo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=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+_*c+b*p+w*y,t[3]=x*o+_*u+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+_*c+b*p+w*y,t[7]=x*o+_*u+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+_*c+b*p+w*y,t[11]=x*o+_*u+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+_*c+b*p+w*y,t[15]=x*o+_*u+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 jo,No=Bo;function Uo(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}jo=new Ro(3),Ro!=Float32Array&&(jo[0]=0,jo[1]=0,jo[2]=0),function(){var t=new Ro(4);Ro!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Vo=(function(){var t=new Ro(2);Ro!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,Oo)}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.queryRadius=function(t){var e=t;return Lo("circle-radius",this,e)+Lo("circle-stroke-width",this,e)+Po(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=zo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return qo(t,e)}))}(l,s),f=u?c*o:c,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=u?y:qo(y,s),x=f,_=Uo([],[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]),bo(h,v,x))return!0}return!1},e}(Xi));function qo(t,e){var r=Uo([],[t.x,t.y,0,1],e);return new a(r[0]/r[3],r[1]/r[3])}var Ho=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}(xo);function Go(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 Wo(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=Go({},{width:n,height:i},r);Zo(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 Zo(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 c=((r.y+l)*t.width+r.x)*a,u=((n.y+l)*e.width+n.x)*a,h=0;h<i.width*a;h++)s[u+h]=o[c+h];return e}ii("HeatmapBucket",Ho,{omit:["layers"]});var Yo=function(t,e){Go(this,t,1,e)};Yo.prototype.resize=function(t){Wo(this,t,1)},Yo.prototype.clone=function(){return new Yo({width:this.width,height:this.height},new Uint8Array(this.data))},Yo.copy=function(t,e,r,n,i){Zo(t,e,r,n,i,1)};var Xo=function(t,e){Go(this,t,4,e)};Xo.prototype.resize=function(t){Wo(this,t,4)},Xo.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},Xo.prototype.clone=function(){return new Xo({width:this.width,height:this.height},new Uint8Array(this.data))},Xo.copy=function(t,e,r,n,i){Zo(t,e,r,n,i,4)},ii("AlphaImage",Yo),ii("RGBAImage",Xo);var $o={paint:new Zi({"heatmap-radius":new qi(Ot.paint_heatmap["heatmap-radius"]),"heatmap-weight":new qi(Ot.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vi(Ot.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wi(Ot.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vi(Ot.paint_heatmap["heatmap-opacity"])})};function Ko(t){var e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new Xo({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,c=0;l<r;l++,c+=4){var u=l/(r-1),h=t.clips[o];a(s,c,h.start*(1-u)+h.end*u)}else for(var f=0,p=0;f<r;f++,p+=4)a(0,p,f/(r-1));return i}var Jo=function(t){function e(e){t.call(this,e,$o),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 Ho(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=Ko({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}(Xi),Qo={paint:new Zi({"hillshade-illumination-direction":new Vi(Ot.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Vi(Ot.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Vi(Ot.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Vi(Ot.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Vi(Ot.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Vi(Ot.paint_hillshade["hillshade-accent-color"])})},ts=function(t){function e(e){t.call(this,e,Qo)}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}(Xi),es=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,rs=is,ns=is;function is(t,e,r){r=r||2;var n,i,a,o,s,l,c,u=e&&e.length,h=u?e[0]*r:t.length,f=as(t,0,h,r,!0),p=[];if(!f||f.next===f.prev)return p;if(u&&(f=function(t,e,r,n){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=as(t,e[i]*n,i<a-1?e[i+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(gs(o));for(s.sort(fs),i=0;i<s.length;i++)ps(s[i],r),r=os(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);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ss(f,p,r,n,i,c),p}function as(t,e,r,n,i){var a,o;if(i===Cs(t,e,r,n)>0)for(a=e;a<r;a+=n)o=Ms(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=Ms(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function os(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==xs(n.prev,n,n.next))n=n.next;else{if(Ss(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ss(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=ms(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,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;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,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?cs(t,n,i,a):ls(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ss(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?ss(t=us(os(t),e,r),e,r,n,i,a,2):2===o&&hs(t,e,r,n,i,a):ss(os(t),e,r,n,i,a,1);break}}}function ls(t){var e=t.prev,r=t,n=t.next;if(xs(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ys(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&xs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function cs(t,e,r,n){var i=t.prev,a=t,o=t.next;if(xs(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,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=ms(s,l,e,r,n),f=ms(c,u,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function us(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!_s(i,a)&&bs(i,n,n.next,a)&&As(i,a)&&As(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ss(n),Ss(n.next),n=t=a),n=n.next}while(n!==t);return os(n)}function hs(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&vs(o,s)){var l=ks(o,s);return o=os(o,o.next),l=os(l,l.next),ss(o,e,r,n,i,a),void ss(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function fs(t,e){return t.x-e.x}function ps(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,c=r,u=r.x,h=r.y,f=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&ys(a<h?i:o,a,u,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),As(n,t)&&(l<f||l===f&&(n.x>r.x||n.x===r.x&&ds(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e),e){var r=ks(e,t);os(e,e.next),os(r,r.next)}}function ds(t,e){return xs(t.prev,t,e.prev)<0&&xs(e.next,t,t.next)<0}function ms(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 gs(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 ys(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 vs(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&&bs(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(As(t,e)&&As(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)&&(xs(t.prev,t,e.prev)||xs(t,e.prev,e))||_s(t,e)&&xs(t.prev,t,t.next)>0&&xs(e.prev,e,e.next)>0)}function xs(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function bs(t,e,r,n){var i=Ts(xs(t,e,r)),a=Ts(xs(t,e,n)),o=Ts(xs(r,n,t)),s=Ts(xs(r,n,e));return!!(i!==a&&o!==s||0===i&&ws(t,r,e)||0===a&&ws(t,n,e)||0===o&&ws(r,t,n)||0===s&&ws(r,e,n))}function ws(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 Ts(t){return t>0?1:t<0?-1:0}function As(t,e){return xs(t.prev,t,t.next)<0?xs(t,e,t.next)>=0&&xs(t,t.prev,e)>=0:xs(t,e,t.prev)<0||xs(t,t.next,e)<0}function ks(t,e){var r=new Es(t.i,t.x,t.y),n=new Es(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 Ms(t,e,r,n){var i=new Es(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 Ss(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 Es(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 Cs(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 Is(t,e,r,n,i){Ls(t,e,r||0,n||t.length-1,i||zs)}function Ls(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),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ls(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,f=n;for(Ps(t,r,e),i(t[n],u)>0&&Ps(t,r,n);h<f;){for(Ps(t,h,f),h++,f--;i(t[h],u)<0;)h++;for(;i(t[f],u)>0;)f--}0===i(t[r],u)?Ps(t,r,f):Ps(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function Ps(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function zs(t,e){return t<e?-1:t>e?1:0}function Ds(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||(Is(a[l],e,1,a[l].length-1,Os),a[l]=a[l].slice(0,e));return a}function Os(t,e){return e.area-t.area}function Rs(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 Fs(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var l=s[o],c=l.paint.get(t+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:n-1},r,{},i.availableImages),h=c.evaluate({zoom:n},r,{},i.availableImages),f=c.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,h=h&&h.name?h.name:h,f=f&&f.name?f.name:f,a[u]=!0,a[h]=!0,a[f]=!0,r.patterns[l.id]={min:u,mid:h,max:f}}}return r}is.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(Cs(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(Cs(t,c,u,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)},is.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},rs.default=ns;var Bs=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 ea,this.indexArray=new da,this.indexArray2=new _a,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Da,this.segments2=new Da,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Bs.prototype.populate=function(t,e,r){this.hasPattern=Rs("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,c=s.id,u=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=yo(l,f);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),p,r)){var d=n?n.evaluate(p,{},r,e.availableImages):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:f?p.geometry:go(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=Fs("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(T)}else this.addFeature(v,_,b,r,{});var A=t[b].feature;e.featureIndex.insert(A,_,b,w,this.index)}},Bs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Bs.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)}},Bs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Bs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Bs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,es),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Bs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Bs.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Ds(e,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].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=rs(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)},ii("FillBucket",Bs,{omit:["layers","patternFeatures"]});var js=new Zi({"fill-sort-key":new qi(Ot.layout_fill["fill-sort-key"])}),Ns={paint:new Zi({"fill-antialias":new Vi(Ot.paint_fill["fill-antialias"]),"fill-opacity":new qi(Ot.paint_fill["fill-opacity"]),"fill-color":new qi(Ot.paint_fill["fill-color"]),"fill-outline-color":new qi(Ot.paint_fill["fill-outline-color"]),"fill-translate":new Vi(Ot.paint_fill["fill-translate"]),"fill-translate-anchor":new Vi(Ot.paint_fill["fill-translate-anchor"]),"fill-pattern":new Hi(Ot.paint_fill["fill-pattern"])}),layout:js},Us=function(t){function e(e){t.call(this,e,Ns)}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 Bs(t)},e.prototype.queryRadius=function(){return Po(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return wo(zo(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return!0},e}(Xi),Vs=Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,qs=Hs;function Hs(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(Gs,this,e)}function Gs(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 Ws(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}Hs.types=["Unknown","Point","LineString","Polygon"],Hs.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 c=t.readVarint();n=7&c,i=c>>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},Hs.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,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Hs.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(),c=Hs.types[this.type];function u(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];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(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=Ws(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++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var f={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Zs=Ys;function Ys(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(Xs,this,e),this.length=this._features.length}function Xs(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))}Ys.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 qs(this._pbf,e,this.extent,this._keys,this._values)};function $s(t,e,r){if(3===t){var n=new Zs(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var Ks={VectorTile:function(t,e){this.layers=t.readFields($s,{},e)},VectorTileFeature:qs,VectorTileLayer:Zs},Js=Ks.VectorTileFeature.types,Qs=Math.pow(2,13);function tl(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Qs)+o,i*Qs*2,a*Qs*2,Math.round(s))}var el=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 na,this.indexArray=new da,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Da,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function rl(t,e){return t.x===e.x&&(t.x<0||t.x>fo)||t.y===e.y&&(t.y<0||t.y>fo)}function nl(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>fo}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>fo}))}el.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Rs("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,c=a.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,h=yo(o,u);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),h,r)){var f={id:s,sourceLayerIndex:c,index:l,geometry:u?h.geometry:go(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Fs("fill-extrusion",this.layers,f,this.zoom,e)):this.addFeature(f,f.geometry,l,r,{}),e.featureIndex.insert(o,f.geometry,l,c,this.index,!0)}}},el.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)}},el.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},el.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},el.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},el.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},el.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},el.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Ds(e,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].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&&!nl(d))for(var m=0,g=0;g<d.length;g++){var y=d[g];if(g>=1){var v=d[g-1];if(!rl(y,v)){h.vertexLength+4>Da.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),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=_,tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),tl(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>Da.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Js[t.type]){for(var w=[],T=[],A=h.vertexLength,k=0,M=s;k<M.length;k+=1){var S=M[k];if(0!==S.length){S!==s[0]&&T.push(w.length/2);for(var E=0;E<S.length;E++){var C=S[E];tl(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),w.push(C.x),w.push(C.y)}}}for(var I=rs(w,T),L=0;L<I.length;L+=3)this.indexArray.emplaceBack(A+I[L],A+I[L+2],A+I[L+1]);h.primitiveLength+=I.length/3,h.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},ii("FillExtrusionBucket",el,{omit:["layers","features"]});var il={paint:new Zi({"fill-extrusion-opacity":new Vi(Ot["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qi(Ot["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vi(Ot["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vi(Ot["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Hi(Ot["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qi(Ot["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qi(Ot["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vi(Ot["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},al=function(t){function e(e){t.call(this,e,il)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new el(t)},e.prototype.queryRadius=function(){return Po(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 c=zo(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),f=function(t,e){for(var r=[],n=0,i=t;n<i.length;n+=1){var o=i[n],s=[o.x,o.y,0,1];Uo(s,s,e),r.push(new a(s[0]/s[3],s[1]/s[3]))}return r}(c,l),p=function(t,e,r,n){for(var i=[],o=[],s=n[8]*e,l=n[9]*e,c=n[10]*e,u=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,A=n[0]*w+n[4]*T+n[12],k=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+c,C=S+u,I=A+h,L=k+f,P=M+p,z=S+d,D=new a((A+s)/C,(k+l)/C);D.z=E/C,y.push(D);var O=new a(I/z,L/z);O.z=P/z,v.push(O)}i.push(y),o.push(v)}return[i,o]}(n,h,u,l);return function(t,e,r){var n=1/0;wo(r,e)&&(n=sl(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],c=a[s+1],u=o[s],h=[l,c,o[s+1],u,l];_o(r,h)&&(n=Math.min(n,sl(r,h)))}return n!==1/0&&n}(p[0],p[1],f)},e}(Xi);function ol(t,e){return t.x*e.x+t.y*e.y}function sl(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),c=o.sub(i),u=ol(s,s),h=ol(s,l),f=ol(l,l),p=ol(c,s),d=ol(c,l),m=u*f-h*h,g=(f*p-h*d)/m,y=(u*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 ll=Qi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,cl=Qi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,ul=Ks.VectorTileFeature.types,hl=Math.cos(Math.PI/180*37.5),fl=Math.pow(2,14)/.5,pl=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 ia,this.layoutVertexArray2=new aa,this.indexArray=new da,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Da,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};pl.prototype.populate=function(t,e,r){this.hasPattern=Rs("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,c=s.id,u=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=yo(l,f);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),p,r)){var d=n?n.evaluate(p,{},r):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:f?p.geometry:go(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=Fs("line",this.layers,v,this.zoom,e);this.patternFeatures.push(T)}else this.addFeature(v,_,b,r,{});var A=t[b].feature;e.featureIndex.insert(A,_,b,w,this.index)}},pl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},pl.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)}},pl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},pl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},pl.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,cl)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ll),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},pl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},pl.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}},pl.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"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var u=0,h=e;u<h.length;u+=1){var f=h[u];this.addLine(f,t,o,s,l,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},pl.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"===ul[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c<l-1&&t[c].equals(t[c+1]);)c++;if(!(l<(s?3:2))){"bevel"===r&&(i=1.05);var u,h=this.overscaling<=16?15*fo/(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&&(u=t[l-2],g=t[c].sub(u)._unit()._perp());for(var y=c;y<l;y++)if(!(d=y===l-1?s?t[c+1]:void 0:t[y+1])||!t[y].equals(d)){g&&(m=g),u&&(p=u),u=t[y],g=d?d.sub(u)._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=_<hl&&p&&d,A=m.x*g.y-m.y*g.x>0;if(T&&y>c){var k=u.dist(p);if(k>2*h){var M=u.sub(u.sub(p)._mult(h/k)._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,u),"miter"===E)v._mult(b),this.addCurrentVertex(u,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*(A?-1:1))}this.addCurrentVertex(u,v,0,0,f),this.addCurrentVertex(u,v.mult(-1),0,0,f)}else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(b*b-1),L=A?I:0,P=A?0:I;if(p&&this.addCurrentVertex(u,m,L,P,f),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),D=1;D<z;D++){var O=D/z;if(.5!==O){var R=O-.5;O+=O*R*(O-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(O)._add(m)._unit()._mult(A?-1:1);this.addHalfVertex(u,F.x,F.y,!1,A,0,f)}d&&this.addCurrentVertex(u,g,-L,-P,f)}else if("butt"===E)this.addCurrentVertex(u,v,0,0,f);else if("square"===E){var B=p?1:-1;this.addCurrentVertex(u,v,B,B,f)}else"round"===E&&(p&&(this.addCurrentVertex(u,m,0,0,f),this.addCurrentVertex(u,m,1,1,f,!0)),d&&(this.addCurrentVertex(u,g,-1,-1,f,!0),this.addCurrentVertex(u,g,0,0,f)));if(T&&y<l-1){var j=u.dist(d);if(j>2*h){var N=u.add(d.sub(u)._mult(h/j)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,f),u=N}}}}},pl.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,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>fl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},pl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*(this.lineClips?this.scaledDistance*(fl-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&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,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},pl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},pl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},ii("LineBucket",pl,{omit:["layers","patternFeatures"]});var dl=new Zi({"line-cap":new Vi(Ot.layout_line["line-cap"]),"line-join":new qi(Ot.layout_line["line-join"]),"line-miter-limit":new Vi(Ot.layout_line["line-miter-limit"]),"line-round-limit":new Vi(Ot.layout_line["line-round-limit"]),"line-sort-key":new qi(Ot.layout_line["line-sort-key"])}),ml={paint:new Zi({"line-opacity":new qi(Ot.paint_line["line-opacity"]),"line-color":new qi(Ot.paint_line["line-color"]),"line-translate":new Vi(Ot.paint_line["line-translate"]),"line-translate-anchor":new Vi(Ot.paint_line["line-translate-anchor"]),"line-width":new qi(Ot.paint_line["line-width"]),"line-gap-width":new qi(Ot.paint_line["line-gap-width"]),"line-offset":new qi(Ot.paint_line["line-offset"]),"line-blur":new qi(Ot.paint_line["line-blur"]),"line-dasharray":new Gi(Ot.paint_line["line-dasharray"]),"line-pattern":new Hi(Ot.paint_line["line-pattern"]),"line-gradient":new Wi(Ot.paint_line["line-gradient"])}),layout:dl},gl=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 zi(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}(qi),yl=new gl(ml.paint.properties["line-width"].specification);yl.useIntegerZoom=!0;var vl=function(t){function e(e){t.call(this,e,ml),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 Qe,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"]=yl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new pl(t)},e.prototype.queryRadius=function(t){var e=t,r=xl(Lo("line-width",this,e),Lo("line-gap-width",this,e)),n=Lo("line-offset",this,e);return r/2+Math.abs(n)+Po(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=zo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*xl(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){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 c=o[l-1],u=o[l],h=o[l+1],f=0===l?n:u.sub(c)._unit()._perp(),p=l===o.length-1?n:h.sub(u)._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(u))}r.push(s)}return r}(n,u*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(Co(t,i[a]))return!0;if(To(t,i,r))return!0}return!1}(l,n,c)},e.prototype.isTileClipped=function(){return!0},e}(Xi);function xl(t,e){return e>0?e+2*t:t}var _l=Qi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),bl=Qi([{name:"a_projected_pos",components:3,type:"Float32"}],4),wl=(Qi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Qi([{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"}]),Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Al=Qi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function kl(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()),Pi.applyArabicShaping&&(t=Pi.applyArabicShaping(t)),t}(t.text,e,r)})),t}Qi([{name:"triangle",components:3,type:"Uint16"}]),Qi([{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"}]),Qi([{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"}]),Qi([{type:"Float32",name:"offsetX"}]),Qi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Sl=24,El=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Cl=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>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=u):(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>=u?(s=0,o=u):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,c+=i;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m},Il=Ll;function Ll(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ll.Varint=0,Ll.Fixed64=1,Ll.Bytes=2,Ll.Fixed32=5;var Pl=4294967296,zl=1/Pl,Dl=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ol(t){return t.type===Ll.Bytes?t.readVarint()+t.pos:t.pos+1}function Rl(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 Fl(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Bl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function jl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Nl(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Ul(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Vl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function ql(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Hl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Gl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Zl(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Yl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Xl(t,e,r){1===t&&r.readMessage($l,e)}function $l(t,e,r){if(3===t){var n=r.readMessage(Kl,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new Yo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Kl(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 Jl(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,c=0,u=t;c<u.length;c+=1)for(var h=u[c],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}}Ll.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=Wl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Yl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Wl(this.buf,this.pos)+Wl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readSFixed64:function(){var t=Wl(this.buf,this.pos)+Yl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readFloat:function(){var t=El(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=El(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(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=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Dl?function(t,e,r){return Dl.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],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}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!==Ll.Bytes)return t.push(this.readVarint(e));var r=Ol(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Ll.Bytes)return t.push(this.readSVarint());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ll.Bytes)return t.push(this.readBoolean());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ll.Bytes)return t.push(this.readFloat());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ll.Bytes)return t.push(this.readDouble());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ll.Bytes)return t.push(this.readFixed32());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ll.Bytes)return t.push(this.readSFixed32());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ll.Bytes)return t.push(this.readFixed64());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ll.Bytes)return t.push(this.readSFixed64());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ll.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ll.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ll.Fixed32)this.pos+=4;else{if(e!==Ll.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),Zl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Zl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Zl(this.buf,-1&t,this.pos),Zl(this.buf,Math.floor(t*zl),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Zl(this.buf,-1&t,this.pos),Zl(this.buf,Math.floor(t*zl),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&&Rl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Cl(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cl(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&&Rl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ll.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Fl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ul,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Vl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writeBytesField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var Ql=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},tc={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};tc.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},tc.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},tc.tlbr.get=function(){return this.tl.concat(this.br)},tc.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ql.prototype,tc);var ec=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=Jl(i),o=a.w,s=a.h,l=new Xo({width:o||1,height:s||1});for(var c in t){var u=t[c],h=r[c].paddedRect;Xo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.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;Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g},p.data),Xo.copy(p.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Xo.copy(p.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Xo.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};ec.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 Ql(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},ec.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)},ec.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})}},ii("ImagePosition",Ql),ii("ImageAtlas",ec);var rc={horizontal:1,vertical:2,horizontalOnly:3},nc=-17,ic=function(){this.scale=1,this.fontStack="",this.imageName=null};ic.forText=function(t,e){var r=new ic;return r.scale=t||1,r.fontStack=e,r},ic.forImage=function(t){var e=new ic;return e.imageName=t,e};var ac=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function oc(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g=ac.fromFeature(t,i);h===rc.vertical&&g.verticalizePunctuation();var y,v=Pi.processBidirectionalText,x=Pi.processStyledBidirectionalText;if(v&&1===g.sections.length){y=[];for(var _=0,b=v(g.toString(),dc(g,c,a,e,n,p,d));_<b.length;_+=1){var w=b[_],T=new ac;T.text=w,T.sections=g.sections;for(var A=0;A<w.length;A++)T.sectionIndex.push(0);y.push(T)}}else if(x){y=[];for(var k=0,M=x(g.text,g.sectionIndex,dc(g,c,a,e,n,p,d));k<M.length;k+=1){var S=M[k],E=new ac;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,dc(g,c,a,e,n,p,d));var C=[],I={positionedLines:C,text:g.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,a,o,s,l,c,u,h){for(var f=0,p=nc,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)*Sl,T={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=T;var A=T.positionedGlyphs,k=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,D=Sl,O=!(l===rc.horizontal||!u&&!mi(C)||u&&(sc[C]||yi(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*Sl/h,L={width:F[0],height:F[1],left:1,top:-3,advance:O?F[1]:F[0]},I=w+(Sl-F[1]*S.scale),D=L.advance;var B=O?F[0]*S.scale-Sl*b:F[1]*S.scale-Sl*b;B>0&&B>k&&(k=B)}else{var j=r[S.fontStack],N=j&&j[C];if(N&&N.rect)P=N.rect,L=N.metrics;else{var U=e[S.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}I=(b-S.scale)*Sl}O?(t.verticalizable=!0,A.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=D*S.scale+c):(A.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=L.advance*S.scale+c)}if(0!==A.length){var q=f-c;d=Math.max(q,d),gc(A,0,A.length-1,g,k)}f=0;var H=a*b+k;T.lineOffset=Math.max(k,w),p+=H,m=Math.max(H,m),++y}else p+=a,++y}var G=p-nc,W=mc(o),Z=W.horizontalAlign,Y=W.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c,u=(e-r)*i;c=a!==o?-s*n-nc:(-n*l+.5)*o;for(var h=0,f=t;h<f.length;h+=1)for(var p=0,d=f[h].positionedGlyphs;p<d.length;p+=1){var m=d[p];m.x+=u,m.y+=c}})(t.positionedLines,g,Z,Y,d,m,a,G,i.length),t.top+=-Y*G,t.bottom=t.top+G,t.left+=-Z*d,t.right=t.left+d}(I,e,r,n,y,o,s,l,h,c,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}ac.fromFeature=function(t,e){for(var r=new ac,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},ac.prototype.length=function(){return this.text.length},ac.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},ac.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},ac.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},ac.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&&gi(n)&&!Ml[t[r+1]]||i&&gi(i)&&!Ml[t[r-1]]||!Ml[t[r]]?e+=t[r]:e+=Ml[t[r]]}return e}(this.text)},ac.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&sc[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&sc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},ac.prototype.substring=function(t,e){var r=new ac;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},ac.prototype.toString=function(){return this.text},ac.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},ac.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(ic.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},ac.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(ic.forImage(e)),this.sectionIndex.push(this.sections.length-1)):A("Reached maximum number of images 6401")}else A("Can't add FormattedSection with an empty image.")},ac.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var sc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},lc={};function cc(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*Sl/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function uc(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 hc(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 fc(t,e,r,n,i,a){for(var o=null,s=uc(e,r,i,a),l=0,c=n;l<c.length;l+=1){var u=c[l],h=uc(e-u.x,r,i,a)+u.badness;h<=s&&(o=u,s=h)}return{index:t,x:e,priorBreak:o,badness:s}}function pc(t){return t?pc(t.priorBreak).concat(t.index):[]}function dc(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+=cc(t.getCharCode(s),l,n,i,e,a)}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,o),c=t.text.indexOf("")>=0,u=0,h=0;h<t.length();h++){var f=t.getSection(h),p=t.getCharCode(h);if(sc[p]||(u+=cc(p,f,n,i,e,o)),h<t.length()-1){var d=di(p);(lc[p]||d||f.imageName)&&s.push(fc(h+1,u,l,s,hc(p,t.getCharCode(h+1),d&&c),!1))}}return pc(fc(t.length(),u,l,s,0,!0))}function mc(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 gc(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 yc(t,e,r,n,i,a){var o,s=t.image;if(s.content){var l=s.content,c=s.pixelRatio||1;o=[l[0]/c,l[1]/c,s.displaySize[0]-l[2]/c,s.displaySize[1]-l[3]/c]}var u,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?(u=i[1]+g-n[0],f=i[1]+y+n[2]):f=(u=i[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:u,right:h,bottom:f,left:p,collisionPadding:o}}lc[10]=!0,lc[32]=!0,lc[38]=!0,lc[40]=!0,lc[41]=!0,lc[43]=!0,lc[45]=!0,lc[47]=!0,lc[173]=!0,lc[183]=!0,lc[8203]=!0,lc[8208]=!0,lc[8211]=!0,lc[8231]=!0;var vc=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);ii("Anchor",vc);var xc=128;function _c(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new zi(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 zi(s)),maxSize:r.evaluate(new zi(l)),interpolationType:i}}function bc(t,e,r){var n=e.uSize,i=e.uSizeT,a=r.lowerSize,o=r.upperSize;return"source"===t.kind?a/xc:"composite"===t.kind?tr(a/xc,o/xc,i):n}function wc(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(_r.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=tr(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var Tc=Object.freeze({__proto__:null,getSizeData:_c,evaluateSizeForFeature:bc,evaluateSizeForZoom:wc,SIZE_PACK_FACTOR:xc});function Ac(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=[],c=0;s<r/2;){var u=t[o-1],h=t[o],f=t[o+1];if(!f)return!1;var p=u.angleTo(h)-h.angleTo(f);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),c+=p;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}function kc(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Mc(t,e,r){return t?.6*e*r:0}function Sc(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Ec(t,e,r,n,i,a){for(var o=Mc(r,i,a),s=Sc(r,n)*a,l=0,c=kc(t)/2,u=0;u<t.length-1;u++){var h=t[u],f=t[u+1],p=h.dist(f);if(l+p>c){var d=(c-l)/p,m=tr(h.x,f.x,d),g=tr(h.y,f.y,d),y=new vc(m,g,f.angleTo(h),u);return y._round(),!o||Ac(t,y,s,o,e)?y:void 0}l+=p}}function Cc(t,e,r,n,i,a,o,s,l){var c=Mc(n,a,o),u=Sc(n,i),h=u*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),Ic(t,f?e/2*s%e:(u/2+2*a)*o*s%e,e,c,r,h,f,!1,l)}function Ic(t,e,r,n,i,a,o,s,l){for(var c=a/2,u=kc(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,_=tr(m.x,g.x,x),b=tr(m.y,g.y,x);if(_>=0&&_<l&&b>=0&&b<l&&f-c>=0&&f+c<=u){var w=new vc(_,b,v,d);w._round(),(!n||Ac(t,w,a,n,i))&&p.push(w)}}h+=y}return!s&&!p.length&&!o&&(p=Ic(t,h/2,r,n,i,a,o,!0,l)),p}function Lc(t,e,r,n,i){for(var o=[],s=0;s<t.length;s++)for(var l=t[s],c=void 0,u=0;u<l.length-1;u++){var h=l[u],f=l[u+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()),(!c||!h.equals(c[c.length-1]))&&(c=[h],o.push(c)),c.push(f)))))}return o}function Pc(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,f=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=f.reduce(d,0),g=p.reduce(d,0),y=l-m,v=c-g,x=0,_=m,b=0,w=g,T=0,A=y,k=0,M=v;if(o.content&&n){var S=o.content;x=zc(f,0,S[0]),b=zc(p,0,S[1]),_=zc(f,S[0],S[2]),w=zc(p,S[1],S[3]),T=S[0]-x,k=S[1]-b,A=S[2]-S[0]-_,M=S[3]-S[1]-w}var E=function(n,i,l,c){var f=Oc(n.stretch-x,_,u,t.left),p=Rc(n.fixed-T,A,n.stretch,m),d=Oc(i.stretch-b,w,h,t.top),y=Rc(i.fixed-k,M,i.stretch,g),v=Oc(l.stretch-x,_,u,t.left),S=Rc(l.fixed-T,A,l.stretch,m),E=Oc(c.stretch-b,w,h,t.top),C=Rc(c.fixed-k,M,c.stretch,g),I=new a(f,d),L=new a(v,d),P=new a(v,E),z=new a(f,E),D=new a(p/s,y/s),O=new a(S/s,C/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),j=[B,-F,F,B];I._matMult(j),L._matMult(j),z._matMult(j),P._matMult(j)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:I,tr:L,bl:z,br:P,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:A/s/u,minFontScaleY:M/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=Dc(f,y,m),I=Dc(p,v,g),L=0;L<C.length-1;L++)for(var P=C[L],z=C[L+1],D=0;D<I.length-1;D++){var O=I[D],R=I[D+1];i.push(E(P,O,z,R))}else i.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return i}function zc(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 Dc(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],c=n[n.length-1];n.push({fixed:s-c.stretch,stretch:c.stretch}),n.push({fixed:s-c.stretch,stretch:c.stretch+(l-s)})}return n.push({fixed:e+1,stretch:r}),n}function Oc(t,e,r,n){return t/e*r+n}function Rc(t,e,r,n){return t-e*r/n}var Fc=function(t,e,r,n,i,o,s,l,c,u){if(this.boxStartIndex=t.length,c){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),u){var _=new a(y,m),b=new a(v,m),w=new a(y,g),T=new a(v,g),A=u*Math.PI/180;_._rotate(A),b._rotate(A),w._rotate(A),T._rotate(A),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},Bc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=jc),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 jc(t,e){return t<e?-1:t>e?1:0}function Nc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<n)&&(n=u.x),(!c||u.y<i)&&(i=u.y),(!c||u.x>o)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,f=s-i,p=Math.min(h,f),d=p/2,m=new Bc([],Uc);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 Vc(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],c=i[s],u=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*u,n+=(l.y+c.y)*u,e+=3*u}return new Vc(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 Vc(_.p.x-d,_.p.y-d,d,t)),m.push(new Vc(_.p.x+d,_.p.y-d,d,t)),m.push(new Vc(_.p.x-d,_.p.y+d,d,t)),m.push(new Vc(_.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 Uc(t,e){return e.max-t.max}function Vc(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 c=a[o],u=a[l];c.y>t.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,So(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Bc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Bc.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}},Bc.prototype.peek=function(){return this.data[0]},Bc.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},Bc.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 qc=Number.POSITIVE_INFINITY;function Hc(t,e){return e[1]!==qc?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 Gc(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 Wc=255,Zc=32640;function Yc(t,e,r,n,i,o,s,l,c,u,h,f,p,d,m){var g=function(t,e,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],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 A=(g.scale-1)*Sl,k=(Sl-g.metrics.width*g.scale)/2;b=p.lineOffset/2-(g.imageName?-k:A)}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/_,D=new a(I,L),O=new a(P,L),R=new a(I,z),F=new a(P,z);if(w){var B=new a(-T,T-nc),j=-Math.PI/2,N=12-T,U=g.imageName?N:0,V=new a(22-N,-U),q=new(Function.prototype.bind.apply(a,[null].concat(C)));D._rotateAround(j,B)._add(V)._add(q),O._rotateAround(j,B)._add(V)._add(q),R._rotateAround(j,B)._add(V)._add(q),F._rotateAround(j,B)._add(V)._add(q)}if(c){var H=Math.sin(c),G=Math.cos(c),W=[G,-H,H,G];D._matMult(W),O._matMult(W),R._matMult(W),F._matMult(W)}var Z=new a(0,0),Y=new a(0,0);u.push({tl:D,tr:O,bl:R,br:F,tex:y,writingMode:e.writingMode,glyphOffset:S,sectionIndex:g.sectionIndex,isSDF:x,pixelOffsetTL:Z,pixelOffsetBR:Y,minFontScaleX:0,minFontScaleY:0})}}return u}(0,r,l,i,o,s,n,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[xc*i.layout.get("text-size").evaluate(s,{})])[0]>Zc&&A(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[xc*d.compositeTextSizes[0].evaluate(s,{},m),xc*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>Zc||v[1]>Zc)&&A(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,o,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(var x=0,_=h;x<_.length;x+=1)f[_[x]]=t.text.placedSymbolArray.length-1;return 4*g.length}function Xc(t){for(var e in t)return t[e];return null}function $c(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 Kc=Ks.VectorTileFeature.types,Jc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Qc(t,e,r,n,i,a,o,s,l,c,u,h,f){var p=s?Math.min(Zc,Math.round(s[0])):0,d=s?Math.min(Zc,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*c,16*u,256*h,256*f)}function tu(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 eu(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(_i(r[e].text))return!0;return!1}var ru=function(t){this.layoutVertexArray=new sa,this.indexArray=new da,this.programConfigurations=t,this.segments=new Da,this.dynamicLayoutVertexArray=new la,this.opacityVertexArray=new ca,this.placedSymbolArray=new Ma};ru.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},ru.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,_l.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,bl.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Jc,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))},ru.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},ii("SymbolBuffers",ru);var nu=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Da,this.collisionVertexArray=new pa};nu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,wl.members,!0)},nu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},ii("CollisionBuffers",nu);var iu=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=Fo([]),this.placementViewportMatrix=Fo([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_c(this.zoom,e["text-size"]),this.iconSizeData=_c(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 rc[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};iu.prototype.createArrays=function(){this.text=new ru(new co(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new ru(new co(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new Ca,this.lineVertexArray=new Ia,this.symbolInstances=new Ea},iu.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=Ml[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0)}},iu.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 ce&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,f=e.glyphDependencies,p=e.availableImages,d=new zi(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=yo(v,w);if(n._featureFilter.filter(d,T,r)){w||(T.geometry=go(v));var A=void 0;if(l){var k=n.getValueAndResolveTokens("text-field",T,r,p),M=ce.factory(k);eu(M)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ii()||this.hasRTLText&&Pi.isParsed())&&(A=kl(M,n,T))}var S=void 0;if(c){var E=n.getValueAndResolveTokens("icon-image",T,r,p);S=E instanceof ue?E:ue.fromString(E)}if(A||S){var C=this.sortFeaturesByKey?u.evaluate(T,{},r):void 0,I={id:x,text:A,icon:S,index:_,sourceLayerIndex:b,geometry:T.geometry,properties:v.properties,type:Kc[v.type],sortKey:C};if(this.features.push(I),S&&(h[S.name]=!0),A){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(rc.vertical)>=0;for(var z=0,D=A.sections;z<D.length;z+=1){var O=D[z];if(O.image)h[O.image.name]=!0;else{var R=fi(A.toString()),F=O.fontStack||L,B=f[F]=f[F]||{};this.calculateGlyphDependencies(O.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 c=0;c<t.length;c++){var u=t[c],h=u.geometry,f=u.text?u.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(c),e[p]=i-1,r[d]=i-1)}else a(c)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},iu.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))},iu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},iu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},iu.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},iu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},iu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},iu.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 c=a[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},iu.prototype.addSymbols=function(t,e,r,n,i,a,o,s,l,c,u,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===rc.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,A=_.br,k=_.tex,M=_.pixelOffsetTL,S=_.pixelOffsetBR,E=_.minFontScaleX,C=_.minFontScaleY,I=_.glyphOffset,L=_.isSDF,P=_.sectionIndex,z=d.vertexLength,D=I[1];Qc(p,s.x,s.y,b.x,D+b.y,k.x,k.y,r,L,M.x,M.y,E,C),Qc(p,s.x,s.y,w.x,D+w.y,k.x+k.w,k.y,r,L,S.x,M.y,E,C),Qc(p,s.x,s.y,T.x,D+T.y,k.x,k.y+k.h,r,L,M.x,S.y,E,C),Qc(p,s.x,s.y,A.x,D+A.y,k.x+k.w,k.y+k.h,r,L,S.x,S.y,E,C),tu(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,c,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,u)},iu.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))},iu.prototype.addCollisionDebugVertices=function(t,e,r,n,i,o,s){var l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,u=i.layoutVertexArray,h=i.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,o,f,p,new a(t,e)),this._addCollisionDebugVertex(u,h,o,f,p,new a(r,e)),this._addCollisionDebugVertex(u,h,o,f,p,new a(r,n)),this._addCollisionDebugVertex(u,h,o,f,p,new a(t,n)),l.vertexLength+=4;var d=i.indexArray;d.emplaceBack(c,c+1),d.emplaceBack(c+1,c+2),d.emplaceBack(c+2,c+3),d.emplaceBack(c+3,c),l.primitiveLength+=4},iu.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,c=a.y2;this.addCollisionDebugVertices(o,s,l,c,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}},iu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new nu(ha,Tl.members,_a),this.iconCollisionBox=new nu(ha,Tl.members,_a);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)}},iu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,l){for(var c={},u=e;u<r;u++){var h=t.get(u);c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}for(var f=n;f<i;f++){var p=t.get(f);c.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.verticalTextFeatureIndex=p.featureIndex;break}for(var d=a;d<o;d++){var m=t.get(d);c.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=t.get(g);c.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},c.verticalIconFeatureIndex=y.featureIndex;break}return c},iu.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))}},iu.prototype.hasTextData=function(){return this.text.segments.get().length>0},iu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},iu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},iu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},iu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},iu.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)},iu.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},iu.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})},iu.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)}},ii("SymbolBucket",iu,{omit:["layers","collisionBoxArray","features","compareText"]}),iu.MAX_GLYPHS=65535,iu.addDynamicAttributes=tu;var au=new Zi({"symbol-placement":new Vi(Ot.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(Ot.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(Ot.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qi(Ot.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(Ot.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(Ot.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Vi(Ot.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(Ot.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(Ot.layout_symbol["icon-rotation-alignment"]),"icon-size":new qi(Ot.layout_symbol["icon-size"]),"icon-text-fit":new Vi(Ot.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(Ot.layout_symbol["icon-text-fit-padding"]),"icon-image":new qi(Ot.layout_symbol["icon-image"]),"icon-rotate":new qi(Ot.layout_symbol["icon-rotate"]),"icon-padding":new Vi(Ot.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(Ot.layout_symbol["icon-keep-upright"]),"icon-offset":new qi(Ot.layout_symbol["icon-offset"]),"icon-anchor":new qi(Ot.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(Ot.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(Ot.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(Ot.layout_symbol["text-rotation-alignment"]),"text-field":new qi(Ot.layout_symbol["text-field"]),"text-font":new qi(Ot.layout_symbol["text-font"]),"text-size":new qi(Ot.layout_symbol["text-size"]),"text-max-width":new qi(Ot.layout_symbol["text-max-width"]),"text-line-height":new Vi(Ot.layout_symbol["text-line-height"]),"text-letter-spacing":new qi(Ot.layout_symbol["text-letter-spacing"]),"text-justify":new qi(Ot.layout_symbol["text-justify"]),"text-radial-offset":new qi(Ot.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(Ot.layout_symbol["text-variable-anchor"]),"text-anchor":new qi(Ot.layout_symbol["text-anchor"]),"text-max-angle":new Vi(Ot.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(Ot.layout_symbol["text-writing-mode"]),"text-rotate":new qi(Ot.layout_symbol["text-rotate"]),"text-padding":new Vi(Ot.layout_symbol["text-padding"]),"text-keep-upright":new Vi(Ot.layout_symbol["text-keep-upright"]),"text-transform":new qi(Ot.layout_symbol["text-transform"]),"text-offset":new qi(Ot.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(Ot.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Vi(Ot.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(Ot.layout_symbol["text-optional"])}),ou=new Zi({"icon-opacity":new qi(Ot.paint_symbol["icon-opacity"]),"icon-color":new qi(Ot.paint_symbol["icon-color"]),"icon-halo-color":new qi(Ot.paint_symbol["icon-halo-color"]),"icon-halo-width":new qi(Ot.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qi(Ot.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(Ot.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(Ot.paint_symbol["icon-translate-anchor"]),"text-opacity":new qi(Ot.paint_symbol["text-opacity"]),"text-color":new qi(Ot.paint_symbol["text-color"],{runtimeType:Zt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new qi(Ot.paint_symbol["text-halo-color"]),"text-halo-width":new qi(Ot.paint_symbol["text-halo-width"]),"text-halo-blur":new qi(Ot.paint_symbol["text-halo-blur"]),"text-translate":new Vi(Ot.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(Ot.paint_symbol["text-translate-anchor"])}),su={paint:ou,layout:au},lu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:qt,this.defaultValue=t};lu.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},lu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},lu.prototype.outputDefined=function(){return!1},lu.prototype.serialize=function(){return null},ii("FormatSectionOverride",lu,{omit:["defaultValue"]});var cu=function(t){function e(e){t.call(this,e,su)}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()||ln(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 iu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=su.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,a=this.paint.get(n),o=new lu(a),s=new sn(o,a.property.specification);i="constant"===a.value.kind||"source"===a.value.kind?new un("source",s):new hn("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[n]=new Ni(a.property,i,a.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=su.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 ce)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){if(!i)if(t instanceof me&&pe(t.value)===Kt){var e=t.value;a(e.sections)}else t instanceof xe?a(t.sections):t.eachChild(o)},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return i},e}(Xi),uu={paint:new Zi({"background-color":new Vi(Ot.paint_background["background-color"]),"background-pattern":new Gi(Ot.paint_background["background-pattern"]),"background-opacity":new Vi(Ot.paint_background["background-opacity"])})},hu=function(t){function e(e){t.call(this,e,uu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Xi),fu={paint:new Zi({"raster-opacity":new Vi(Ot.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vi(Ot.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vi(Ot.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vi(Ot.paint_raster["raster-brightness-max"]),"raster-saturation":new Vi(Ot.paint_raster["raster-saturation"]),"raster-contrast":new Vi(Ot.paint_raster["raster-contrast"]),"raster-resampling":new Vi(Ot.paint_raster["raster-resampling"]),"raster-fade-duration":new Vi(Ot.paint_raster["raster-fade-duration"])})},pu=function(t){function e(e){t.call(this,e,fu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Xi),du=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}(Xi),mu={circle:Vo,heatmap:Jo,hillshade:ts,fill:Us,"fill-extrusion":al,line:vl,symbol:cu,background:hu,raster:pu},gu=s.HTMLImageElement,yu=s.HTMLCanvasElement,vu=s.HTMLVideoElement,xu=s.ImageData,_u=s.ImageBitmap,bu=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};bu.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 gu||t instanceof yu||t instanceof vu||t instanceof xu||_u&&t instanceof _u?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},c=l.x,u=l.y;t instanceof gu||t instanceof yu||t instanceof vu||t instanceof xu||_u&&t instanceof _u?s.texSubImage2D(s.TEXTURE_2D,0,c,u,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,c,u,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},bu.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)},bu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},bu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var wu=function(t){var e=this;this._callback=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};wu.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))},wu.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Tu=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 wu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=S()?t:s};function Au(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]}Tu.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:li(e,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId})}}},Tu.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)},Tu.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)}},Tu.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(ci(e.error)):n(null,ci(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?li(e):null,data:li(n,a)},a)}:function(t){i=!0},s=null,l=ci(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var ku=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]))};ku.prototype.setNorthEast=function(t){return this._ne=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},ku.prototype.setSouthWest=function(t){return this._sw=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},ku.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Su)e=t,r=t;else{if(!(t instanceof ku)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(ku.convert(a))}var o=t;return this.extend(Su.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 Su(e.lng,e.lat),this._ne=new Su(r.lng,r.lat)),this},ku.prototype.getCenter=function(){return new Su((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},ku.prototype.getSouthWest=function(){return this._sw},ku.prototype.getNorthEast=function(){return this._ne},ku.prototype.getNorthWest=function(){return new Su(this.getWest(),this.getNorth())},ku.prototype.getSouthEast=function(){return new Su(this.getEast(),this.getSouth())},ku.prototype.getWest=function(){return this._sw.lng},ku.prototype.getSouth=function(){return this._sw.lat},ku.prototype.getEast=function(){return this._ne.lng},ku.prototype.getNorth=function(){return this._ne.lat},ku.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},ku.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},ku.prototype.isEmpty=function(){return!(this._sw&&this._ne)},ku.prototype.contains=function(t){var e=Su.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},ku.convert=function(t){return!t||t instanceof ku?t:new ku(t)};var Mu=6371008.8,Su=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")};Su.prototype.wrap=function(){return new Su(f(this.lng,-180,180),this.lat)},Su.prototype.toArray=function(){return[this.lng,this.lat]},Su.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Su.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 Mu*Math.acos(Math.min(i,1))},Su.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 ku(new Su(this.lng-r,this.lat-e),new Su(this.lng+r,this.lat+e))},Su.convert=function(t){if(t instanceof Su)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Su(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Su(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 Eu=2*Math.PI*Mu;function Cu(t){return Eu*Math.cos(t*Math.PI/180)}function Iu(t){return(180+t)/360}function Lu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Pu(t,e){return t/Cu(e)}function zu(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Du=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Du.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Su.convert(t);return new Du(Iu(r.lng),Lu(r.lat),Pu(e,r.lat))},Du.prototype.toLngLat=function(){return new Su(function(t){return 360*t-180}(this.x),zu(this.y))},Du.prototype.toAltitude=function(){return function(t,e){return t*Cu(zu(e))}(this.z,this.y)},Du.prototype.meterInMercatorCoordinateUnits=function(){return 1/Eu*function(t){return 1/Math.cos(t*Math.PI/180)}(zu(this.y))};var Ou=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Bu(0,t,t,e,r)};Ou.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Ou.prototype.url=function(t,e){var r=function(t,e,r){var n=Au(256*t,256*(e=Math.pow(2,r)-e-1),r),i=Au(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)},Ou.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new a((t.x*e-this.x)*fo,(t.y*e-this.y)*fo)},Ou.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Ru=function(t,e){this.wrap=t,this.canonical=e,this.key=Bu(t,e.z,e.z,e.x,e.y)},Fu=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Ou(r,+n,+i),this.key=Bu(e,t,r,n,i)};function Bu(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)}Fu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Fu.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Fu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Fu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Bu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Bu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Fu.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},Fu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Fu(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 Fu(e,this.wrap,e,r,n),new Fu(e,this.wrap,e,r+1,n),new Fu(e,this.wrap,e,r,n+1),new Fu(e,this.wrap,e,r+1,n+1)]},Fu.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))},Fu.prototype.wrapped=function(){return new Fu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Fu.prototype.unwrapTo=function(t){return new Fu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Fu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Fu.prototype.toUnwrapped=function(){return new Ru(this.wrap,this.canonical)},Fu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Fu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Du(t.x-this.wrap,t.y))},ii("CanonicalTileID",Ou),ii("OverscaledTileID",Fu,{omit:["posMatrix"]});var ju=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 A('"'+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)]};ju.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])},ju.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},ju.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)},ju.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},ju.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},ju.prototype.getPixels=function(){return new Xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},ju.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,c=a;c<o;c++)for(var u=n;u<i;u++)this.data[this._idx(u,c)]=t.data[this._idx(u+s,c+l)]},ii("DEMData",ju);var Nu=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}};Nu.prototype.encode=function(t){return this._stringToNumber[t]},Nu.prototype.decode=function(t){return this._numberToString[t]};var Uu=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},Vu={geometry:{configurable:!0}};Vu.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},Vu.geometry.set=function(t){this._geometry=t},Uu.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(Uu.prototype,Vu);var qu=function(){this.state={},this.stateChanges={},this.deletedStates={}};qu.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]},qu.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}},qu.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},qu.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},qu.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 c in this.deletedStates[o]){if(null===this.deletedStates[o][c])this.state[o][c]={};else for(var u=0,h=Object.keys(this.deletedStates[o][c]);u<h.length;u+=1){var f=h[u];delete this.state[o][c][f]}s[c]=this.state[o][c]}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 Hu=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Jn(fo,16,0),this.grid3D=new Jn(fo,16,0),this.featureIndexArray=new Pa,this.promoteId=e};function Gu(t,e,r,n,i){return _(t,(function(t,a){var o=e instanceof Ui?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function Wu(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 Zu(t,e){return e-t}Hu.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 c=e[l],u=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var f=c[h];u[0]=Math.min(u[0],f.x),u[1]=Math.min(u[1],f.y),u[2]=Math.max(u[2],f.x),u[3]=Math.max(u[3],f.y)}u[0]<fo&&u[1]<fo&&u[2]>=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Hu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ks.VectorTile(new Il(this.rawTileData)).layers,this.sourceLayerCoder=new Nu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hu.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=fo/t.tileSize/t.scale,l=Tn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,h=Wu(c),f=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=Wu(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(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 c=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var u=0,h=c;u<h.length;u+=1)if(Co(t,h[u]))return!0;for(var f=0;f<t.length-1;f++)if(Io(t[f],t[f+1],c))return!0;return!1}(t.cameraQueryGeometry,e-u,r-u,n+u,i+u)})),m=0,g=d;m<g.length;m+=1){var y=g[m];f.push(y)}f.sort(Zu);for(var v,x={},_=function(a){var u=f[a];if(u!==v){v=u;var h=i.featureIndexArray.get(u),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=go(e)),r.queryIntersectsFeature(c,e,n,p,i.z,t.transform,s,t.pixelPosMatrix)}))}},b=0;b<f.length;b++)_(b);return x},Hu.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s,l,c,u){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=yo(d,!0);if(!i.filter(new zi(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new zi(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&&c&&(_=c.getState(x.sourceLayer||"_geojsonTileLayer",g));var b=p({},l[v]);b.paint=Gu(b.paint,x.paint,d,_,o),b.layout=Gu(b.layout,x.layout,d,_,o);var w=!u||u(d,x,_);if(w){var T=new Uu(d,this.z,this.x,this.y,g);T.layer=b;var A=t[v];void 0===A&&(A=t[v]=[]),A.push({featureIndex:n,feature:T,intersectionZ:w})}}}}}},Hu.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a,o,s){var l={};this.loadVTLayers();for(var c=Tn(i),u=0,h=t;u<h.length;u+=1){var f=h[u];this.loadMatchingFeature(l,r,n,f,c,a,o,s,e)}return l},Hu.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},Hu.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},ii("FeatureIndex",Hu,{omit:["rawTileData","sourceLayerCoder"]});var Yu=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"};Yu.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<j.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Yu.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Yu.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 iu){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 iu&&o.hasRTLText){this.hasRTLText=!0,!Pi.isLoading()&&!Pi.isLoaded()&&"deferred"===Ii()&&Li();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 Aa},Yu.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"},Yu.prototype.getBucket=function(t){return this.buckets[t.id]},Yu.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 bu(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new bu(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Yu.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Yu.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}},Yu.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=Tn(e&&e.filter),s=this.tileID.canonical,l=s.z,c=s.x,u=s.y,h={z:l,x:c,y:u},f=0;f<a.length;f++){var p=a.feature(f);if(o.needGeometry){var d=yo(p,!0);if(!o.filter(new zi(this.tileID.overscaledZ),d,this.tileID.canonical))continue}else if(!o.filter(new zi(this.tileID.overscaledZ),p))continue;var m=r.getId(p,i),g=new Uu(p,l,c,u,m);g.tile=h,t.push(g)}}},Yu.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Yu.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Yu.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}},Yu.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)},Yu.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)))}}}},Yu.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Yu.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<j.now()},Yu.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Yu.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=j.now()+t},Yu.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},Yu.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 Xu=s.performance,$u=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Xu.mark(this._marks.start)};$u.prototype.finish=function(){Xu.mark(this._marks.end);var t=Xu.getEntriesByName(this._marks.measure);return 0===t.length&&(Xu.measure(this._marks.measure,this._marks.start,this._marks.end),t=Xu.getEntriesByName(this._marks.measure),Xu.clearMarks(this._marks.start),Xu.clearMarks(this._marks.end),Xu.clearMeasures(this._marks.measure)),t},t.Actor=Tu,t.AlphaImage=Yo,t.CanonicalTileID=Ou,t.CollisionBoxArray=Aa,t.Color=oe,t.DEMData=ju,t.DataConstantProperty=Vi,t.DictionaryCoder=Nu,t.EXTENT=fo,t.ErrorEvent=zt,t.EvaluationParameters=zi,t.Event=Pt,t.Evented=Dt,t.FeatureIndex=Hu,t.FillBucket=Bs,t.FillExtrusionBucket=el,t.ImageAtlas=ec,t.ImagePosition=Ql,t.LineBucket=pl,t.LngLat=Su,t.LngLatBounds=ku,t.MercatorCoordinate=Du,t.ONE_EM=Sl,t.OverscaledTileID=Fu,t.Point=a,t.Point$1=a,t.Properties=Zi,t.Protobuf=Il,t.RGBAImage=Xo,t.RequestManager=W,t.RequestPerformance=$u,t.ResourceType=vt,t.SegmentVector=Da,t.SourceFeatureState=qu,t.StructArrayLayout1ui2=ba,t.StructArrayLayout2f1f2i16=fa,t.StructArrayLayout2i4=ea,t.StructArrayLayout3ui6=da,t.StructArrayLayout4i8=ra,t.SymbolBucket=iu,t.Texture=bu,t.Tile=Yu,t.Transitionable=Ri,t.Uniform1f=Xa,t.Uniform1i=Ya,t.Uniform2f=$a,t.Uniform3f=Ka,t.Uniform4f=Ja,t.UniformColor=Qa,t.UniformMatrix4f=eo,t.UnwrappedTileID=Ru,t.ValidationError=Rt,t.WritingMode=rc,t.ZoomHistory=ui,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=tu,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=c,t.bindAll=v,t.browser=j,t.cacheEntryPossiblyAdded=function(t){++gt>ft&&(t.getActor().send("enforceCacheSizeLimit",ht),gt=0)},t.clamp=h,t.clearTileCache=function(t){var e=s.caches.delete(ut);t&&e.catch(t).then((function(){return t()}))},t.clipLine=Lc,t.clone=function(t){var e=new Ro(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 Ro(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Al,t.config=N,t.create=function(){var t=new Ro(16);return Ro!=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 Ro(9);return Ro!=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 Ro(4);return Ro!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=cn,t.createLayout=Qi,t.createStyleLayer=function(t){return"custom"===t.type?new du(t):new mu[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=u,t.emitValidationErrors=Kn,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=bc,t.evaluateSizeForZoom=wc,t.evaluateVariableOffset=Hc,t.evented=Ci,t.extend=p,t.featureFilter=Tn,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=mc,t.getAnchorJustification=Gc,t.getArrayBuffer=Tt,t.getImage=Ct,t.getJSON=function(t,e){return wt(p(t,{type:"json"}),e)},t.getRTLTextPluginStatus=Ii,t.getReferrer=_t,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");kt(t[n])||(r.crossOrigin="Anonymous"),i.src=t[n],r.appendChild(i)}return{cancel:function(){}}},t.identity=Fo,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],c=e[7],u=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*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,A=u*m-h*d,k=u*g-f*d,M=u*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*k+T*A;return I?(I=1/I,t[0]=(s*C-l*E+c*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-c*k)*I,t[5]=(r*C-i*M+a*k)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(u*T-f*_+p*x)*I,t[8]=(o*E-s*M+c*A)*I,t[9]=(n*M-r*E-a*A)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-u*w-p*v)*I,t[12]=(s*k-o*S-l*A)*I,t[13]=(r*S-n*k+i*A)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(u*b-h*x+f*v)*I,t):null},t.isChar=hi,t.isMapboxURL=Z,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=wt,t.mapObject=_,t.mercatorXfromLng=Iu,t.mercatorYfromLat=Lu,t.mercatorZfromAltitude=Pu,t.mul=No,t.multiply=Bo,t.mvt=Ks,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=tr,t.offscreenCanvasSupported=yt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Il(t).readFields(Xl,[])},t.pbf=Il,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=fo/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,f=h.minZoom,p=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new zi(f),o),c["text-size"].possiblyEvaluate(new zi(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new zi(m),o),c["icon-size"].possiblyEvaluate(new zi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new zi(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new zi(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new zi(18));for(var y=l.get("text-line-height")*Sl,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(","),c=_.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),f=u.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)*Sl,k=function(t){for(var e=0,r=t;e<r.length;e+=1)if(!pi(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?Hc(M,[E*Sl,qc]):l.get("text-offset").evaluate(a,{},o).map((function(t){return t*Sl}))}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)*Sl:0,P=function(){t.allowVerticalPlacement&&fi(g)&&(p.vertical=oc(d,e,r,i,s,L,y,M,"left",k,m,rc.vertical,!0,I,h,c))};if(!v&&S){for(var z="auto"===C?S.map((function(t){return Gc(t)})):[C],D=!1,O=0;O<z.length;O++){var R=z[O];if(!p.horizontal[R])if(D)p.horizontal[R]=p.horizontal[0];else{var F=oc(d,e,r,i,s,L,y,"center",R,k,m,rc.horizontal,!1,I,h,c);F&&(p.horizontal[R]=F,D=1===F.positionedLines.length)}}P()}else{"auto"===C&&(C=Gc(M));var B=oc(d,e,r,i,s,L,y,M,C,k,m,rc.horizontal,!1,I,h,c);B&&(p.horizontal[C]=B),P(),fi(g)&&v&&x&&(p.vertical=oc(d,e,r,i,s,L,y,M,C,k,m,rc.vertical,!1,I,h,c))}}var j=void 0,N=!1;if(a.icon&&a.icon.name){var U=n[a.icon.name];U&&(j=function(t,e,r){var n=mc(r),i=n.horizontalAlign,a=n.verticalAlign,o=e[0],s=e[1],l=o-t.displaySize[0]*i,c=l+t.displaySize[0],u=s-t.displaySize[1]*a;return{image:t,top:u,bottom:u+t.displaySize[1],left:l,right:c}}(i[a.icon.name],l.get("icon-offset").evaluate(a,{},o),l.get("icon-anchor").evaluate(a,{},o)),N=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&A("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=Xc(p.horizontal)||p.vertical;t.iconsInText=!!V&&V.iconsInText,(V||j)&&function(t,e,r,n,i,a,o,s,l,c,u){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,{},u),m=Xc(r.horizontal),g=o/24,y=t.tilePixelRatio*g,v=t.tilePixelRatio*h/24,x=t.tilePixelRatio*s,_=t.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*t.tilePixelRatio,w=p.get("icon-padding")*t.tilePixelRatio,T=p.get("text-max-angle")/180*Math.PI,k="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),M="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),S=p.get("symbol-placement"),E=_/2,C=p.get("icon-text-fit");n&&"none"!==C&&(t.allowVerticalPlacement&&r.vertical&&(f=yc(n,r.vertical,C,p.get("icon-text-fit-padding"),d,g)),m&&(n=yc(n,m,C,p.get("icon-text-fit-padding"),d,g)));var I=function(s,h){h.x<0||h.x>=fo||h.y<0||h.y>=fo||function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k){var M,S,E,C,I,L=t.addToLineVertexArray(e,r),P=0,z=0,D=0,O=0,R=-1,F=-1,B={},j=ja(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(M=s.layout.get("text-offset").evaluate(_,{},T).map((function(t){return t*Sl})))[0],U=M[1]):(N=s.layout.get("text-radial-offset").evaluate(_,{},T)*Sl,U=qc),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(_,{},T)+90,q=n.vertical;C=new Fc(l,e,c,u,h,q,f,p,d,V),o&&(I=new Fc(l,e,c,u,h,o,g,y,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),W=Pc(i,H,w,G),Z=o?Pc(o,H,w,G):void 0;E=new Fc(l,e,c,u,h,i,g,y,!1,H),P=4*W.length;var Y=t.iconSizeData,X=null;"source"===Y.kind?(X=[xc*s.layout.get("icon-size").evaluate(_,{})])[0]>Zc&&A(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[xc*b.compositeIconSizes[0].evaluate(_,{},T),xc*b.compositeIconSizes[1].evaluate(_,{},T)])[0]>Zc||X[1]>Zc)&&A(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'),t.addSymbols(t.icon,W,X,x,v,_,!1,e,L.lineStartIndex,L.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1,Z&&(z=4*Z.length,t.addSymbols(t.icon,Z,X,x,v,_,rc.vertical,e,L.lineStartIndex,L.lineLength,-1,T),F=t.icon.placedSymbolArray.length-1)}for(var $ in n.horizontal){var K=n.horizontal[$];if(!S){j=ja(K.text);var J=s.layout.get("text-rotate").evaluate(_,{},T);S=new Fc(l,e,c,u,h,K,f,p,d,J)}var Q=1===K.positionedLines.length;if(D+=Yc(t,e,K,a,s,d,_,m,L,n.vertical?rc.horizontal:rc.horizontalOnly,Q?Object.keys(n.horizontal):[$],B,R,b,T),Q)break}n.vertical&&(O+=Yc(t,e,n.vertical,a,s,d,_,m,L,rc.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,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(C,lt),lt=ct(E,lt);var ut=(lt=ct(I,lt))>-1?1:0;ut&&(lt*=k/Sl),t.glyphOffsetArray.length>=iu.MAX_GLYPHS&&A("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,j,tt,et,rt,nt,it,at,ot,st,c,D,O,P,z,ut,0,f,N,U,lt)}(t,h,s,r,n,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,b,k,l,x,w,M,d,e,a,c,u,o)};if("line"===S)for(var L=0,P=Lc(e.geometry,0,0,fo,fo);L<P.length;L+=1)for(var z=P[L],D=0,O=Cc(z,_,T,r.vertical||m,n,24,v,t.overscaling,fo);D<O.length;D+=1){var R=O[D];(!m||!$c(t,m.text,E,R))&&I(z,R)}else if("line-center"===S)for(var F=0,B=e.geometry;F<B.length;F+=1){var j=B[F];if(j.length>1){var N=Ec(j,T,r.vertical||m,n,24,v);N&&I(j,N)}}else if("Polygon"===e.type)for(var U=0,V=Ds(e.geometry,0);U<V.length;U+=1){var q=V[U],H=Nc(q,16);I(q[0],new vc(H.x,H.y,0))}else if("LineString"===e.type)for(var G=0,W=e.geometry;G<W.length;G+=1){var Z=W[G];I(Z,new vc(Z[0].x,Z[0].y,0))}else if("Point"===e.type)for(var Y=0,X=e.geometry;Y<X.length;Y+=1)for(var $=0,K=X[Y];$<K.length;$+=1){var J=K[$];I([J],new vc(J.x,J.y,0))}}(t,a,p,j,n,u,h,f,m,N,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=Pi,t.polygonIntersectsPolygon=_o,t.postMapLoadEvent=ct,t.postTurnstileEvent=st,t.potpack=Jl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=ii,t.registerForPluginStateChange=function(t){return t({pluginStatus:ki,pluginURL:Mi}),Ci.on("pluginStateChange",t),t},t.renderColorRamp=Ko,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],c=e[8],u=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+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=c*i-a*n,t[9]=u*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],c=e[4],u=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+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=c*i-a*n,t[5]=u*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),ki===bi||ki===wi||ki===Ti)throw new Error("setRTLTextPlugin cannot be called multiple times.");Mi=j.resolveURL(t),ki=bi,Ai=e,Ei(),r||Li()},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=function(t){var e=t[0],r=t[1];return e*e+r*r},t.styleSpec=Ot,t.sub=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.symbolSize=Tc,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=Uo,t.translate=function(t,e,r){var n,i,a,o,s,l,c,u,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],c=e[6],u=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]=c,t[7]=u,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+c*g+p*y+e[14],t[15]=o*m+u*g+d*y+e[15]),t},t.triggerPluginCompletionEvent=Si,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=Yn,t.validateStyle=Zn,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=Ks,t.version=r,t.warnOnce=A,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 c=0,u=n;c<u.length;c+=1){var h=u[c];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 c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(c),o[s]={rect:c,metrics:l.metrics}}}}var u=t.potpack(n),h=u.w,f=u.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 c=new t.DictionaryCoder(Object.keys(e.layers).sort()),u=new t.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var h={},f={featureIndex:u,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=c.encode(d),y=[],v=0;v<m.length;v++){var x=m.feature(v),_=u.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],A=T[0];A.minzoom&&this.zoom<Math.floor(A.minzoom)||A.maxzoom&&this.zoom>=A.maxzoom||"none"===A.visibility||(o(T,this.zoom,n),(h[A.id]=A.createBucket({index:u.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),u.bucketLayerIDs.push(T.map((function(t){return t.id}))))}}}var k,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){k||(k=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){k||(k=t,S=e,P.call(l))})):S={};var L=Object.keys(f.patternDependencies);function P(){if(k)return s(k);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:u,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){k||(k=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,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.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,c,u))})),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 c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.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)},u.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=[],c=0,u=s[o];c<u.length;c+=1){var h=u[c];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=v;function A(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,k,t.layers[r])}(e,r),r.finish()}function k(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,M,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,L,a[r])}function M(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,S,t),e.writeVarintField(3,r.type),e.writeMessage(4,I,r)}function S(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];typeof l>"u"&&(n.push(s),l=n.length-1,a[s]=l),e.writeVarint(l);var c=r.properties[s],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,f=o[h];typeof f>"u"&&(i.push(c),f=i.length-1,o[h]=f),e.writeVarint(f)}}function E(t,e){return(e<<3)+(7&t)}function C(t){return t<<1^t>>31}function I(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],c=1;1===n&&(c=l.length),e.writeVarint(E(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&e.writeVarint(E(2,u-1));var f=l[h].x-i,p=l[h].y-a;e.writeVarint(C(f)),e.writeVarint(C(p)),i+=f,a+=p}3===n&&e.writeVarint(E(7,1))}}function L(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 P(t,e,r,n,i,a){if(!(i-n<=r)){var o=n+i>>1;z(t,e,o,n,i,a%2),P(t,e,r,n,o-1,a+1),P(t,e,r,o+1,i,a+1)}}function z(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),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);z(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),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){O(t,r,n),O(e,2*r,2*n),O(e,2*r+1,2*n+1)}function O(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function R(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}b.fromVectorTileJs=w,b.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 A({layers:r})},b.GeoJSONWrapper=T;var F=function(t){return t[0]},B=function(t){return t[1]},j=function(t,e,r,n,i){void 0===e&&(e=F),void 0===r&&(r=B),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]);P(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,c=[0,t.length-1,0],u=[];c.length;){var h=c.pop(),f=c.pop(),p=c.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&&u.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&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(p),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(f),c.push(g))}}return u}(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 c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var f=h;f<=u;f++)R(e[2*f],e[2*f+1],r,n)<=l&&s.push(t[f]);else{var p=Math.floor((h+u)/2),d=e[2*p],m=e[2*p+1];R(d,m,r,n)<=l&&s.push(t[p]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(o.push(h),o.push(p-1),o.push(g)),(0===c?r+i>=d:n+i>=m)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var N={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=$(Object.create(N),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function q(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:W(n),y:Z(i),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[Y(t.x),X(t.y)]}}}function G(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return $($({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function W(t){return t/360+.5}function Z(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 Y(t){return 360*(t-.5)}function X(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function $(t,e){for(var r in e)t[r]=e[r];return t}function K(t){return t.x}function J(t){return t.y}function Q(t,e,r,n){for(var i,a=n,o=r-e>>1,s=r-e,l=t[e],c=t[e+1],u=t[r],h=t[r+1],f=e+3;f<r;f+=3){var p=tt(t[f],t[f+1],l,c,u,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&&Q(t,e,i,n),t[i+2]=a,r-i>3&&Q(t,i,r,n))}function tt(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 et(t,e,r,n){var i={id:typeof t>"u"?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)rt(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)rt(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)rt(t,e[n][i])}(i),i}function rt(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 nt(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)it(i,s);else if("MultiPoint"===a)for(var c=0;c<i.length;c++)it(i[c],s);else if("LineString"===a)at(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(c=0;c<i.length;c++)s=[],at(i[c],s,o,!1),t.push(et(l,"LineString",s,e.properties));return}ot(i,s,o,!1)}else if("Polygon"===a)ot(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(c=0;c<e.geometry.geometries.length;c++)nt(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var u=[];ot(i[c],u,o,!0),s.push(u)}}t.push(et(l,a,s,e.properties))}}function it(t,e){e.push(st(t[0])),e.push(lt(t[1])),e.push(0)}function at(t,e,r,n){for(var i,a,o=0,s=0;s<t.length;s++){var l=st(t[s][0]),c=lt(t[s][1]);e.push(l),e.push(c),e.push(0),s>0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,Q(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function ot(t,e,r,n){for(var i=0;i<t.length;i++){var a=[];at(t[i],a,r,n),e.push(a)}}function st(t){return t/360+.5}function lt(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=[],c=0;c<t.length;c++){var u=t[c],h=u.geometry,f=u.type,p=0===i?u.minX:u.minY,d=0===i?u.maxX:u.maxY;if(p>=r&&d<n)l.push(u);else if(!(d<r||p>=n)){var m=[];if("Point"===f||"MultiPoint"===f)ut(h,m,r,n,i);else if("LineString"===f)ht(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)pt(h,m,r,n,i,!1);else if("Polygon"===f)pt(h,m,r,n,i,!0);else if("MultiPolygon"===f)for(var g=0;g<h.length;g++){var y=[];pt(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(et(u.id,f,m[g],u.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(et(u.id,f,m,u.tags))}}}return l.length?l:null}function ut(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 ht(t,e,r,n,i,a,o){for(var s,l,c=ft(t),u=0===i?mt:gt,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=u(c,p,d,g,y,r),o&&(c.start=h+s*l)):v>n?x<n&&(l=u(c,p,d,g,y,n),o&&(c.start=h+s*l)):dt(c,p,d,m),x<r&&v>=r&&(l=u(c,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,p,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),e.push(c),c=ft(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&&dt(c,p,d,m),b=c.length-3,a&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&dt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ft(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function pt(t,e,r,n,i,a){for(var o=0;o<t.length;o++)ht(t[o],e,r,n,i,a,!1)}function dt(t,e,r,n){t.push(e),t.push(r),t.push(n)}function mt(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 gt(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 yt(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=vt(a.geometry,e);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(vt(a.geometry[s],e))}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var l=[],c=0;c<a.geometry[s].length;c++)l.push(vt(a.geometry[s][c],e));i.push(l)}r.push(et(a.id,o,i,a.tags))}return r}function vt(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 xt(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],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(_t(c[n],c[n+1],e,a,o,s));else for(n=0;n<c.length;n++){var h=[];for(i=0;i<c[n].length;i+=2)h.push(_t(c[n][i],c[n][i+1],e,a,o,s));l.geometry.push(h)}}return t.transformed=!0,t}function _t(t,e,r,n,i,a){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function bt(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++,wt(o,t[s],a,i);var l=t[s].minX,c=t[s].minY,u=t[s].maxX,h=t[s].maxY;l<o.minX&&(o.minX=l),c<o.minY&&(o.minY=c),u>o.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function wt(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)Tt(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)Tt(o,i[s],t,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)Tt(o,c[s],t,r,!0,0===s)}if(o.length){var u=e.tags||null;if("LineString"===a&&n.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var f={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:u};null!==e.id&&(f.id=e.id),t.features.push(f)}}function Tt(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++)nt(r,t.features[n],e,n);else"Feature"===t.type?nt(r,t,e):nt(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=yt(i,1).concat(n)),a&&(n=n.concat(yt(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 kt(t,e,r){return 32*((1<<t)*r+e)+t}function Mt(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})}U.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(q(t[l],l));this.trees[i+1]=new j(s,K,J,a,Float32Array),r&&console.timeEnd(o);for(var c=i;c>=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new j(s,K,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},U.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)],c=[],u=0,h=l.range(W(r),Z(a),W(i),Z(n));u<h.length;u+=1){var f=h[u],p=l.points[f];c.push(p.numPoints?H(p):this.points[p.index])}return c},U.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,c=i.within(a.x,a.y,o);l<c.length;l+=1){var u=c[l],h=i.points[u];h.parentId===t&&s.push(h.numPoints?H(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},U.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},U.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,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,c),n.points,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.points,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.points,-1,r,i,u),u.features.length?u:null},U.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},U.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},U.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]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:c?G(l):this.points[l.index].properties},h=void 0;c?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(u.id=h),a.features.push(u)}},U.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},U.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)),c=0;c<t.length;c++){var u=t[c];if(!(u.zoom<=e)){u.zoom=e;for(var h=this.trees[e+1],f=h.within(u.x,u.y,l),p=u.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=u.x*p,_=u.y*p,b=o&&p>1?this._map(u,!0):null,w=(c<<5)+(e+1)+this.points.length,T=0,A=f;T<A.length;T+=1){var k=A[T],M=h.points[k];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(u,!0)),o(b,this._map(M)))}}u.parentId=w,r.push(V(x/d,_/d,w,d,b))}else if(r.push(u),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},U.prototype._getOriginId=function(t){return t-this.points.length>>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?$({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?$({},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,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<<e,h=kt(e,r,n),f=this.tiles[h];if(!f&&(c>1&&console.time("creation"),f=this.tiles[h]=bt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>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){c>1&&console.time("clipping");var m,g,y,v,x,_,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,A=1+b;m=g=y=v=null,x=ct(t,u,r-b,r+T,0,f.minX,f.maxX,l),_=ct(t,u,r+w,r+A,0,f.minX,f.maxX,l),t=null,x&&(m=ct(x,u,n-b,n+T,1,f.minY,f.maxY,l),g=ct(x,u,n+w,n+A,1,f.minY,f.maxY,l),x=null),_&&(y=ct(_,u,n-b,n+T,1,f.minY,f.maxY,l),v=ct(_,u,n+w,n+A,1,f.minY,f.maxY,l),_=null),c>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=kt(t,e=(e%o+o)%o,r);if(this.tiles[s])return xt(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[kt(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?xt(this.tiles[s],i):null):null};var St=function(e){function r(t,r,n,i){e.call(this,t,r,n,Mt),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 U(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),c=0,u=l;c<u.length;c+=1){var h=u[c],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 c={};if(i){var u=i.finish();u&&(c.resourceTiming={},c.resourceTiming[n.source]=JSON.parse(JSON.stringify(u)))}r(null,c)}))}},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{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),Et=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:St},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 Et.prototype.setReferrer=function(t,e){this.referrer=e},Et.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()},Et.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Et.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Et.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Et.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Et.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Et.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Et.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Et.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Et.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()}},Et.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Et.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())}},Et.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Et.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},Et.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]},Et.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new u),this.demWorkerSources[t][e]},Et.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Et(self)),Et})),n(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return typeof window<"u"&&typeof document<"u"?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{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":"not a browser"}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 c=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c)}catch{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 u=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",u,!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",u,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",u,!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 typeof t.window.InstallTrigger<"u"&&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,c=l.x+1,u=l.y+1,h=this.images[s].data,f=h.width,p=h.height;t.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u},{width:f,height:p}),t.RGBAImage.copy(h,o,{x:0,y:p-1},{x:c,y:u-1},{width:f,height:1}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u+p},{width:f,height:1}),t.RGBAImage.copy(h,o,{x:f-1,y:0},{x:c-1,y:u},{width:1,height:p}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:c+f,y:u},{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,c=o.glyph;(n[s]||(n[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.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=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,"-transition")?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),T=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};T.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]},T.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 c=t[l];i=s*r,a=(s+=c)*r,n.push({left:i,right:a,isDash:o,zeroLength:0===c})}return n},T.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],c=0;c<this.width;c++){c/l.right>1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,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+c]=Math.max(0,Math.min(255,p+128))}},T.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],c=0;c<this.width;c++){c/l.right>1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=l.isDash?f:-f;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.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 c={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,c},T.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 k(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 M=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};M.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]},M.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 S=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=k(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 M(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),E=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=k(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 M(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),C=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}(E),I=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),L=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),P=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 c=i-r,u=a-n,h=Math.max(c,u),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,L.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),z=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,L.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}(P),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,L.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}(P),O={vector:S,raster:E,"raster-dem":C,geojson:I,video:z,image:P,canvas:D};function R(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 F(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(B);for(var c=[],u=0,h=l;u<h.length;u+=1){var f=h[u];c.push({wrappedTileID:f.tileID.wrapped().key,queryResults:f.tile.queryRenderedFeatures(e,r,t._state,f.queryGeometry,f.cameraQueryGeometry,f.scale,i,a,s,R(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 c in o)for(var u=o[c],h=l[c]=l[c]||{},f=e[c]=e[c]||[],p=0,d=u;p<d.length;p+=1){var m=d[p];h[m.featureIndex]||(h[m.featureIndex]=!0,f.push(m))}}return e}(c);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 B(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 N=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};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=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};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},V.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)}},V.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[U[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},V.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var q=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};q.prototype.get=function(){return this.current},q.prototype.set=function(t){},q.prototype.getDefault=function(){return this.default},q.prototype.setDefault=function(){this.set(this.default)};var H=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}(q),G=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}(q),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}(q),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[!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}(q),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},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(q),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 255},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(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{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}(q),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}(q),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!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}(q),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[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}(q),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!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}(q),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 this.gl.LESS},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(q),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!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}(q),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(){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}(q),it=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}(q),at=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}(q),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!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}(q),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 this.gl.BACK},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(q),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.CCW},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(q),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}(q),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.TEXTURE0},e.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(q),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(){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}(q),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(){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}(q),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.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(q),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.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(q),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.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(q),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){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(q),yt=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}(q),vt=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}(q),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!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}(q),_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_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),bt=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}(q),wt=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}(bt),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.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}(bt),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 wt(t,a),n&&(this.depthAttachment=new Tt(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 kt=function(t,e,r){this.func=t,this.mask=e,this.range=r};kt.ReadOnly=!1,kt.ReadWrite=!0,kt.disabled=new kt(519,kt.ReadOnly,[0,1]);var Mt=7680,St=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};St.disabled=new St({func:519,mask:0},0,0,Mt,Mt,Mt);var Et=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Et.disabled=new Et(Et.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Et.unblended=new Et(Et.Replace,t.Color.transparent,[!0,!0,!0,!0]),Et.alphaBlended=new Et([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Ct=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Ct.disabled=new Ct(!1,1029,2305),Ct.backCCW=new Ct(!0,1029,2305);var It=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new H(this),this.clearDepth=new G(this),this.clearStencil=new W(this),this.colorMask=new Z(this),this.depthMask=new Y(this),this.stencilMask=new X(this),this.stencilFunc=new $(this),this.stencilOp=new K(this),this.stencilTest=new J(this),this.depthRange=new Q(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new rt(this),this.blendFunc=new nt(this),this.blendColor=new it(this),this.blendEquation=new at(this),this.cullFace=new ot(this),this.cullFaceSide=new st(this),this.frontFace=new lt(this),this.program=new ct(this),this.activeTexture=new ut(this),this.viewport=new ht(this),this.bindFramebuffer=new ft(this),this.bindRenderbuffer=new pt(this),this.bindTexture=new dt(this),this.bindVertexBuffer=new mt(this),this.bindElementBuffer=new gt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new yt(this),this.pixelStoreUnpack=new vt(this),this.pixelStoreUnpackPremultiplyAlpha=new xt(this),this.pixelStoreUnpackFlipY=new _t(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)};It.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()},It.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},It.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},It.prototype.createVertexBuffer=function(t,e,r){return new V(this,t,e,r)},It.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},It.prototype.createFramebuffer=function(t,e,r){return new At(this,t,e,r)},It.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])),typeof r<"u"&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},It.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))},It.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)},It.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)},It.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Et.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},It.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Lt=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 O[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(Pt).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(Pt).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(zt(this._source.type)){for(var c={},u={},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),c[g.tileID.key]=g.tileID),u[p]=d}}for(var y in this._retainLoadedChildren(u,a,s,l),c)l[y]||(this._coveredTiles[y]=!0,l[y]=c[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,c=t;l<c.length;l+=1){var u=c[l],h=this._addTile(u);n[u.key]=u,!h.hasData()&&e<this._source.maxzoom&&(s[u.key]=u)}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)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,m=0,g=c;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[u[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=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x<u.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(zt(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 Pt(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 zt(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(na.workerUrl)}Lt.maxOverzooming=10,Lt.maxUnderzooming=3;var Ot="mapboxgl_preloaded_worker_pool",Rt=function(){this.active={}};Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Rt.workerCount;)this.workers.push(new Dt);return this.active[t]=!0,this.workers.slice()},Rt.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Rt.prototype.isPreloaded=function(){return!!this.active[Ot]},Rt.prototype.numActive=function(){return Object.keys(this.active).length};var Ft,Bt=Math.floor(t.browser.hardwareConcurrency/2);function jt(){return Ft||(Ft=new Rt),Ft}function Nt(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 Ut(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]=Nt(t[n],e[t[n].ref]));return t}Rt.workerCount=Math.max(Math.min(Bt,6),1);var Vt={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 qt(t,e,r){r.push({command:Vt.addSource,args:[t,e[t]]})}function Ht(t,e,r){e.push({command:Vt.removeSource,args:[t]}),r[t]=!0}function Gt(t,e,r,n){Ht(t,r,n),qt(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 Zt(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 Yt(t){return t.id}function Xt(t,e){return t[e.id]=e,t}var $t=function(t,e){this.reset(t,e)};$t.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},$t.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 Kt=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 Jt(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 Qt(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 te(e,r){var n=[e.x,e.y,0,1];he(n,n,r);var i=n[3];return{point:new t.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function ee(t,e){return.5+t/e*.5}function re(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 ne(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,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)ue(v.numGlyphs,f);else{g=!1;var x=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(x,x,r),re(x,h)){var _=x[3],b=ee(n.transform.cameraToCenterDistance,_),w=t.evaluateSizeForFeature(c,u,v),T=s?w/b:w*b,A=new t.Point(v.anchorX,v.anchorY),k=te(A,a).point,M={},S=oe(v,T,!1,l,r,a,o,e.glyphOffsetArray,p,f,k,A,M,m);g=S.useVertical,(S.notEnoughRoom||g||S.needsFlipping&&oe(v,T,!0,l,r,a,o,e.glyphOffsetArray,p,f,k,A,M,m).notEnoughRoom)&&ue(v.numGlyphs,f)}else ue(v.numGlyphs,f)}}i?e.text.dynamicLayoutVertexBuffer.updateData(f):e.icon.dynamicLayoutVertexBuffer.updateData(f)}function ie(t,e,r,n,i,a,o,s,l,c,u){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=le(t*d,r,n,i,a,o,s.segment,f,p,l,c,u);if(!g)return null;var y=le(t*m,r,n,i,a,o,s.segment,f,p,l,c,u);return y?{first:g,last:y}:null}function ae(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 oe(e,r,n,i,a,o,s,l,c,u,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=ie(g,l,y,v,n,h,f,e,c,o,p);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,A=te(w.last.point,s).point;if(i&&!n){var k=ae(e.writingMode,T,A,d);if(k)return k}m=[w.first];for(var M=e.glyphStartIndex+1;M<x-1;M++)m.push(le(g*l.getoffsetX(M),y,v,n,h,f,e.segment,_,b,c,o,p));m.push(w.last)}else{if(i&&!n){var S=te(f,a).point,E=e.lineStartIndex+e.segment+1,C=new t.Point(c.getx(E),c.gety(E)),I=te(C,a),L=I.signedDistanceFromCamera>0?I.point:se(f,C,S,1,a),P=ae(e.writingMode,S,L,d);if(P)return P}var z=le(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p);if(!z)return{notEnoughRoom:!0};m=[z]}for(var D=0,O=m;D<O.length;D+=1){var R=O[D];t.addDynamicAttributes(u,R.point,R.angle)}return{}}function se(t,e,r,n,i){var a=te(t.add(t.sub(e)._unit()),i).point,o=r.sub(a);return r.add(o._mult(n/o.mag()))}function le(e,r,n,i,a,o,s,l,c,u,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>=c)return null;if(v=y,w.push(y),void 0===(y=f[g])){var T=new t.Point(u.getx(g),u.gety(g)),A=te(T,h);if(A.signedDistanceFromCamera>0)y=f[g]=A.point;else{var k=g-d;y=se(0===x?o:new t.Point(u.getx(k),u.gety(k)),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}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.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)},Kt.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)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Kt.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 c=this.circles[3*l],u=this.circles[3*l+1],h=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:c-h,y1:u-h,x2:c+h,y2:u+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},Kt.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 c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,f=c;h<f.length;h+=1){var p=f[h];if(!l.box[p]){l.box[p]=!0;var d=4*p;if(t<=u[d+2]&&e<=u[d+3]&&r>=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[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})}}}},Kt.prototype._queryCellCircle=function(t,e,r,n,i,a,o,s){var l=o.circle,c=o.seenUids,u=this.boxCells[i];if(null!==u)for(var h=this.bboxes,f=0,p=u;f<p.length;f+=1){var d=p[f];if(!c.box[d]){c.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(!c.circle[_]){c.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}}},Kt.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),f=l;f<=u;f++)for(var p=c;p<=h;p++){var d=this.xCellCount*p+f;if(i.call(this,t,e,r,n,d,a,o,s))return}},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.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},Kt.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 c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,f=u-c;return h*h+f*f<=r*r};var ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(ce,3*n)}}function he(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 fe=100,pe=function(t,e,r){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===r&&(r=new Kt(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+fe,this.screenBottomBoundary=t.height+fe,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function de(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}pe.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,c=t.x2*o+a.point.x,u=t.y2*o+a.point.y;return!this.isInsideGrid(s,l,c,u)||!e&&this.grid.hitTest(s,l,c,u,i)?{box:[],offscreen:!1}:{box:[s,l,c,u],offscreen:this.isOffscreen(s,l,c,u)}},pe.prototype.placeCollisionCircles=function(e,r,n,i,a,o,s,l,c,u,h,f,p){var d=[],m=new t.Point(r.anchorX,r.anchorY),g=te(m,o),y=ee(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(u?a/y:a*y)/t.ONE_EM,x=te(m,s).point,_=ie(v,i,r.lineOffsetX*v,r.lineOffsetY*v,!1,x,m,r,n,s,{}),b=!1,w=!1,T=!0;if(_){for(var A=.5*f*y+p,k=new t.Point(-fe,-fe),M=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),S=new $t,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*A;if(l){var D=I.map((function(t){return te(t,l)}));I=D.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:D.map((function(t){return t.point}))}var O=[];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);O=R.x>=k.x&&F.x<=M.x&&R.y>=k.y&&F.y<=M.y?[I]:F.x<k.x||R.x>M.x||F.y<k.y||R.y>M.y?[]:t.clipLine([I],k.x,k.y,M.x,M.y)}for(var j=0,N=O;j<N.length;j+=1){var U=N[j];S.reset(U,.25*A);var V;V=S.length<=.5*A?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),W=G.x+fe,Z=G.y+fe;d.push(W,Z,A,0);var Y=W-A,X=Z-A,$=W+A,K=Z+A;if(T=T&&this.isOffscreen(Y,X,$,K),w=w||this.isInsideGrid(Y,X,$,K),!e&&this.grid.hitTestCircle(W,Z,A,h)&&(b=!0,!c))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!c&&b||!w?[]:d,offscreen:T,collisionDetected:b}},pe.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 c=l[s],u=new t.Point(c.x+fe,c.y+fe);n=Math.min(n,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y),r.push(u)}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},pe.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])},pe.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])},pe.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var i=[r,n,0,1];return he(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+fe,(-i[1]/i[3]+1)/2*this.transform.height+fe),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},pe.prototype.isOffscreen=function(t,e,r,n){return r<fe||t>=this.screenRightBoundary||n<fe||e>this.screenBottomBoundary},pe.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary},pe.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-fe,-fe,0]),e};var me=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};me.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var ge=function(t,e,r,n,i){this.text=new me(t?t.text:null,e,r,i),this.icon=new me(t?t.icon:null,e,n,i)};ge.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var ye=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},ve=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},xe=function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},_e=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function be(e,r,n,i,a){var o=t.getAnchorAlignment(e),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,c=t.evaluateVariableOffset(e,i);return new t.Point(s+c[0]*a,l+c[1]*a)}function we(e,r,n,i,a,o){var s=e.x1,l=e.x2,c=e.y1,u=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:c+p.y,x2:l+p.x,y2:u+p.y,anchorPointX:h,anchorPointY:f}}_e.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 Te=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new pe(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new _e(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function Ae(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)}Te.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,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=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=de(n,1,this.transform.zoom),m=Jt(h,f,p,this.transform,d),g=null;if(f){var y=Qt(h,f,p,this.transform,d);g=t.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[a.bucketInstanceId]=new xe(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);var v={bucket:a,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:c,textPixelRatio:u,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,A=b.symbolInstanceEnd;e.push({sortKey:w,symbolInstanceStart:T,symbolInstanceEnd:A,parameters:v})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}},Te.prototype.attemptAnchorPlacement=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d){var m,g=[h.textOffset0,h.textOffset1],y=be(t,r,n,g,i),v=this.collisionIndex.placeCollisionBox(we(e,y.x,y.y,a,o,this.transform.angle),u,s,l,c.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(we(d,y.x,y.y,a,o,this.transform.angle),u,s,l,c.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},Te.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=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"),A=v&&(x||!o.hasIconData()||y),k=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 ye(!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,D=0,O=0;a.textFeatureIndex?z=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),a.verticalTextFeatureIndex&&(D=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 j=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[e.crossTileID]){var N=i.prevPlacement.variableOffsets[e.crossTileID];j.indexOf(N.anchor)>0&&(j=j.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,f={box:[],offscreen:!1},p=v?2*j.length:j.length,d=0;d<p;++d){var g=j[d%j.length],y=d>=j.length,A=i.attemptAnchorPlacement(g,t,a,s,c,_,b,h,l,m,y,e,o,n,u);if(A&&(f=A.placedGlyphBoxes)&&f.box&&f.box.length){T=!0,E=A.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),W=t.evaluateSizeForFeature(o.textSizeData,d,G),Z=s.get("text-padding"),Y=e.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,W,l,c,u,n,b,m.predicate,Y,Z),T=v||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(O=a.iconFeatureIndex),a.iconBox){var X=function(t){var e=w&&E?we(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,K=y||0===e.numIconVertices;if($||K?K?$||(M=M&&T):T=M&&T:M=T=M&&T,T&&p&&p.box&&(I&&I.box&&D?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,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,O,m.ID),L&&(T&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new ve);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 ye(T||A,M||k,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},Te.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 c=l[s];c>=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},Te.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)},Te.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],c=i[s];c?(this.opacities[s]=new ge(c,n,l.text,l.icon),r=r||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new ge(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var u in i){var h=i[u];if(!this.opacities[u]){var f=new ge(h,n,!1,!1);f.isHidden()||(this.opacities[u]=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)},Te.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)}},Te.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 ge(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),c=a.get("text-variable-anchor"),u="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),f="none"!==a.get("icon-text-fit"),p=new ge(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=Pe(y.text),A=b?ze:T;d(e.text,s,A);var k=w?ze:T;d(e.text,l,k);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=Pe(y.icon),I=!(f&&a.verticalPlacedIconSymbolIndex&&b);if(a.placedIconSymbolIndex>=0){var L=I?C:ze;d(e.icon,a.numIconVertices,L),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var P=I?ze: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 D=new t.Point(0,0);if(z.textBox||z.verticalTextBox){var O=!0;if(c){var R=i.variableOffsets[m];R?(D=be(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&D._rotate(h?i.transform.angle:-i.transform.angle)):O=!1}z.textBox&&Ae(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||b,D.x,D.y),z.verticalTextBox&&Ae(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||w,D.x,D.y)}var F=!(w||!z.verticalIconBox);z.iconBox&&Ae(e.iconCollisionBox.collisionVertexArray,y.icon.placed,F,f?D.x:0,f?D.y:0),z.verticalIconBox&&Ae(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,f?D.x:0,f?D.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]}},Te.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Te.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},Te.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Te.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},Te.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Me=Math.pow(2,24),Se=Math.pow(2,17),Ee=Math.pow(2,16),Ce=Math.pow(2,9),Ie=Math.pow(2,8),Le=Math.pow(2,1);function Pe(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*ke+e*Me+r*Se+e*Ee+r*Ce+e*Ie+r*Le+e}var ze=0,De=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=[]};De.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 Oe=function(t,e,r,n,i,a,o){this.placement=new Te(t,i,a,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Oe.prototype.isDone=function(){return this._done},Oe.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 De(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Oe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Re=512/t.EXTENT/2,Fe=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)})}};Fe.prototype.getScaledCoordinates=function(e,r){var n=r.canonical.z-this.tileID.canonical.z,i=Re/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)}},Fe.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,c=o;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-s.x)<=n&&Math.abs(u.coord.y-s.y)<=n&&!r[u.crossTileID]){r[u.crossTileID]=!0,a.crossTileID=u.crossTileID;break}}}}};var Be=function(){this.maxCrossTileID=0};Be.prototype.generate=function(){return++this.maxCrossTileID};var je=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};je.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},je.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 c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u<e.symbolInstances.length;u++){var h=e.symbolInstances.get(u);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 Fe(t,e.symbolInstances,e.bucketInstanceId),!0},je.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]}},je.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 Ne=function(){this.layerIndexes={},this.crossTileIDs=new Be,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Ne.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new je);var i=!1,a={};n.handleWrapJump(r);for(var o=0,s=e;o<s.length;o+=1){var l=s[o],c=l.getBucket(t);!c||t.id!==c.layerIds[0]||(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,c,this.crossTileIDs)&&(i=!0),a[c.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i},Ne.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 Ue=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},Ve=t.pick(Vt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),qe=t.pick(Vt,["setCenter","setZoom","setBearing","setPitch"]),He=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!=(a="version"===n?r:"array"===i.type?[]:{})&&(e[n]=a)}}return e}(),Ge=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 T(256,512),this.crossTileSymbolIndex=new Ne,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(He,!1)},r.prototype._load=function(e,r){if(!r||!Ue(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=Ut(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 w(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,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=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:c,height:u});t.RGBAImage.copy(e,v,{x:h,y:f},{x:0,y:0},{width:c,height:u}),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),c&&(c.cancel(),c=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 c in this.sourceCaches){var u=this.sourceCaches[c];l[c]=u.used,u.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(),Ue(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Ut(e.layers);var n=function(e,r){if(!e)return[{command:Vt.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:Vt.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:Vt.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:Vt.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:Vt.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:Vt.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:Vt.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:Vt.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:Vt.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:Vt.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)||Ht(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:Vt.setGeoJSONSourceData,args:[a,r[a].data]}):Gt(a,r,n,i)):qt(a,r,n))}(e.sources,r.sources,a,i);var o=[];e.layers&&e.layers.forEach((function(t){i[t.source]?n.push({command:Vt.removeLayer,args:[t.id]}):o.push(t)})),n=n.concat(a),function(e,r,n){r=r||[];var i,a,o,s,l,c,u,h=(e=e||[]).map(Yt),f=r.map(Yt),p=e.reduce(Xt,{}),d=r.reduce(Xt,{}),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:Vt.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:Vt.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,c=m[m.length-i],n.push({command:Vt.addLayer,args:[d[o],c]}),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:Vt.removeLayer,args:[o]}),c=m[m.lastIndexOf(o)+1],n.push({command:Vt.addLayer,args:[l,c]});continue}for(u in Zt(s.layout,l.layout,n,o,null,Vt.setLayoutProperty),Zt(s.paint,l.paint,n,o,null,Vt.setPaintProperty),t.deepEqual(s.filter,l.filter)||n.push({command:Vt.setFilter,args:[o,l.filter]}),(!t.deepEqual(s.minzoom,l.minzoom)||!t.deepEqual(s.maxzoom,l.maxzoom))&&n.push({command:Vt.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(u)&&("layout"===u||"paint"===u||"filter"===u||"metadata"===u||"minzoom"===u||"maxzoom"===u||(0===u.indexOf("paint.")?Zt(s[u],l[u],n,o,u.slice(6),Vt.setPaintProperty):t.deepEqual(s[u],l[u])||n.push({command:Vt.setLayerProperty,args:[o,u,l[u]]})));for(u in l)!l.hasOwnProperty(u)||s.hasOwnProperty(u)||"layout"===u||"paint"===u||"filter"===u||"metadata"===u||"minzoom"===u||"maxzoom"===u||(0===u.indexOf("paint.")?Zt(s[u],l[u],n,o,u.slice(6),Vt.setPaintProperty):t.deepEqual(s[u],l[u])||n.push({command:Vt.setLayerProperty,args:[o,u,l[u]]}))}}(o,r.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Vt.setStyle,args:[r]}]}return n}(this.serialize(),e).filter((function(t){return!(t.command in qe)}));if(0===n.length)return!1;var i=n.filter((function(t){return!(t.command in Ve)}));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 Lt(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(Ue(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 c=l[s][o];if(c)for(var u=0,h=c;u<h.length;u+=1){var f=h[u];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 c=[];for(var u in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!i[u]||c.push(F(this.sourceCaches[u],this._layers,this._serializedLayers,e,r,n));return this.placement&&c.push(function(t,e,r,n,i,a,o){for(var s={},l=a.queryRenderedSymbols(n),c=[],u=0,h=Object.keys(l).map(Number);u<h.length;u+=1){var f=h[u];c.push(o[f])}c.sort(B);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]||[],c=n[a];c.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 u=0,h=c;u<h.length;u+=1){var f=h[u];o.push(f)}}},d=0,m=c;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(c)},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)&&Ue(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={},c=0,u=this._order;c<u.length;c+=1){var h=u[c],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 Oe(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);Ge.getSourceType=function(t){return O[t]},Ge.setSourceType=function(t,e){O[t]=e},Ge.registerForPluginStateChange=t.registerForPluginStateChange;var We=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ze=xr("#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;}"),Ye=xr("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);}"),Xe=xr("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);}"),$e=xr("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);}"),Ke=xr("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);}"),Je=xr("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;}"),Qe=xr("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;}"),tr=xr("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;}"),er=xr("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);}"),rr=xr("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);}"),nr=xr("#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);}"),ir=xr("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;}"),ar=xr("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;}"),or=xr("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);}"),sr=xr("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;}"),lr=xr("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;}"),cr=xr("#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;}"),ur=xr("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;}"),hr=xr("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);}"),fr=xr("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);}"),pr=xr("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;}"),dr=xr("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);}"),mr=xr("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;}"),gr=xr("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));}"),yr=xr("#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);}"),vr=xr("#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 xr(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 _r=Object.freeze({__proto__:null,prelude:Ze,background:Ye,backgroundPattern:Xe,circle:$e,clippingMask:Ke,heatmap:Je,heatmapTexture:Qe,collisionBox:tr,collisionCircle:er,debug:rr,fill:nr,fillOutline:ir,fillOutlinePattern:ar,fillPattern:or,fillExtrusion:sr,fillExtrusionPattern:lr,hillshadePrepare:cr,hillshade:ur,line:hr,lineGradient:fr,linePattern:pr,lineSDF:dr,raster:mr,symbolIcon:gr,symbolSDF:yr,symbolTextAndIcon:vr}),br=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function wr(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}br.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(l=!0);var u=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||u?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())},br.prototype.freshBind=function(t,e,r,n,i,a,o){var s,l=t.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.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=c.currentNumAttributes||0;for(var h=l;h<s;h++)u.disableVertexAttribArray(h)}e.enableAttributes(u,t);for(var f=0,p=r;f<p.length;f+=1)p[f].enableAttributes(u,t);a&&a.enableAttributes(u,t),o&&o.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,i);for(var d=0,m=r;d<m.length;d+=1){var g=m[d];g.bind(),g.setVertexAttribPointers(u,t,i)}a&&(a.bind(),a.setVertexAttribPointers(u,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,t,i)),c.currentNumAttributes=l},br.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Tr=function(t,e,r,n,i,a){var o=t.gl;this.program=o.createProgram();for(var s=wr(r.staticAttributes),l=n?n.getBinderAttributes():[],c=s.concat(l),u=r.staticUniforms?wr(r.staticUniforms):[],h=n?n.getBinderUniforms():[],f=[],p=0,d=u.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(Ze.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(Ze.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=c.length;for(var w=0;w<this.numAttributes;w++)c[w]&&(o.bindAttribLocation(this.program,w,c[w]),this.attributes[c[w]]=w);o.linkProgram(this.program),o.deleteShader(_),o.deleteShader(x);for(var T=0;T<f.length;T++){var A=f[T];if(A&&!b[A]){var k=o.getUniformLocation(this.program,A);k&&(b[A]=k)}}this.fixedUniforms=i(t,b),this.binderUniforms=n?n.getUniforms(t,b):[]}}};function Ar(t,e,r){var n=1/de(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]}}Tr.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,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=u.get();_<b.length;_+=1){var w=b[_],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new br)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,w.vertexOffset,d,m),y.drawElements(e,w.primitiveLength*x,y.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var kr=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 c=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},Mr=function(e,r,n,i,a,o,s){return t.extend(kr(e,r,n,i),Ar(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Sr=function(t){return{u_matrix:t}},Er=function(e,r,n,i){return t.extend(Sr(e),Ar(n,r,i))},Cr=function(t,e){return{u_matrix:t,u_world:e}},Ir=function(e,r,n,i,a){return t.extend(Er(e,r,n,i),{u_world:a})},Lr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=de(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}},Pr=function(t,e,r){var n=de(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}},zr=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]}},Dr=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},Or=function(t){return{u_matrix:t}},Rr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:de(e,1,r),u_intensity:n}};function Fr(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 Br=function(e,r,n){var i=e.transform;return{u_matrix:qr(e,r,n),u_ratio:1/de(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},jr=function(e,r,n,i){return t.extend(Br(e,r,n),{u_image:0,u_image_height:i})},Nr=function(e,r,n,i){var a=e.transform,o=Vr(r,a);return{u_matrix:qr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/de(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]]}},Ur=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=Vr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),f=u.width*a.fromScale,p=h.width*a.toScale;return t.extend(Br(e,r,n),{u_patternscale_a:[l/f,-u.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:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Vr(t,e){return 1/de(t,1,e.tileZoom)}function qr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Hr=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:Zr(i.paint.get("raster-saturation")),u_contrast_factor:Wr(i.paint.get("raster-contrast")),u_spin_weights:Gr(i.paint.get("raster-hue-rotate"))}};function Gr(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 Wr(t){return t>0?1/(1-t):1+t}function Zr(t){return t>0?1-1/(1.001-t):-t}var Yr,Xr=function(t,e,r,n,i,a,o,s,l,c){var u=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:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.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:c,u_texture:0}},$r=function(e,r,n,i,a,o,s,l,c,u,h){var f=a.transform;return t.extend(Xr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Kr=function(e,r,n,i,a,o,s,l,c,u){return t.extend($r(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Jr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Qr=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,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),f=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:[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/de(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})},tn={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 en(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=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&&u.draw(l,c.LINES,kt.disabled,St.disabled,e.colorModeForRenderPass(),Ct.disabled,Pr(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"),A=new t.StructArrayLayout2f1f2i16;A.resize(4*f),A._trim();for(var k=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],D=E.circleArray[I+3];A.emplace(k++,L,P,z,D,0),A.emplace(k++,L,P,z,D,1),A.emplace(k++,L,P,z,D,2),A.emplace(k++,L,P,z,D,3)}(!Yr||Yr.length<2*f)&&(Yr=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 O=l.createIndexBuffer(Yr,!0),R=l.createVertexBuffer(A,t.collisionCircleLayout.members,!0),F=0,B=h;F<B.length;F+=1){var j=B[F],N=zr(j.transform,j.invTransform,e.transform);T.draw(l,c.TRIANGLES,kt.disabled,St.disabled,e.colorModeForRenderPass(),Ct.disabled,N,n.id,R,O,t.SegmentVector.simpleSegment(0,2*j.circleOffset,j.circleArray.length,j.circleArray.length/2),null,e.transform.zoom,null,null,null)}R.destroy(),O.destroy()}}var rn=t.identity(new Float32Array(16));function nn(e,r,n,i,a,o){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,c=-(s.verticalAlign-.5)*n,u=t.evaluateVariableOffset(e,i);return new t.Point((l/a+u[0])*o,(c/a+u[1])*o)}function an(e,r,n,i,a,o,s,l,c,u,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=te(_,n?l:s),w=ee(o.cameraToCenterDistance,b.signedDistanceFromCamera),T=a.evaluateSizeForFeature(e.textSizeData,u,y)*w/t.ONE_EM;n&&(T*=e.tilePixelRatio/c);for(var A=x.width,k=x.height,M=nn(x.anchor,A,k,x.textOffset,x.textBoxScale,T),S=n?te(_.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 ue(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)ue(P.numGlyphs,d);else{var z=m[L];if(z)for(var D=0;D<P.numGlyphs;D++)t.addDynamicAttributes(d,z.shiftedAnchor,z.angle);else ue(P.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function on(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function sn(e,r,n,i,a,o,s,l,c,u,h,f){for(var p=e.context,d=p.gl,m=e.transform,g="map"===l,y="map"===c,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,kt.ReadOnly),T=n.layout.get("text-variable-anchor"),A=[],k=0,M=i;k<M.length;k+=1){var S=M[k],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,D=y||0!==m.pitch,O=e.useProgram(on(P,a,C),L),R=t.evaluateSizeForZoom(z,m.zoom),F=void 0,B=[0,0],j=void 0,N=void 0,U=null,V=void 0;if(a){if(j=E.glyphAtlasTexture,N=d.LINEAR,F=E.glyphAtlasTexture.size,C.iconsInText){B=E.imageAtlasTexture.size,U=E.imageAtlasTexture;var q="composite"===z.kind||"camera"===z.kind;V=D||e.options.rotating||e.options.zooming||q?d.LINEAR:d.NEAREST}}else{var H=1!==n.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear;j=E.imageAtlasTexture,N=P||e.options.rotating||e.options.zooming||H||D?d.LINEAR:d.NEAREST,F=E.imageAtlasTexture.size}var G=de(E,1,e.transform.zoom),W=Jt(S.posMatrix,y,g,e.transform,G),Z=Qt(S.posMatrix,y,g,e.transform,G),Y=T&&C.hasTextData(),X="none"!==n.layout.get("icon-text-fit")&&Y&&C.hasIconData();v&&ne(C,S.posMatrix,e,a,W,Z,y,u);var $=e.translatePosMatrix(S.posMatrix,E,o,s),K=v||a&&T||X?rn:W,J=e.translatePosMatrix(Z,E,o,s,!0),Q=P&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),tt={program:O,buffers:I,uniformValues:P?C.iconsInText?Kr(z.kind,R,x,y,e,$,K,J,F,B):$r(z.kind,R,x,y,e,$,K,J,a,F,!0):Xr(z.kind,R,x,y,e,$,K,J,a,F),atlasTexture:j,atlasTextureIcon:U,atlasInterpolation:N,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];A.push({segments:new t.SegmentVector([nt]),sortKey:nt.sortKey,state:tt})}}else A.push({segments:I.segments,sortKey:0,state:tt})}}}b&&A.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,at=A;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,ln(st.buffers,ot.segments,n,e,st.program,w,h,f,lt)),lt.u_is_halo=0}ln(st.buffers,ot.segments,n,e,st.program,w,h,f,st.uniformValues)}}function ln(t,e,r,n,i,a,o,s,l){var c=n.context,u=c.gl;i.draw(c,u.TRIANGLES,a,o,s,Ct.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function cn(t,e,r,n,i,a,o){var s,l,c,u,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 A=x.imageAtlas,k=A.patternPositions[T.to.toString()],M=A.patternPositions[T.from.toString()];k&&M&&b.setConstantPatternPositions(k,M)}var S=t.translatePosMatrix(v.posMatrix,x,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){u=_.indexBuffer2,h=_.segments2;var E=[f.drawingBufferWidth,f.drawingBufferHeight];c="fillOutlinePattern"===l&&d?Ir(S,t,m,x,E):Cr(S,E)}else u=_.indexBuffer,h=_.segments,c=d?Er(S,t,m,x):Sr(S);w.draw(t.context,s,i,t.stencilModeForClipping(v),a,Ct.disabled,c,r.id,_.layoutVertexBuffer,u,h,r.paint,t.transform.zoom,b)}}}}function un(t,e,r,n,i,a,o){for(var s=t.context,l=s.gl,c=r.paint.get("fill-extrusion-pattern"),u=c.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(u?"fillExtrusionPattern":"fillExtrusion",v);u&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var _=c.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 A=t.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),k=r.paint.get("fill-extrusion-vertical-gradient"),M=u?Mr(A,t,k,f,m,h,g):kr(A,t,k,f);x.draw(s,s.gl.TRIANGLES,i,a,o,Ct.backCCW,M,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,v)}}}function hn(t,e,r,n,i,a){var o=t.context,s=o.gl,l=e.fbo;if(l){var c=t.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var u=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:Fr(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}}(t,e,r);c.draw(o,s.TRIANGLES,n,i,a,Ct.disabled,u,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function fn(e,r,n,i,a,o){var s=e.context,l=s.gl,c=r.dem;if(c&&c.data){var u=c.dim,h=c.stride,f=c.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:u,height:u,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(d=r.fbo=s.createFramebuffer(u,u,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Ct.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,c),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function pn(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,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.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-c,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 dn=new t.Color(1,0,0,1),mn=new t.Color(0,1,0,1),gn=new t.Color(0,0,1,1),yn=new t.Color(1,0,1,1),vn=new t.Color(0,1,1,1);function xn(t,e,r,n){bn(t,0,e+r/2,t.transform.width,r,n)}function _n(t,e,r,n){bn(t,e-r/2,0,r,t.transform.height,n)}function bn(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 wn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=kt.disabled,c=St.disabled,u=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,c,u,Ct.disabled,Dr(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,c,Et.alphaBlended,Ct.disabled,Dr(o,t.Color.transparent,g),h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var Tn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=St.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="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=de(d,1,r.transform.zoom),x=Jt(p.posMatrix,u,c,r.transform,v),_="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(y){var b=Math.pow(2,l.zoom-d.tileID.overscaledZ);an(m,c,u,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)&&sn(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)&&sn(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&&(en(e,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),en(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 c=e.context,u=c.gl,h=e.depthModeForSublayer(0,kt.ReadOnly),f=St.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:Lr(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 A=0,k=d;A<k.length;A+=1){var M=k[A],S=M.state,E=S.programConfiguration,C=S.program,I=S.layoutVertexBuffer,L=S.indexBuffer,P=S.uniformValues,z=M.segments;C.draw(c,u.TRIANGLES,h,f,p,Ct.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=St.disabled,l=new Et([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 c=0;c<i.length;c++){var u=i[c];if(!r.hasRenderableParent(u)){var h=r.getTile(u),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,kt.disabled,s,l,Ct.disabled,Rr(u.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,kt.disabled,St.disabled,e.colorModeForRenderPass(),Ct.disabled,function(e,r){var n=t.create();t.ortho(n,0,e.width,e.height,0,0,1);var i=e.context.gl;return{u_matrix:n,u_world:[i.drawingBufferWidth,i.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(e,r),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,kt.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),f=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),d=h?"linePattern":c?"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),A=e.context.program.get(),k=e.useProgram(d,T),M=y||k.program!==A,S=u.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?Nr(e,b,n,p):c?Ur(e,b,n,c,p):f?jr(e,b,n,w.lineClipsArray.length):Br(e,b,n);if(h)m.activeTexture.set(g.TEXTURE0),b.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),T.updatePaintBuffers(p);else if(c&&(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 D=256;if(n.stepInterpolant){var O=r.getSource().maxzoom,R=_.canonical.z===O?Math.ceil(1<<e.transform.maxZoom-_.canonical.z):1,F=w.maxLineLength/t.EXTENT*1024*R;D=t.clamp(t.nextPowerOfTwo(F),256,m.maxTextureSize)}P.gradient=t.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:D,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)}k.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(_),l,Ct.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"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var u=e.depthModeForSublayer(1,"opaque"===e.renderPass?kt.ReadWrite:kt.ReadOnly);cn(e,r,n,i,u,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var h=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,kt.ReadOnly);cn(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 kt(t.context.gl.LEQUAL,kt.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))un(t,e,r,n,a,St.disabled,Et.disabled),un(t,e,r,n,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var o=t.colorModeForRenderPass();un(t,e,r,n,a,St.disabled,o)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,a=t.depthModeForSublayer(0,kt.ReadOnly),o=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n],l=s[0],c=0,u=s[1];c<u.length;c+=1){var h=u[c],f=e.getTile(h);f.needsHillshadePrepare&&"offscreen"===t.renderPass?fn(t,f,r,a,St.disabled,o):"translucent"===t.renderPass&&hn(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(),c=o instanceof P?[{},n]:t.stencilConfigForOverlap(n),u=c[0],h=c[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")?kt.ReadWrite:kt.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=pn(v,_,e,r,t.transform),w=void 0,T=void 0,A="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),v.texture.bind(A,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),_?(_.texture.bind(A,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(A,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var k=Hr(x,T||[0,0],w||1,b,r);o instanceof P?s.draw(i,a.TRIANGLES,y,St.disabled,l,Ct.disabled,k,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,y,u[g.overscaledZ],l,Ct.disabled,k,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,c=r.paint.get("background-pattern");if(!t.isPatternMissing(c)){var u=!c&&1===n.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===u){var h=St.disabled,f=t.depthModeForSublayer(0,"opaque"===u?kt.ReadWrite:kt.ReadOnly),p=t.colorModeForRenderPass(),d=t.useProgram(c?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});c&&(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=c?Qr(_,i,t,c,{tileID:x,tileSize:l},g):Jr(_,i,n);d.draw(a,o.TRIANGLES,f,h,p,Ct.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)wn(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(St.disabled);var o="3d"===i.renderingMode?new kt(t.context.gl.LEQUAL,kt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,kt.ReadOnly);n.setDepthMode(o),i.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},An=function(t,e){this.context=new It(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Lt.maxUnderzooming+Lt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ne,this.gpuTimers={}};An.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()}},An.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,We.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,We.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,L.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,We.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 St({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},An.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,kt.disabled,this.stencilClearMode,Et.disabled,Ct.disabled,Or(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},An.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(Et.disabled),r.setDepthMode(kt.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,kt.disabled,new St({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Et.disabled,Ct.disabled,Or(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},An.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new St({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},An.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new St({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},An.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 St({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]=St.disabled,e),n]},An.prototype.colorModeForRenderPass=function(){var e=this.context.gl;if(this._showOverdrawInspector){var r=1/8;return new Et([e.CONSTANT_COLOR,e.ONE],new t.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Et.unblended:Et.alphaBlended},An.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return kt.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new kt(r||this.context.gl.LEQUAL,e,[n,n])},An.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},An.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,c,u={},h={},f={};for(var p in a){var d=a[p];u[p]=d.getVisibleCoordinates(),h[p]=u[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],A=u[w.source];this._renderTileClippingMasks(w,A),this.renderLayer(this,T,w,A)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var k=this.style._layers[i[this.currentLayer]],M=a[k.source],S=("symbol"===k.type?f:h)[k.source];this._renderTileClippingMasks(k,u[k.source]),this.renderLayer(this,M,k,S)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(n.transform.zoom)&&(t.source!==(c&&c.id)&&(c=n.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&Tn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;xn(t,t.transform.height-(e.top||0),3,dn),xn(t,e.bottom||0,3,mn),_n(t,e.left||0,3,gn),_n(t,t.transform.width-(e.right||0),3,yn);var r=t.transform.centerPoint;!function(t,e,r,n){bn(t,e-1,r-10,2,20,n),bn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,vn)}(this),this.context.setDefault()},An.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),Tn[r.type](t,e,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},An.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)}},An.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},An.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},An.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},An.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 c=[a?n[0]:de(r,n[0],this.transform.zoom),a?n[1]:de(r,n[1],this.transform.zoom),0],u=new Float32Array(16);return t.translate(u,e,c),u},An.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},An.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},An.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},An.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 Tr(this.context,t,_r[t],e,tn[t],this._showOverdrawInspector)),this.cache[r]},An.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()},An.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)},An.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)}},An.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var kn=function(t,e){this.points=t,this.planes=e};kn.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 kn(a,o)};var Mn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Mn.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 Mn(n,i)},Mn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},Mn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},Mn.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 c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var f=e.points[h][l]-this.min[l];c=Math.min(c,f),u=Math.max(u,f)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var Sn=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};Sn.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},Sn.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)},Sn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},Sn.prototype.clone=function(){return new Sn(this.top,this.bottom,this.left,this.right)},Sn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=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=n??0,this._maxPitch=i??60,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 Sn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Cn={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}};En.prototype.clone=function(){var t=new En(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},Cn.minZoom.get=function(){return this._minZoom},Cn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Cn.maxZoom.get=function(){return this._maxZoom},Cn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Cn.minPitch.get=function(){return this._minPitch},Cn.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Cn.maxPitch.get=function(){return this._maxPitch},Cn.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Cn.renderWorldCopies.get=function(){return this._renderWorldCopies},Cn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Cn.worldSize.get=function(){return this.tileSize*this.scale},Cn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Cn.size.get=function(){return new t.Point(this.width,this.height)},Cn.bearing.get=function(){return-this.angle/Math.PI*180},Cn.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))},Cn.pitch.get=function(){return this._pitch/Math.PI*180},Cn.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())},Cn.fov.get=function(){return this._fov/Math.PI*180},Cn.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())},Cn.zoom.get=function(){return this._zoom},Cn.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())},Cn.center.get=function(){return this._center},Cn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Cn.padding.get=function(){return this._edgeInsets.toJSON()},Cn.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Cn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},En.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},En.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)},En.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)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},En.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=kn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Mn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],f=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.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 A=0;A<4;A++){var k=(g<<1)+A%2,M=(y<<1)+(A>>1);u.push({aabb:m.aabb.quadrant(A),zoom:m.zoom+1,x:k,y:M,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},En.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Cn.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(t){return Math.pow(2,t)},En.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},En.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)},En.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Cn.point.get=function(){return this.project(this.center)},En.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())},En.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},En.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},En.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},En.prototype.coordinateLocation=function(t){return t.toLngLat()},En.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,c=n[1]/a,u=r[2]/i,h=n[2]/a,f=u===h?0:(0-u)/(h-u);return new t.MercatorCoordinate(t.number(o,s,f)/this.worldSize,t.number(l,c,f)/this.worldSize)},En.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])},En.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)))},En.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},En.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])},En.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]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.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,c=this.size,u=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<c.y?c.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<c.x?c.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=u,void(this._constraining=!1);if(this.latRange){var m=p.y,g=c.y/2;m-g<a&&(i=a+g),m+g>o&&(i=o-g)}if(this.lngRange){var y=p.x,v=c.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=u,this._constraining=!1}},En.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,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,u,c),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={}}},En.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},En.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},En.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 c=l[s];n=Math.min(n,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),o=Math.max(o,c.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(En.prototype,Cn);var In=function(e){var r,n,i,a;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),n=!1,i=null,a=function(){i=null,n&&(r(),i=setTimeout(a,300),n=!1)},function(){return n=!0,i||a(),i})};In.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},In.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},In.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(),c=this._map.getPitch(),u="";if(u+=e?"/"+o+"/"+s+"/"+n:n+"/"+s+"/"+o,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),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+"="+u):t})).filter((function(t){return t}));return f||p.push(h+"="+u),"#"+p.join("&")}return"#"+u},In.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("/")},In.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},In.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch{}};var Ln={linearity:.3,easing:t.bezier(0,0,.3,1)},Pn=t.extend({deceleration:2500,maxSpeed:1400},Ln),zn=t.extend({deceleration:20,maxSpeed:1400},Ln),Dn=t.extend({deceleration:1e3,maxSpeed:360},Ln),On=t.extend({deceleration:1e3,maxSpeed:90},Ln),Rn=function(t){this._map=t,this.clear()};function Fn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Bn(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)}}Rn.prototype.clear=function(){this._inertiaBuffer=[]},Rn.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Rn.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();e.length>0&&r-e[0].time>160;)e.shift()},Rn.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=Bn(r.pan.mag(),o,t.extend({},Pn,e||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,Fn(s,l)}if(r.zoom){var c=Bn(r.zoom,o,zn);s.zoom=this._map.transform.zoom+c.amount,Fn(s,c)}if(r.bearing){var u=Bn(r.bearing,o,Dn);s.bearing=this._map.transform.bearing+t.clamp(u.amount,-179,179),Fn(s,u)}if(r.pitch){var h=Bn(r.pitch,o,On);s.pitch=this._map.transform.pitch+h.amount,Fn(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 jn=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),Nn=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)})),c=s.reduce((function(t,e,r,n){return t.add(e.div(n.length))}),new t.Point(0,0)),u=i.unproject(c);e.call(this,n,{points:s,point:c,lngLats:l,lngLat:u,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),Un=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),Vn=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Vn.prototype.reset=function(){delete this._mousedownPos},Vn.prototype.wheel=function(t){return this._firePreventable(new Un(t.type,this._map,t))},Vn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new jn(t.type,this._map,t))},Vn.prototype.mouseup=function(t){this._map.fire(new jn(t.type,this._map,t))},Vn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new jn(t.type,this._map,t))},Vn.prototype.dblclick=function(t){return this._firePreventable(new jn(t.type,this._map,t))},Vn.prototype.mouseover=function(t){this._map.fire(new jn(t.type,this._map,t))},Vn.prototype.mouseout=function(t){this._map.fire(new jn(t.type,this._map,t))},Vn.prototype.touchstart=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},Vn.prototype.touchmove=function(t){this._map.fire(new Nn(t.type,this._map,t))},Vn.prototype.touchend=function(t){this._map.fire(new Nn(t.type,this._map,t))},Vn.prototype.touchcancel=function(t){this._map.fire(new Nn(t.type,this._map,t))},Vn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Vn.prototype.isEnabled=function(){return!0},Vn.prototype.isActive=function(){return!1},Vn.prototype.enable=function(){},Vn.prototype.disable=function(){};var qn=function(t){this._map=t};qn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},qn.prototype.mousemove=function(t){this._map.fire(new jn(t.type,this._map,t))},qn.prototype.mousedown=function(){this._delayContextMenu=!0},qn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new jn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},qn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new jn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var Hn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Gn(t,e){for(var r={},n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}Hn.prototype.isEnabled=function(){return!!this._enabled},Hn.prototype.isActive=function(){return!!this._active},Hn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Hn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Hn.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Hn.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"}}},Hn.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)}},Hn.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Hn.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},Hn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Wn=function(t){this.reset(),this.numTouches=t.numTouches};Wn.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Wn.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=Gn(n,r)))},Wn.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var n=Gn(r,e);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>30)&&(this.aborted=!0)}}},Wn.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 Zn=function(t){this.singleTap=new Wn(t),this.numTaps=t.numTaps,this.reset()};Zn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Zn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Zn.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 Yn=function(){this._zoomIn=new Zn({numTouches:1,numTaps:2}),this._zoomOut=new Zn({numTouches:2,numTaps:1}),this.reset()};Yn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Yn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Yn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Yn.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},Yn.prototype.touchcancel=function(){this.reset()},Yn.prototype.enable=function(){this._enabled=!0},Yn.prototype.disable=function(){this._enabled=!1,this.reset()},Yn.prototype.isEnabled=function(){return this._enabled},Yn.prototype.isActive=function(){return this._active};var Xn={0:1,2:2},$n=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};$n.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},$n.prototype._correctButton=function(t,e){return!1},$n.prototype._move=function(t,e){return{}},$n.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},$n.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r){if(t.preventDefault(),function(t,e){var r=Xn[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)}},$n.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},$n.prototype.enable=function(){this._enabled=!0},$n.prototype.disable=function(){this._enabled=!1,this.reset()},$n.prototype.isEnabled=function(){return this._enabled},$n.prototype.isActive=function(){return this._active};var Kn=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}($n),Jn=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}($n),Qn=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}($n),ti=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};ti.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},ti.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},ti.prototype.touchmove=function(t,e,r){if(this._active&&!(r.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,r)},ti.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},ti.prototype.touchcancel=function(){this.reset()},ti.prototype._calculateTransform=function(e,r,n){n.length>0&&(this._active=!0);var i=Gn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}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}}},ti.prototype.enable=function(){this._enabled=!0},ti.prototype.disable=function(){this._enabled=!1,this.reset()},ti.prototype.isEnabled=function(){return this._enabled},ti.prototype.isActive=function(){return this._active};var ei=function(){this.reset()};function ri(t,e,r){for(var 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}ei.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},ei.prototype._start=function(t){},ei.prototype._move=function(t,e,r){return{}},ei.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]]))},ei.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var n=this._firstTwoTouches,i=n[0],a=n[1],o=ri(r,e,i),s=ri(r,e,a);if(o&&s){var l=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],l,t)}}},ei.prototype.touchend=function(t,e,n){if(this._firstTwoTouches){var i=this._firstTwoTouches,a=i[0],o=i[1],s=ri(n,e,a),l=ri(n,e,o);s&&l||(this._active&&r.suppressClick(),this.reset())}},ei.prototype.touchcancel=function(){this.reset()},ei.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},ei.prototype.disable=function(){this._enabled=!1,this.reset()},ei.prototype.isEnabled=function(){return this._enabled},ei.prototype.isActive=function(){return this._active};var ii=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(ni(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ni(this._distance,r),pinchAround:e}},e}(ei);function ai(t,e){return 180*t.angleWith(e)/Math.PI}var oi=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:ai(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=ai(t,this._startVector);return Math.abs(r)<e},e}(ei);function si(t){return Math.abs(t.y)>Math.abs(t.x)}var li=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,si(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 si(t)&&si(e)&&a}},e}(ei),ci={panStep:100,bearingStep:15,pitchStep:10},ui=function(){var t=ci;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function hi(t){return t*(2-t)}ui.prototype.reset=function(){this._active=!1},ui.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:hi,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})}}}},ui.prototype.enable=function(){this._enabled=!0},ui.prototype.disable=function(){this._enabled=!1,this.reset()},ui.prototype.isEnabled=function(){return this._enabled},ui.prototype.isActive=function(){return this._active},ui.prototype.disableRotation=function(){this._rotationDisabled=!0},ui.prototype.enableRotation=function(){this._rotationDisabled=!1};var fi=4.000244140625,pi=1/450,di=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=pi,t.bindAll(["_onTimeout"],this)};di.prototype.setZoomRate=function(t){this._defaultZoomRate=t},di.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},di.prototype.isEnabled=function(){return!!this._enabled},di.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},di.prototype.isZooming=function(){return!!this._zooming},di.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},di.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},di.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%fi==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()}},di.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},di.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())}},di.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)>fi?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,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=c(h);o=t.number(l,s,f),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},di.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},di.prototype.reset=function(){this._active=!1};var mi=function(t,e){this._clickZoom=t,this._tapZoom=e};mi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var gi=function(){this.reset()};gi.prototype.reset=function(){this._active=!1},gi.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})}}},gi.prototype.enable=function(){this._enabled=!0},gi.prototype.disable=function(){this._enabled=!1,this.reset()},gi.prototype.isEnabled=function(){return this._enabled},gi.prototype.isActive=function(){return this._active};var yi=function(){this._tap=new Zn({numTouches:1,numTaps:1}),this.reset()};yi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yi.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))},yi.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)},yi.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)},yi.prototype.touchcancel=function(){this.reset()},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};vi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},vi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},vi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},vi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var xi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};xi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},xi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},xi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},xi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _i=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_i.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")},_i.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_i.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_i.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_i.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_i.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var bi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},wi=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 Ti(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Ai=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rn(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],c=s[1],u=s[2];r.addEventListener(l,c,l===t.window.document?this.handleWindowEvent:this.handleEvent,u)}};Ai.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)}},Ai.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Vn(e,t));var n=e.boxZoom=new Hn(e,t);this._add("boxZoom",n);var i=new Yn,a=new gi;e.doubleClickZoom=new mi(a,i),this._add("tapZoom",i),this._add("clickZoom",a);var o=new yi;this._add("tapDragZoom",o);var s=e.touchPitch=new li;this._add("touchPitch",s);var l=new Jn(t),c=new Qn(t);e.dragRotate=new xi(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Kn(t),h=new ti(t);e.dragPan=new vi(r,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var f=new oi,p=new ii;e.touchZoomRotate=new _i(r,p,f,o),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]);var d=e.scrollZoom=new di(e,this);this._add("scrollZoom",d,["mousePan"]);var m=e.keyboard=new ui;this._add("keyboard",m),this._add("blockableMapEvent",new qn(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])}},Ai.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},Ai.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=[]}},Ai.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},Ai.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ai.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ai.prototype.isMoving=function(){return!!bi(this._eventsInProgress)||this.isZooming()},Ai.prototype._blockedByActive=function(t,e,r){for(var n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1},Ai.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},Ai.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},Ai.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),c=0,u=this._handlers;c<u.length;c+=1){var h=u[c],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||Ti(i))&&(this._changes.push([i,a,g]),this._triggerRenderFrame()),(Object.keys(o).length||Ti(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)},Ai.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)}},Ai.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],c=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,c)}this._updateMapTransform(e,r,n),this._changes=[]},Ai.prototype._updateMapTransform=function(t,e,r){var n=this._map,i=n.transform;if(!Ti(t))return this._fireEvents(e,r,!0);var a=t.panDelta,o=t.zoomDelta,s=t.bearingDelta,l=t.pitchDelta,c=t.around,u=t.pinchAround;void 0!==u&&(c=u),n._stop(!0),c=c||n.transform.centerPoint;var h=i.pointLocation(a?c.sub(a):c);s&&(i.bearing+=s),l&&(i.pitch+=l),o&&(i.zoom+=o),i.setLocationAtPoint(h,c),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)},Ai.prototype._fireEvents=function(e,r,n){var i=this,a=bi(this._eventsInProgress),o=bi(e),s={};for(var l in e){var c=e[l].originalEvent;this._eventsInProgress[l]||(s[l+"start"]=c),this._eventsInProgress[l]=e[l]}for(var u in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(u,s[u]);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 _=bi(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}},Ai.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Ai.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new wi("renderFrame",{timeStamp:e})),t._applyChanges()}))},Ai.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var ki=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,c=s.project(t.LngLat.convert(e)),u=s.project(t.LngLat.convert(r)),h=c.rotate(-n*Math.PI/180),f=u.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(c.add(u).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(),c="zoom"in e?+e.zoom:a,u="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(c-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||c!==a,this._rotating=this._rotating||o!==u,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,c,e)),n._rotating&&(i.bearing=t.number(o,u,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=c>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(),c=this.getPadding(),u="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(u-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,A=_.mag();if("minZoom"in e){var k=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),M=w/a.zoomScale(k-o);b=Math.sqrt(M/A*2)}var S=b*b;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*A*A)/(2*(t?T:w)*S*A);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)/A},D=(E(1)-L)/b;if(Math.abs(A)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=T<w?-1:1;D=Math.abs(Math.log(T/w))/b,z=function(){return 0},P=function(t){return Math.exp(O*b*t)}}if("duration"in e)e.duration=+e.duration;else{var R="screenSpeed"in e?+e.screenSpeed/b:+e.speed;e.duration=1e3*D/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*D,d=1/P(i);a.zoom=1===e?u: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(c,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),Mi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mi.prototype.getDefaultPosition=function(){return"bottom-right"},Mi.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},Mi.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},Mi.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},Mi.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"))},Mi.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")}},Mi.prototype._updateData=function(t){t&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType||"style"===t.dataType)&&(this._updateAttributions(),this._updateEditLink())},Mi.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)}},Mi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Si=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Si.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},Si.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Si.prototype.getDefaultPosition=function(){return"bottom-left"},Si.prototype._updateLogo=function(t){(!t||"metadata"===t.sourceDataType)&&(this._container.style.display=this._logoRequired()?"block":"none")},Si.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}},Si.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 Ei=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ei.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Ei.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)}},Ei.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},Ei.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ci={"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"},Ii=t.window.HTMLImageElement,Li=t.window.HTMLElement,Pi=t.window.ImageBitmap,zi={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,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},Di=function(n){function i(e){var r=this;if(null!=(e=t.extend({},zi,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>60)throw new Error("maxPitch must be less than or equal to 60");var i=new En(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 Ei,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ci,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 Li))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)})),typeof t.window<"u"&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ai(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new In(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 Mi({customAttribution:e.customAttribution})),this.addControl(new Si,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=t??-2)>=-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=t??22)>=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=t??0)<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=t??60)>60)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 jn(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 jn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new jn(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 Ge(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 Ge(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 Ii||Pi&&r instanceof Pi){var c=t.browser.getImageData(r),u=c.width,h=c.height,f=c.data;this.style.addImage(e,{data:new t.RGBAImage({width:u,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 Ii||Pi&&r instanceof Pi?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 Ii||Pi&&r instanceof Pi);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 An(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 c=new t.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();(1!==u||u!==this._crossFadingFactor)&&(o=!0,this._crossFadingFactor=u),this.style.update(c)}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),typeof t.window<"u"&&(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(),Oi(this._canvasContainer),Oi(this._controlContainer),Oi(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}(ki);function Oi(t){t.parentNode&&t.parentNode.removeChild(t)}var Ri={showCompass:!0,showZoom:!0,visualizePitch:!1},Fi=function(e){var n=this;this.options=t.extend({},Ri,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))};Fi.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())},Fi.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},Fi.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 Bi(this._map,this._compass,this.options.visualizePitch)),this._container},Fi.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},Fi.prototype._createButton=function(t,e){var n=r.create("button",t,this._container);return n.type="button",n.addEventListener("click",e),n},Fi.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Bi=function(e,n,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Jn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,i&&(this.mousePitch=new Qn({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 ji(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}Bi.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Bi.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)}},Bi.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()},Bi.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Bi.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)},Bi.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Bi.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Bi.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))},Bi.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))},Bi.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Bi.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Ni={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 Ui(t,e,r){var n=t.classList;for(var i in Ni)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var Vi,qi=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 c=0,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"}];c<u.length;c+=1){var h=u[c],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()})),Ui(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=13.5,r=Math.sqrt(Math.pow(e,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(24.6+r)],"bottom-right":[-r,-1*(24.6+r)],left:[e,-24.6],right:[-e,-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=ji(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,Ni[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),Hi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Gi=0,Wi=!1,Zi=function(e){function n(r){e.call(this),this.options=t.extend({},Hi,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!==Vi?e(Vi):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){Vi="denied"!==t.state,e(Vi)})):(Vi=!!t.window.navigator.geolocation,e(Vi))}(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,Gi=0,Wi=!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&&Wi)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 qi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new qi({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":Gi--,Wi=!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"),++Gi>1?(e={maximumAge:6e5,timeout:0},Wi=!0):(e=this.options.positionOptions,Wi=!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),Yi={maxWidth:100,unit:"metric"},Xi=function(e){this.options=t.extend({},Yi,e),t.bindAll(["_onMove","setUnit"],this)};function $i(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?Ki(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Ki(e,n,l,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){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}Xi.prototype.getDefaultPosition=function(){return"bottom-left"},Xi.prototype._onMove=function(){$i(this._map,this._container,this.options)},Xi.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},Xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Xi.prototype.setUnit=function(t){this.options.unit=t,$i(this._map,this._container,this.options)};var Ji=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")};Ji.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},Ji.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ji.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Ji.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)},Ji.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Ji.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ji.prototype._isFullscreen=function(){return this._fullscreen},Ji.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())},Ji.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 Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ta=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ea=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Qi),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=ji(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=ra(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.y<c?["top"]:i.y>this._map.transform.height-c?["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 u=i.add(o[a]).round();r.setTransform(this._container,Ni[a]+" translate("+u.x+"px,"+u.y+"px)"),Ui(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(ta);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function ra(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 ra(new t.Point(0,0))}var na={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Di,NavigationControl:Fi,GeolocateControl:Zi,AttributionControl:Mi,ScaleControl:Xi,FullscreenControl:Ji,Popup:ea,Marker:qi,Style:Ge,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){jt().acquire(Ot)},clearPrewarmedResources:function(){var t=Ft;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Ot),Ft=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 Rt.workerCount},set workerCount(t){Rt.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 na})),r},"object"==typeof t&&typeof e<"u"?e.exports=n():(r=r||self).mapboxgl=n()}}),N_=p({"src/plots/mapbox/layers.js"(t,e){var r=le(),n=Se().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 c(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=c(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=c(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_=p({"src/plots/mapbox/mapbox.js"(t,e){var r=j_(),n=le(),i=_g(),a=qt(),o=ir(),s=fr(),l=Dr(),c=Or(),u=c.drawMode,h=c.selectMode,f=En().prepSelect,p=En().clearOutline,d=En().clearSelectionsCache,m=En().selectOnClick,g=S_(),y=N_();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 c=s.bounds,u=c?[[c.west,c.south],[c.east,c.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:u,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=[],c=b(s.style,e);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.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 c=i[r];n="string"==typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,f={};for(u in a)f[n=a[u]]?f[n].push(u):f[n]=[u];for(n in f){var p=f[n];if(p.length>1)for(r=0;r<p.length;r++)0===(u=p[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.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 c=Object.keys(a);t:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<t.length;i++)if(u===(r=t[i][0].trace).uid)continue t;(e=a[u]).dispose(),delete a[u]}},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]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};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)||u(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 c(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_=p({"src/plots/mapbox/layout_defaults.js"(t,e){var r=le(),n=Hs(),i=je(),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"),c=r("bounds.north");(void 0===a||void 0===o||void 0===l||void 0===c)&&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_=p({"src/plots/mapbox/index.js"(t){var e=j_(),r=le(),n=r.strTranslate,i=r.strScale,a=we().getSubplotCalcData,o=ke(),s=x(),l=Qe(),c=Se(),u=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;if(""===t._context.mapboxAccessToken)return"";for(var i=[],a=[],o=!1,s=!1,l=0;l<e.length;l++){var c=n[e[l]],u=c.accesstoken;m(c.style)&&(u?r.pushUnique(i,u):(m(c._input.style)&&(r.error("Uses Mapbox map style, but did not set an access token."),o=!0),s=!0)),u&&r.pushUnique(a,u)}if(s){var h=o?f.noAccessTokenErrorMsg:f.missingStyleErrorMsg;throw r.error(h),new Error(h)}return i.length?(i.length>1&&r.warn(f.multipleTokensErrorMsg),i[0]):(a.length&&r.log(["Listed mapbox access token(s)",a.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 c=o[l],g=a(i,h,c),y=n[c],v=y._subplot;v||(v=new u(t,c),n[c]._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,u=0;u<r.length;u++){var p=e[r[u]],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(c.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 A=1;b.width+6>w&&(A=w/(b.width+6));var k=[a.l+a.w*d.x[1],a.t+a.h*(1-d.y[0])];x.attr("transform",n(k[0],k[1])+i(A))}},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_=p({"src/traces/scattermapbox/index.js"(t,e){["*scattermapbox* trace is deprecated!","Please consider switching to the *scattermap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:C_(),supplyDefaults:L_(),colorbar:pi(),formatLabels:P_(),calc:cg(),plot:O_(),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_=p({"lib/scattermapbox.js"(t,e){e.exports=H_()}}),W_=p({"src/traces/choroplethmapbox/attributes.js"(t,e){var r=Rg(),n=Pe(),i=Ot().hovertemplateAttrs,a=U(),o=R().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"}))}}),Z_=p({"src/traces/choroplethmapbox/defaults.js"(t,e){var r=le(),n=qe(),i=W_();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("locations"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"==typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),e._length=Math.min(l.length,c.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_=p({"src/traces/choroplethmapbox/convert.js"(t,e){var r=A(),n=le(),i=Ze(),a=Qe(),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,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=e._opts={fill:c,line:u,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(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":T}),n.extendFlat(u.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":T}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:f},l(t),h},convertOnSelect:l}}}),X_=p({"src/traces/choroplethmapbox/plot.js"(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}}}),$_=p({"src/traces/choroplethmapbox/index.js"(t,e){["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:W_(),supplyDefaults:Z_(),colorbar:Uo(),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"}}}}),K_=p({"lib/choroplethmapbox.js"(t,e){e.exports=$_()}}),J_=p({"src/traces/densitymapbox/attributes.js"(t,e){var r=Pe(),n=Ot().hovertemplateAttrs,i=U(),a=C_(),o=R().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_=p({"src/traces/densitymapbox/defaults.js"(t,e){var r=le(),n=qe(),i=J_();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}}}),tb=p({"src/traces/densitymapbox/calc.js"(t,e){var r=A(),n=le().isArrayOrTypedArray,i=k().BADNUM,a=We(),o=le()._;e.exports=function(t,e){for(var s=e._length,l=new Array(s),c=e.z,u=n(c)&&c.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],u){var m=c[h];f.z=r(m)?m:i}}return a(t,e,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(t,"lat:")+" ",lon:o(t,"lon:")+" "}}),l}}}),eb=p({"src/traces/densitymapbox/convert.js"(t,e){var r=A(),n=le(),i=H(),a=Ze(),o=k().BADNUM,s=pg().makeBlank;e.exports=function(t){var e=t[0].trace,l=!0===e.visible&&0!==e._length,c=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],f=e.z,p=e.radius,d=n.isArrayOrTypedArray(f)&&f.length,m=n.isArrayOrTypedArray(p);for(u=0;u<t.length;u++){var g=t[u],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[u])&&p[u]>0?+p[u]: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(u=1;u<b.length;u++)T.push(b[u][0],b[u][1]);var A=["interpolate",["linear"],["get","z"],_.min,0,_.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":d?A:1/(_.max-_.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),rb=p({"src/traces/densitymapbox/plot.js"(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],c=s[1],u=i[l];e.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&e.setOptions(c,"setPaintProperty",u.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=p({"src/traces/densitymapbox/hover.js"(t,e){var r=ir(),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,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),ib=p({"src/traces/densitymapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),ab=p({"src/traces/densitymapbox/index.js"(t,e){["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:J_(),supplyDefaults:Q_(),colorbar:Uo(),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=p({"lib/densitymapbox.js"(t,e){e.exports=ab()}}),sb=p({"src/plots/map/styles/arcgis-sat-hybrid.js"(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=p({"src/plots/map/styles/arcgis-sat.js"(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"}}]}}}),cb=p({"src/plots/map/constants.js"(t,e){var r=Zt(),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."}}}),ub=p({"src/plots/map/layout_attributes.js"(t,e){var r=le(),n=H().defaultLine,i=Aa().attributes,a=F(),o=Tn().textposition,s=Pt().overrideAll,l=ye().templatedArray,c=cb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.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:c.styleValuesMap,dflt:c.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:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),hb=p({"src/traces/scattermap/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=wn(),a=og(),o=Tn(),s=ub(),l=U(),c=Pe(),u=R().extendFlat,h=Pt().overrideAll,f=ub(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},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:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({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},c("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:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),fb=p({"src/traces/scattermap/constants.js"(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=p({"src/traces/scattermap/defaults.js"(t,e){var r=le(),n=Ye(),i=Zn(),a=Yn(),o=$n(),s=Kn(),l=hb(),c=fb().isSupportedFont;e.exports=function(t,e,u,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,u,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,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),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:c(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,u,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}),db=p({"src/traces/scattermap/format_labels.js"(t,e){var r=ir();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=p({"src/plots/map/convert_text_opts.js"(t,e){var r=le();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,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),gb=p({"src/traces/scattermap/convert.js"(t,e){var r=A(),n=le(),i=k().BADNUM,a=pg(),o=Ze(),s=Qe(),l=Xe(),c=Ye(),u=fb().isSupportedFont,h=mb(),f=$e().appendArrayPointValue,p=Se().NEWLINES,d=Se().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"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),A=c.hasMarkers(u),k=c.hasText(u),M=A&&"circle"===u.marker.symbol,S=A&&"circle"!==u.marker.symbol,E=u.cluster&&u.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":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var y,x=[];for(e=0;e<t.length;e++){var _=t[e],b=_.lonlat;if(!v(b)){var w={};i&&(w.mcc=_.mcc=i(_.mc)),a&&(w.mrc=_.mrc=a(_.ms)),c&&(w.mo=c(_.mo)),f&&(w.selected=_.selected||0),x.push({type:"Feature",id:e+1,geometry:{type:"Point",coordinates:b},properties:w})}}if(f)for(y=s.makeSelectedPointStyleFns(u),e=0;e<x.length;e++){var T=x[e].properties;y.selectedOpacityFn&&(T.mo=g(y.selectedOpacityFn(T))),y.selectedColorFn&&(T.mcc=y.selectedColorFn(T)),y.selectedSizeFn&&(T.mrc=y.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:x},mcc:p||y&&y.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:d||y&&y.selectedSizeFn?{type:"identity",property:"mrc"}:function(t){return t/2}(h.size),mo:m||y&&y.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(e);L.geojson=D.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(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":_(u),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":D.mcc,"circle-radius":D.mrc,"circle-opacity":D.mo})}if(M&&E&&(L.filter=["!",["has","point_count"]]),(S||k)&&(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,u="auto"!==s?g(s,!0):y,h=c.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,A=i._module.formatLabels(_,i,r),k={};f(k,i,_.i);var M=i._meta||{};b=n.texttemplateString(T,A,r._d3locale,k,_,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:u(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":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(P.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),P.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(P.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),k)){var O=(u.marker||{}).size,R=h(u.textposition,O);n.extendFlat(P.layout,{"text-size":u.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":_(u)}),n.extendFlat(P.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),yb=p({"src/traces/scattermap/plot.js"(t,e){var r=le(),n=gb(),i=cb().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),c=!!this.clusterEnabled,u=this;function h(t){c?function(t){for(var e=a.cluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function f(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.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||u.addSource(n,i),u.addLayer(n,i,s)}}(t)}var p=this.isHidden,d=!0!==e.visible;d?p||h():p?d||f():c!==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(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.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,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)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=p({"src/traces/scattermap/hover.js"(t,e){var r=Dr(),n=le(),i=gi(),a=n.fillText,o=k().BADNUM,s=cb().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,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(e,t,c),c.join("<br>")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.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(c,(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]),c=s.y-f.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),A=f.c2p(w),k=_.mrc||1;t.x0=T-k,t.x1=T+k,t.y0=A-k,t.y1=A+k;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),xb=p({"src/traces/scattermap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),_b=p({"src/traces/scattermap/select.js"(t,e){var r=le(),n=Ye(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))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)?(c.push({pointNumber:a,lon:f[0],lat:f[1]}),h.selected=1):h.selected=0}}return c}}}),bb=p({"node_modules/maplibre-gl/dist/maplibre-gl.js"(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),typeof window<"u"&&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 c=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=typeof OffscreenCanvas<"u"&&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 A=1;function k(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?k(t,S):t}let E={};function C(t){E[t]||(typeof console<"u"&&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 typeof WorkerGlobalScope<"u"&&void 0!==t&&t instanceof WorkerGlobalScope}let P=null;function z(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}let D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(t,r,n,i,a){return e(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let e=new VideoFrame(t,{timestamp:0});try{let o=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),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(t.width,e+n)-l,height:Math.min(t.height,r+i)-c},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 j(){return new Error(B)}let N={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 N.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 j();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(j())})),n.send(i.body)}))};function W(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 Z(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 K{on(t,e){return this._listeners=this._listeners||{},Z(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||{},Z(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 J={$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 ct(t,e){return t[e.id]=e,t}class ut{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"},At={kind:"resolvedImage"},kt={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,At,kt];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,Dt=.82521,Ot=4/29,Rt=6/29,Ft=3*Rt*Rt,Bt=Rt*Rt*Rt,jt=Math.PI/180,Nt=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)/Dt));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+Ot}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*Zt(i),a=zt*Zt(a),o=Dt*Zt(o),[Wt(3.1338561*a-1.6168667*i-.4906146*o),Wt(-.9787684*a+1.9161415*i+.033454*o),Wt(.0719453*a-.2289914*i+1.4052427*o),n]}function Wt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Zt(t){return t>Rt?t*t*t:Ft*(t-Ot)}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 Kt(t){return!t.some(Number.isNaN)}let Jt={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=Jt[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,c,u,h,f]=e,p=[i||" ",s||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){let t=[n,o,c].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(Kt(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,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){let t=[+e,$t(+i,0,100),$t(+o,0,100),l?Xt(+l,c):1];if(Kt(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)*Nt):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 ce(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 kt;if(t instanceof oe)return At;if(Array.isArray(t)){let e,r=t.length;for(let r of t){let t=ce(r);if(e){if(e===t)continue;e=_t;break}e=t}return Mt(e||_t,r)}return xt}function ue(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=ce(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,ce(r)))return r;if(e===this.args.length-1)throw new fe(`Expected value to be of type ${St(this.type)}, but found ${St(ce(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(ue(this.args[0].evaluate(t)));case"resolvedImage":return oe.fromString(ue(this.args[0].evaluate(t)));default:return ue(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(ce(e))} instead.`);if(!Lt(r,["string","array"]))throw new fe(`Expected second argument to be of type array or string, but found ${St(ce(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Ae{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 Ae(r,n,i):null}return new Ae(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(ce(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(ce(n))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class ke{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 c=e.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(let t of s){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ce(t)))return null}else r=ce(t);if(void 0!==i[String(t)])return c.error("Branch labels must be unique.");i[String(t)]=a.length}let u=e.parse(l,o,n);if(!u)return null;n=n||u.type,a.push(u)}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 ke(r,n,o,i,a,s):null}evaluate(t){let e=this.input.evaluate(t);return(ce(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(ce(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 c=e.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}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 De(t,e,r){return t+r*(e-t)}function Oe(t,e,r){return t.map(((t,n)=>De(t,e[n],r)))}let Re={number:De,color:function(t,e,r,n="rgb"){switch(n){case"rgb":{let[n,i,a,o]=Oe(t.rgb,e.rgb,r);return new Qt(n,i,a,o,!1)}case"hcl":{let n,i,[a,o,s,l]=t.hcl,[c,u,h,f]=e.hcl;if(isNaN(a)||isNaN(c))isNaN(a)?isNaN(c)?n=NaN:(n=c,1!==s&&0!==s||(i=u)):(n=a,1!==h&&0!==h||(i=o));else{let t=c-a;c>a&&t>180?t-=360:c<a&&a-c>180&&(t+=360),n=a+r*t}let[p,d,m,g]=function([t,e,r,n]){return t=isNaN(t)?0:t*jt,Gt([r,Math.cos(t)*e,Math.sin(t)*e,n])}([n,i??De(o,u,r),De(s,h,r),De(l,f,r)]);return new Qt(p,d,m,g,!1)}case"lab":{let[n,i,a,o]=Gt(Oe(t.lab,e.lab,r));return new Qt(n,i,a,o,!1)}}},array:Oe,padding:function(t,e,r){return new ne(Oe(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([De(e,s,r),De(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 c=e.parse(n,l,s);if(!c)return null;s=s||c.type,o.push([r,c])}return Pt(s,mt)||Pt(s,vt)||Pt(s,Tt)||Pt(s,kt)||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 je{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 je(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 Ne(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(!Ne(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(!Ne(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=ce(a),r=ce(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=ce(a),r=ce(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})),We=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})),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 Ke{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 Ke(n)}evaluate(t){return new re(this.sections.map((e=>{let r=e.content.evaluate(t);return ce(r)===At?new ee("",r,null,null,null):new ee(ue(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 Je{constructor(t){this.type=At,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 Je(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(ce(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 cr(t,e){for(let r of e)if(lr(t,r))return!0;return!1}function ur(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(ur(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(!cr(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(!ur(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),c=.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+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,f=n;for(wr(t,r,e),i(t[n],u)>0&&wr(t,r,n);h<f;){for(wr(t,h,f),h++,f--;i(t[h],u)<0;)h++;for(;i(t[f],u)>0;)f--}0===i(t[r],u)?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 Ar(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,kr),i[t]=i[t].slice(0,e));return i}function kr(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],c=t[s][1],u=this.wrap(t[s+1][0]-l)*this.kx,h=(t[s+1][1]-c)*this.ky,f=0;0===u&&0===h||(f=(this.wrap(e[0]-l)*this.kx*u+(e[1]-c)*this.ky*h)/(u*u+h*h),f>1?(l=t[s+1][0],c=t[s+1][1]):f>0&&(l+=u/this.kx*f,c+=h/this.ky*f)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;let p=u*u+h*h;p<o&&(o=p,r=l,n=c,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 Dr(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 Or(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 jr(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}function Nr(t,e,r,n,i){let a=Math.min(jr(t,[r,n],i),jr(e,[r,n],i)),o=Math.min(jr(r,[t,e],i),jr(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,Nr(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,jr(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,Nr(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 Wr(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,Nr(i,s,n,l,r))}}return o}function Zr(t,e,r,n,i,a){if(!a)return;let o=Br(Or(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(Or(n,a),Or(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],c=e?50:100;if(Pr(l)<=c){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=Dr(l,e);Zr(o,a,n,t,s,r[0]),Zr(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],c=a[2],u=e?50:100,h=n?50:100;if(Pr(l)<=u&&Pr(c)<=h){if(!zr(l,t.length)&&zr(c,r.length))return NaN;let a;if(e&&n)a=Ur(t,l,r,c,i),o=Math.min(o,a);else if(e&&!n){let e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(a=jr(r[t],e,i),o=Math.min(o,a),0===o)return o}else if(!e&&n){let e=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=jr(t[r],e,i),o=Math.min(o,a),0===o)return o}else a=Vr(t,l,r,c,i),o=Math.min(o,a)}else{let a=Dr(l,e),u=Dr(c,n);Yr(s,o,i,t,r,a[0],u[0]),Yr(s,o,i,t,r,a[0],u[1]),Yr(s,o,i,t,r,a[1],u[0]),Yr(s,o,i,t,r,a[1],u[1])}}return o}function Kr(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 Jr{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 Jr(e,e.features.map((t=>Kr(t.geometry))).flat());if("Feature"===e.type)return new Jr(e,Kr(e.geometry));if("type"in e&&"coordinates"in e)return new Jr(e,Kr(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=Ar(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,Wr(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,">":We,"<":Ge,">=":Ye,"<=":Ze,array:de,at:we,boolean:de,case:Me,coalesce:je,collator:Xe,format:Ke,image:Je,in:Te,"index-of":Ae,interpolate:Fe,"interpolate-hcl":Fe,"interpolate-lab":Fe,length:Qe,let:_e,literal:he,match:ke,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:Jr};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 Jr)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)&&cn(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 Jr)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 cn(t,e){if(t instanceof tn&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!cn(t,e)&&(r=!1)})),r}function un(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,c;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];c=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,c)}}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,c)}}}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],c=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 c(r,n,o,t.colorSpace)}}:c(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(ce(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=>ue(e.evaluate(t)))).join("")],"resolved-locale":[gt,[bt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class An{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,typeof console<"u"&&console.warn(t.message)),this._defaultValue}}}function kn(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:At,variableAnchorOffsetCollection:kt};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?un(new An(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=cn(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')]):un(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 je){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 Dn(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 On(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?jn(t[1],t.slice(2)):"!in"===e?Un(jn(t[1],t.slice(2))):"has"===e?Nn(t[1]):"!has"!==e||Un(Nn(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 jn(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(On)]]:["filter-in-small",t,["literal",e]]}}function Nn(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 ut(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 Wn(t){if(Array.isArray(t))return t.map(Wn);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Wn(t[r]);return e}return Gn(t)}function Zn(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=t.validateSpec,l=[],c=mn(r);if("object"!==c)return[new ut(e,r,`object expected, ${c} found`)];for(let t in r){let c,u=t.split(".")[0],h=n[u]||n["*"];if(i[u])c=i[u];else if(n[u])c=s;else if(i["*"])c=i["*"];else{if(!n["*"]){l.push(new ut(e,r[t],`unknown property "${t}"`));continue}c=s}l=l.concat(c({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 ut(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 ut(a,e,`array expected, ${mn(e)} found`)];if(r.length&&e.length!==r.length)return[new ut(a,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new ut(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 ut(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new ut(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new ut(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,c="array"===mn(t.value.stops)&&"array"===mn(t.value.stops[0])&&"object"===mn(t.value.stops[0][0]),u=Zn({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 ut(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 ut(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&&u.push(new ut(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new ut(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!dn(t.valueSpec)&&u.push(new ut(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!fn(t.valueSpec)?u.push(new ut(t.key,t.value,"property functions not supported")):s&&!pn(t.valueSpec)&&u.push(new ut(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new ut(t.key,t.value,'"property" property is required')),u;function h(t){let e=[],a=t.value,s=t.key;if("array"!==mn(a))return[new ut(s,a,`array expected, ${mn(a)} found`)];if(2!==a.length)return[new ut(s,a,`array length 2 expected, length ${a.length} found`)];if(c){if("object"!==mn(a[0]))return[new ut(s,a,`object expected, ${mn(a[0])} found`)];if(void 0===a[0].zoom)return[new ut(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new ut(s,a,"object stop key must have value")];if(n&&n>Gn(a[0].zoom))return[new ut(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(Zn({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],valueSpec:{},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},a));return kn(Wn(a[1]))?e.concat([new ut(`${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),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new ut(t.key,c,`${s} stop domain type must match previous stop domain type ${e}`)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ut(t.key,c,"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 ut(t.key,c,e)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new ut(t.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new ut(t.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new ut(t.key,c,`integer expected, found ${l}`)]}}function Kn(t){let e=("property"===t.expressionContext?Cn:Mn)(Wn(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new ut(`${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 ut(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 ut(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!cn(r,["zoom","feature-state"]))return[new ut(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!sn(r))return[new ut(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jn(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 ut(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Gn(r))&&i.push(new ut(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(t){return Pn(Wn(t.value))?Kn(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 ut(r,e,`array expected, ${mn(e)} found`)];let n,i=t.styleSpec,a=[];if(e.length<1)return[new ut(r,e,"filter array must have at least 1 element")];switch(a=a.concat(Jn({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 ut(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&a.push(new ut(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 ut(`${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(Jn({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 ut(`${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 ut(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==n&&a.push(new ut(`${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 c=s.match(/^(.*)-transition$/);if("paint"===e&&c&&l[c[1]]&&l[c[1]].transition)return n({key:r,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u,h=t.valueSpec||l[s];if(!h)return[new ut(r,o,`unknown property "${s}"`)];if("string"===mn(o)&&fn(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new ut(r,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];let f=[];return"symbol"===t.layerType&&("text-field"===s&&i&&!i.glyphs&&f.push(new ut(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&gn(Wn(o))&&"identity"===Gn(o.type)&&f.push(new ut(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 ut(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 ut(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 ut(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 ut(n,r.ref,"ref cannot reference another ref layer")):o=Gn(t.type):e.push(new ut(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 ut(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?e.push(new ut(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?e.push(new ut(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 ut(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ut(n,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new ut(n,r.source,`source "${r.source}" not found`))}else e.push(new ut(n,r,'missing required property "source"'));return e=e.concat(Zn({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=>Zn({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=>Zn({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 ut(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 ut(r,e,'"type" is required')];let o,s=Gn(e.type);switch(s){case"vector":case"raster":return o=Zn({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 ut("source_raster_dem",n,`object expected, ${l} found`)),s;let c="custom"===Gn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let e in n)!c&&u.includes(e)?s.push(new ut(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 ut(e,n[e],`unknown property "${e}"`));return s}({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:a}),o;case"geojson":if(o=Zn({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],s="string"==typeof n?[n,["accumulated"],["get",t]]:n;o.push(...Kn({key:`${r}.${t}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),o.push(...Kn({key:`${r}.${t}.reduce`,value:s,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return Zn({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return Zn({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ut(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}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 ut("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 ut(o,e[o],`unknown property "${o}"`)])}return a}function ci(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 ut("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 ut(a,e[a],`unknown property "${a}"`)]);return o}function ui(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 ut("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 ut(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 ut(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 ut(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),e=e.concat(Zn({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 ut(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 ut(e,r,`color expected, ${n} found`)]:Qt.parse(String(r))?[]:[new ut(e,r,`color expected, "${r}" found`)]},constants:Hn,enum:Jn,filter:Qn,function:$n,layer:ii,object:Zn,source:si,light:li,sky:ci,terrain:ui,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 ut("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 ut(a,e[a],`unknown property "${a}"`)]);return o},string:ai,formatted:function(t){return 0===ai(t).length?[]:Kn(t)},resolvedImage:function(t){return 0===ai(t).length?[]:Kn(t)},padding:function(t){let e=t.key,r=t.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ut(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 ut(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(Jn({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&&kn(Wn(e))?Kn(t):r.type&&fi[r.type]?fi[r.type](t):Zn(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 ut(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new ut(r,e,'"glyphs" url must include a "{range}" token'))),n}function mi(t,e=J){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,style:t,styleSpec:e,validateSpec:pi}))),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)&&h(t,r,e[r]);if(o)for(var r of o(e))u.call(e,r)&&h(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(ci)),mi.terrain=vi(gi(ui)),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 Ai(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 ki{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,c=this.bboxes;for(let u=0;u<l.length;u++){let h=l[u];if(void 0===o[h]){let l=4*h;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):t<=c[l+2]&&e<=c[l+3]&&r>=c[l+0]&&n>=c[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),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;l<=h;l++){let c=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,c,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 ki(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",ki),Si("Color",Qt),Si("Error",Error),Si("AJAXError",q),Si("ResolvedImage",oe),Si("StylePropertyFunction",In),Si("StyleExpression",An,{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&&typeof ArrayBuffer<"u"&&(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 Di=t=>t>=12272&&t<=12287,Oi=t=>t>=12288&&t<=12351,Ri=t=>t>=12448&&t<=12543,Fi=t=>t>=12736&&t<=12783,Bi=t=>t>=12800&&t<=13055,ji=t=>t>=13056&&t<=13311,Ni=t=>t>=65040&&t<=65055,Ui=t=>t>=65072&&t<=65103,Vi=t=>t>=65104&&t<=65135,qi=t=>t>=65280&&t<=65519;function Hi(t){for(let e of t)if($i(e.charCodeAt(0)))return!0;return!1}function Gi(t){for(let e of t)if(!Yi(e.charCodeAt(0)))return!1;return!0}function Wi(t){let e=t.map((t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch{return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}let Zi=Wi(["Arab","Dupl","Mong","Ougr","Syrc"]);function Yi(t){return!Zi.test(String.fromCodePoint(t))}let Xi=Wi(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function $i(t){return!(746!==t&&747!==t&&(t<4352||!(Ui(t)&&!(t>=65097&&t<=65103)||ji(t)||Fi(t)||!(!Oi(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Bi(t)||Di(t)||(t=>t>=12688&&t<=12703)(t)||Ri(t)&&12540!==t||!(!qi(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)||!(!Vi(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Ni(t)||(t=>t>=19904&&t<=19967)(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||Xi.test(String.fromCodePoint(t)))))}function Ki(t){return!($i(t)||(e=t,(t=>t>=128&&t<=255)(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(t=>t>=8192&&t<=8303)(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)||(t=>t>=8448&&t<=8527)(e)||(t=>t>=8528&&t<=8591)(e)||(t=>t>=8960&&t<=9215)(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)||(t=>t>=9216&&t<=9279)(e)&&9251!==e||(t=>t>=9280&&t<=9311)(e)||(t=>t>=9312&&t<=9471)(e)||(t=>t>=9632&&t<=9727)(e)||(t=>t>=9728&&t<=9983)(e)&&!(e>=9754&&e<=9759)||(t=>t>=11008&&t<=11263)(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Oi(e)||Ri(e)||(t=>t>=57344&&t<=63743)(e)||Ui(e)||Vi(e)||qi(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}let Ji=Wi(["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 Qi(t){return Ji.test(String.fromCodePoint(t))}function ta(t,e){return!(!e&&Qi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||(t=>t>=6016&&t<=6143)(t))}function ea(t){for(let e of t)if(Qi(e.charCodeAt(0)))return!0;return!1}let ra=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 na{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(!ta(r.charCodeAt(0),e))return!1;return!0}(t,"loaded"===ra.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 ia{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(gn(t))return new In(t,e);if(kn(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 aa{constructor(t){this.property=t,this.value=new ia(t,void 0)}transitioned(t,e){return new sa(this.property,this.value,e,T({},t.transition,this.transition),t.now)}untransitioned(){return new sa(this.property,this.value,null,{},0)}}class oa{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 aa(this._values[t].property)),this._values[t].value=new ia(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 aa(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 la(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 la(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class sa{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 la{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){let n=new ha(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 ca{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 ia(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 ha(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class ua{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 ha{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class fa{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 pa{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,r,n){return new ua(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 ua(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 ua(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 da extends pa{possiblyEvaluate(t,e,r,n){if(void 0===t.value)return new ua(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 ua(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 ua(this,{kind:"constant",value:r},e)}return new ua(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 ma{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 na(Math.floor(e.zoom-1),e)),t.expression.evaluate(new na(Math.floor(e.zoom),e)),t.expression.evaluate(new na(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 ga{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)}interpolate(){return!1}}class ya{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 ia(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new aa(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}Si("DataDrivenProperty",pa),Si("DataConstantProperty",fa),Si("CrossFadedDataDrivenProperty",da),Si("CrossFadedProperty",ma),Si("ColorRampProperty",ga);let va="-transition";class xa extends K{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 ca(e.layout)),e.paint)){this._transitionablePaint=new oa(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 ha(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(va)?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(va))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)&&Ai(this,t.call(xi,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:J,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 ua&&fn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}let _a={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ba{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 wa{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 Ta(t,e=1){let r=0,n=0;return{members:t.map((t=>{let i=_a[t.type].BYTES_PER_ELEMENT,a=r=Aa(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:Aa(r,Math.max(n,e)),alignment:e}}function Aa(t,e){return Math.ceil(t/e)*e}class ka extends wa{_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}}ka.prototype.bytesPerElement=4,Si("StructArrayLayout2i4",ka);class Ma extends wa{_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}}Ma.prototype.bytesPerElement=6,Si("StructArrayLayout3i6",Ma);class Sa extends wa{_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}}Sa.prototype.bytesPerElement=8,Si("StructArrayLayout4i8",Sa);class Ea extends wa{_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}}Ea.prototype.bytesPerElement=12,Si("StructArrayLayout2i4i12",Ea);class Ca extends wa{_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}}Ca.prototype.bytesPerElement=8,Si("StructArrayLayout2i4ub8",Ca);class Ia extends wa{_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}}Ia.prototype.bytesPerElement=8,Si("StructArrayLayout2f8",Ia);class La extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)}emplace(t,e,r,n,i,a,o,s,l,c,u){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]=c,this.uint16[h+9]=u,t}}La.prototype.bytesPerElement=20,Si("StructArrayLayout10ui20",La);class Pa extends wa{_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,c,u,h){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,c,u,h)}emplace(t,e,r,n,i,a,o,s,l,c,u,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]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,t}}Pa.prototype.bytesPerElement=24,Si("StructArrayLayout4i4ui4i24",Pa);class za extends wa{_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}}za.prototype.bytesPerElement=12,Si("StructArrayLayout3f12",za);class Da extends wa{_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}}Da.prototype.bytesPerElement=4,Si("StructArrayLayout1ul4",Da);class Oa extends wa{_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 c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)}emplace(t,e,r,n,i,a,o,s,l,c){let u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t}}Oa.prototype.bytesPerElement=20,Si("StructArrayLayout6i1ul2ui20",Oa);class Ra extends wa{_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}}Ra.prototype.bytesPerElement=12,Si("StructArrayLayout2i2i2i12",Ra);class Fa extends wa{_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}}Fa.prototype.bytesPerElement=16,Si("StructArrayLayout2f1f2i16",Fa);class Ba extends wa{_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,c=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[c+6]=a,this.int16[c+7]=o,t}}Ba.prototype.bytesPerElement=16,Si("StructArrayLayout2ub2f2i16",Ba);class ja extends wa{_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}}ja.prototype.bytesPerElement=6,Si("StructArrayLayout3ui6",ja);class Na extends wa{_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,c,u,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,c,u,h,f,p,d,m,g)}emplace(t,e,r,n,i,a,o,s,l,c,u,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]=c,this.uint16[v+12]=u,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}}Na.prototype.bytesPerElement=48,Si("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Na);class Ua extends wa{_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,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,M,S){let E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,M,S)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k,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]=c,this.uint16[C+9]=u,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]=A,this.float32[I+13]=k,this.float32[I+14]=M,this.uint16[C+30]=S,this.uint16[C+31]=E,t}}Ua.prototype.bytesPerElement=64,Si("StructArrayLayout8i15ui1ul2f2ui64",Ua);class Va extends wa{_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}}Va.prototype.bytesPerElement=4,Si("StructArrayLayout1f4",Va);class qa extends wa{_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}}qa.prototype.bytesPerElement=12,Si("StructArrayLayout1ui2f12",qa);class Ha extends wa{_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}}Ha.prototype.bytesPerElement=8,Si("StructArrayLayout1ul2ui8",Ha);class Ga extends wa{_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}}Ga.prototype.bytesPerElement=4,Si("StructArrayLayout2ui4",Ga);class Wa extends wa{_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}}Wa.prototype.bytesPerElement=2,Si("StructArrayLayout1ui2",Wa);class Za extends wa{_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}}Za.prototype.bytesPerElement=16,Si("StructArrayLayout4f16",Za);class Ya extends ba{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 c(this.anchorPointX,this.anchorPointY)}}Ya.prototype.size=20;class Xa extends Oa{get(t){return new Ya(this,t)}}Si("CollisionBoxArray",Xa);class $a extends ba{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]}}$a.prototype.size=48;class Ka extends Na{get(t){return new $a(this,t)}}Si("PlacedSymbolArray",Ka);class Ja extends ba{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]}}Ja.prototype.size=64;class Qa extends Ua{get(t){return new Ja(this,t)}}Si("SymbolInstanceArray",Qa);class to extends Va{getoffsetX(t){return this.float32[1*t+0]}}Si("GlyphOffsetArray",to);class eo extends Ma{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",eo);class ro extends ba{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]}}ro.prototype.size=12;class no extends qa{get(t){return new ro(this,t)}}Si("TextAnchorOffsetArray",no);class io extends ba{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]}}io.prototype.size=8;class ao extends Ha{get(t){return new io(this,t)}}Si("FeatureIndexArray",ao);class oo extends ka{}class so extends ka{}class lo extends ka{}class co extends Ea{}class uo extends Ca{}class ho extends Ia{}class fo extends La{}class po extends Pa{}class mo extends za{}class go extends Da{}class yo extends Ra{}class vo extends Ba{}class xo extends ja{}class _o extends Ga{}let bo=Ta([{name:"a_pos",components:2,type:"Int16"}],4),{members:wo}=bo;class To{constructor(t=[]){this.segments=t}prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>To.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${To.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>To.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 To([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function Ao(t,e){return 256*(t=b(Math.floor(t),0,255))+b(Math.floor(e),0,255)}To.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Si("SegmentVector",To);let ko=Ta([{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 Mo={exports:{}},So=function(t,e){var r,n,i,a,o,s,l,c;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,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(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*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},Eo=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};Mo.exports=So,Mo.exports.murmur3=So,Mo.exports.murmur2=Eo;var Co=n(Mo.exports);class Io{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,r,n){this.ids.push(Lo(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=Lo(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 Po(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){let e=new Io;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function Lo(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Co(String(t))}function Po(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;zo(t,a,o),zo(e,3*a,3*o),zo(e,3*a+1,3*o+1),zo(e,3*a+2,3*o+2)}o-r<n-o?(Po(t,e,r,o),r=o+1):(Po(t,e,o+1,n),n=o)}}function zo(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}Si("FeaturePositionMap",Io);class Do{constructor(t,e){this.gl=t.gl,this.location=e}}class Oo extends Do{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Ro extends Do{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 Fo extends Do{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 Bo=new Float32Array(16);function jo(t){return[Ao(255*t.r,255*t.g),Ao(255*t.b,255*t.a)]}class No{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 Fo(t,e):new Oo(t,e)}}class Uo{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 Ro(t,e):new Oo(t,e)}}class Vo{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 na(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=jo(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 qo{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 na(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new na(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=jo(r),a=jo(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 Oo(t,e)}}class Ho{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],c=n[o];if(s&&l&&c)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],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,ko.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,ko.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Go{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 ua&&fn(a.property.specification)))continue;let o=Zo(i,t.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new Uo(s.value,o):new No(s.value,o,l),n.push(`/u_${i}`);else if("source"===s.kind||h){let r=Yo(i,l,"source");this.binders[i]=h?new Ho(s,l,c,e,r,t.id):new Vo(s,o,l,r),n.push(`/a_${i}`)}else{let t=Yo(i,l,"composite");this.binders[i]=new qo(s,o,l,c,e,t),n.push(`/z_${i}`)}}this.cacheKey=n.sort().join("")}getMaxValue(t){let e=this.binders[t];return e instanceof Vo||e instanceof qo?e.maxValue:0}populatePaintArrays(t,e,r,n,i){for(let a in this.binders){let o=this.binders[a];(o instanceof Vo||o instanceof qo||o instanceof Ho)&&o.populatePaintArray(t,e,r,n,i)}}setConstantPatternPositions(t,e){for(let r in this.binders){let n=this.binders[r];n instanceof Uo&&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 Vo||l instanceof qo||l instanceof Ho)&&!0===l.expression.isStateDependent){let c=n.paint.get(r);l.expression=c.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 No||r instanceof Uo)&&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 Vo||r instanceof qo)for(let e=0;e<r.paintVertexAttributes.length;e++)t.push(r.paintVertexAttributes[e].name);else if(r instanceof Ho)for(let e=0;e<ko.members.length;e++)t.push(ko.members[e].name)}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof No||r instanceof Uo||r instanceof qo)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 No||i instanceof Uo||i instanceof qo)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 Ho){let e=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(r instanceof Vo||r instanceof qo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof Vo||r instanceof qo||r instanceof Ho)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof Vo||e instanceof qo||e instanceof Ho)&&e.destroy()}}}class Wo{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let n of t)this.programConfigurations[n.id]=new Go(n,e,r);this.needsUpload=!1,this._featureMap=new Io,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 Zo(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 Yo(t,e,r){let n={color:{source:Ia,composite:Za},number:{source:Va,composite:Ia}},i={"line-pattern":{source:fo,composite:fo},"fill-pattern":{source:fo,composite:fo},"fill-extrusion-pattern":{source:fo,composite:fo}}[t];return i&&i[r]||n[e][r]}Si("ConstantBinder",No),Si("CrossFadedConstantBinder",Uo),Si("SourceExpressionBinder",Vo),Si("CrossFadedCompositeBinder",Ho),Si("CompositeExpressionBinder",qo),Si("ProgramConfiguration",Go,{omit:["_buffers"]}),Si("ProgramConfigurationSet",Wo);let Xo,$o,Ko=8192,Jo=Math.pow(2,14)-1,Qo=-Jo-1;function ts(t){let e=Ko/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,Qo,Jo),r.y=b(a,Qo,Jo),(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 es(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ts(t):[]}}function rs(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}class ns{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 so,this.indexArray=new xo,this.segments=new To,this.programConfigurations=new Wo(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,c=es(e,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),c,r))continue;let u=o?a.evaluate(c,{},r):void 0,h={id:n,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ts(e),patterns:{},sortKey:u};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,wo),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>=Ko||n<0||n>=Ko)continue;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=i.vertexLength;rs(this.layoutVertexArray,r,n,-1,-1),rs(this.layoutVertexArray,r,n,1,-1),rs(this.layoutVertexArray,r,n,1,1),rs(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 is(t,e){for(let r=0;r<t.length;r++)if(ps(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(ps(t,e[r]))return!0;return!!ls(t,e)}function as(t,e,r){return!!ps(t,e)||!!us(e,t,r)}function os(t,e){if(1===t.length)return fs(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let e=0;e<n.length;e++)if(ps(t,n[e]))return!0}for(let r=0;r<t.length;r++)if(fs(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(ls(t,e[r]))return!0;return!1}function ss(t,e,r){if(t.length>1){if(ls(t,e))return!0;for(let n=0;n<e.length;n++)if(us(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(us(t[n],e,r))return!0;return!1}function ls(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(cs(n,i,e[t],e[t+1]))return!0}return!1}function cs(t,e,r,n){return I(t,r,n)!==I(e,r,n)&&I(t,e,r)!==I(t,e,n)}function us(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(hs(t,e[r-1],e[r])<n)return!0;return!1}function hs(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 fs(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 ps(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 ds(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 ms(t,e,r){let n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function gs(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ys(t,e,r,n,i){if(!e[0]&&!e[1])return t;let a=c.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",ns,{omit:["layers"]});var vs={get paint(){return $o=$o||new ya({"circle-radius":new pa(J.paint_circle["circle-radius"]),"circle-color":new pa(J.paint_circle["circle-color"]),"circle-blur":new pa(J.paint_circle["circle-blur"]),"circle-opacity":new pa(J.paint_circle["circle-opacity"]),"circle-translate":new fa(J.paint_circle["circle-translate"]),"circle-translate-anchor":new fa(J.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new fa(J.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new fa(J.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new pa(J.paint_circle["circle-stroke-width"]),"circle-stroke-color":new pa(J.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new pa(J.paint_circle["circle-stroke-opacity"])})},get layout(){return Xo=Xo||new ya({"circle-sort-key":new pa(J.layout_circle["circle-sort-key"])})}},xs=1e-6,_s=typeof Float32Array<"u"?Float32Array:Array;function bs(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 ws(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=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+_*c+b*p+w*y,t[3]=x*o+_*u+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+_*c+b*p+w*y,t[7]=x*o+_*u+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+_*c+b*p+w*y,t[11]=x*o+_*u+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+_*c+b*p+w*y,t[15]=x*o+_*u+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 Ts,As=ws;function ks(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}Ts=new _s(4),_s!=Float32Array&&(Ts[0]=0,Ts[1]=0,Ts[2]=0,Ts[3]=0);class Ms extends xa{constructor(t){super(t,vs)}createBucket(t){return new ns(t)}queryRadius(t){let e=t;return ms("circle-radius",this,e)+ms("circle-stroke-width",this,e)+gs(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o,s){let l=ys(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:(p=s,l.map((t=>Ss(t,p)))),f=u?c*o:c;var p;for(let t of n)for(let e of t){let t=u?e:Ss(e,s),r=f,n=ks([],[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]),as(h,t,r))return!0}return!1}}function Ss(t,e){let r=ks([],[t.x,t.y,0,1],e);return new c(r[0]/r[3],r[1]/r[3])}class Es extends ns{}let Cs;Si("HeatmapBucket",Es,{omit:["layers"]});var Is={get paint(){return Cs=Cs||new ya({"heatmap-radius":new pa(J.paint_heatmap["heatmap-radius"]),"heatmap-weight":new pa(J.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new fa(J.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ga(J.paint_heatmap["heatmap-color"]),"heatmap-opacity":new fa(J.paint_heatmap["heatmap-opacity"])})}};function Ls(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 Ps(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=Ls({},{width:e,height:r},n);zs(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 zs(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 c=((r.y+l)*t.width+r.x)*a,u=((n.y+l)*e.width+n.x)*a;for(let t=0;t<i.width*a;t++)s[u+t]=o[c+t]}return e}class Ds{constructor(t,e){Ls(this,t,1,e)}resize(t){Ps(this,t,1)}clone(){return new Ds({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){zs(t,e,r,n,i,1)}}class Os{constructor(t,e){Ls(this,t,4,e)}resize(t){Ps(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Os({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){zs(t,e,r,n,i,4)}}function Rs(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new Os({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:c}=t.clips[e];a(i,o,l*(1-s)+c*s)}else for(let t=0,e=0;t<r;t++,e+=4)a(0,e,t/(r-1));return i}Si("AlphaImage",Ds),Si("RGBAImage",Os);let Fs,Bs="big-fb";class js extends xa{createBucket(t){return new Es(t)}constructor(t){super(t,Is),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Rs({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Bs)&&this.heatmapFbos.delete(Bs)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}var Ns={get paint(){return Fs=Fs||new ya({"hillshade-illumination-direction":new fa(J.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new fa(J.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new fa(J.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new fa(J.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new fa(J.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new fa(J.paint_hillshade["hillshade-accent-color"])})}};class Us extends xa{constructor(t){super(t,Ns)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}let Vs,qs,Hs=Ta([{name:"a_pos",components:2,type:"Int16"}],4),{members:Gs}=Hs;function Ws(t,e,r=2){let n,i,a,o=e&&e.length,s=o?e[0]*r:t.length,l=Zs(t,0,s,r,!0),c=[];if(!l||l.next===l.prev)return c;if(o&&(l=function(t,e,r,n){let i=[];for(let r=0,a=e.length;r<a;r++){let o=Zs(t,e[r]*n,r<a-1?e[r+1]*n:t.length,n,!1);o===o.next&&(o.steiner=!0),i.push(il(o))}i.sort(tl);for(let t=0;t<i.length;t++)r=el(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 Xs(l,c,r,n,i,a,0),c}function Zs(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=dl(i/n|0,t[i],t[i+1],a);else for(let i=r-n;i>=e;i-=n)a=dl(i/n|0,t[i],t[i+1],a);return a&&ll(a,a.next)&&(ml(a),a=a.next),a}function Ys(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!ll(n,n.next)&&0!==sl(n.prev,n,n.next))n=n.next;else{if(ml(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function Xs(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=nl(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,c=t.next;if(a?Ks(t,n,i,a):$s(t))e.push(l.i,t.i,c.i),ml(t),t=c.next,s=c.next;else if((t=c)===s){o?1===o?Xs(t=Js(Ys(t),e),e,r,n,i,a,2):2===o&&Qs(t,e,r,n,i,a):Xs(Ys(t),e,r,n,i,a,1);break}}}function $s(t){let e=t.prev,r=t,n=t.next;if(sl(e,r,n)>=0)return!1;let i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,f=i>a?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c,d=n.next;for(;d!==e;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&al(i,s,a,l,o,c,d.x,d.y)&&sl(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ks(t,e,r,n){let i=t.prev,a=t,o=t.next;if(sl(i,a,o)>=0)return!1;let s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,f=o.y,p=s<l?s<c?s:c:l<c?l:c,d=u<h?u<f?u:f:h<f?h:f,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>f?u:f:h>f?h:f,y=nl(p,d,e,r,n),v=nl(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&&al(s,u,l,h,c,f,x.x,x.y)&&sl(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&al(s,u,l,h,c,f,_.x,_.y)&&sl(_.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&&al(s,u,l,h,c,f,x.x,x.y)&&sl(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&&al(s,u,l,h,c,f,_.x,_.y)&&sl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Js(t,e){let r=t;do{let n=r.prev,i=r.next.next;!ll(n,i)&&cl(n,r,r.next,i)&&fl(n,i)&&fl(i,n)&&(e.push(n.i,r.i,i.i),ml(r),ml(r.next),r=t=i),r=r.next}while(r!==t);return Ys(r)}function Qs(t,e,r,n,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&ol(o,t)){let s=pl(o,t);return o=Ys(o,o.next),s=Ys(s,s.next),Xs(o,e,r,n,i,a,0),void Xs(s,e,r,n,i,a,0)}t=t.next}o=o.next}while(o!==t)}function tl(t,e){return t.x-e.x}function el(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,c=r.y,u=1/0;n=r;do{if(i>=n.x&&n.x>=l&&i!==n.x&&al(a<c?i:o,a,l,c,a<c?o:i,a,n.x,n.y)){let e=Math.abs(a-n.y)/(i-n.x);fl(n,t)&&(e<u||e===u&&(n.x>r.x||n.x===r.x&&rl(r,n)))&&(r=n,u=e)}n=n.next}while(n!==s);return r}(t,e);if(!r)return e;let n=pl(r,t);return Ys(n,n.next),Ys(r,r.next)}function rl(t,e){return sl(t.prev,t,e.prev)<0&&sl(e.next,t,t.next)<0}function nl(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 il(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 al(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 ol(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&&cl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(fl(t,e)&&fl(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)&&(sl(t.prev,t,e.prev)||sl(t,e.prev,e))||ll(t,e)&&sl(t.prev,t,t.next)>0&&sl(e.prev,e,e.next)>0)}function sl(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function ll(t,e){return t.x===e.x&&t.y===e.y}function cl(t,e,r,n){let i=hl(sl(t,e,r)),a=hl(sl(t,e,n)),o=hl(sl(r,n,t)),s=hl(sl(r,n,e));return i!==a&&o!==s||!(0!==i||!ul(t,r,e))||!(0!==a||!ul(t,n,e))||!(0!==o||!ul(r,t,n))||!(0!==s||!ul(r,e,n))}function ul(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 hl(t){return t>0?1:t<0?-1:0}function fl(t,e){return sl(t.prev,t,t.next)<0?sl(t,e,t.next)>=0&&sl(t,t.prev,e)>=0:sl(t,e,t.prev)<0||sl(t,t.next,e)<0}function pl(t,e){let r=gl(t.i,t.x,t.y),n=gl(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 dl(t,e,r,n){let i=gl(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 ml(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 gl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function yl(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 vl(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 xl{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 lo,this.indexArray=new xo,this.indexArray2=new _o,this.programConfigurations=new Wo(t.layers,t.zoom),this.segments=new To,this.segments2=new To,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=yl("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:c}of t){let t=this.layers[0]._featureFilter.needGeometry,u=es(o,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),u,r))continue;let h=i?n.evaluate(u,{},r,e.availableImages):void 0,f={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:ts(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=vl("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,Gs),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 Ar(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=Ws(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",xl,{omit:["layers","patternFeatures"]});var _l={get paint(){return qs=qs||new ya({"fill-antialias":new fa(J.paint_fill["fill-antialias"]),"fill-opacity":new pa(J.paint_fill["fill-opacity"]),"fill-color":new pa(J.paint_fill["fill-color"]),"fill-outline-color":new pa(J.paint_fill["fill-outline-color"]),"fill-translate":new fa(J.paint_fill["fill-translate"]),"fill-translate-anchor":new fa(J.paint_fill["fill-translate-anchor"]),"fill-pattern":new da(J.paint_fill["fill-pattern"])})},get layout(){return Vs=Vs||new ya({"fill-sort-key":new pa(J.layout_fill["fill-sort-key"])})}};class bl extends xa{constructor(t){super(t,_l)}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 xl(t)}queryRadius(){return gs(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){return os(ys(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)}isTileClipped(){return!0}}let wl=Ta([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Tl=Ta([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Al}=wl;var kl={},Ml=a,Sl=El;function El(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(Cl,this,e)}function Cl(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 Il(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}El.types=["Unknown","Point","LineString","Polygon"],El.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 Ml(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},El.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,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},El.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(),c=El.types[this.type];function u(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];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(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=Il(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++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var f={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Ll=Sl,Pl=zl;function zl(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(Dl,this,e),this.length=this._features.length}function Dl(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))}zl.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 Ll(this._pbf,e,this.extent,this._keys,this._values)};var Ol=Pl;function Rl(t,e,r){if(3===t){var n=new Ol(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}kl.VectorTile=function(t,e){this.layers=t.readFields(Rl,{},e)},kl.VectorTileFeature=Sl,kl.VectorTileLayer=Pl;let Fl,Bl=kl.VectorTileFeature.types,jl=Math.pow(2,13);function Nl(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*jl)+o,i*jl*2,a*jl*2,Math.round(s))}class Ul{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 co,this.centroidVertexArray=new oo,this.indexArray=new xo,this.programConfigurations=new Wo(t.layers,t.zoom),this.segments=new To,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.features=[],this.hasPattern=yl("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=es(n,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),s,r))continue;let l={id:i,sourceLayerIndex:o,index:a,geometry:t?s.geometry:ts(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(vl("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,Al),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Tl.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 Ar(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||ql(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(!Vl(a,o)){i.vertexLength+4>To.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),Nl(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,r),Nl(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,Nl(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,0,r),Nl(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>To.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(n,this.layoutVertexArray,this.indexArray)),"Polygon"!==Bl[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];Nl(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=Ws(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 Vl(t,e){return t.x===e.x&&(t.x<0||t.x>Ko)||t.y===e.y&&(t.y<0||t.y>Ko)}function ql(t){return t.every((t=>t.x<0))||t.every((t=>t.x>Ko))||t.every((t=>t.y<0))||t.every((t=>t.y>Ko))}Si("FillExtrusionBucket",Ul,{omit:["layers","features"]});var Hl={get paint(){return Fl=Fl||new ya({"fill-extrusion-opacity":new fa(J["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new pa(J["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new fa(J["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new fa(J["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new da(J["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new pa(J["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new pa(J["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new fa(J["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Gl extends xa{constructor(t){super(t,Hl)}createBucket(t){return new Ul(t)}queryRadius(){return gs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,r,n,i,a,o,s){let l=ys(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),h=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];ks(t,t,e),r.push(new c(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,h=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+h,w=g+f,T=y+p,A=v+d,k=new c((m+o)/_,(g+s)/_);k.z=x/_,t.push(k);let M=new c(b/A,w/A);M.z=T/A,r.push(M)}i.push(t),a.push(r)}return[i,a]}(n,h,u,s);return function(t,e,r){let n=1/0;os(r,e)&&(n=Zl(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];is(r,i)&&(n=Math.min(n,Zl(r,i)))}}return n!==1/0&&n}(p[0],p[1],f)}}function Wl(t,e){return t.x*e.x+t.y*e.y}function Zl(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),c=o.sub(i),u=Wl(s,s),h=Wl(s,l),f=Wl(l,l),p=Wl(c,s),d=Wl(c,l),m=u*f-h*h,g=(f*p-h*d)/m,y=(u*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 Yl,Xl,$l=Ta([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Kl}=$l,Jl=Ta([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Ql}=Jl,tc=kl.VectorTileFeature.types,ec=Math.cos(Math.PI/180*37.5),rc=Math.pow(2,14)/.5;class nc{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 uo,this.layoutVertexArray2=new ho,this.indexArray=new xo,this.programConfigurations=new Wo(t.layers,t.zoom),this.segments=new To,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=yl("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,c=es(e,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),c,r))continue;let u=i?n.evaluate(c,{},r):void 0,h={id:o,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ts(e),patterns:{},sortKey:u};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=vl("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,Ql)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Kl),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"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(let r of e)this.addLine(r,t,o,s,l,c);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"===tc[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 c,u,h,f,p,d=this.overscaling<=16?15*Ko/(512*this.overscaling):0,m=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,o&&(c=t[s-2],p=t[l].sub(c)._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),c&&(u=c),c=t[e],p=h?h.sub(c)._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<ec&&u&&h,w=f.x*p.y-f.y*p.x>0;if(b&&e>l){let t=c.dist(u);if(t>2*d){let e=c.sub(c.sub(u)._mult(d/t)._round());this.updateDistance(u,e),this.addCurrentVertex(e,f,0,0,m),u=e}}let T=u&&h,A=T?r:o?"butt":n;if(T&&"round"===A&&(x<a?A="miter":x<=2&&(A="fakeround")),"miter"===A&&x>i&&(A="bevel"),"bevel"===A&&(x>2&&(A="flipbevel"),x<i&&(A="miter")),u&&this.updateDistance(u,c),"miter"===A)g._mult(x),this.addCurrentVertex(c,g,0,0,m);else if("flipbevel"===A){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(c,g,0,0,m),this.addCurrentVertex(c,g.mult(-1),0,0,m)}else if("bevel"===A||"fakeround"===A){let t=-Math.sqrt(x*x-1),e=w?t:0,r=w?0:t;if(u&&this.addCurrentVertex(c,f,e,r,m),"fakeround"===A){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(c,n.x,n.y,!1,w,0,m)}}h&&this.addCurrentVertex(c,p,-e,-r,m)}else if("butt"===A)this.addCurrentVertex(c,g,0,0,m);else if("square"===A){let t=u?1:-1;this.addCurrentVertex(c,g,t,t,m)}else"round"===A&&(u&&(this.addCurrentVertex(c,f,0,0,m),this.addCurrentVertex(c,f,1,1,m,!0)),h&&(this.addCurrentVertex(c,p,-1,-1,m,!0),this.addCurrentVertex(c,p,0,0,m)));if(b&&e<s-1){let t=c.dist(h);if(t>2*d){let e=c.add(h.sub(c)._mult(d/t)._round());this.updateDistance(c,e),this.addCurrentVertex(e,p,0,0,m),c=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>rc/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*(rc-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 c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),a?this.e2=c:this.e1=c}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",nc,{omit:["layers","patternFeatures"]});var ic={get paint(){return Xl=Xl||new ya({"line-opacity":new pa(J.paint_line["line-opacity"]),"line-color":new pa(J.paint_line["line-color"]),"line-translate":new fa(J.paint_line["line-translate"]),"line-translate-anchor":new fa(J.paint_line["line-translate-anchor"]),"line-width":new pa(J.paint_line["line-width"]),"line-gap-width":new pa(J.paint_line["line-gap-width"]),"line-offset":new pa(J.paint_line["line-offset"]),"line-blur":new pa(J.paint_line["line-blur"]),"line-dasharray":new ma(J.paint_line["line-dasharray"]),"line-pattern":new da(J.paint_line["line-pattern"]),"line-gradient":new ga(J.paint_line["line-gradient"])})},get layout(){return Yl=Yl||new ya({"line-cap":new fa(J.layout_line["line-cap"]),"line-join":new pa(J.layout_line["line-join"]),"line-miter-limit":new fa(J.layout_line["line-miter-limit"]),"line-round-limit":new fa(J.layout_line["line-round-limit"]),"line-sort-key":new pa(J.layout_line["line-sort-key"])})}};class ac extends pa{possiblyEvaluate(t,e){return e=new na(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 oc;class sc extends xa{constructor(t){super(t,ic),this.gradientVersion=0,oc||(oc=new ac(ic.paint.properties["line-width"].specification),oc.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"]=oc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new nc(t)}queryRadius(t){let e=t,r=lc(ms("line-width",this,e),ms("line-gap-width",this,e)),n=ms("line-offset",this,e);return r/2+Math.abs(n)+gs(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){let s=ys(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*lc(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 c(0,0):n.sub(r)._unit()._perp(),l=t===i.length-1?new c(0,0):o.sub(n)._unit()._perp(),u=s._add(l)._unit(),h=u.x*l.x+u.y*l.y;0!==h&&u._mult(1/h),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(ps(t,i[e]))return!0;if(ss(t,i,r))return!0}return!1}(s,n,l)}isTileClipped(){return!0}}function lc(t,e){return e>0?e+2*t:t}let cc=Ta([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),uc=Ta([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ta([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let hc=Ta([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ta([{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 fc=Ta([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),pc=Ta([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function dc(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()),ra.applyArabicShaping&&(t=ra.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ta([{name:"triangle",components:3,type:"Uint16"}]),Ta([{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"}]),Ta([{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"}]),Ta([{type:"Float32",name:"offsetX"}]),Ta([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ta([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let mc={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var gc=24,yc=_c,vc=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},xc=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>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=u):(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>=u?(s=0,o=u):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,c+=i;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m};function _c(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}_c.Varint=0,_c.Fixed64=1,_c.Bytes=2,_c.Fixed32=5;var bc=4294967296,wc=1/bc,Tc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ac(t){return t.type===_c.Bytes?t.readVarint()+t.pos:t.pos+1}function kc(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 Mc(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Sc(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Ec(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Cc(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Ic(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Lc(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Pc(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function zc(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Dc(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Oc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Rc(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Fc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}_c.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=Oc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Fc(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Oc(this.buf,this.pos)+Oc(this.buf,this.pos+4)*bc;return this.pos+=8,t},readSFixed64:function(){var t=Oc(this.buf,this.pos)+Fc(this.buf,this.pos+4)*bc;return this.pos+=8,t},readFloat:function(){var t=vc(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=vc(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&&Tc?(t=this.buf,e=i,r=n,Tc.decode(t.subarray(e,r))):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,l=t[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}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!==_c.Bytes)return t.push(this.readVarint(e));var r=Ac(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==_c.Bytes)return t.push(this.readSVarint());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==_c.Bytes)return t.push(this.readBoolean());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==_c.Bytes)return t.push(this.readFloat());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==_c.Bytes)return t.push(this.readDouble());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==_c.Bytes)return t.push(this.readFixed32());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==_c.Bytes)return t.push(this.readSFixed32());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==_c.Bytes)return t.push(this.readFixed64());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==_c.Bytes)return t.push(this.readSFixed64());var e=Ac(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===_c.Varint)for(;this.buf[this.pos++]>127;);else if(e===_c.Bytes)this.pos=this.readVarint()+this.pos;else if(e===_c.Fixed32)this.pos+=4;else{if(e!==_c.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),Rc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Rc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Rc(this.buf,-1&t,this.pos),Rc(this.buf,Math.floor(t*wc),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Rc(this.buf,-1&t,this.pos),Rc(this.buf,Math.floor(t*wc),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&&kc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),xc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),xc(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&&kc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,_c.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Mc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Sc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ic,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ec,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Cc,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Lc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Pc,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,zc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Dc,e)},writeBytesField:function(t,e){this.writeTag(t,_c.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,_c.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,_c.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,_c.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,_c.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,_c.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,_c.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,_c.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,_c.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,_c.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var Bc,jc=n(yc);function Nc(t,e,r){1===t&&r.readMessage(Uc,e)}function Uc(t,e,r){if(3===t){let{id:t,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(Vc,{});e.push({id:t,bitmap:new Ds({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function Vc(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 qc(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 Hc{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 Gc{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}=qc(i),s=new Os({width:a||1,height:o||1});for(let e in t){let n=t[e],i=r[e].paddedRect;Os.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,c=r.data.height;Os.copy(r.data,s,{x:0,y:0},{x:a,y:o},r.data),Os.copy(r.data,s,{x:0,y:c-1},{x:a,y:o-1},{width:l,height:1}),Os.copy(r.data,s,{x:0,y:0},{x:a,y:o+c},{width:l,height:1}),Os.copy(r.data,s,{x:l-1,y:0},{x:a-1,y:o},{width:1,height:c}),Os.copy(r.data,s,{x:0,y:0},{x:a+l,y:o},{width:1,height:c})}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 Hc(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",Hc),Si("ImageAtlas",Gc),t.ah=void 0,(Bc=t.ah||(t.ah={}))[Bc.none=0]="none",Bc[Bc.horizontal=1]="horizontal",Bc[Bc.vertical=2]="vertical",Bc[Bc.horizontalOnly=3]="horizontalOnly";let Wc=-17;class Zc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){let r=new Zc;return r.scale=t||1,r.fontStack=e,r}static forImage(t){let e=new Zc;return e.imageName=t,e}}class Yc{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){let r=new Yc;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&&Ki(n)&&!mc[t[r+1]]||i&&Ki(i)&&!mc[t[r-1]]||!mc[t[r]]?t[r]:mc[t[r]]}return e}(this.text)}trim(){let t=0;for(let e=0;e<this.text.length&&$c[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let r=this.text.length-1;r>=0&&r>=t&&$c[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 Yc;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(Zc.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(Zc.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 Xc(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){let g,y=Yc.fromFeature(e,a);f===t.ah.vertical&&y.verticalizePunctuation();let{processBidirectionalText:v,processStyledBidirectionalText:x}=ra;if(v&&1===y.sections.length){g=[];let t=v(y.toString(),iu(y,u,o,r,i,d));for(let e of t){let t=new Yc;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,iu(y,u,o,r,i,d));for(let e of t){let t=new Yc;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,iu(y,u,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,c,u,h,f){let p=0,d=Wc,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)*gc,_={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,A=null,k=gc,M=!(c===t.ah.horizontal||!h&&!$i(y)||h&&($c[y]||(x=y,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(x)))));if(m.imageName){let t=i[m.imageName];if(!t)continue;A=m.imageName,e.iconsInText=e.iconsInText||!0,T=t.paddedRect;let r=t.displaySize;m.scale=m.scale*gc/f,_={width:r[0],height:r[1],left:1,top:-3,advance:M?r[1]:r[0]},v=l+(gc-r[1]*m.scale),k=_.advance;let n=M?r[0]*m.scale-gc*a:r[1]*m.scale-gc*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)*gc}M?(e.verticalizable=!0,b.push({glyph:y,imageName:A,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=k*m.scale+u):(b.push({glyph:y,imageName:A,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=_.advance*m.scale+u)}0!==b.length&&(m=Math.max(p-u,m),ou(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-Wc,{horizontalAlign:b,verticalAlign:w}=au(s);(function(t,e,r,n,i,a,o,s,l){let c=(e-r)*i,u=0;u=a!==o?-s*n-Wc:(-n*l+.5)*o;for(let e of t)for(let t of e.positionedGlyphs)t.x+=c,t.y+=u})(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,c,f,u,p,m),!function(t){for(let e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(_)&&b}let $c={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Kc={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},Jc={40:!0};function Qc(t,e,r,n,i,a){if(e.imageName){let t=n[e.imageName];return t?t.displaySize[0]*e.scale*gc/a+i:0}{let n=r[e.fontStack],a=n&&n[t];return a?a.metrics.advance*e.scale+i:0}}function tu(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 eu(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 ru(t,e,r,n,i,a){let o=null,s=tu(e,r,i,a);for(let t of n){let n=tu(e-t.x,r,i,a)+t.badness;n<=s&&(o=t,s=n)}return{index:t,x:e,priorBreak:o,badness:s}}function nu(t){return t?nu(t.priorBreak).concat(t.index):[]}function iu(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+=Qc(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,c=0;for(let r=0;r<t.length();r++){let h=t.getSection(r),f=t.getCharCode(r);if($c[f]||(c+=Qc(f,h,n,i,e,a)),r<t.length()-1){let e=!((u=f)<11904)&&(!!Ui(u)||!!ji(u)||!!Fi(u)||!!Oi(u)||!!Bi(u)||!!qi(u)||!!Di(u)||!!Ni(u)||Xi.test(String.fromCodePoint(u)));(Kc[f]||e||h.imageName||r!==t.length()-2&&Jc[t.getCharCode(r+1)])&&o.push(ru(r+1,c,s,o,eu(f,t.getCharCode(r+1),e&&l),!1))}}var u;return nu(ru(t.length(),c,s,o,0,!0))}function au(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 ou(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 su(t,e,r){let{horizontalAlign:n,verticalAlign:i}=au(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 lu(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",c=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&a/o<c||"proportional"===s){let t=Math.ceil(o*c);n*=t/a,a=t}}else if("proportional"===s&&"stretchOnly"===l&&0!==c&&a/o>c){let t=Math.ceil(a/c);i*=t/o,o=t}return{x1:n,y1:i,x2:n+a,y2:i+o}}function cu(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,c,u,h,f=e.left*a,p=e.right*a;"width"===r||"both"===r?(h=i[0]+f-n[3],c=i[0]+p+n[1]):(h=i[0]+(f+p-s.displaySize[0])/2,c=h+s.displaySize[0]);let d=e.top*a,m=e.bottom*a;return"height"===r||"both"===r?(l=i[1]+d-n[0],u=i[1]+m+n[2]):(l=i[1]+(d+m-s.displaySize[1])/2,u=l+s.displaySize[1]),{image:s,top:l,right:c,bottom:u,left:h,collisionPadding:o}}let uu=128,hu=32640;function fu(t,e){let{expression:r}=e;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new na(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 na(o)),maxSize:r.evaluate(new na(s)),interpolationType:n}}}function pu(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}let du,mu,gu=kl.VectorTileFeature.types,yu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function vu(t,e,r,n,i,a,o,s,l,c,u,h,f){let p=s?Math.min(hu,Math.round(s[0])):0,d=s?Math.min(hu,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*c,16*u,256*h,256*f)}function xu(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 _u(t){for(let e of t.sections)if(ea(e.text))return!0;return!1}class bu{constructor(t){this.layoutVertexArray=new po,this.indexArray=new xo,this.programConfigurations=t,this.segments=new To,this.dynamicLayoutVertexArray=new mo,this.opacityVertexArray=new go,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ka}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,cc.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,uc.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,yu,!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",bu);class wu{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new To,this.collisionVertexArray=new vo}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,hc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Si("CollisionBuffers",wu);class Tu{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=bs([]),this.placementViewportMatrix=bs([]);let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=fu(this.zoom,r["text-size"]),this.iconSizeData=fu(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"!==pu(n,"text-overlap","text-allow-overlap")||"never"!==pu(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 bu(new Wo(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new bu(new Wo(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new to,this.lineVertexArray=new eo,this.symbolInstances=new Qa,this.textAnchorOffsets=new no}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=mc[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"),c=("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),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;let f=r.iconDependencies,p=r.glyphDependencies,d=r.availableImages,m=new na(this.zoom);for(let{feature:r,id:s,index:l,sourceLayerIndex:g}of e){let e,y,v=i._featureFilter.needGeometry,x=es(r,v);if(!i._featureFilter.filter(m,x,n))continue;if(v||(x.geometry=ts(r)),c){let t=i.getValueAndResolveTokens("text-field",x,n,d),r=re.factory(t),a=this.hasRTLText=this.hasRTLText||_u(r);(!a||"unavailable"===ra.getRTLTextPluginStatus()||a&&ra.isParsed())&&(e=dc(r,i,x))}if(u){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:gu[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=Hi(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 c=0;c<t.length;c++){let u=t[c],h=u.geometry,f=u.text?u.text.toString():null;if(!f){a(c);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(c),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,c,u,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:c,tex:u,pixelOffsetTL:h,pixelOffsetBR:g,minFontScaleX:y,minFontScaleY:_,glyphOffset:b,isSDF:w,sectionIndex:T}=r[t],A=m.vertexLength,k=b[1];vu(d,l.x,l.y,i.x,k+i.y,u.x,u.y,n,w,h.x,h.y,y,_),vu(d,l.x,l.y,a.x,k+a.y,u.x+u.w,u.y,n,w,g.x,h.y,y,_),vu(d,l.x,l.y,s.x,k+s.y,u.x,u.y+u.h,n,w,h.x,g.y,y,_),vu(d,l.x,l.y,c.x,k+c.y,u.x+u.w,u.y+u.h,n,w,g.x,g.y,y,_),xu(e.dynamicLayoutVertexArray,l,v),p.emplaceBack(A,A+1,A+2),p.emplaceBack(A+1,A+2,A+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,c,u,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,h=i.collisionVertexArray,f=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(u,h,a,f,p,new c(t,e)),this._addCollisionDebugVertex(u,h,a,f,p,new c(r,e)),this._addCollisionDebugVertex(u,h,a,f,p,new c(r,n)),this._addCollisionDebugVertex(u,h,a,f,p,new c(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 wu(yo,fc.members,_o),this.iconCollisionBox=new wu(yo,fc.members,_o);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 c={};for(let n=e;n<r;n++){let e=t.get(n);c.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.textFeatureIndex=e.featureIndex;break}for(let e=n;e<i;e++){let r=t.get(e);c.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.verticalTextFeatureIndex=r.featureIndex;break}for(let e=a;e<o;e++){let r=t.get(e);c.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.iconFeatureIndex=r.featureIndex;break}for(let e=s;e<l;e++){let r=t.get(e);c.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.verticalIconFeatureIndex=r.featureIndex;break}return c}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",Tu,{omit:["layers","collisionBoxArray","features","compareText"]}),Tu.MAX_GLYPHS=65535,Tu.addDynamicAttributes=xu;var Au={get paint(){return mu=mu||new ya({"icon-opacity":new pa(J.paint_symbol["icon-opacity"]),"icon-color":new pa(J.paint_symbol["icon-color"]),"icon-halo-color":new pa(J.paint_symbol["icon-halo-color"]),"icon-halo-width":new pa(J.paint_symbol["icon-halo-width"]),"icon-halo-blur":new pa(J.paint_symbol["icon-halo-blur"]),"icon-translate":new fa(J.paint_symbol["icon-translate"]),"icon-translate-anchor":new fa(J.paint_symbol["icon-translate-anchor"]),"text-opacity":new pa(J.paint_symbol["text-opacity"]),"text-color":new pa(J.paint_symbol["text-color"],{runtimeType:vt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new pa(J.paint_symbol["text-halo-color"]),"text-halo-width":new pa(J.paint_symbol["text-halo-width"]),"text-halo-blur":new pa(J.paint_symbol["text-halo-blur"]),"text-translate":new fa(J.paint_symbol["text-translate"]),"text-translate-anchor":new fa(J.paint_symbol["text-translate-anchor"])})},get layout(){return du=du||new ya({"symbol-placement":new fa(J.layout_symbol["symbol-placement"]),"symbol-spacing":new fa(J.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new fa(J.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new pa(J.layout_symbol["symbol-sort-key"]),"symbol-z-order":new fa(J.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new fa(J.layout_symbol["icon-allow-overlap"]),"icon-overlap":new fa(J.layout_symbol["icon-overlap"]),"icon-ignore-placement":new fa(J.layout_symbol["icon-ignore-placement"]),"icon-optional":new fa(J.layout_symbol["icon-optional"]),"icon-rotation-alignment":new fa(J.layout_symbol["icon-rotation-alignment"]),"icon-size":new pa(J.layout_symbol["icon-size"]),"icon-text-fit":new fa(J.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new fa(J.layout_symbol["icon-text-fit-padding"]),"icon-image":new pa(J.layout_symbol["icon-image"]),"icon-rotate":new pa(J.layout_symbol["icon-rotate"]),"icon-padding":new pa(J.layout_symbol["icon-padding"]),"icon-keep-upright":new fa(J.layout_symbol["icon-keep-upright"]),"icon-offset":new pa(J.layout_symbol["icon-offset"]),"icon-anchor":new pa(J.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new fa(J.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new fa(J.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new fa(J.layout_symbol["text-rotation-alignment"]),"text-field":new pa(J.layout_symbol["text-field"]),"text-font":new pa(J.layout_symbol["text-font"]),"text-size":new pa(J.layout_symbol["text-size"]),"text-max-width":new pa(J.layout_symbol["text-max-width"]),"text-line-height":new fa(J.layout_symbol["text-line-height"]),"text-letter-spacing":new pa(J.layout_symbol["text-letter-spacing"]),"text-justify":new pa(J.layout_symbol["text-justify"]),"text-radial-offset":new pa(J.layout_symbol["text-radial-offset"]),"text-variable-anchor":new fa(J.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new pa(J.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new pa(J.layout_symbol["text-anchor"]),"text-max-angle":new fa(J.layout_symbol["text-max-angle"]),"text-writing-mode":new fa(J.layout_symbol["text-writing-mode"]),"text-rotate":new pa(J.layout_symbol["text-rotate"]),"text-padding":new fa(J.layout_symbol["text-padding"]),"text-keep-upright":new fa(J.layout_symbol["text-keep-upright"]),"text-transform":new pa(J.layout_symbol["text-transform"]),"text-offset":new pa(J.layout_symbol["text-offset"]),"text-allow-overlap":new fa(J.layout_symbol["text-allow-overlap"]),"text-overlap":new fa(J.layout_symbol["text-overlap"]),"text-ignore-placement":new fa(J.layout_symbol["text-ignore-placement"]),"text-optional":new fa(J.layout_symbol["text-optional"])})}};class ku{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",ku,{omit:["defaultValue"]});class Mu extends xa{constructor(t){super(t,Au)}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()||kn(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 Tu(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of Au.paint.overridableProperties){if(!Mu.hasPaintOverride(this.layout,t))continue;let e=this.paint.get(t),r=new ku(e),n=new An(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 ua(e.property,i,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&Mu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){let r=t.get("text-field"),n=Au.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&&ce(e.value)===wt?a(e.value.sections):e instanceof Ke?a(e.sections):e.eachChild(t))},e=r.value;e._styleExpression&&t(e._styleExpression.expression)}return i}}let Su;var Eu={get paint(){return Su=Su||new ya({"background-color":new fa(J.paint_background["background-color"]),"background-pattern":new ma(J.paint_background["background-pattern"]),"background-opacity":new fa(J.paint_background["background-opacity"])})}};class Cu extends xa{constructor(t){super(t,Eu)}}let Iu;var Lu={get paint(){return Iu=Iu||new ya({"raster-opacity":new fa(J.paint_raster["raster-opacity"]),"raster-hue-rotate":new fa(J.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new fa(J.paint_raster["raster-brightness-min"]),"raster-brightness-max":new fa(J.paint_raster["raster-brightness-max"]),"raster-saturation":new fa(J.paint_raster["raster-saturation"]),"raster-contrast":new fa(J.paint_raster["raster-contrast"]),"raster-resampling":new fa(J.paint_raster["raster-resampling"]),"raster-fade-duration":new fa(J.paint_raster["raster-fade-duration"])})}};class Pu extends xa{constructor(t){super(t,Lu)}}class zu extends xa{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 Du{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(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 Ou=6371008.8;class Ru{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 Ru(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 Ou*Math.acos(Math.min(i,1))}static convert(t){if(t instanceof Ru)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ru(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ru(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 Fu=2*Math.PI*Ou;function Bu(t){return Fu*Math.cos(t*Math.PI/180)}function ju(t){return(180+t)/360}function Nu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Uu(t,e){return t/Bu(e)}function Vu(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class qu{constructor(t,e,r=0){this.x=+t,this.y=+e,this.z=+r}static fromLngLat(t,e=0){let r=Ru.convert(t);return new qu(ju(r.lng),Nu(r.lat),Uu(e,r.lat))}toLngLat(){return new Ru(360*this.x-180,Vu(this.y))}toAltitude(){return this.z*Bu(Vu(this.y))}meterInMercatorCoordinateUnits(){return 1/Fu*(t=Vu(this.y),1/Math.cos(t*Math.PI/180));var t}}function Hu(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 Gu{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=Yu(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=Hu(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=Hu(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;let c=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,c).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 c((t.x*e-this.x)*Ko,(t.y*e-this.y)*Ko)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Wu{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Yu(t,e.z,e.z,e.x,e.y)}}class Zu{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 Gu(r,+n,+i),this.key=Yu(e,t,r,n,i)}clone(){return new Zu(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 Zu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Zu(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?Yu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Yu(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 Zu(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 Zu(e,this.wrap,e,r,n),new Zu(e,this.wrap,e,r+1,n),new Zu(e,this.wrap,e,r,n+1),new Zu(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 Zu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Zu(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 Wu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new qu(t.x-this.wrap,t.y))}}function Yu(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",Gu),Si("OverscaledTileID",Zu,{omit:["posMatrix"]});class Xu{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 Os({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",Xu);class $u{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 Ku{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 Ju{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ki(Ko,16,0),this.grid3D=new ki(Ko,16,0),this.featureIndexArray=new ao,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]<Ko&&n[1]<Ko&&n[2]>=0&&n[3]>=0&&s.insert(o,n[0],n[1],n[2],n[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new kl.VectorTile(new jc(this.rawTileData)).layers,this.sourceLayerCoder=new $u(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();let i=t.params||{},a=Ko/t.tileSize/t.scale,o=Dn(i.filter),s=t.queryGeometry,l=t.queryPadding*a,u=th(s),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),f=th(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 c(e,r),new c(e,i),new c(n,i),new c(n,r)];if(t.length>2)for(let e of a)if(ps(t,e))return!0;for(let e=0;e<t.length-1;e++)if(ds(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)h.push(t);h.sort(eh);let d,m={};for(let l=0;l<h.length;l++){let c=h[l];if(c===d)continue;d=c;let u=this.featureIndexArray.get(c),f=null;this.loadMatchingFeature(m,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,o,i.layers,i.availableImages,e,r,n,((e,r,n)=>(f||(f=ts(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,c,u){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=es(p,!0);if(!i.filter(new na(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new na(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&&c&&(f=c.getState(i.sourceLayer||"_geojsonTileLayer",d));let m=T({},l[r]);m.paint=Qu(m.paint,i.paint,p,f,o),m.layout=Qu(m.layout,i.layout,p,f,o);let g=!u||u(p,i,f);if(!g)continue;let y=new Ku(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 c=Dn(i);for(let i of t)this.loadMatchingFeature(l,r,n,i,c,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 Qu(t,e,r,n,i){return k(t,((t,a)=>{let o=e instanceof ha?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function th(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 eh(t,e){return e-t}function rh(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 c(e,o.y+(e-o.x)/(u.x-o.x)*(u.y-o.y))._round():u.x<e&&(u=new c(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 c(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r)._round():u.y<r&&(u=new c(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 c(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y))._round():u.x>=n&&(u=new c(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 c(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i)._round():u.y>=i&&(u=new c(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",Ju,{omit:["rawTileData","sourceLayerCoder"]});class nh extends c{constructor(t,e,r,n){super(t,e),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new nh(this.x,this.y,this.angle,this.segment)}}function ih(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=[],c=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}),c+=a;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=e.dist(r)}return!0}function ah(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function oh(t,e,r){return t?.6*e*r:0}function sh(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function lh(t,e,r,n,i,a){let o=oh(r,i,a),s=sh(r,n)*a,l=0,c=ah(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>c){let u=(c-l)/a,h=Re.number(n.x,i.x,u),f=Re.number(n.y,i.y,u),p=new nh(h,f,i.angleTo(n),r);return p._round(),!o||ih(t,p,s,o,e)?p:void 0}l+=a}}function ch(t,e,r,n,i,a,o,s,l){let c=oh(n,a,o),u=sh(n,i),h=u*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),uh(t,f?e/2*s%e:(u/2+2*a)*o*s%e,e,c,r,h,f,!1,l)}function uh(t,e,r,n,i,a,o,s,l){let c=a/2,u=ah(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-c>=0&&f+c<=u){let r=new nh(y,v,m,e);r._round(),n&&!ih(t,r,a,n,i)||p.push(r)}}h+=d}return s||p.length||o||(p=uh(t,h/2,r,n,i,a,o,!0,l)),p}function hh(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},h=a.stretchX||[[0,s]],f=a.stretchY||[[0,l]],p=(t,e)=>t+e[1]-e[0],d=h.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,A=0,k=y;if(a.content&&n){let e=a.content,r=e[2]-e[0],n=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(u=lu(t)),v=fh(h,0,e[0]),_=fh(f,0,e[1]),x=fh(h,e[0],e[2]),b=fh(f,e[1],e[3]),w=e[0]-v,A=e[1]-_,T=r-x,k=n-b}let M=u.x1,S=u.y1,E=u.x2-M,C=u.y2-S,I=(t,n,i,s)=>{let l=dh(t.stretch-v,x,E,M),u=mh(t.fixed-w,T,t.stretch,d),h=dh(n.stretch-_,b,C,S),f=mh(n.fixed-A,k,n.stretch,m),p=dh(i.stretch-v,x,E,M),g=mh(i.fixed-w,T,i.stretch,d),y=dh(s.stretch-_,b,C,S),I=mh(s.fixed-A,k,s.stretch,m),L=new c(l,h),P=new c(p,h),z=new c(p,y),D=new c(l,y),O=new c(u/o,f/o),R=new c(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),D._matMult(r),z._matMult(r)}let B=t.stretch+t.fixed,j=n.stretch+n.fixed;return{tl:L,tr:P,bl:D,br:z,tex:{x:a.paddedRect.x+1+B,y:a.paddedRect.y+1+j,w:i.stretch+i.fixed-B,h:s.stretch+s.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:R,minFontScaleX:T/o/E,minFontScaleY:k/o/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){let t=ph(h,g,d),e=ph(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 fh(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 ph(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 dh(t,e,r,n){return t/e*r+n}function mh(t,e,r,n){return t-e*r/n}Si("Anchor",nh);class gh{constructor(t,e,r,n,i,a,o,s,l,u){var h;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!==(h=a.image)&&void 0!==h&&h.content&&(a.image.textFitWidth||a.image.textFitHeight)?lu(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 c(l.x1,l.y1),e=new c(l.x2,l.y1),r=new c(l.x1,l.y2),n=new c(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 yh{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 vh(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,h=new yh([],xh);if(0===l)return new c(n,i);for(let e=n;e<a;e+=l)for(let r=i;r<o;r+=l)h.push(new _h(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 _h(r/e,n/e,0,t)}(t),p=h.length;for(;h.length;){let n=h.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,h.push(new _h(n.p.x-u,n.p.y-u,u,t)),h.push(new _h(n.p.x+u,n.p.y-u,u,t)),h.push(new _h(n.p.x-u,n.p.y+u,u,t)),h.push(new _h(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 xh(t,e){return e.max-t.max}function _h(t,e,r,n){this.p=new c(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,hs(t,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var bh;t.aq=void 0,(bh=t.aq||(t.aq={}))[bh.center=1]="center",bh[bh.left=2]="left",bh[bh.right=3]="right",bh[bh.top=4]="top",bh[bh.bottom=5]="bottom",bh[bh["top-left"]=6]="top-left",bh[bh["top-right"]=7]="top-right",bh[bh["bottom-left"]=8]="bottom-left",bh[bh["bottom-right"]=9]="bottom-right";let wh=Number.POSITIVE_INFINITY;function Th(t,e){return e[1]!==wh?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 Ah(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*gc));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)*gc,wh]:i.get("text-offset").evaluate(e,{},r).map((t=>t*gc));let a=[];for(let t of o)a.push(t,Th(t,n));return new ae(a)}return null}function kh(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 Mh(e,r,n,i,a,o,s,l,c,u,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=Eh(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),A=d.get("text-max-angle")/180*Math.PI,k="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=cu(i,n.vertical,I,d.get("icon-text-fit-padding"),m,y)),g&&(i=cu(i,g,I,d.get("icon-text-fit-padding"),m,y)));let L=(l,f)=>{f.x<0||f.x>=Ko||f.y<0||f.y>=Ko||function(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A,k){let M,S,E,I,L=e.addToLineVertexArray(r,n),P=0,z=0,D=0,O=0,R=-1,F=-1,B={},j=Co("");if(e.allowVerticalPlacement&&i.vertical){let t=l.layout.get("text-rotate").evaluate(b,{},A)+90;E=new gh(c,r,u,h,f,i.vertical,p,d,m,t),s&&(I=new gh(c,r,u,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=hh(a,n,T,i),p=s?hh(s,n,T,i):void 0;S=new gh(c,r,u,h,f,a,y,v,!1,n),P=4*o.length;let d=e.iconSizeData,m=null;"source"===d.kind?(m=[uu*l.layout.get("icon-size").evaluate(b,{})],m[0]>hu&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(m=[uu*w.compositeIconSizes[0].evaluate(b,{},A),uu*w.compositeIconSizes[1].evaluate(b,{},A)],(m[0]>hu||m[1]>hu)&&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,A),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,A),F=e.icon.placedSymbolArray.length-1)}let N=Object.keys(i.horizontal);for(let n of N){let a=i.horizontal[n];if(!M){j=Co(a.text);let t=l.layout.get("text-rotate").evaluate(b,{},A);M=new gh(c,r,u,h,f,a,p,d,m,t)}let s=1===a.positionedLines.length;if(D+=Sh(e,r,a,o,l,m,b,g,L,i.vertical?t.ah.horizontal:t.ah.horizontalOnly,s?N:[n],B,R,w,A),s)break}i.vertical&&(O+=Sh(e,r,i.vertical,o,l,m,b,g,L,t.ah.vertical,["vertical"],B,F,w,A));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,W=S?S.boxEndIndex:e.collisionBoxArray.length,Z=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 K=X>-1?1:0;K&&(X*=k/gc),e.glyphOffsetArray.length>=Tu.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 J=Ah(l,b,A),[Q,tt]=function(e,r){let n=e.length,i=r?.values;if(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,J);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,j,U,V,q,H,G,W,Z,Y,u,D,O,P,z,K,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],k,c,_,T,M,m,r,o,u,h,s)};if("line"===S)for(let t of rh(r.geometry,0,0,Ko,Ko)){let r=ch(t,b,A,n.vertical||g,i,24,x,e.overscaling,Ko);for(let n of r)g&&Ch(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=lh(t,A,n.vertical||g,i,24,x);e&&L(t,e)}}else if("Polygon"===r.type)for(let t of Ar(r.geometry,0)){let e=vh(t,16);L(t[0],new nh(e.x,e.y,0))}else if("LineString"===r.type)for(let t of r.geometry)L(t,new nh(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 nh(e.x,e.y,0))}function Sh(t,e,r,n,i,a,o,s,l,u,h,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||{},h=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?-(gc-n.metrics.width*n.scale)/2:(n.scale-1)*gc)),n.imageName){let t=o[n.imageName];f=t.sdf,p=t.pixelRatio,h=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-h)*n.scale-g+v[0],w=(-n.metrics.top-h)*n.scale+v[1],T=b+a.w/_*n.scale/p,A=w+a.h/_*n.scale/p,k=new c(b,w),M=new c(T,w),S=new c(b,A),E=new c(T,A);if(m){let t=new c(-g,g-Wc),e=-Math.PI/2,r=12-g,i=new c(22-r,-(n.imageName?r:0)),a=new c(...x);k._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];k._matMult(r),M._matMult(r),S._matMult(r),E._matMult(r)}let C=new c(0,0),I=new c(0,0);u.push({tl:k,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=[uu*i.layout.get("text-size").evaluate(o,{})],v[0]>hu&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[uu*d.compositeTextSizes[0].evaluate(o,{},m),uu*d.compositeTextSizes[1].evaluate(o,{},m)],(v[0]>hu||v[1]>hu)&&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 h)f[e]=t.text.placedSymbolArray.length-1;return 4*g.length}function Eh(t){for(let e in t)return t[e];return null}function Ch(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 Ih=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Lh{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=Ih[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 Lh(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=Ih.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 Ph(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 c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){let s=a[2*o],c=a[2*o+1];s>=t&&s<=r&&c>=e&&c<=n&&l.push(i[o])}continue}let f=h+u>>1,p=a[2*f],d=a[2*f+1];p>=t&&p<=r&&d>=e&&d<=n&&l.push(i[f]),(0===c?t<=p:e<=d)&&(s.push(h),s.push(f-1),s.push(1-c)),(0===c?r>=p:n>=d)&&(s.push(f+1),s.push(u),s.push(1-c))}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 c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)Rh(i[2*r],i[2*r+1],t,e)<=l&&s.push(n[r]);continue}let f=h+u>>1,p=i[2*f],d=i[2*f+1];Rh(p,d,t,e)<=l&&s.push(n[f]),(0===c?t-r<=p:e-r<=d)&&(o.push(h),o.push(f-1),o.push(1-c)),(0===c?t+r>=p:e+r>=d)&&(o.push(f+1),o.push(u),o.push(1-c))}return s}}function Ph(t,e,r,n,i,a){if(i-n<=r)return;let o=n+i>>1;zh(t,e,o,n,i,a),Ph(t,e,r,n,o-1,1-a),Ph(t,e,r,o+1,i,1-a)}function zh(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),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);zh(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}let o=e[2*r+a],s=n,l=i;for(Dh(t,e,n,r),e[2*i+a]>o&&Dh(t,e,n,i);s<l;){for(Dh(t,e,s,l),s++,l--;e[2*s+a]<o;)s++;for(;e[2*l+a]>o;)l--}e[2*n+a]===o?Dh(t,e,n,l):(l++,Dh(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Dh(t,e,r,n){Oh(t,r,n),Oh(e,2*r,2*n),Oh(e,2*r+1,2*n+1)}function Oh(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function Rh(t,e,r,n){let i=t-r,a=e-n;return i*i+a*a}var Fh;t.bg=void 0,(Fh=t.bg||(t.bg={})).create="create",Fh.load="load",Fh.fullLoad="fullLoad";let Bh=null,jh=[],Nh=1e3/60,Uh="loadTime",Vh="fullLoadTime",qh={mark(t){performance.mark(t)},frame(t){let e=t;null!=Bh&&jh.push(e-Bh),Bh=e},clearMetrics(){Bh=null,jh=[],performance.clearMeasures(Uh),performance.clearMeasures(Vh);for(let e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(Uh,t.bg.create,t.bg.load),performance.measure(Vh,t.bg.create,t.bg.fullLoad);let e=performance.getEntriesByName(Uh)[0].duration,r=performance.getEntriesByName(Vh)[0].duration,n=jh.length,i=1/(jh.reduce(((t,e)=>t+e),0)/n/1e3),a=jh.filter((t=>t>Nh)).reduce(((t,e)=>t+(e-Nh)/Nh),0);return{loadTime:e,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};t.$=class extends Sa{},t.A=_s,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=fa,t.E=K,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 Du((()=>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 _s(16);return _s!=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=Hc,t.J=function(t,e,r){var n,i,a,o,s,l,c,u,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],c=e[6],u=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]=c,t[7]=u,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+c*g+p*y+e[14],t[15]=o*m+u*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=ws,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=Ru,t.O=ju,t.P=c,t.Q=Nu,t.R=Os,t.S=Zu,t.T=oa,t.U=y,t.V=v,t.W=O,t.X=Ko,t.Y=Ta,t.Z=qu,t._=e,t.a=N,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],c=t[7],u=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],A=e[6],k=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)<=xs*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-x)<=xs*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-_)<=xs*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(a-b)<=xs*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(o-w)<=xs*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=xs*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-A)<=xs*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(c-k)<=xs*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-M)<=xs*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(h-S)<=xs*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-E)<=xs*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(p-C)<=xs*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(d-I)<=xs*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(m-L)<=xs*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(g-P)<=xs*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-z)<=xs*Math.max(1,Math.abs(y),Math.abs(z))},t.a0=To,t.a1=Gu,t.a2=ut,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");W(r)||(e.crossOrigin="Anonymous"),t.src=r,e.appendChild(t)}}))},t.a4=function(){return A++},t.a5=Xa,t.a6=Tu,t.a7=Dn,t.a8=es,t.a9=Ku,t.aA=function(t){if("custom"===t.type)return new zu(t);switch(t.type){case"background":return new Cu(t);case"circle":return new Ms(t);case"fill":return new bl(t);case"fill-extrusion":return new Gl(t);case"heatmap":return new js(t);case"hillshade":return new Us(t);case"line":return new sc(t);case"raster":return new Pu(t);case"symbol":return new Mu(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),c=e.map(lt),u=t.reduce(ct,{}),h=e.reduce(ct,{}),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<c.length;t++)n=c[c.length-1-t],f[f.length-1-t]!==n&&(Object.prototype.hasOwnProperty.call(u,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<c.length;t++)if(n=c[t],i=u[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=k,t.aG=M,t.aH=class extends Do{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=Oo,t.aJ=class extends Do{constructor(t,e){super(t,e),this.current=Bo}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=Ro,t.aL=Fo,t.aM=Qt,t.aN=class extends Do{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 Do{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),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.aQ=As,t.aR=class extends Fa{},t.aS=pc,t.aT=class extends ja{},t.aU=Bs,t.aV=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.aW=Rs,t.aX=oo,t.aY=xo,t.aZ=class extends Wa{},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],c=e[4],u=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+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},t.ae=function(t){var e=new _s(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=ks,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/uu:"composite"===t.kind?Re.number(n/uu,i/uu,r):e},t.aj=xu,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 c(t.x+u*a,t.y+u*i)},t.al=rh,t.am=is,t.an=bs,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=gc,t.ar=pu,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],c=e[7],u=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*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,A=u*m-h*d,k=u*g-f*d,M=u*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*k+T*A;return I?(t[0]=(s*C-l*E+c*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-c*k)*I,t[5]=(r*C-i*M+a*k)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(u*T-f*_+p*x)*I,t[8]=(o*E-s*M+c*A)*I,t[9]=(n*M-r*E-a*A)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-u*w-p*v)*I,t[12]=(s*k-o*S-l*A)*I,t[13]=(r*S-n*k+i*A)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(u*b-h*x+f*v)*I,t):null},t.at=kh,t.au=au,t.av=Lh,t.aw=function(){let t={},e=J.$version;for(let r in J.$root){let n=J.$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=Wu,t.b5=Uu,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],c=e[8],u=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+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},t.b8=x,t.b9=_,t.bA=yc,t.bB=function(t){return t.message===B},t.bC=Mn,t.bD=ra,t.ba=function(t){return t*Math.PI/180},t.bb=function(t,e){let{x:r,y:n}=qu.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 Ma{},t.be=Ou,t.bf=qh,t.bh=q,t.bi=function(t,e){N.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete N.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=$u,t.bn=Ju,t.bo=Gc,t.bp=function(e){e.bucket.createArrays(),e.bucket.tilePixelRatio=Ko/(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 na(e.bucket.zoom+1),e.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new na(e.bucket.zoom+1),e.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new na(18))};if("composite"===e.bucket.textSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.textSizeData;a.compositeTextSizes=[i["text-size"].possiblyEvaluate(new na(t),e.canonical),i["text-size"].possiblyEvaluate(new na(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;a.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new na(t),e.canonical),i["icon-size"].possiblyEvaluate(new na(r),e.canonical)]}let o=n.get("text-line-height")*gc,s="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),l=n.get("text-keep-upright"),c=n.get("text-size");for(let i of e.bucket.features){let u,h=n.get("text-font").evaluate(i,{},e.canonical).join(","),f=c.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(),c=n.get("text-letter-spacing").evaluate(i,{},e.canonical)*gc,u=Gi(a)?c:0,d=n.get("text-anchor").evaluate(i,{},e.canonical),v=Ah(r,i,e.canonical);if(!v){let t=n.get("text-radial-offset").evaluate(i,{},e.canonical);y=t?Th(d,[t*gc,wh]):n.get("text-offset").evaluate(i,{},e.canonical).map((t=>t*gc))}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)*gc:1/0,b=()=>{e.bucket.allowVerticalPlacement&&Hi(a)&&(m.vertical=Xc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,d,"left",u,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(kh(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=Xc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,"center",i,u,y,t.ah.horizontal,!1,p,f);r&&(m.horizontal[i]=r,n=1===r.positionedLines.length)}b()}else{"auto"===x&&(x=kh(d));let r=Xc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,d,x,u,y,t.ah.horizontal,!1,p,f);r&&(m.horizontal[x]=r),b(),Hi(a)&&s&&l&&(m.vertical=Xc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,d,x,u,y,t.ah.vertical,!1,p,f))}}let v=!1;if(i.icon&&i.icon.name){let t=e.imageMap[i.icon.name];t&&(u=su(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=Eh(m.horizontal)||m.vertical;e.bucket.iconsInText=!!x&&x.iconsInText,(x||u)&&Mh(e.bucket,i,m,u,e.imageMap,a,p,d,y,v,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.bq=nc,t.br=xl,t.bs=Ul,t.bt=kl,t.bu=jc,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 O(t,r,n,i,a)}catch{}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=Xu,t.by=n,t.bz=a,t.c=j,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=D}))},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):D})),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 jc(t).readFields(Nc,[])},t.o=Ds,t.p=qc,t.q=ya,t.r=_i,t.s=W,t.t=Ai,t.u=xi,t.v=J,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=na})),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 c={},u={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),(c[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,u,this.tileID.canonical),l.bucketLayerIDs.push(e.map((t=>t.id))))}}let f=t.aF(u.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>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(u.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(u.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 c){let r=c[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(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).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 c={};if(i){let t=i.finish();t&&(c.resourceTiming=JSON.parse(JSON.stringify(t)))}a.vectorTile=n.vectorTile;let u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{let e=yield u;return t.e({rawTileData:s.slice(0)},e,l,c)}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,c=i.width+2,u=i.height+2,h=t.b(i)?new t.R({width:c,height:u},yield t.bw(i,-1,-1,c,u)):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 c=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 u=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,k,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],c=a[s];if(null!==l){void 0===c&&(n.push(s),a[s]=c=n.length-1),e.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+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 A(t){return t<<1^t>>31}function k(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],c=1;1===n&&(c=l.length),e.writeVarint(T(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&e.writeVarint(T(2,u-1));var f=l[h].x-i,p=l[h].y-a;e.writeVarint(A(f)),e.writeVarint(A(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(D(n)),s=C(O(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(D(r),O(a),D(i),O(n)),l=o.data,c=[];for(let t of s){let e=this.stride*t;c.push(l[e+5]>1?P(l,e,this.clusterProps):this.points[l[e+3]])}return c}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,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,c),n.data,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u: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,c=o*this.stride,u=e[c+5]>1;if(u)t=z(e,c,this.clusterProps),s=e[c],l=e[c+1];else{let r=this.points[e[c+3]];t=r.properties;let[n,i]=r.geometry.coordinates;s=D(n),l=O(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=u||this.options.generateId?e[c+3]:this.points[e[c+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=[],c=this.stride;for(let r=0;r<s.length;r+=c){if(s[r+2]<=e)continue;s[r+2]=e;let n=s[r],u=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*c;s[r+2]>e&&(p+=s[r+5])}if(p>f&&p>=a){let t,a=n*f,o=u*f,d=-1,m=(r/c<<5)+(e+1)+this.points.length;for(let n of h){let l=n*c;if(s[l+2]<=e)continue;s[l+2]=e;let u=s[l+5];a+=s[l]*u,o+=s[l+1]*u,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<c;t++)l.push(s[r+t]);if(p>1)for(let t of h){let r=t*c;if(!(s[r+2]<=e)){s[r+2]=e;for(let t=0;t<c;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 D(t){return t/360+.5}function O(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],c=t[e+1],u=t[r],h=t[r+1];for(let n=e+3;n<r;n+=3){let e=B(t[n],t[n+1],l,c,u,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 j(t,e,r,n){let i={id:t??null,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)N(i,r);else if("Polygon"===e)N(i,r[0]);else if("MultiLineString"===e)for(let t of r)N(i,t);else if("MultiPolygon"===e)for(let t of r)N(i,t[0]);return i}function N(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(j(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(j(l,a,s,e.properties))}function V(t,e){e.push(G(t[0]),W(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=W(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 W(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 Z(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,c=0===i?e.maxX:e.maxY;if(o>=r&&c<n){l.push(e);continue}if(c<r||o>=n)continue;let u=[];if("Point"===a||"MultiPoint"===a)Y(t,u,r,n,i);else if("LineString"===a)X(t,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===a)K(t,u,r,n,i,!1);else if("Polygon"===a)K(t,u,r,n,i,!0);else if("MultiPolygon"===a)for(let e of t){let t=[];K(e,t,r,n,i,!0),t.length&&u.push(t)}if(u.length){if(s.lineMetrics&&"LineString"===a){for(let t of u)l.push(j(e.id,a,t,e.tags));continue}"LineString"!==a&&"MultiLineString"!==a||(1===u.length?(a="LineString",u=u[0]):a="MultiLineString"),"Point"!==a&&"MultiPoint"!==a||(a=3===u.length?"Point":"MultiPoint"),l.push(j(e.id,a,u,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&&J(e,t[a],t[a+1],t[a+2])}}function X(t,e,r,n,i,a,o){let s,l,c=$(t),u=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=u(c,p,d,g,y,r),o&&(c.start=h+s*l)):v>n?x<n&&(l=u(c,p,d,g,y,n),o&&(c.start=h+s*l)):J(c,p,d,m),x<r&&v>=r&&(l=u(c,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,p,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),e.push(c),c=$(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&&J(c,p,d,t[f+2]),f=c.length-3,a&&f>=3&&(c[f]!==c[0]||c[f+1]!==c[1])&&J(c,c[0],c[1],c[2]),c.length&&e.push(c)}function $(t){let e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function K(t,e,r,n,i,a){for(let o of t)X(o,e,r,n,i,a,!1)}function J(t,e,r,n){t.push(e,r,n)}function Q(t,e,r,n,i,a){let o=(a-e)/(n-e);return J(t,a,r+(i-r)*o,1),o}function tt(t,e,r,n,i,a){let o=(a-r)/(i-r);return J(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(j(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 ct{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=Z(t,1,-1-r,r,0,-1,2,e),a=Z(t,1,1-r,2+r,0,-1,2,e);return(i||a)&&(n=Z(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,c=l.debug;for(;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();let u=1<<e,h=ut(e,r,n),f=this.tiles[h];if(!f&&(c>1&&console.time("creation"),f=this.tiles[h]=at(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>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;c>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=Z(t,u,r-p,r+m,0,f.minX,f.maxX,l),w=Z(t,u,r+d,r+g,0,f.minX,f.maxX,l);t=null,b&&(y=Z(b,u,n-p,n+m,1,f.minY,f.maxY,l),v=Z(b,u,n+d,n+g,1,f.minY,f.maxY,l),b=null),w&&(x=Z(w,u,n-p,n+m,1,f.minY,f.maxY,l),_=Z(w,u,n+d,n+g,1,f.minY,f.maxY,l),w=null),c>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=ut(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,c=t,u=e,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ut(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?nt(this.tiles[s],i):null):null}}function ut(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 u.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 ct(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(c(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{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:typeof performance<"u"&&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:typeof navigator<"u"&&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=typeof window<"u"&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o.transformProp=o.testProp(["transform","WebkitTransform"]);let s,l,c={supported:!1,testSupport:function(t){!u&&l&&(h?f(t):s=t)}},u=!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;c.supported=!0}catch{}t.deleteTexture(e),u=!0}var p;typeof document<"u"&&(l=document.createElement("img"),l.onload=()=>{s&&f(s),s=null,h=!0},l.onerror=()=>{u=!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)=>{c.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:c}=t,u=!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=u?l(r,c):e.m(r,c);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 A 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 k,M=1e20;function S(t,e,r,n,i,a,o,s,l){for(let c=e;c<e+n;c++)E(t,r*a+c,a,i,o,s,l);for(let c=r;c<r+i;c++)E(t,c*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,c=0;s<n;s++){i[s]=t[e+s*r];let n=s*s;do{let t=a[l];c=(i[s]-i[t]+n-t*t)/(s-t)/2}while(c<=o[l]&&--l>-1);l++,a[l]=s,o[l]=c,o[l+1]=M}for(let s=0,l=0;s<n;s++){for(;o[l+1]<s;)l++;let n=a[l],c=s-n;t[e+s*r]=i[n]+c*c}}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 c={};for(let t of e.n(l.data))c[t.id]=t;return c}))},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),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${t}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.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)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),f=new Uint8ClampedArray(h),p={data:f,width:c,height:u,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)*c+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,c,u,c,this.f,this.v,this.z),S(g,m,m,s,l,c,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(),k=k||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(k),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!==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 D{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,c=Math.abs(s-o.left),u=Math.abs(s-o.right),h=Math.min(c,u),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 O="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[O]}numActive(){return Object.keys(this.active).length}}let F,B,j=Math.floor(a.hardwareConcurrency/2);function N(){return F||(F=new R),F}R.workerCount=e.C(globalThis)?Math.max(Math.min(j,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(N(),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 c=[];for(let n of l)c.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 u=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}(c);for(let e in u)u[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 u}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 W(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 Z{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 Z))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Z.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 Z?t:t&&new Z(t)}static fromLngLat(t,r=0){let n=360*r/40075017,i=n/Math.cos(Math.PI/180*t.lat);return new Z(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 Z(t,t.lng>r.lng?new e.N(r.lng+360,r.lat):r)}}class Y{constructor(t,e,r){this.bounds=Z.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 W(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 W(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 K 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(typeof VideoFrame<"u"&&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{}}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 J 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 J;case"image":return tt;case"raster":return $;case"raster-dem":return K;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 ct{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,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,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:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};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,c,u,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 ut{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 ut(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={},c=Object.keys(t),u=a.now();for(let r of c){let n=t[r],i=this._tiles[r];if(!i||0!==i.fadeEndTime&&i.fadeEndTime<=u)continue;let a=this.findLoadedParent(n,e),o=this.findLoadedSibling(n),c=a||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.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 c=e.ab(this._tiles,l);for(let t of c){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 ct(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))),c=this.getIds(),u=1/0,h=1/0,f=-1/0,p=-1/0;for(let t of l)u=Math.min(u,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<c.length;t++){let n=this._tiles[c[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(u,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 c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(t,e,r,n,i,a,o,s){let{seenUids:l,hitTest:c,overlapMode:u}=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))&&(!c||!gt(u,f.overlapMode))&&(a.push({key:f,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))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))&&(!c||!gt(u,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}),c)return!0}}}return!1}_queryCellCircle(t,e,r,n,i,a,o,s){let{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){let t=this.bboxes;for(let e of h)if(!c.box[e]){c.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(u,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(!c.circle[e]){c.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(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(t,e,r,n,i,a,o,s){let l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;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 c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;let h=l-s,f=u-c;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],Ot(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,c,u,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 A=b.get(i);if(A.hidden||A.writingMode===e.ah.vertical&&!T){Dt(A.numGlyphs,x);continue}T=!1;let k=_t(A.anchorX,A.anchorY,r,m);if(!wt(k.point,v)){Dt(A.numGlyphs,x);continue}let M=bt(n.transform.cameraToCenterDistance,k.signedDistanceFromCamera),S=e.ai(g,y,A),E=s?S/M:S*M,C={getElevation:m,labelPlaneMatrix:a,lineVertexArray:_,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new e.P(A.anchorX,A.anchorY),unwrappedTileID:h,width:f,height:p,translation:d},I=Mt(C,A,E,!1,l,r,o,t.glyphOffsetArray,x,w,c);T=I.useVertical,(I.notEnoughRoom||T||I.needsFlipping&&Mt(C,A,E,!0,l,r,o,t.glyphOffsetArray,x,w,c).notEnoughRoom)&&Dt(A.numGlyphs,x)}i?t.text.dynamicLayoutVertexBuffer.updateData(x):t.icon.dynamicLayoutVertexBuffer.updateData(x)}function At(t,e,r,n,i,a,o,s){let l=a.glyphStartIndex+a.numGlyphs,c=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,h=e.getoffsetX(a.glyphStartIndex),f=e.getoffsetX(l-1),p=Pt(t*h,r,n,i,a.segment,c,u,s,o);if(!p)return null;let d=Pt(t*f,r,n,i,a.segment,c,u,s,o);return d?s.projectionCache.anyProjectionOccluded?null:{first:p,last:d}:null}function kt(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,c,u,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,c=At(p,l,d,m,i,r,h,t);if(!c)return{notEnoughRoom:!0};let g=_t(c.first.point.x,c.first.point.y,s,t.getElevation).point,y=_t(c.last.point.x,c.last.point.y,s,t.getElevation).point;if(a&&!i){let t=kt(r.writingMode,g,y,u);if(t)return t}f=[c.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(c.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),c=kt(r.writingMode,n,l,u);if(c)return c}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(c,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 St(0===n.distanceFromAnchor?r.tileAnchorPoint:new e.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),a,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,void 0,r)}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,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];let u=n.add(r);if(t+c.direction<i||t+c.direction>=a)return l.projectionCache.offsets[t]=u,u;let h=Et(t+c.direction,l,c),f=It(h.sub(n),s,c.direction),p=n.add(f),d=h.add(f);return l.projectionCache.offsets[t]=e.ak(o,u,p,d)||u,l.projectionCache.offsets[t]}function Pt(t,e,r,n,i,a,o,s,l){let c=n?t-e:t+e,u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let f,p=u>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(c),w=[];for(;x+_<=b;){if(p+=u,p<a||p>=o)return null;x+=_,v=y,m=d;let t={absOffsetX:b,direction:u,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+u,s,t).sub(y),r,u):It(n,r,u),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),A=h+Math.atan2(y.y-v.y,y.x-v.x);return w.push(T),{point:T,angle:l?A: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 Dt(t,e){for(let r=0;r<t;r++){let t=e.length;e.resize(t+4),e.float32.set(zt,3*t)}}function Ot(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,c,u){let h,f=t.anchorPointX+s[0],p=t.anchorPointY+s[1],d=this.projectAndGetPerspectiveRatio(n,f,p,i,c),m=r*d.perspectiveRatio;if(a||o)h=this._projectCollisionBox(t,m,n,i,a,o,s,d,c,u);else{let e=d.point.x+(u?u.x*m:0),r=d.point.y+(u?u.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,c,u,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=At(_,i,r.lineOffsetX*_,r.lineOffsetY*_,!1,r,!1,b),T=!1,A=!1,k=!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(c){let t=this.projectPathToScreenSpace(l,b,c);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 c=s-r,h=l-r,p=s+r,d=l+r;if(k=k&&this.isOffscreen(c,h,p,d),A=A||this.isInsideGrid(c,h,p,d),"always"!==t&&this.grid.hitTestCircle(s,l,r,t,f)&&(T=!0,!u))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!u&&T||!A||x<this.perspectiveRatioCutoff?[]:y,offscreen:k,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={},c={};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===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}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],Ot(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,c,u){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,c).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),u||(m*=e.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}u&&(d=d.add(h.mult(u.x*m)).add(f.mult(u.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 A=!1;if(a){let t=T.map((t=>this.projectAndGetPerspectiveRatio(n,t.x,t.y,i,c)));A=t.some((t=>!t.isOccluded)),T=t.map((t=>t.point))}else A=!0;return{box:e.ao(T),allPointsOccluded:!A}}}function Bt(t,r,n){return r*(e.X/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}class jt{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 Nt{constructor(t,e,r,n,i){this.text=new jt(t?t.text:null,e,r,i),this.icon=new jt(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 Wt{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,c=a.layers[0].paint,u=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,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.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:u,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,c,u,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,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,f,l,c,u,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:c,textLabelPlaneMatrix:u,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"),A="map"===a.get("text-pitch-alignment"),k="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,D=null,O={box:null,placeable:!1,offscreen:null},R={box:null,placeable:!1,offscreen:null},F=null,B=null,j=null,N=0,U=0,V=0;d.textFeatureIndex?N=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=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?(O=n(),R=O):O=r(),O&&O.placeable)break}else O=r()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){let n=(e,r)=>{let n=this.collisionIndex.placeCollisionBox(e,x,f,l,c,A,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(O&&O.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,_=k&&"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=u;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,A,f,l,c,g,S,t,i,d,o,s,_,C);if(a&&(w=a.placedGlyphBoxes,w&&w.placeable))return L=!0,D=a.shift,w}p?p=null:S=x}return n&&!w&&(w={box:this.collisionIndex.placeCollisionBox(q,"always",f,l,c,A,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&&(!O||!O.placeable)&&t.numVerticalGlyphVertices>0&&r?m(r,d.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}})),O&&(L=O.placeable,z=O.offscreen);let y=r(O&&O.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=O,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,c,u,h,n,A,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,c,A,T,s,g.predicate,C,k&&D?D:void 0);R&&R.placeable&&d.verticalIconBox?(j=t(d.verticalIconBox),P=j.placeable):(j=t(d.iconBox),P=j.placeable),z=z&&j.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 W=P&&j.placeable;if(L&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,R&&R.placeable&&U?U:N,g.ID),W&&this.collisionIndex.insertCollisionBox(j.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,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,d,F,j,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 Nt(a,n,e.text,e.icon),r=r||e.text!==a.text.placed||e.icon!==a.icon.placed):(this.opacities[t]=new Nt(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 Nt(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 Nt(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=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 Nt(null,0,l&&(c||!t.hasIconData()||o.get("icon-optional")),c&&(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,c=this.opacities[l];n[l]?c=s:c||(c=d,this.opacities[l]=c),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(c.text);m(t.text,a,x?re:e),m(t.text,o,_?re:e);let r=c.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(c.icon),r=!(p&&i.verticalPlacedIconSymbolIndex&&x);i.placedIconSymbolIndex>=0&&(m(t.icon,i.numIconVertices,r?e:re),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=c.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,i.numVerticalIconVertices,r?re:e),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=c.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(u){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=_),Zt(t.textCollisionBox.collisionVertexArray,c.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),Zt(t.iconCollisionBox.collisionVertexArray,c.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 Zt(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,c=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,c),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,c)}let Yt=Math.pow(2,25),Xt=Math.pow(2,24),$t=Math.pow(2,17),Kt=Math.pow(2,16),Jt=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*Kt+r*Jt+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 Wt(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,c=oe/Math.pow(2,l-a),u=(s*e.X+t.anchorY)*c,h=i*e.X*oe;return{x:Math.floor((o*e.X+t.anchorX)*c-n*e.X*oe),y:Math.floor(u-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 ce{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 ue{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 ce);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(N(),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 A,this.imageManager.setEventedParent(this),this.glyphManager=new C(t._requestManager,r.localIdeographFontFamily),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new ue,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={},c={};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");c[t]=p.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),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:c,pixelRatio:u,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m}=o[t];e[n][t]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return e}))}(l,c)}))}(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),c=[];for(let t of Object.keys(l).map(Number))c.push(o[t]);c.sort(G);for(let r of c){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 c=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!c&&t<n.length;t++)this.boundPaintVertexBuffers[t]!==n[t]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||c||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,c=this.context,u=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.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(u,t);for(let e of r)e.enableAttributes(u,t);a&&a.enableAttributes(u,t),o&&o.enableAttributes(u,t),s&&s.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,i);for(let e of r)e.bind(),e.setVertexAttribPointers(u,t,i);a&&(a.bind(),a.setVertexAttribPointers(u,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,t,i)),s&&(s.bind(),s.setVertexAttribPointers(u,t,i)),c.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),c=n?n.getBinderAttributes():[],u=l.concat(c),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=u.length;for(let t=0;t<this.numAttributes;t++)u[t]&&(s.bindAttribLocation(this.program,t,u[t]),this.attributes[u[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,c,u,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,c,d?d.getPaintVertexBuffers():[],u,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=(c=new e.A(9),e.A!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[5]=0,c[6]=0,c[7]=0),c[0]=1,c[4]=1,c[8]=1,c);var c;"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 u=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.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}),Ae=t=>({u_matrix:t}),ke=(t,r,n,i)=>e.e(Ae(t),be(n,r,i)),Me=(t,e)=>({u_matrix:t,u_world:e}),Se=(t,r,n,i,a)=>e.e(ke(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 De(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 Oe=(t,e,r,n)=>{let i=t.transform;return{u_matrix:Ne(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(Oe(t,r,n,a),{u_image:0,u_image_height:i}),Fe=(t,e,r,n,i)=>{let a=t.transform,o=je(e,a);return{u_matrix:Ne(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=je(r,t.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),f=u.width*a.fromScale,p=h.width*a.toScale;return e.e(Oe(t,r,n,o),{u_patternscale_a:[l/f,-u.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:u.y,u_tex_y_b:h.y,u_mix:a.t})};function je(t,e){return 1/Bt(t,1,e.tileZoom)}function Ne(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,c,u,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:c,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:u,u_pitched_scale:p}},He=(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m)=>{let g=s.transform;return e.e(qe(t,r,n,i,a,o,s,l,c,u,h,f,p,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+d})},Ge=(t,r,n,i,a,o,s,l,c,u,h,f,p,d)=>e.e(He(t,r,n,i,a,o,s,l,c,u,h,!0,f,!0,d),{u_texsize_icon:p,u_texture_icon:1}),We=(t,e,r)=>({u_matrix:t,u_opacity:e,u_color:r}),Ze=(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),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=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:[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:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,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 Ke{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 Je=new WeakMap;function Qe(t){var e;if(Je.has(t))return Je.get(t);{let r=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return Je.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 cr 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 ur 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 Ar 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 kr 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 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_ATTACHMENT,e.RENDERBUFFER,t),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_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 Or(t,o):new Dr(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 cr(this),this.depthRange=new ur(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 Ar(this),this.bindTexture=new kr(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:n?.RGBA16F_EXT,this.RGB16F=null!==(r=t.RGB16F)&&void 0!==r?r: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=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 Ke(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 jr{constructor(t,e,r){this.func=t,this.mask=e,this.range=r}}jr.ReadOnly=!1,jr.ReadWrite=!0,jr.disabled=new jr(519,jr.ReadOnly,[0,1]);let Nr,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"),c=[],u=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),c.push({circleArray:y,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),u+=y.length/4,h=u}g&&l.draw(o,s.LINES,jr.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||!c.length)return;let p=t.useProgram("collisionCircle"),d=new e.aR;d.resize(4*u),d._trim();let m=0;for(let t of c)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)}(!Nr||Nr.length<2*u)&&(Nr=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}(u));let g=o.createIndexBuffer(Nr,!0),y=o.createVertexBuffer(d,e.aS.members,!0);for(let r of c){let i=Ce(r.transform,r.invTransform,t.transform);p.draw(o,s.TRIANGLES,jr.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 Wr(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 Zr(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,c,u,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,lineVertexArray:null,pitchWithMap:n,projection:h,projectionCache:null,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,c,x)*b/e.ap;n&&(w*=t.tilePixelRatio/l);let{width:T,height:A,anchor:k,textOffset:M,textBoxScale:S}=_,E=Wr(k,T,A,M,S,w),C=h.getPitchedTextCorrection(a,i.add(new e.P(f[0],f[1])),p),I=Zr(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);u&&x.associatedIconIndex>=0&&(v[x.associatedIconIndex]={shiftedAnchor:I,angle:L})}else Dt(x.numGlyphs,g)}if(u){y.clear();let r=t.icon.placedSymbolArray;for(let t=0;t<r.length;t++){let n=r.get(t);if(n.hidden)Dt(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 Dt(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,c,u,h,f){let p=t.context,d=p.gl,m=t.transform,g=ne(),y="map"===l,v="map"===c,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,A=t.depthModeForSublayer(0,jr.ReadOnly),k=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),c=i.getBucket(n);if(!c)continue;let h=a?c.text:c.icon;if(!h||!h.segments.get().length||!h.hasVisibleVertices)continue;let f,p,A,E,C=h.programConfigurations.get(n.id),I=a||c.sdfIcons,L=a?c.textSizeData:c.iconSizeData,P=v||0!==m.pitch,z=t.useProgram(Xr(I,a,c),C),D=e.ag(L,m.zoom),O=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l),R=[0,0],F=null;if(a)p=i.glyphAtlasTexture,A=d.LINEAR,f=i.glyphAtlasTexture.size,c.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)||c.iconsNeedLinear;p=i.imageAtlasTexture,A=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),j=b?l.posMatrix:Gr,N=vt(j,v,y,t.transform,B),U=xt(j,v,y,t.transform,B),V=xt(l.posMatrix,v,y,t.transform,B),q=g.translatePosition(t.transform,i,o,s),H=k&&c.hasTextData(),G="none"!==n.layout.get("icon-text-fit")&&H&&c.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(c,l.posMatrix,t,a,N,V,v,u,r,g,l.toUnwrapped(),m.width,m.height,q,e)}let W,Z=l.posMatrix,Y=a&&k||G,X=x||Y?Gr:N,$=U,K=I&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);W=I?c.iconsInText?Ge(L.kind,D,_,v,x,Y,t,Z,X,$,q,f,R,S):He(L.kind,D,_,v,x,Y,t,Z,X,$,q,a,f,!0,S):qe(L.kind,D,_,v,x,Y,t,Z,X,$,q,a,f,S);let J={program:z,buffers:h,uniformValues:W,atlasTexture:p,atlasTextureIcon:F,atlasInterpolation:A,atlasInterpolationIcon:E,isSDF:I,hasHalo:K};if(w&&c.canOverlap){T=!0;let t=h.segments.get();for(let r of t)M.push({segments:new e.a0([r]),sortKey:r.sortKey,state:J,terrainData:O})}else M.push({segments:h.segments,sortKey:0,state:J,terrainData:O})}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,Kr(r.buffers,e.segments,n,t,r.program,A,h,f,i,e.terrainData)),i.u_is_halo=0}Kr(r.buffers,e.segments,n,t,r.program,A,h,f,r.uniformValues,e.terrainData)}}function Kr(t,e,r,n,i,a,o,s,l,c){let u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,qr.disabled,l,c,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Jr(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]),c=r.getBucket(n);if(!c)return;let u=i.key,h=n.heatmapFbos.get(u);h||(h=tn(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:e.aM.transparent});let f=c.programConfigurations.get(n.id),p=t.useProgram("heatmap",f),d=t.style.map.terrain.getTerrainData(i);p.draw(a,o.TRIANGLES,jr.disabled,s,l,qr.disabled,Pe(i.posMatrix,r,t.transform.zoom,n.paint.get("heatmap-intensity")),d,n.id,c.layoutVertexBuffer,c.indexBuffer,c.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,jr.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 c=t.createFramebuffer(e,r,!1,!1);return c.colorAttachment.set(o),c}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,c,u,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){u=v.indexBuffer2,h=v.segments2;let e=[f.drawingBufferWidth,f.drawingBufferHeight];c="fillOutlinePattern"===l&&m?Se(T,t,g,n,e):Me(T,e)}else u=v.indexBuffer,h=v.segments,c=m?ke(T,t,g,n):Ae(T);_.draw(t.context,s,i,t.stencilModeForClipping(d),a,qr.disabled,c,b,r.id,v.layoutVertexBuffer,u,h,r.paint,t.transform.zoom,x)}}function an(t,e,r,n,i,a,o){let s=t.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),f=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),d=u.constantOr(null);for(let u of n){let n=e.getTile(u),m=n.getBucket(r);if(!m)continue;let g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(u),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,c,d,n,r);let x=t.translatePosMatrix(u.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,u,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,c=r.fbo;if(!c)return;let u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.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:De(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,c=r.dem;if(c&&c.data){let u=c.dim,h=c.stride,f=c.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:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.fbo=s.createFramebuffer(u,u,!0,!1),p.colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,u,u]),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,c),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,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.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-c,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 cn=new e.aM(1,0,0,1),un=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=jr.disabled,c=Vr.disabled,u=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,c,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,c,u,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 jr(i.LEQUAL,jr.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 c of r){let r=t.renderToTexture.getTexture(c),u=e.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);let h=t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),f=e.getMeshFrameDelta(t.transform.zoom),p=t.transform.calculateFogMatrix(c.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,u,"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 ue}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,jr.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(jr.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,jr.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 jr.disabled;let n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new jr(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=(u=r,h=t.style.map.transform,f=t.pixelRatio,{u_sky_color:u.properties.get("sky-color"),u_horizon_color:u.properties.get("horizon-color"),u_horizon:(h.height/2+h.getHorizon())*f,u_sky_horizon_blend:u.properties.get("sky-horizon-blend")*h.height/2*f}),o=new jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=Vr.disabled,l=t.colorModeForRenderPass(),c=t.useProgram("sky");var u,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))}c.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,cn),dn(t,e.bottom||0,3,un),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;gn(n=t,(i=r.x)-1,(a=t.transform.height-r.y)-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 jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=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),u={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};c.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,u,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 jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=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 c){let c=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)};u.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,h,c,"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,c){let u=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,u.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,u.zoom-t.tileID.overscaledZ),n=r.style.map.terrain?(t,e)=>r.style.map.terrain.getElevation(a,t,e):null,i=h.translatePosition(u,t,s,l);Yr(o,f,p,c,u,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 c=t.context,u=c.gl,h=t.depthModeForSublayer(0,jr.ReadOnly),f=Vr.disabled,p=t.colorModeForRenderPass(),d=[];for(let a=0;a<i.length;a++){let o=i[a],s=r.getTile(o),c=s.getBucket(n);if(!c)continue;let u=c.programConfigurations.get(n.id),h=t.useProgram("circle",u),f=c.layoutVertexBuffer,p=c.indexBuffer,m=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),g={programConfiguration:u,program:h,layoutVertexBuffer:f,indexBuffer:p,uniformValues:Ee(t,o,s,n),terrainData:m};if(l){let t=c.segments.get();for(let r of t)d.push({segments:new e.a0([r]),sortKey:r.sortKey,state:g})}else d.push({segments:c.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(c,u.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?Jr(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 c=i[e];if(r.hasRenderableParent(c))continue;let u=r.getTile(c),h=u.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,jr.disabled,s,l,qr.disabled,Pe(c.posMatrix,u,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,jr.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,jr.ReadOnly),l=t.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),f=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),d=h?"linePattern":c?"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),A=u.constantOr(null);if(A&&i.imageAtlas){let t=i.imageAtlas,e=t.patternPositions[A.to.toString()],r=t.patternPositions[A.from.toString()];e&&r&&v.setConstantPatternPositions(e,r)}let k=T?a:null,M=h?Fe(t,i,n,p,k):c?Be(t,i,n,c,p,k):f?Re(t,i,n,o.lineClipsArray.length,k):Oe(t,i,n,k);if(h)m.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),v.updatePaintBuffers(p);else if(c&&(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"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.aM.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){let e=t.depthModeForSublayer(1,"opaque"===t.renderPass?jr.ReadWrite:jr.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,jr.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 jr(t.context.gl.LEQUAL,jr.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,jr.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(),[c,u]=o instanceof tt?[{},n]:t.stencilConfigForOverlap(n),h=u[u.length-1].overscaledZ,f=!t.options.moving;for(let n of u){let u=t.depthModeForSublayer(n.overscaledZ-h,1===r.paint.get("raster-opacity")?jr.ReadWrite:jr.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,u,Vr.disabled,l,qr.disabled,T,_,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,u,c[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,c=l.tileSize,u=r.paint.get("background-pattern");if(t.isPatternMissing(u))return;let h=!u&&1===i.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;let f=Vr.disabled,p=t.depthModeForSublayer(0,"opaque"===h?jr.ReadWrite:jr.ReadOnly),d=t.colorModeForRenderPass(),m=t.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});u&&(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=u?Ze(l,a,t,u,{tileID:e,tileSize:c},y):We(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 jr(t.context.gl.LEQUAL,jr.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,jr.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],c=i[2],u=o[0],h=o[1],f=o[2],n[0]=l*f-c*h,n[1]=c*u-s*f,n[2]=s*h-l*u,n)),r=-((p=e)[0]*(d=a[t[1]])[0]+p[1]*d[1]+p[2]*d[2]);var n,i,o,s,l,c,u,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 An=85.051129;class kn{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=n??0,this._maxPitch=i??60,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 kn(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)),c=1;for(let n=s-c;n<=l+c;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),c=[l*o.x,l*o.y,0],u=[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?c:u,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=c[0]-.5-(a<<t),n=c[1]-.5-(o<<t);g.push({tileID:new e.S(i.zoom===y?v:i.zoom,i.wrap,i.zoom,a,o),distanceSq:x([u[0]-.5-a,u[1]-.5-o]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let l=0;l<4;l++){let c=(a<<1)+l%2,u=(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,c,u),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:c,y:u,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,An);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,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);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 Z).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 Z([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,An])}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,c=a,u=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&&(u=p/(s-o))}i&&(l=e.b3(e.O(i[0])*a,0,a),c=e.b3(e.O(i[1])*a,0,a),c<l&&(c+=a),c-l<f&&(h=f/(c-l)));let d,m,{x:g,y}=this.project.call({worldSize:a},t),v=Math.max(h||0,u||0);if(v){let t=new e.P(h?(c+l)/2:g,u?(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+c)/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>c&&(d=c-n)}if(void 0!==d||void 0!==m){let t=new e.P(d??g,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,c=Math.PI/2+this._pitch,u=this._fov*(.5+t.y/this.height),h=Math.sin(u)*l/Math.sin(e.ac(Math.PI-c-u,.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-c-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(),c="";if(c+=t?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${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}=${c}`):r})).filter((t=>t));return e||r.push(`${t}=${c}`),`#${r.join("&")}`}return`#${c}`}}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=On(r.pan.mag(),n,e.e({},Cn,t||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,Dn(i,a)}if(r.zoom){let t=On(r.zoom,n,In);i.zoom=this._map.transform.zoom+t.amount,Dn(i,t)}if(r.bearing){let t=On(r.bearing,n,Ln);i.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),Dn(i,t)}if(r.pitch){let t=On(r.pitch,n,Pn);i.pitch=this._map.transform.pitch+t.amount,Dn(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 Dn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function On(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 jn{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 Nn{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 Wn{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 Zn{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 Kn=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Jn=({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 Zn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Kn})},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 Zn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Kn})};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 ci={panStep:100,bearingStep:15,pitchStep:10};class ui{constructor(t){this._tr=new Un(t);let e=ci;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 Ai{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,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),t);for(let{handlerName:o,handler:s,allowed:u}of this._handlers){if(!s.isEnabled())continue;let h;this._blockedByActive(a,u,o)?s.reset():s[e||t.type]&&(h=s[e||t.type](t,c,l),this.mergeHandlerResult(n,i,h,o,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||s.isActive())&&(a[o]=s)}let u={};for(let t in this._previousActiveHandlers)a[t]||(u[t]=r);this._previousActiveHandlers=a,(Object.keys(u).length||Ti(n))&&(this._changes.push([n,i,u]),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 jn(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 Wn(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 c=e.touchPitch=new li(e);this._add("touchPitch",c),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);let u=Jn(t),h=Qn(t);e.dragRotate=new vi(t,u,h),this._add("mouseRotate",u,["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 Zn({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:r,enable:t,assignEvents:Kn})})(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 ui(e);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new Nn(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:c,around:u,pinchAround:h}=t;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;let f=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),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,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(f,u)):i.setLocationAtPoint(f,u),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,c={};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,c[`${t}end`]=l)}for(let t in c)this._fireEvent(t,c[t]);let u=bi(this._eventsInProgress),h=(i||o)&&!u;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 ki 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=Z.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 Z(t,r),c=o.project(l.getNorthWest()),u=o.project(l.getNorthEast()),h=o.project(l.getSouthEast()),f=o.project(l.getSouthWest()),p=e.ba(-n),d=c.rotate(p),m=u.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),A=e.P.convert(i.offset),k=new e.P((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(e.ba(n)),M=A.add(k).mult(o.scale/o.zoomScale(T));return{center:o.unproject(c.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,c=o.z-a.z,u=Math.hypot(s,l,c);if(0===u)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/u/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI,d=180*Math.acos(h/u)/Math.PI;return d=c<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,c=i.padding,u="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!==u,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,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,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,c=i.padding,u="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,A=_.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/A*2)}let k=b*b;function M(t){let e=(T*T-w*w+(t?-1:1)*k*k*A*A)/(2*(t?T:w)*k*A);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))/k)/A;var e},P=(M(!0)-C)/b;if(Math.abs(A)<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!==u,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,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,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 ct(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),c=e.X>>o;e.aP(a.posMatrix,0,c,0,c,0,1),e.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,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),c=e.X>>o;e.aP(a.posMatrix,0,e.X,0,e.X,0,1),e.J(a.posMatrix,a.posMatrix,[s*c,l*c,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),c=[l[0]*s.dim,l[1]*s.dim],u=Math.floor(c[0]),h=Math.floor(c[1]),f=c[0]-u,p=c[1]-h;var d,m,g,y,v;return s.get(u,h)*(1-f)*(1-p)+s.get(u+1,h)*f*(1-p)+s.get(u,h+1)*(1-f)*p+s.get(u+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),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);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+c)/p,this.getElevation(h.tileID,l,c,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 c=r.length,u=c+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(c+t,c+t+1,c+t+3),n.emplaceBack(c+t,c+t+3,c+t+2),n.emplaceBack(u+t,u+t+3,u+t+1),n.emplaceBack(u+t,u+t+2,u+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 Di={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{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(Di[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(Di[r]&&(this._prevType&&Di[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!i))return!0;if(Di[this._prevType]||Di[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(),Di[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,ji={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},Ni=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=Jn({clickTolerance:i,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{let n=new $n;return new Zn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Ni})})({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 Zn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Ni})})({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 Wi 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"===t?.type||"render"===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(t?.opacity,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 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"}];for(let t of c){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 u=o.createNS("http://www.w3.org/2000/svg","g");u.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"),u.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(u),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,c=i.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;!(null===(n=this._popup)||void 0===n)&&n.isOpen()&&u&&this._popup.remove(),this._element.style.opacity=u?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 Zi={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 Ki(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?Ji(e,n,r/5280,t._getUIString("ScaleControl.Miles")):Ji(e,n,r,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ji(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ji(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ji(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ji(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=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=J,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=Z.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 Wi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-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())),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({},Zi,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{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=ui,t.LngLatBounds=Z,t.LogoControl=Ei,t.Map=class extends ki{constructor(t){e.bf.mark(e.bg.create);let r=Object.assign(Object.assign({},ji),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 kn(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})),typeof window<"u"){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 Ai(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(Z.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-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=t??22)>=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=t??0)<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=t??60)>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 Oi(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:c,textFitWidth:u,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:c,textFitWidth:u,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:c,textFitWidth:u,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 c=!(r instanceof HTMLImageElement||e.b(r));return n.data.replace(l,c),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),c.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),typeof window<"u"&&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");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=Wi,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=K,t.RasterTileSource=$,t.ScaleControl=class{constructor(t){this._onMove=()=>{Ki(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ki(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(O),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(){N().acquire(O)},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&&typeof e<"u"?e.exports=a():(n=typeof globalThis<"u"?globalThis:n||self).maplibregl=a()}}),wb=p({"src/plots/map/layers.js"(t,e){var r=le(),n=Se().sanitizeHTML,i=mb(),a=cb();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 c(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=c(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=c(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=p({"src/plots/map/map.js"(t,e){var r=bb(),n=le(),i=_g(),a=qt(),o=ir(),s=fr(),l=Dr(),c=Or(),u=c.drawMode,h=c.selectMode,f=En().prepSelect,p=En().clearOutline,d=En().clearSelectionsCache,m=En().selectOnClick,g=cb(),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),c=s.bounds,u=c?[[c.west,c.south],[c.east,c.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:u,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=[],c=b(s.style);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.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 c=i[r];n="string"==typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,f={};for(u in a)f[n=a[u]]?f[n].push(u):f[n]=[u];for(n in f){var p=f[n];if(p.length>1)for(r=0;r<p.length;r++)0===(u=p[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.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 c=Object.keys(a);t:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<t.length;i++)if(u===(r=t[i][0].trace).uid)continue t;(e=a[u]).dispose(),delete a[u]}},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]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};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)||u(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 c(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}}),Ab=p({"src/plots/map/layout_defaults.js"(t,e){var r=le(),n=Hs(),i=je(),a=ub();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"})}}}),kb=p({"src/plots/map/index.js"(t){var e=le(),r=e.strTranslate,n=e.strScale,i=we().getSubplotCalcData,a=ke(),o=x(),s=Qe(),l=Se(),c=Tb(),u="map";t.name=u,t.attr="subplot",t.idRoot=u,t.idRegex=t.attrRegex=e.counterRegex(u),t.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},t.layoutAttributes=ub(),t.supplyLayoutDefaults=Ab(),t.plot=function(t){for(var r=t._fullLayout,n=t.calcdata,a=r._subplots[u],o=0;o<a.length;o++){var s=a[o],l=i(n,u,s),h=r[s],f=h._subplot;f||(f=new c(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[u]||[],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[u],c=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:c.l+c.w*p.x[0],y:c.t+c.h*(1-p.y[1]),width:c.w*(p.x[1]-p.x[0]),height:c.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=c.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=[c.l+c.w*p.x[1],c.t+c.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[u],n=0;n<r.length;n++)e[r[n]]._subplot.updateFx(e)}}}),Mb=p({"src/traces/scattermap/index.js"(t,e){e.exports={attributes:hb(),supplyDefaults:pb(),colorbar:pi(),formatLabels:db(),calc:cg(),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:kb(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}}),Sb=p({"lib/scattermap.js"(t,e){e.exports=Mb()}}),Eb=p({"src/traces/choroplethmap/attributes.js"(t,e){var r=Rg(),n=Pe(),i=Ot().hovertemplateAttrs,a=U(),o=R().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=p({"src/traces/choroplethmap/defaults.js"(t,e){var r=le(),n=qe(),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"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"==typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),e._length=Math.min(l.length,c.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=p({"src/traces/choroplethmap/convert.js"(t,e){var r=A(),n=le(),i=Ze(),a=Qe(),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,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=e._opts={fill:c,line:u,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(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":T}),n.extendFlat(u.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":T}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:f},l(t),h},convertOnSelect:l}}}),Lb=p({"src/traces/choroplethmap/plot.js"(t,e){var r=Ib().convert,n=Ib().convertOnSelect,i=cb().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=p({"src/traces/choroplethmap/index.js"(t,e){e.exports={attributes:Eb(),supplyDefaults:Cb(),colorbar:Uo(),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:kb(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}}),zb=p({"lib/choroplethmap.js"(t,e){e.exports=Pb()}}),Db=p({"src/traces/densitymap/attributes.js"(t,e){var r=Pe(),n=Ot().hovertemplateAttrs,i=U(),a=hb(),o=R().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"}))}}),Ob=p({"src/traces/densitymap/defaults.js"(t,e){var r=le(),n=qe(),i=Db();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}}}),Rb=p({"src/traces/densitymap/calc.js"(t,e){var r=A(),n=le().isArrayOrTypedArray,i=k().BADNUM,a=We(),o=le()._;e.exports=function(t,e){for(var s=e._length,l=new Array(s),c=e.z,u=n(c)&&c.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],u){var m=c[h];f.z=r(m)?m:i}}return a(t,e,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(t,"lat:")+" ",lon:o(t,"lon:")+" "}}),l}}}),Fb=p({"src/traces/densitymap/convert.js"(t,e){var r=A(),n=le(),i=H(),a=Ze(),o=k().BADNUM,s=pg().makeBlank;e.exports=function(t){var e=t[0].trace,l=!0===e.visible&&0!==e._length,c=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],f=e.z,p=e.radius,d=n.isArrayOrTypedArray(f)&&f.length,m=n.isArrayOrTypedArray(p);for(u=0;u<t.length;u++){var g=t[u],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[u])&&p[u]>0?+p[u]: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(u=1;u<b.length;u++)T.push(b[u][0],b[u][1]);var A=["interpolate",["linear"],["get","z"],_.min,0,_.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":d?A:1/(_.max-_.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),Bb=p({"src/traces/densitymap/plot.js"(t,e){var r=Fb(),n=cb().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],c=s[1],u=i[l];e.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&e.setOptions(c,"setPaintProperty",u.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}}}),jb=p({"src/traces/densitymap/hover.js"(t,e){var r=ir(),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,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),Nb=p({"src/traces/densitymap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),Ub=p({"src/traces/densitymap/index.js"(t,e){e.exports={attributes:Db(),supplyDefaults:Ob(),colorbar:Uo(),formatLabels:db(),calc:Rb(),plot:Bb(),hoverPoints:jb(),eventData:Nb(),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:kb(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}}),Vb=p({"lib/densitymap.js"(t,e){e.exports=Ub()}}),qb=p({"src/traces/sankey/attributes.js"(t,e){var r=F(),n=U(),i=q(),a=N(),o=Aa().attributes,s=Ot().hovertemplateAttrs,l=Pe(),c=ye().templatedArray,u=Ce().descriptionOnlyNumbers,h=R().extendFlat,f=Pt().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:u("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:c("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=p({"src/traces/sankey/defaults.js"(t,e){var r=le(),n=qb(),i=H(),a=O(),o=Aa().defaults,s=Sr(),l=ye(),c=je();function u(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,A=b("color",T?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function k(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(A)?A.map(k):k(A)),b("customdata"),c(x,_,{name:"colorscales",handleItemDefaults:u}),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=p({"node_modules/strongly-connected-components/scc.js"(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 c,u=0,h=[],f=[];function p(e){var l=[e],c=[e];for(r[e]=n[e]=u,i[e]=!0,u+=1;c.length>0;){e=c[c.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]=u,i[m]=!0,u+=1,l.push(m),c.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(_)}c.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})),c=[d[0]];for(var m=1;m<d.length;m++)d[m]!==d[m-1]&&c.push(d[m]);f[l]=c}}return{components:h,adjacencyList:f}}}}),Wb=p({"src/traces/sankey/calc.js"(t,e){var r=Gb(),n=le(),i=Xx().wrap,a=n.isArrayOrTypedArray,o=n.isIndex,s=Ze();e.exports=function(t,e){var l=function(t){var e,i=t.node,l=t.link,c=[],u=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 A=w[e];for(b=0;b<A.length;b++){var k=A[b],M=_+e;T.hasOwnProperty(k)?n.warn("Node "+k+" is already part of a group."):T[k]=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]),c.push({pointNumber:e,label:L,color:u?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,D=a(i.color),O=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:D?i.color[e]:i.color,customdata:O?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])}return r(a).components.some((function(t){return t.length>1}))}(z,S.source,S.target)&&(B=!0),{circular:B,links:c,nodes:R,groups:w,groupLookup:T}}(e);return i({circular:l.circular,_nodes:l.nodes,_links:l.links,_groups:l.groups,_groupLookup:l.groupLookup})}}}),Zb=p({"node_modules/d3-quadtree/dist/d3-quadtree.js"(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,c,u,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((c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=p,!(p=p[h=u<<1|c]))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),(c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(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(e??n,r??i,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),c=1/0,u=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<c&&(c=i),i>h&&(h=i),a<u&&(u=a),a>f&&(f=a));if(c>h||u>f)return this;for(this.cover(c,u).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,c=this._root;r>t||t>=i||n>e||e>=a;)switch(s=(e<n)<<1|t<r,o=new Array(4),o[s]=c,c=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=c)}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,c,u,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);c=m.pop();)if(!(!(g=c.node)||(a=c.x0)>p||(o=c.y0)>d||(s=c.x1)<h||(l=c.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)),(u=(e>=v)<<1|t>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}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,c,u,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((c=a>=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,e=p,!(p=p[h=u<<1|c]))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=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(c=e.node,i=e.x0,a=e.y0,o=e.x1,s=e.y1)&&c.length){var u=(i+o)/2,h=(a+s)/2;(n=c[3])&&l.push(new r(n,u,h,o,s)),(n=c[2])&&l.push(new r(n,i,h,u,s)),(n=c[1])&&l.push(new r(n,u,a,o,h)),(n=c[0])&&l.push(new r(n,i,a,u,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,c=e.x1,u=e.y1,h=(s+c)/2,f=(l+u)/2;(o=a[0])&&n.push(new r(o,s,l,h,f)),(o=a[1])&&n.push(new r(o,h,l,c,f)),(o=a[2])&&n.push(new r(o,s,f,h,u)),(o=a[3])&&n.push(new r(o,h,f,c,u))}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&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),Yb=p({"node_modules/d3-collection/dist/d3-collection.js"(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(){return{}}function a(t,e,r){t[e]=r}function o(){return n()}function s(t,e,r){t.set(e,r)}function l(){}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 u(t,e){var r=new l;if(t instanceof l)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}l.prototype=u.prototype={constructor:l,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=function(){var t,e,r,l=[],c=[];function u(r,i,a,o){if(i>=l.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var s,c,h,f=-1,p=r.length,d=l[i++],m=n(),g=a();++f<p;)(h=m.get(s=d(c=r[f])+""))?h.push(c):m.set(s,[c]);return m.each((function(t,e){o(g,e,u(t,i,a,o))})),g}function h(t,r){if(++r>l.length)return t;var n,i=c[r-1];return null!=e&&r>=l.length?n=t.entries():(n=[],t.each((function(t,e){n.push({key:e,values:h(t,r)})}))),null!=i?n.sort((function(t,e){return i(t.key,e.key)})):n}return r={object:function(t){return u(t,0,i,a)},map:function(t){return u(t,0,o,s)},entries:function(t){return h(u(t,0,o,s),0)},key:function(t){return l.push(t),r},sortKeys:function(t){return c[l.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}},t.set=u,t.map=n,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},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&typeof e<"u"?t:r.d3=r.d3||{})}}),Xb=p({"node_modules/d3-dispatch/dist/d3-dispatch.js"(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&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),$b=p({"node_modules/d3-timer/dist/d3-timer.js"(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,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return s||(u(f),s=c.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=c.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=c.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-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(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&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),Kb=p({"node_modules/d3-force/dist/d3-force.js"(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 c(t){return t.index}function u(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,c=1;function u(){for(var t,a,u,f,p,d,m,g=r.length,y=0;y<c;++y)for(a=e.quadtree(r,s,l).visitAfter(h),t=0;t<g;++t)u=r[t],d=n[u.index],m=d*d,f=u.x+u.vx,p=u.y+u.vy,a.visit(v);function v(t,e,r,n,a){var s=t.data,l=t.r,c=d+l;if(!s)return e>f+c||n<f-c||r>p+c||a<p-c;if(s.index>u.index){var h=f-s.x-s.vx,g=p-s.y-s.vy,y=h*h+g*g;y<c*c&&(0===h&&(y+=(h=o())*h),0===g&&(y+=(g=o())*g),y=(c-(y=Math.sqrt(y)))/y*i,u.vx+=(h*=y)*(c=(l*=l)/(m+l)),u.vy+=(g*=y)*c,s.vx-=h*(c=1-c),s.vy-=g*c)}}}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)),u.initialize=function(t){r=t,f()},u.iterations=function(t){return arguments.length?(c=+t,u):c},u.strength=function(t){return arguments.length?(i=+t,u):i},u.radius=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),f(),u):t},u},t.forceLink=function(t){var e,n,i,s,l,h=c,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,c,u,h,f,p,m,g=0;g<a;++g)c=(s=t[g]).source,h=(u=s.target).x+u.vx-c.x-c.vx||o(),f=u.y+u.vy-c.y-c.vy||o(),h*=p=((p=Math.sqrt(h*h+f*f))-n[g])/p*r*e[g],f*=p,u.vx-=h*(m=l[g]),u.vy-=f*m,c.vx+=h*(m=1-m),c.vy+=f*m}function g(){if(i){var a,o,c=i.length,f=t.length,p=r.map(i,h);for(a=0,s=new Array(c);a<f;++a)(o=t[a]).index=a,"object"!=typeof o.source&&(o.source=u(p,o.source)),"object"!=typeof o.target&&(o.target=u(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,c=1/0,u=.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/u<d)return d<c&&(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>=c)){(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?(c=t*t,p):Math.sqrt(c)},p.theta=function(t){return arguments.length?(u=t*t,p):Math.sqrt(u)},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],c=l.x-e||1e-6,u=l.y-r||1e-6,h=Math.sqrt(c*c+u*u),f=(o[a]-h)*i[a]*t/h;l.vx+=c*f,l.vy+=u*f}}function c(){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,c()},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:a(+t),c(),l):s},l.radius=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),c(),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,c=.6,u=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,u.each((function(t){t(a)})),n=0;n<o;++n)null==(i=t[n]).fx?i.x+=i.vx*=c:(i.x=i.fx,i.vx=0),null==i.fy?i.y+=i.vy*=c:(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(),u.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?(c=1-t,e):1-c},force:function(t,r){return arguments.length>1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(i=e-(s=t[c]).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&&typeof e<"u"?n(t,Zb(),Yb(),Xb(),$b()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,r.d3)}}),Jb=p({"node_modules/d3-path/dist/d3-path.js"(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,c=i-t,u=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*c-u*h)>n&&o){var d=i-s,m=a-l,g=c*c+u*u,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*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,o,s,l,c){t=+t,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),f=t+u,p=a+h,d=1^c,m=c?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-u)+","+(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&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),Qb=p({"node_modules/d3-shape/dist/d3-shape.js"(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,c=Math.sqrt,u=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,u=e-n,h=(s?a:-a)/c(l*l+u*u),f=h*u,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,A=d*y-g*m,k=(b<0?-1:1)*c(o(0,T*T*w-A*A)),M=(A*b-_*k)/w,S=(-A*_-b*k)/w,E=(A*b+_*k)/w,C=(-A*_+b*k)/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 A(t){return t[1]}function k(){var t=T,n=A,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,f=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=h;++l)!(l<h&&i(c=r[l],l,r))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+t(c,l,r),+n(c,l,r));if(u)return s=null,u+""||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=A,o=r(!0),s=null,l=w,c=null;function u(r){var u,h,f,p,d,m=r.length,g=!1,y=new Array(m),v=new Array(m);for(null==s&&(c=l(d=e.path())),u=0;u<=m;++u){if(!(u<m&&o(p=r[u],u,r))===g)if(g=!g)h=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),f=u-1;f>=h;--f)c.point(y[f],v[f]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+t(p,u,r),v[u]=+i(p,u,r),c.point(n?+n(p,u,r):y[u],a?+a(p,u,r):v[u]))}if(d)return c=null,d+""||null}function h(){return k().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return h().x(t).y(i)},u.lineY1=function(){return h().x(t).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}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(k().curve(C))}function D(){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 O(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 j(t){var n=F,i=B,a=T,o=A,s=null;function l(){var r,l=R.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,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=t??null,l):s},l}function N(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=O(e,r),o=O(e,r=(r+i)/2),s=O(n,r),l=O(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),W=2*G,Z={draw:function(t,e){var r=Math.sqrt(e/W),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,K={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()}},J={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,Z,J,K,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 ct(t){this._context=t}function ut(t){this._context=t}function ht(t){this._context=t}function ft(t,e){this._basis=new ct(t),this._beta=e}ct.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}},ut.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 ct(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>u){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>u){var c=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*c+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*c+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 At(t,e){this._context=t,this._alpha=e}At.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 kt=function t(e){function r(t){return e?new At(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 Dt(t){this._context=new Ot(t)}function Ot(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 jt(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 Nt(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 Nt(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 Nt(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}}},(Dt.prototype=Object.create(zt.prototype)).point=function(t,e){zt.prototype.point.call(this,e,t)},Ot.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,A=v,k=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=A.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>u)if(S>p-u)M.moveTo(y*a(v),y*l(v)),M.arc(0,0,y,v,x,!E),g>u&&(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,D=x,O=S,R=S,F=k.apply(this,arguments)/2,B=F>u&&(w?+w.apply(this,arguments):c(g*g+y*y)),j=s(n(y-g)/2,+b.apply(this,arguments)),N=j,U=j;if(B>u){var V=d(B/g*l(F)),q=d(B/y*l(F));(O-=2*V)>u?(z+=V*=E?1:-1,D-=V):(O=0,z=D=(v+x)/2),(R-=2*q)>u?(L+=q*=E?1:-1,P-=q):(R=0,L=P=(v+x)/2)}var H=y*a(L),G=y*l(L),W=g*a(D),Z=g*l(D);if(j>u){var Y,X=y*a(P),$=y*l(P),K=g*a(z),J=g*l(z);if(S<h&&(Y=function(t,e,r,n,i,a,o,s){var l=r-t,c=n-e,h=o-i,f=s-a,p=f*l-h*c;if(!(p*p<u))return[t+(p=(h*(e-a)-f*(t-i))/p)*l,e+p*c]}(H,G,K,J,X,$,W,Z))){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)/(c(Q*Q+tt*tt)*c(et*et+rt*rt)))/2),it=c(Y[0]*Y[0]+Y[1]*Y[1]);N=s(j,(g-it)/(nt-1)),U=s(j,(y-it)/(nt+1))}}R>u?U>u?(C=_(K,J,H,G,y,U,E),I=_(X,$,W,Z,y,U,E),M.moveTo(C.cx+C.x01,C.cy+C.y01),U<j?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>u&&O>u?N>u?(C=_(W,Z,X,$,g,-N,E),I=_(H,G,K,J,g,-N,E),M.lineTo(C.cx+C.x01,C.cy+C.y01),N<j?M.arc(C.cx,C.cy,N,i(C.y01,C.x01),i(I.y01,I.x01),!E):(M.arc(C.cx,C.cy,N,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,N,i(I.y11,I.x11),i(I.y01,I.x01),!E))):M.arc(0,0,g,D,z,E):M.lineTo(W,Z)}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)+ +A.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?(A="function"==typeof t?t:r(+t),S):A},S.padAngle=function(t){return arguments.length?(k="function"==typeof t?t:r(+t),S):k},S.context=function(t){return arguments.length?(M=t??null,S):M},S},t.area=M,t.areaRadial=D,t.curveBasis=function(t){return new ct(t)},t.curveBasisClosed=function(t){return new ut(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=kt,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 Dt(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=k,t.lineRadial=z,t.linkHorizontal=function(){return j(N)},t.linkRadial=function(){var t=j(V);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return j(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,c,u,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,c=d?(v-f*_)/d:0;s<f;++s,y=u)l=m[s],u=y+((h=g[l])>0?h*c:0)+_,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,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=O,t.radialArea=D,t.radialLine=z,t.stack=function(){var t=r([]),e=Nt,n=jt,i=Ut;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a<c;++a){for(var h,f=s[a],p=u[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(u);a<c;++a)u[o[a]].index=a;return n(u,o),u}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?Nt:"function"==typeof t?t:r(R.call(t)),a):e},a.offset=function(t){return arguments.length?(n=t??jt,a):n},a},t.stackOffsetDiverging=function(t,e){if((s=t.length)>0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l<c;++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}jt(t,e)}},t.stackOffsetNone=jt,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}jt(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,c=0;s<i;++s){for(var u=t[e[s]],h=u[o][1]||0,f=(h-(u[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,c+=f*h}r[o-1][1]+=r[o-1][0]=a,l&&(a-=c/l)}r[o-1][1]+=r[o-1][0]=a,jt(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=[],c=[];for(e=0;e<n;++e)r=a[e],o<s?(o+=i[r],l.push(r)):(s+=i[r],c.push(r));return c.reverse().concat(l)},t.stackOrderNone=Nt,t.stackOrderReverse=function(t){return Nt(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=t??null,a):i},a},t.symbolCircle=q,t.symbolCross=H,t.symbolDiamond=Z,t.symbolSquare=J,t.symbolStar=K,t.symbolTriangle=tt,t.symbolWye=at,t.symbols=ot,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?n(t,Jb()):n((r=r||self).d3=r.d3||{},r.d3)}}),tw=p({"node_modules/@plotly/d3-sankey/build/d3-sankey.js"(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 c(t.source,e.source)||t.index-e.index}function l(t,e){return c(t.target,e.target)||t.index-e.index}function c(t,e){return t.y0-e.y0}function u(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,A=g,k=32,M=2/3;function S(){var a={nodes:T.apply(null,arguments),links:A.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,u),e.sum(t.targetLinks,u))}))}(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}));(function(){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,u)}));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}))})(),d();for(var a=1,o=k;o>0;--o)l(a*=.99),d(),s(a),d();function s(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,f)/e.sum(r.targetLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(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,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),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?(A="function"==typeof t?t:o(t),S):A},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?(k=+t,S):k},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&&typeof e<"u"?n(t,Mg(),Yb(),Qb()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}}),ew=p({"node_modules/elementary-circuits-directed-graph/johnson.js"(t,e){var r=Gb();e.exports=function(t,e){var n,i=[],a=[],o=[],s={},l=[];function c(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach((function(e){delete s[t][e],o[e]&&c(e)}))}function u(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=u(r));if(i)c(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(u):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]={}}u(n),n+=1}else n=p}if(!e)return i}}}),rw=p({"node_modules/@plotly/d3-sankey-circular/dist/d3-sankey-circular.js"(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 c(t,e){return h(t.source,e.source)||t.index-e.index}function u(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),W(t,e)&&(t.circularLinkType=t.source.circularLinkType))}))}function A(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function k(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&&!W(t,e)?r+1:r}));var n=0;return t.targetLinks.forEach((function(t){n=t.circular&&!W(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(W(n,r)&&S(n))n.circularPathData.verticalBuffer=a+n.width/2;else{for(var o=0;o<i;o++)if(k(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,W(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,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(P):c.sort(L);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+u,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(D):c.sort(z),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+u,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+u),u+=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 O(t)==O(e)?"bottom"==t.circularLinkType?P(t,e):L(t,e):O(e)-O(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 D(t,e){return e.y1-t.y1}function O(t){return t.target.column-t.source.column}function R(t){return t.target.x0-t.source.x1}function F(t,e){var r=A(t),n=R(e)/Math.tan(r);return"up"==G(t)?t.y1+n:t.y1-n}function B(t,e){var r=A(t),n=R(e)/Math.tan(r);return"up"==G(t)?t.y1-n:t.y1+n}function j(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 c,u=s/(l+1),h=Math.pow(1-u,3),f=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,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?(c=o.y1-g+10,c="bottom"==o.circularLinkType?c:-c,o=U(o,c,e,r),t.nodes.forEach((function(t){_(t,n)==_(o,n)||t.column!=o.column||N(o,t)&&U(t,c,e,r)}))):(y>o.y0&&y<o.y1||g<o.y0&&y>o.y1)&&(c=y-o.y0+10,o=U(o,c,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,c,e,r)})))}}))}}))}function N(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 W(t,e){return _(t.source,e)==_(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,_=0,A=1,k=1,S=24,E=g,I=o,L=y,P=v,z=32,D=2,O=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"!==(typeof n>"u"?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(typeof i>"u"?"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,c=s.target.index;a[l]||(a[l]=[]),a[c]||(a[c]=[]),-1===a[l].indexOf(c)&&a[l].push(c)}var u=i(a);u.sort((function(t,e){return t.length-e.length}));var h={};for(o=0;o<u.length;o++){var f=u[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,O),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}));(function(r){if(n){var o=1/0;l.forEach((function(t){var e=k*n/(t.length+1);o=e<o?e:o})),t=o}var s=e.min(l,(function(r){return(k-_-(r.length-1)*t)/e.sum(r,f)}));s*=.3,i.links.forEach((function(t){t.width=t.value*s}));var c=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),u=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),i=A-a,o=k-_,s=i/(i+r.right+r.left),l=o/(o+r.top+r.bottom);return a=a*s+r.left,A=0==r.right?A:A*s,_=_*l+r.top,k*=l,t.nodes.forEach((function(t){t.x0=a+t.column*((A-a-S)/n),t.x1=t.x0+S})),l}(i,c);s*=u,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=k/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==M(t,r)?(t.y0=k/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=_+n,t.y1=t.y0+t.value*s):(t.y0=k-t.value*s-n,t.y1=t.y0+t.value*s):0==c.top||0==c.bottom?(t.y0=(k-_)/e*n,t.y1=t.y0+t.value*s):(t.y0=(k-_)/2-e/2+n,t.y1=t.y0+t.value*s)}))}))})(s),y();for(var c=1,u=o;u>0;--u)g(c*=.99,s),y();function g(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=k/2-s/2,i.y1=k/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=k/2-s/2,i.y1=k/2+s/2;else{var l=e.mean(i.sourceLinks,m),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function y(){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-k)>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,k,E),q(o,0,E),j(o,_,k,E),V(o,k,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})),c=e.max(i,(function(t){return t.y1})),u=(n-r)/(c-l);i.forEach((function(t){var e=(t.y1-t.y0)*u;t.y0=(t.y0-l)*u,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*u,t.y1=(t.y1-l)*u,t.width=t.width*u}))}}(o,_,k),C(o,D,k,E),o}function F(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),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,A=+t[0],k=+t[1],R):[A-a,k-_]},R.extent=function(t){return arguments.length?(a=+t[0][0],A=+t[1][0],_=+t[0][1],k=+t[1][1],R):[[a,_],[A,k]]},R.iterations=function(t){return arguments.length?(z=+t,R):z},R.circularLinkGap=function(t){return arguments.length?(D=+t,R):D},R.nodePaddingRatio=function(t){return arguments.length?(n=+t,R):n},R.sortNodes=function(t){return arguments.length?(O=t,R):O},R.update=function(t){return T(t,E),F(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1<k?"top":"bottom",t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)})),V(t,k,E,!1),q(t,0,E),C(t,D,k,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&&typeof e<"u"?n(t,Mg(),Yb(),Qb(),ew()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,null)}}),nw=p({"src/traces/sankey/constants.js"(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=p({"src/traces/sankey/render.js"(t,e){var r=Kb(),n=(td(),g(Qp)).interpolateNumber,i=x(),a=tw(),o=rw(),s=nw(),l=O(),c=H(),u=Qe(),h=le(),f=h.strTranslate,p=h.strRotate,d=Xx(),m=d.keyFun,y=d.repeat,v=d.unwrap,_=Se(),b=qt(),w=Me(),T=w.CAP_SHIFT,A=w.LINE_SPACING;function k(t,e,r){var n,i=v(e),c=i.trace,u=c.domain,f="h"===c.orientation,p=c.node.pad,d=c.node.thickness,m={justify:a.sankeyJustify,left:a.sankeyLeft,right:a.sankeyRight,center:a.sankeyCenter}[c.node.align],g=t.width*(u.x[1]-u.x[0]),y=t.height*(u.y[1]-u.y[0]),x=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(x).links(_);var w,T,A,k=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<k.nodes.length;w++)if(k.nodes[w].pointNumber===E){S=k.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:[]};k.nodes.unshift(C),S.childrenNodes.unshift(C)}}if(function(){for(w=0;w<k.nodes.length;w++){var t,e,r=k.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(A=0;A<a.length;A++)s[(e=a[A]).label]||(s[e.label]=0),s[e.label]+=e.value,o+=e.value;for(A=0;A<a.length;A++)(e=a[A]).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 c=0;for(T=0;T<r.sourceLinks.length;T++)c+=r.sourceLinks[T].value;for(T=0;T<r.sourceLinks.length;T++)(e=r.sourceLinks[T]).concentrationOut=e.value/c;var u=0;for(T=0;T<r.targetLinks.length;T++)u+=r.targetLinks[T].value;for(T=0;T<r.targetLinks.length;T++)(e=r.targetLinks[T]).concenrationIn=e.value/u}}(),c.node.x.length&&c.node.y.length){for(w=0;w<Math.min(c.node.x.length,c.node.y.length,k.nodes.length);w++)if(c.node.x[w]&&c.node.y[w]){var I=[c.node.x[w]*g,c.node.y[w]*y];k.nodes[w].x0=I[0]-d/2,k.nodes[w].x1=I[0]+d/2;var L=k.nodes[w].y1-k.nodes[w].y0;k.nodes[w].y0=I[1]-L/2,k.nodes[w].y1=I[1]+L/2}if("snap"===c.arrangement)(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})(x=k.nodes).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(k)}return{circular:b,key:r,trace:c,guid:h.randstr(),horizontal:f,width:g,height:y,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?y:g,dragPerpendicular:f?g:y,arrangement:c.arrangement,sankey:n,graph:k,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:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.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),c=t.link.y0-t.link.width/2,u=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+","+c,d="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+f+" "+s+","+u+" "+i+","+u,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),u="node_"+e.pointNumber;return e.group&&(u=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,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:c.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,u].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,j(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(N(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),j(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(t.filter(N(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 j(t){t.lastDraggedX=t.x0+t.dx/2,t.lastDraggedY=t.y0+t.dy/2}function N(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 g=t._fullLayout._dragCover,x=r.filter((function(t){return v(t).trace.visible})).map(k.bind(null,n)),b=e.selectAll("."+s.cn.sankey).data(x,m);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,m);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))}),m);I.enter().append("path").classed(s.cn.sankeyLink,!0).call(R,b,a.linkEvents),I.style("stroke",(function(t){return z(t)?c.tinyRGB(l(t.linkLineColor)):t.tinyColorHue})).style("stroke-opacity",(function(t){return z(t)?c.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||g?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,m);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))}),m);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 c.tinyRGB(l(t.nodeLineColor))})).style("stroke-opacity",(function(t){return c.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 j=O.selectAll("."+s.cn.nodeLabel).data(y);j.enter().append("text").classed(s.cn.nodeLabel,!0).style("cursor","default"),j.attr("data-notex",1).text((function(t){return t.node.label})).each((function(e){var r=i.select(this);u.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)*A-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})),j.transition().ease(s.ease).duration(s.duration)}}}),aw=p({"src/traces/sankey/plot.js"(t,e){var r=x(),n=le(),i=n.numberFormat,a=iw(),o=Dr(),s=H(),l=nw().cn,c=n._;function u(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(v.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 v(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 x=t._fullData[m].node;t._fullData[m]._viewInitial={node:{groups:x.groups.slice(),x:x.x.slice(),y:x.y.slice()}}}var w=c(t,"source:")+" ",T=c(t,"target:")+" ",A=c(t,"concentration:")+" ",k=c(t,"incoming flow count:")+" ",M=c(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(v.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 c=[],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};c.push({x:g[0],y:g[1],name:y.valueLabel,text:[m.label||"",w+m.source.label,T+m.target.label,m.concentrationscale?A+i("%0.2f")(m.flow.labelConcentration):""].filter(u).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(c,{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 c=r.select(e).select("."+l.nodeRect),h=t._fullLayout._paperdiv.node().getBoundingClientRect(),d=c.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,k+a.node.targetLinks.length,M+a.node.sourceLinks.length].filter(u).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=p({"src/traces/sankey/base_plot.js"(t){var e=Pt().overrideAll,r=we().getModuleCalcData,n=aw(),i=j(),a=pr(),o=fr(),s=En().prepSelect,l=le(),c=qt(),u="sankey";function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);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 u=s(r[l].pointNumber);if(u)if(u.group){for(var h=0;h<u.childrenNodes.length;h++)o.push(u.childrenNodes[h].pointNumber);a[u.pointNumber-i.node._count]=!1}else o.push(u.pointNumber)}n=a.filter(Boolean).concat([o]),c.call("_guiRestyle",t,{"node.groups":[n]},e)},prepFn:function(t,e,r){s(t,e,r,d,i)}};o.init(d)}}t.name=u,t.baseLayoutAttrOverrides=e({hoverlabel:i.hoverlabel},"plot","nested"),t.plot=function(e){var i=r(e.calcdata,u)[0];n(e,i),t.updateFx(e)},t.clean=function(t,e,r,n){var i=n._has&&n._has(u),a=e._has&&e._has(u);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=p({"src/traces/sankey/select.js"(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=p({"src/traces/sankey/index.js"(t,e){e.exports={attributes:qb(),supplyDefaults:Hb(),calc:Wb(),plot:aw(),moduleType:"trace",name:"sankey",basePlotModule:ow(),selectPoints:sw(),categories:["noOpacity"],meta:{}}}}),cw=p({"lib/sankey.js"(t,e){e.exports=lw()}}),uw=p({"src/traces/indicator/base_plot.js"(t){var e=Ae();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=p({"src/traces/indicator/attributes.js"(t,e){var r=R().extendFlat,n=R().extendDeep,i=Pt().overrideAll,a=F(),o=q(),s=Aa().attributes,l=Ie(),c=ye().templatedArray,u=kl(),h=Ce().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=c("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:u.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:u.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:u.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:u.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=p({"src/traces/indicator/constants.js"(t,e){e.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}}),pw=p({"src/traces/indicator/defaults.js"(t,e){var r=le(),n=hw(),i=Aa().defaults,a=ye(),o=je(),s=fw(),l=Re(),c=Fe(),u=Ne(),h=Ue();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,A,k,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(A,k,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"),A={},w&&(A=w.axis||{}),k=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(A,k,E,"linear"),h(A,k,E,"linear",C),u(A,k,E,"linear",C),c(A,k,E,C)}else m("title.align","center"),m("align","center"),e._isAngular=e._isBullet=!1;e._length=null}}}}),dw=p({"src/traces/indicator/calc.js"(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=p({"src/traces/indicator/plot.js"(t,e){var r=x(),n=(td(),g(Qp)).interpolate,i=(td(),g(Qp)).interpolateNumber,a=le(),o=a.strScale,s=a.strTranslate,l=a.rad2deg,c=Me().MID_SHIFT,u=Qe(),h=fw(),f=Se(),p=ir(),d=Ti(),m=Ai(),y=Ie(),v=H(),_={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 A(t){t.each((function(t){v.stroke(r.select(this),t.line.color)})).each((function(t){v.fill(r.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(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),m(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(u.font,e),u.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,x,C,I,L,P=e[0].trace,z=r.select(this),D=P._hasGauge,O=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]},j=B.l+B.w/2,N=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,q=P.align||"center";if(x=N,D){if(O&&(m=j,x=N+U/2,C=function(t){return function(t,e){return[e/Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),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 c,h,d,m=n[0].trace,g=l.numbersX,y=l.numbersY,x=m.align||"center",A=_[x],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=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?p.tickText(o,t).text:r(t)}}P.enter().append("text"),P.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var D,O=m.mode+m.align;if(m._hasDelta&&(D=function(){var e=k(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},c=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(c(l(n[0]),a)).call(v.fill,d(n[0])).call(f.convertToTspans,t)}return g.call(u.font,m.delta.font).call(v.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),u=i(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(v.fill,d({delta:u(e)}))}})).each("end",(function(){y(),C&&C()})).each("interrupt",(function(){y(),C&&C()})):y(),h=S(c(l(n[0]),a),m.delta.font,A,t),g}(),O+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,O+=m.delta.increasing.symbol+m.delta.decreasing.symbol,d=h),m._hasNumber&&(function(){var e=k(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(u.font,m.number.font).call(f.convertToTspans,t)}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(),c=S(s+a(n[0].y)+o,m.number.font,A,t)}(),O+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,d=c),m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=[(h.left+h.right)/2,(h.top+h.bottom)/2],N=.75*m.delta.font.size;"left"===m.delta.position&&(R=E(m,"deltaPos",0,-1*(c.width*b[m.align]+h.width*(1-b[m.align])+N),O,Math.min),F=B[1]-j[1],d={width:c.width+h.width+N,height:Math.max(c.height,h.height),left:h.left+R,right:c.right,top:Math.min(c.top,h.top+F),bottom:Math.max(c.bottom,h.bottom+F)}),"right"===m.delta.position&&(R=E(m,"deltaPos",0,c.width*(1-b[m.align])+h.width*b[m.align]+N,O,Math.max),F=B[1]-j[1],d={width:c.width+h.width+N,height:Math.max(c.height,h.height),left:c.left,right:h.right+R,top:Math.min(c.top,h.top+F),bottom:Math.max(c.bottom,h.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=h.height,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(R=null,F=c.top,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),D.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&I.attr("transform",(function(){var t=l.numbersScaler(d);O+=t[2];var e,r=E(m,"numbersScale",1,t[0],O,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[x];"center"===x&&(n=(d.left+d.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,O,Math.max),s(i,e)+o(r)}))}(t,z,e,{numbersX:m,numbersY:x,numbersScaler:C,transitionOpts:d,onComplete:g}),D&&(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 W=z.selectAll("g.angular").data(O?e:[]);W.exit().remove();var Z=z.selectAll("g.angularaxis").data(O?e:[]);Z.exit().remove(),O&&function(t,e,i,a){var o,u,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=k(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={},D=p.makeLabelFns(o,0).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*c)},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 O=function(t){return s(_[0]+g*Math.cos(t),_[1]-g*Math.sin(t))};h=function(t){return O(P(t))};if(u=p.calcTicks(o),f=p.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;p.drawTicks(t,o,{vals:u,layer:w,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(t){var e=P(t);return O(e)+"rotate("+-l(e)+")"}}),p.drawLabels(t,o,{vals:u,layer:w,transFn:h,labelFns:z})}var F=[v].concat(d.gauge.steps),B=b.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(L).call(A),B.exit().remove();var j=I(d.gauge.bar.thickness),N=b.selectAll("g.value-arc").data([d.gauge.bar]);N.enter().append("g").classed("value-arc",!0).append("path");var U=N.select("path");T(M)?(U.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))()}}}(j,C(i[0].lastY),C(i[0].y))),d._lastValue=i[0].y):U.attr("d","number"==typeof i[0].y?j.endAngle(C(i[0].y)):"M0,0Z"),U.call(A),N.exit().remove(),F=[];var V=d.gauge.threshold.value;(V||0===V)&&F.push({range:[V,V],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var q=b.selectAll("g.threshold-arc").data(F);q.enter().append("g").classed("threshold-arc",!0).append("path"),q.select("path").call(L).call(A),q.exit().remove();var H=b.selectAll("g.gauge-outline").data([x]);H.enter().append("g").classed("gauge-outline",!0).append("path"),H.select("path").call(L).call(A),H.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:W,layer:Z,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,c,u=r[0].trace,f=n.gauge,d=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,x=u.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=u.gauge.bar.thickness*w,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._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=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=p.calcTicks(i),o=p.makeTransTickFn(i),l=p.getTickSigns(i)[2],c=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,c,l),transFn:o}),p.drawLabels(t,i,{vals:a,layer:d,transFn:o,labelFns:p.makeLabelFns(i,c)}));var I=[m].concat(u.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(A),L.exit().remove();var P=f.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(w-M)/2).call(A),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(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),P.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),D=f.selectAll("g.threshold-bullet").data(z);D.enter().append("g").classed("threshold-bullet",!0).append("line"),D.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),D.exit().remove();var O=f.selectAll("g.gauge-outline").data([g]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(C).call(A),O.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(u.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=u.bBox($.node());return D?(O&&(t=P.gauge.axis.visible?u.bBox(Z.node()).top-r-n.bottom:B.t+B.h/2-U/2-n.bottom-r),R&&(t=x-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)):t=P._numbersTop-r-n.bottom,s(e,t)}))}))}}}),gw=p({"src/traces/indicator/index.js"(t,e){e.exports={moduleType:"trace",name:"indicator",basePlotModule:uw(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:hw(),supplyDefaults:pw().supplyDefaults,calc:dw().calc,plot:mw(),meta:{}}}}),yw=p({"lib/indicator.js"(t,e){e.exports=gw()}}),vw=p({"src/traces/table/attributes.js"(t,e){var r=_n(),n=R().extendFlat,i=Pt().overrideAll,a=F(),o=Aa().attributes,s=Ce().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=p({"src/traces/table/defaults.js"(t,e){var r=le(),n=vw(),i=Aa().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=p({"src/traces/table/calc.js"(t,e){var r=Xx().wrap;e.exports=function(){return r({})}}}),bw=p({"src/traces/table/constants.js"(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=p({"src/traces/table/data_preparation_helper.js"(t,e){var r=bw(),n=R().extendFlat,i=A(),a=E().isTypedArray,o=E().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 c(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(u(s)))}return r}function u(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,c=0;c<t.length;c++)r=t[c],o.rows.push({rowIndex:c,rowHeight:r}),((a+=r)>=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var a=c(e.cells.values),d=function(t){return t.slice(e.header.values.length,t.length)},m=c(e.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(d(a).map((function(){return u((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),A=f(p(_,w),[]),k=f(T,A),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:k,headerRowBlocks:A,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=p({"src/traces/table/data_split_helpers.js"(t){var e=R().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;return[r,e?r+e.rows.length:0]}(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}}))}}}),Aw=p({"src/traces/table/plot.js"(t,e){var r=bw(),n=x(),i=le(),a=i.numberFormat,o=Xx(),s=Qe(),l=Se(),c=le().raiseToTop,u=le().strTranslate,h=le().cancelTransition,f=ww(),p=Tw(),d=H();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 v(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 u(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 u(0,t.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.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),c.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})),c.transition().delay(0).duration(0),c.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&&(c.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),c=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:A(r.size,n,e),color:A(r.color,n,e),family:A(r.family,n,e),weight:A(r.weight,n,e),style:A(r.style,n,e),variant:A(r.variant,n,e),textcase:A(r.textcase,n,e),lineposition:A(r.lineposition,n,e),shadow:A(r.shadow,n,e)};t.rowNumber=t.key,t.align=A(t.calcdata.cells.align,n,e),t.cellBorderWidth=A(t.calcdata.cells.line.width,n,e),t.font=i}))}(c);var u=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}(c);!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,A(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),d.fill(e,A(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))}))}(u);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}(c),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),O(c)}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 c=function(t){return"string"==typeof t&&t.match(r.latexCheck)}(i);t.latex=c;var u,h,f=c?"":A(t.calcdata.cells.prefix,e,n)||"",p=c?"":A(t.calcdata.cells.suffix,e,n)||"",d=c?null:A(t.calcdata.cells.format,e,n)||null,m=f+(d?a(d)(t.value):t.value)+p;if(t.wrappingNeeded=!t.wrapped&&!l&&!c&&(u=T(m)),t.cellHeightMayIncrease=s||c||t.mayHaveMarkup||(void 0===u?T(m):u),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),c=t.wrappingNeeded?P:z;t.needsConvertToTspans?l.convertToTspans(s,o,c(i,a,e,o,t)):n.select(a.parentNode).attr("transform",(function(t){return u(D(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 A(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 k(t,e,n){t.transition().ease(r.releaseTransitionEase).duration(r.releaseTransitionDuration).attr("transform",u(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=v(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)),c=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,c=0;c<s.length;c++)l+=s[c].rowHeight;o.allRowsHeight=l,e<i+l&&e+r>i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=R(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(L(t,r,e,c,n.prevPages,n,0),L(t,r,e,c,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})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(M);return C(t,h,l),s.scrollY===u}}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=[],c=0,u=t.column.columnWidth-2*r.cellPad;for(t.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(t.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(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(O)}}function z(t,e,i,a,o){return function(){if(!o.settledY){var s=n.select(e.parentNode),l=j(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*r.cellPad:h,p=Math.max(f,h);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+r.cn.columnCell).call(O),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 u(D(o,n.select(t.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function D(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 O(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(j(t),t.key);return u(0,r+e)})).selectAll("."+r.cn.cellRect).attr("height",(function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(j(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 j(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 u(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 x="onwheel"in document?"wheel":"mousewheel";d.on("mousemove",(function(e){l.filter((function(t){return e===t})).call(_,t)})).on(x,(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 u(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 u(t.x,0)})),i&&T.call(n.behavior.drag().origin((function(e){return k(n.select(this),e,-r.uplift),c(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)),v(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 u(t.x,0)})),e.call(h).attr("transform",u(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,k(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 A=T.selectAll("."+r.cn.columnBlock).data(p.splitToPanels,o.keyFun);A.enter().append("g").classed(r.cn.columnBlock,!0).attr("id",(function(t){return t.key})),A.style("cursor",(function(t){return t.dragHandle?"ew-resize":t.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"}));var E=A.filter(S),L=A.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,A),b(t,l,L,A);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 D=T.selectAll("."+r.cn.columnBoundaryClippath).data(o.repeat,o.keyFun);D.enter().append("clipPath").classed(r.cn.columnBoundaryClippath,!0),D.attr("id",(function(e){return y(t,e)}));var O=D.selectAll("."+r.cn.columnBoundaryRect).data(o.repeat,o.keyFun);O.enter().append("rect").classed(r.cn.columnBoundaryRect,!0).attr("fill","none"),O.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)}}}),kw=p({"src/traces/table/base_plot.js"(t){var e=we().getModuleCalcData,r=Aw(),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=p({"src/traces/table/index.js"(t,e){e.exports={attributes:vw(),supplyDefaults:xw(),calc:_w(),plot:Aw(),moduleType:"trace",name:"table",basePlotModule:kw(),categories:["noOpacity"],meta:{}}}}),Sw=p({"lib/table.js"(t,e){e.exports=Mw()}}),Ew=p({"src/traces/carpet/axis_attributes.js"(t,e){var r=F(),n=q(),i=Ie(),a=Ce().descriptionWithDates,o=Pt().overrideAll,s=zt().dash,l=R().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=p({"src/traces/carpet/attributes.js"(t,e){var r=F(),n=Ew(),i=q(),a=r({editType:"calc"}),o=Tn().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=p({"src/traces/carpet/xy_defaults.js"(t,e){var r=le().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=p({"src/traces/carpet/axis_defaults.js"(t,e){var r=Cw(),n=H().addOpacity,i=qt(),a=le(),o=Re(),s=Ne(),l=Ue(),c=bi(),u=er(),h=rr();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),u(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),c(t,e,g,{data:f.data,dataAttr:p});var b=y("gridcolor",n(x,.3)),w=y("gridwidth"),T=y("griddash"),A=g("showgrid");A||(delete e.gridcolor,delete e.gridwidth,delete e.griddash);var k=y("startlinecolor",x),M=y("startlinewidth",w);g("startline",e.showgrid||!!k||!!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),A?(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=p({"src/traces/carpet/ab_defaults.js"(t,e){var r=Lw(),n=ye();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){["aaxis","baxis"].forEach((function(o){var s=o.charAt(0),l=t[o]||{},c=n.newContainer(e,o),u={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,c,u),c._categories=c._categories||[],!t[o]&&"-"!==l.type&&(t[o]={type:l.type})}))}(t,e,i,o)}}}),zw=p({"src/traces/carpet/defaults.js"(t,e){var r=le(),n=Iw(),i=Pw(),a=Cw(),o=q();e.exports=function(t,e,s,l){function c(n,i){return r.coerce(t,e,a,n,i)}e._clipPathId="clip"+e.uid+"carpet";var u=c("color",o.defaultLine);r.coerceFont(c,"font",l.font),c("carpet"),i(t,e,l,c,u),e.a&&e.b?(e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0),n(t,e,c)||(e.visible=!1),e._cheater&&c("cheaterslope"),c("zorder")):e.visible=!1}}}),Dw=p({"src/traces/carpet/map_1d_array.js"(t,e){var r=le().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}}}),Ow=p({"src/traces/carpet/makepath.js"(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=p({"src/traces/carpet/orient_text.js"(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,c=1;if(a){var u=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])/u/h;c=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:c}}}}),Fw=p({"src/traces/carpet/plot.js"(t,e){var r=x(),n=Qe(),i=Dw(),a=Ow(),o=Rw(),s=Se(),l=le(),c=l.strRotate,u=l.strTranslate,h=Me();function f(t,e,o,s,l,c,u){var h="const-"+l+"-lines",f=o.selectAll("."+h).data(c);f.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),f.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,t.c2p),h=i([],c,e.c2p),f="M"+a(u,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",u(f.p[0],f.p[1])+c(f.angle)+u(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 c=t._context.staticPlot,u=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(u,h,_,0,"a",y._gridlines,!0),f(u,h,_,0,"b",v._gridlines,!0),f(u,h,x,0,"a",y._minorgridlines,!0),f(u,h,x,0,"b",v._minorgridlines,!0),f(u,h,b,0,"a-boundary",y._boundarylines,c),f(u,h,b,0,"b-boundary",v._boundarylines,c);var T=p(t,u,h,m,0,w,y._labels,"a-label"),A=p(t,u,h,m,0,w,v._labels,"b-label");(function(t,e,r,n,i,a,s,c){var u,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);u=.5*(d+m),h=y,f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,f,r.dxydb_rough(u,h))),g(t,e,r,0,f,p,r.aaxis,i,a,s,"a-title"),u=d,h=.5*(y+v),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,f,r.dxyda_rough(u,h))),g(t,e,r,0,f,p,r.baxis,i,a,c,"b-title")})(t,w,m,0,u,h,T,A),function(t,e,r,n,o){var s,c,u,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],c=i([],s.x,n.c2p),u=i([],s.y,o.c2p),m.push(a(c,u,s.bicubic));var g="M"+m.join("L")+"Z";f.attr("id",t._clipPathId),p.attr("d",g)}(m,s,d,u,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",u(e.p[0],e.p[1])+c(e.angle)+u(0,b)).attr("text-anchor","middle").call(n.font,f.title.font)})),_.exit().remove()}}}),Bw=p({"src/traces/carpet/cheater_basis.js"(t,e){var r=le().isArrayOrTypedArray;e.exports=function(t,e,n){var i,a,o,s,l,c=[],u=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])/(u-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(c[a]=[],l=p?(p[a]-p[0])*s:a/(h-1),i=0;i<u;i++)d=(f?(f[i]-f[0])*o:i/(u-1))-l*n,m=Math.min(d,m),g=Math.max(d,g),c[a][i]=d;var y=1/(g-m),v=-m*y;for(a=0;a<h;a++)for(i=0;i<u;i++)c[a][i]=y*c[a][i]+v;return c}}}),jw=p({"src/traces/carpet/array_minmax.js"(t,e){var r=le().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 c=n(l,e+1);c&&(i=Math.min(c[0],i),a=Math.max(c[1],a))}else i=Math.min(l,i),a=Math.max(l,a)}return[i,a]}e.exports=function(t){return n(t,0)}}}),Nw=p({"src/traces/carpet/calc_gridlines.js"(t,e){var r=ir(),n=R().extendFlat;e.exports=function(t,e,i){var a,o,s,l,c,u,h,f,p,d,m,g,y,v,x=t["_"+e],_=t[e+"axis"],b=_._gridlines=[],w=_._minorgridlines=[],T=_._boundarylines=[],A=t["_"+i],k=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,c,u,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++)c=Math.min(I-2,n),u=n-c,h=t.evalxy([],n,a),k.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),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=L,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a<L;a++)o=Math.min(L-2,a),s=a-o,h=t.evalxy([],n,a),k.smoothing&&a>0&&(m=t.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,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=k,x.value=r,x.constvar=i,x.index=f,x.x=y,x.y=v,x.smoothing=k.smoothing,x}function D(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=A.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++)c[n]=M[r*P][n],u[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++)c[n]=M[n][r*P],u[n]=S[n][r*P];return h.axisLetter=e,h.axis=_,h.crossAxis=k,h.value=x[r],h.constvar=i,h.index=r,h.x=c,h.y=u,h.smoothing=k.smoothing,h}if("array"===_.tickmode){for(l=5e-15,u=(c=[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=c[1]+1,f=u;f<h;f++)!((o=_.arraytick0+_.arraydtick*f)<0||o>x.length-1)&&b.push(n(D(o),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u;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(D(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(D(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(l=5e-15,u=(c=[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=c[1],f=u;f<=h;f++)p=_.tick0+_.dtick*f,b.push(n(z(p),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u-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=p({"src/traces/carpet/calc_labels.js"(t,e){var r=ir(),n=R().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=p({"src/traces/carpet/calc_clippath.js"(t,e){e.exports=function(t,e,r,n){var i,a,o,s=[],l=!!r.smoothing,c=!!n.smoothing,u=t[0].length-1,h=t.length-1;for(i=0,a=[],o=[];i<=u;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][u],o[i]=e[i][u];for(s.push({x:a,y:o,bicubic:c}),i=u,a=[],o=[];i>=0;i--)a[u-i]=t[h][i],o[u-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:c}),s}}}),qw=p({"src/traces/carpet/smooth_fill_2d_array.js"(t,e){var r=le();e.exports=function(t,e,n){var i,a,o,s,l,c,u,h,f=[],p=[],d=t[0].length,m=t.length,g=0;for(i=0;i<d;i++)for(a=0;a<m;a++)void 0===t[a][i]&&(f.push(i),p.push(a),t[a][i]=(l=a,c=void 0,u=void 0,h=void 0,u=0,h=0,(s=i)>0&&void 0!==(c=t[l][s-1])&&(h++,u+=c),s<d-1&&void 0!==(c=t[l][s+1])&&(h++,u+=c),l>0&&void 0!==(c=t[l-1][s])&&(h++,u+=c),l<m-1&&void 0!==(c=t[l+1][s])&&(h++,u+=c),u/Math.max(1,h))),g=Math.max(g,Math.abs(t[a][i]));if(!f.length)return t;var y,v,x,_,b,w,T,A,k,M,S,E=0,C=0,I=f.length;do{for(E=0,o=0;o<I;o++){i=f[o],a=p[o];var L,P,z,D,O,R,F=0,B=0;0===i?(z=e[O=Math.min(d-1,2)],D=e[1],L=t[a][O],B+=(P=t[a][1])+(P-L)*(e[0]-D)/(D-z),F++):i===d-1&&(z=e[O=Math.max(0,d-3)],D=e[d-2],L=t[a][O],B+=(P=t[a][d-2])+(P-L)*(e[d-1]-D)/(D-z),F++),(0===i||i===d-1)&&a>0&&a<m-1&&(y=n[a+1]-n[a],B+=((v=n[a]-n[a-1])*t[a+1][i]+y*t[a-1][i])/(v+y),F++),0===a?(z=n[R=Math.min(m-1,2)],D=n[1],L=t[R][i],B+=(P=t[1][i])+(P-L)*(n[0]-D)/(D-z),F++):a===m-1&&(z=n[R=Math.max(0,m-3)],D=n[m-2],L=t[R][i],B+=(P=t[m-2][i])+(P-L)*(n[m-1]-D)/(D-z),F++),(0===a||a===m-1)&&i>0&&i<d-1&&(y=e[i+1]-e[i],B+=((v=e[i]-e[i-1])*t[a][i+1]+y*t[a][i-1])/(v+y),F++),F?B/=F:(x=e[i+1]-e[i],_=e[i]-e[i-1],A=(b=n[a+1]-n[a])*(w=n[a]-n[a-1])*(b+w),B=((T=x*_*(x+_))*(w*t[a+1][i]+b*t[a-1][i])+A*(_*t[a][i+1]+x*t[a][i-1]))/(A*(_+x)+T*(w+b))),E+=(M=(k=B-t[a][i])/g)*M,S=F?0:.85,t[a][i]+=k*(1+S)}E=Math.sqrt(E)}while(C++<100&&E>1e-5);return r.log("Smoother converged to",E,"after",C,"iterations"),t}}}),Hw=p({"src/traces/carpet/constants.js"(t,e){e.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Gw=p({"src/traces/carpet/catmull_rom.js"(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),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=c*(l+c)*3,p=l*(l+c)*3;return[[e[0]+(f&&u/f),e[1]+(f&&h/f)],[e[0]-(p&&u/p),e[1]-(p&&h/p)]]}}}),Ww=p({"src/traces/carpet/compute_control_points.js"(t,e){var r=Gw(),n=le().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 c,u,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(u=0,f=0;u<_;u++,f+=l?3:1)for(p=t[f],d=e[f],m=a[u],g=o[u],c=0,h=0;c<x;c++,h+=s?3:1)p[h]=m[c],d[h]=g[c];if(s)for(u=0,f=0;u<_;u++,f+=l?3:1){for(c=1,h=3;c<x-1;c++,h+=3)y=r([a[u][c-1],o[u][c-1]],[a[u][c],o[u][c]],[a[u][c+1],o[u][c+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]}}}),Zw=p({"src/traces/carpet/create_spline_evaluator.js"(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,c,u,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,A=T*T,k=A*T;for(h=0;h<t.length;h++)i=_*(u=t[h])[p][f]+3*(x*d*u[p][f+1]+v*g*u[p][f+2])+y*u[p][f+3],s=_*u[p+1][f]+3*(x*d*u[p+1][f+1]+v*g*u[p+1][f+2])+y*u[p+1][f+3],l=_*u[p+2][f]+3*(x*d*u[p+2][f+1]+v*g*u[p+2][f+2])+y*u[p+2][f+3],c=_*u[p+3][f]+3*(x*d*u[p+3][f+1]+v*g*u[p+3][f+2])+y*u[p+3][f+3],e[h]=k*i+3*(A*m*s+T*b*l)+w*c;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,c,u,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(u=0;u<t.length;u++)i=b*(h=t[u])[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],c=b*h[p][f+3]+m*h[p+1][f+1],e[u]=_*i+3*(x*d*s+v*g*l)+y*c;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,c,u,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(u=0;u<t.length;u++)i=b*(h=t[u])[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],c=b*h[p+3][f]+d*h[p+3][f+1],e[u]=_*i+3*(x*m*s+v*g*l)+y*c;return e}:function(e,r,n){e||(e=[]);var i,s,l,c,u=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-u)),p=Math.max(0,Math.min(1,n-h)),d=1-p,m=1-f;for(l=0;l<t.length;l++)i=m*(c=t[l])[h][u]+f*c[h][u+1],s=m*c[h+1][u]+f*c[h+1][u+1],e[l]=d*i+p*s;return e}}}}),Yw=p({"src/traces/carpet/create_i_derivative_evaluator.js"(t,e){e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,c,u,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,A=T*w;for(h=0;h<t.length;h++)o=g*(u=t[h])[n][r]+y*u[n][r+1]+v*u[n][r+2]+x*u[n][r+3],s=g*u[n+1][r]+y*u[n+1][r+1]+v*u[n+1][r+2]+x*u[n+1][r+3],l=g*u[n+2][r]+y*u[n+2][r+1]+v*u[n+2][r+2]+x*u[n+2][r+3],c=g*u[n+3][r]+y*u[n+3][r+1]+v*u[n+3][r+2]+x*u[n+3][r+3],e[h]=A*o+3*(T*a*s+w*_*l)+b*c;return e}:e?function(e,r,n,i,a){var o,s,l,c;e||(e=[]),r*=3;var u=i*i,h=1-i,f=h*h,p=h*i*2,d=-3*f,m=3*(f-p),g=3*(p-u),y=3*u,v=1-a;for(l=0;l<t.length;l++)o=d*(c=t[l])[n][r]+m*c[n][r+1]+g*c[n][r+2]+y*c[n][r+3],s=d*c[n+1][r]+m*c[n+1][r+1]+g*c[n+1][r+2]+y*c[n+1][r+3],e[l]=v*o+a*s;return e}:r?function(e,r,n,i,a){var o,s,l,c,u,h;e||(e=[]),n*=3;var f=a*a,p=f*a,d=1-a,m=d*d,g=m*d;for(u=0;u<t.length;u++)o=(h=t[u])[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],c=h[n+3][r+1]-h[n+3][r],e[u]=g*o+3*(m*a*s+d*f*l)+p*c;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,c,u=1-a;for(l=0;l<t.length;l++)o=(c=t[l])[n][r+1]-c[n][r],s=c[n+1][r+1]-c[n+1][r],e[l]=u*o+a*s;return e}}}}),Xw=p({"src/traces/carpet/create_j_derivative_evaluator.js"(t,e){e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,c,u,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),A=3*y;for(h=0;h<t.length;h++)o=b*(u=t[h])[n][r]+w*u[n+1][r]+T*u[n+2][r]+A*u[n+3][r],s=b*u[n][r+1]+w*u[n+1][r+1]+T*u[n+2][r+1]+A*u[n+3][r+1],l=b*u[n][r+2]+w*u[n+1][r+2]+T*u[n+2][r+2]+A*u[n+3][r+2],c=b*u[n][r+3]+w*u[n+1][r+3]+T*u[n+2][r+3]+A*u[n+3][r+3],e[h]=g*o+3*(m*i*s+d*f*l)+p*c;return e}:e?function(e,r,n,i,a){var o,s,l,c,u,h;e||(e=[]),r*=3;var f=a*a,p=f*a,d=1-a,m=d*d,g=m*d;for(u=0;u<t.length;u++)o=(h=t[u])[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],c=h[n+1][r+3]-h[n][r+3],e[u]=g*o+3*(m*a*s+d*f*l)+p*c;return e}:r?function(e,r,n,i,a){var o,s,l,c;e||(e=[]),n*=3;var u=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*(c=t[l])[n][r]+g*c[n+1][r]+y*c[n+2][r]+v*c[n+3][r],s=m*c[n][r+1]+g*c[n+1][r+1]+y*c[n+2][r+1]+v*c[n+3][r+1],e[l]=u*o+i*s;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,c,u=1-i;for(l=0;l<t.length;l++)o=(c=t[l])[n+1][r]-c[n][r],s=c[n+1][r+1]-c[n][r+1],e[l]=u*o+i*s;return e}}}}),$w=p({"src/traces/carpet/set_convert.js"(t,e){var r=Hw(),n=Wt().findBin,i=Ww(),a=Zw(),o=Yw(),s=Xw();e.exports=function(t){var e=t._a,l=t._b,c=e.length,u=l.length,h=t.aaxis,f=t.baxis,p=e[0],d=e[c-1],m=l[0],g=l[u-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],c,u,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]),c-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]),c-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),c-2)),i=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-i)/(a-i)))},t.b2j=function(t){var e=Math.max(0,Math.min(n(t,l),u-2)),r=l[e],i=l[e+1];return Math.max(0,Math.min(u-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[c-1]|n<l[0]||n>l[u-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[c-1]?(h=c-2,f=1,m=(r-e[c-1])/(e[c-1]-e[c-2])):f=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),n<l[0]?(p=0,d=0,g=(n-l[0])/(l[1]-l[0])):n>l[u-1]?(p=u-2,d=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):d=o-(p=Math.max(0,Math.min(u-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}}}}),Kw=p({"src/traces/carpet/calc.js"(t,e){var r=ir(),n=le().isArray1D,i=Bw(),a=jw(),o=Nw(),s=Uw(),l=Vw(),c=zo(),u=qw(),h=Po(),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:_,A="index"===g.cheatertype?b.length:b;y=i(T,A,e.cheaterslope)}e._x=y=c(y),e._y=v=c(v),u(y,_,b),u(v,_,b),f(e),e.setScale();var k=a(y),M=a(v),S=.5*(k[1]-k[0]),E=.5*(k[1]+k[0]),C=.5*(M[1]-M[0]),I=.5*(M[1]+M[0]),L=1.3;return k=[E-S*L,E+S*L],M=[I-C*L,I+C*L],e._extremes[p._id]=r.findExtremes(p,k,{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]}}}),Jw=p({"src/traces/carpet/index.js"(t,e){e.exports={attributes:Cw(),supplyDefaults:zw(),plot:Fw(),calc:Kw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Si(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),Qw=p({"lib/carpet.js"(t,e){e.exports=Jw()}}),tT=p({"src/traces/scattercarpet/attributes.js"(t,e){var r=wn(),n=Tn(),i=U(),a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=Pe(),l=R().extendFlat,c=n.marker,u=n.line,h=c.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:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.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=p({"src/traces/scattercarpet/defaults.js"(t,e){var r=le(),n=bn(),i=Ye(),a=Zn(),o=Yn(),s=Xn(),l=$n(),c=Kn(),u=tT();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,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&&(c(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=p({"src/traces/scattercarpet/format_labels.js"(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,c=n.evalxy([],a,s,o,l);return r.yLabel=c[1].toFixed(3),r}}}),nT=p({"src/traces/carpet/lookup_carpetid.js"(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=p({"src/traces/scattercarpet/calc.js"(t,e){var r=A(),n=ni(),i=ii(),a=ai(),o=oi().calcMarkerSize,s=nT();e.exports=function(t,e){var l=e._carpetTrace=s(t,e);if(l&&l.visible&&"legendonly"!==l.visible){var c;e.xaxis=l.xaxis,e.yaxis=l.yaxis;var u,h,f=e._length,p=new Array(f),d=!1;for(c=0;c<f;c++)if(u=e.a[c],h=e.b[c],r(u)&&r(h)){var m=l.ab2xy(+u,+h,!0),g=l.isVisible(+u,+h);g||(d=!0),p[c]={x:m[0],y:m[1],a:u,b:h,vis:g}}else p[c]={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=p({"src/traces/scattercarpet/plot.js"(t,e){var r=fi(),n=ir(),i=Qe();e.exports=function(t,e,a,o){var s,l,c,u=a[0][0].carpet,h=n.getFromId(t,u.xaxis||"x"),f=n.getFromId(t,u.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,c=o.selectAll("g.trace"+l.uid+" .js-line"),i.setClipUrl(c,a[s][0].carpet._clipPathId,t)}}}),oT=p({"src/traces/scattercarpet/hover.js"(t,e){var r=yi(),n=le().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,c=t.xa._length,u=c*l/2,h=c-u;return s.x0=Math.max(Math.min(s.x0,h),u),s.x1=Math.max(Math.min(s.x1,h),u),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=p({"src/traces/scattercarpet/event_data.js"(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=p({"src/traces/scattercarpet/index.js"(t,e){e.exports={attributes:tT(),supplyDefaults:eT(),colorbar:pi(),formatLabels:rT(),calc:iT(),plot:aT(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:oT(),selectPoints:vi(),eventData:sT(),moduleType:"trace",name:"scattercarpet",basePlotModule:Si(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),cT=p({"lib/scattercarpet.js"(t,e){e.exports=lT()}}),uT=p({"src/traces/contourcarpet/attributes.js"(t,e){var r=bo(),n=ls(),i=Pe(),a=R().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=p({"src/traces/contourcarpet/defaults.js"(t,e){var r=le(),n=wo(),i=uT(),a=Ls(),o=us(),s=fs();e.exports=function(t,e,l,c){function u(n,a){return r.coerce(t,e,i,n,a)}if(u("carpet"),t.a&&t.b){if(!n(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?a(t,e,u,c,l,{hasHover:!1}):(o(t,e,u,(function(n){return r.coerce2(t,e,i,n)})),s(t,e,u,c,{hasHover:!1}))}else e._defaultColor=l,e._length=null;u("zorder")}}}),fT=p({"src/traces/contourcarpet/calc.js"(t,e){var r=We(),n=le(),i=Po(),a=zo(),o=Do(),s=Oo(),l=Ro(),c=hT(),u=nT(),h=ds();e.exports=function(t,e){var f=e._carpetTrace=u(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),c(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var c,u,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"]),c=e._a=e._a||e.a,f=e._b=e._b||e.b,c=c?y.makeCalcdata(e,"_a"):[],f=f?v.makeCalcdata(e,"_b"):[],u=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?"":c,b=l(e,_,u,h,x,y),w="scaled"===e.ytype?"":f,T={a:b,b:l(e,w,p,d,m.length,v),z:m};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&r(t,e,{vals:m,containerStr:"",cLetter:"z"}),[T]}(t,e);return h(e,e._z),m}}}}),pT=p({"src/traces/carpet/axis_aligned_line.js"(t,e){var r=le().isArrayOrTypedArray;e.exports=function(t,e,n,i){var a,o,s,l,c,u,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,A="a"===v?e.b.length:e.a.length,k=Math.floor("a"===v?t.b2j(w):t.a2i(w)),M="a"===v?function(e){return t.evalxy([],e,k)}:function(e){return t.evalxy([],k,e)};x&&(s=Math.max(0,Math.min(A-2,k)),l=k-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,D=C>0?Math.max:Math.min,O=L(S+I),R=P(E-I),F=[[h=M(S)]];for(a=O;a*C<R*C;a+=C)c=[],m=D(S,a),y=(g=z(E,a+C))-m,u=Math.max(0,Math.min(T-2,Math.floor(.5*(m+g)))),f=M(g),x&&(p=o(u,m-u),d=o(u,g-u),c.push([h[0]+p[0]/3*y,h[1]+p[1]/3*y]),c.push([f[0]-d[0]/3*y,f[1]-d[1]/3*y])),c.push(f),F.push(c),h=f;return F}}}),dT=p({"src/traces/contourcarpet/plot.js"(t,e){var r=x(),n=Dw(),i=Ow(),a=Qe(),o=le(),s=vs(),l=xs(),c=As(),u=ys(),h=ws(),f=bs(),p=Ts(),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 v(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,x,_){var b=e.xaxis,w=e.yaxis;o.makeTraceGroups(_,x,"contour").each((function(x){var _=r.select(this),T=x[0],A=T.trace,k=A._carpetTrace=d(t,A),M=t.calcdata[k.index][0];if(k.visible&&"legendonly"!==k.visible){var S=T.a,E=T.b,C=A.contours,I=f(C,e,T),L="constraint"===C.type,P=C._operation,z=L?"="===P?"lines":"fill":C.coloring,D=[[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 O=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);l(I,O,R);var F=I;"constraint"===C.type&&(F=h(I,P)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r<t.length;r++){for(o=(a=t[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(u=a.edgepaths[n],l=[],i=0;i<u.length;i++)l[i]=e(u[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(u=a.paths[n],c=[],i=0;i<u.length;i++)c[i]=e(u[i]);s.push(c)}}}(I,H);var B,j,N,U,V=[];for(U=M.clipsegments.length-1;U>=0;U--)B=M.clipsegments[U],j=n([],B.x,b.c2p),N=n([],B.y,w.c2p),j.reverse(),N.reverse(),V.push(i(j,N,B.bicubic));var q="M"+V.join("L")+"Z";(function(t,e,r,a,s,l){var c,u,h,f,p=o.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;f<e.length;f++)c=e[f],u=n([],c.x,r.c2p),h=n([],c.y,a.c2p),d.push(i(u,h,c.bicubic));p.attr("d","M"+d.join("L")+"Z").style("stroke","none")})(_,M.clipsegments,b,w,L,z),function(t,e,n,i,s,l,c,u,h,f,d){var g="fill"===f;g&&p(s,t.contours);var y=o.ensureSingle(e,"g","contourfill").selectAll("path").data(g?s:[]);y.enter().append("path"),y.exit().remove(),y.each((function(t){var e=(t.prefixBoundary?d:"")+function(t,e,r,n,i,s,l,c){var u,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 A(t){return Math.abs(t[1]-r[2][1])<w}function k(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,u="";for(T(t)&&!M(t)||A(t)&&!k(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(u+=o.smoothing?"C":"L",n=0;n<a[r].length;n++){var h=a[r][n];u+=[l.c2p(h[0]),c.c2p(h[1])]+" "}return u}for(u=0,h=null;x.length;){var E=e.edgepaths[u][0];for(h&&(v+=S(h,E)),y=a.smoothopen(e.edgepaths[u].map(n),e.smoothing),v+=_?y:y.replace(/^M/,"L"),x.splice(x.indexOf(u),1),h=e.edgepaths[u][e.edgepaths[u].length-1],d=-1,p=0;p<4;p++){if(!h){o.log("Missing end?",u,e);break}for(T(h)&&!M(h)?f=r[1]:k(h)?f=r[0]:A(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}u=d,(_=-1===x.indexOf(u))&&(u=x[0],v+=S(h,f)+"Z",h=null)}for(u=0;u<e.paths.length;u++)v+=a.smoothclosed(e.paths[u].map(n),e.smoothing);return v}(0,t,l,c,u,h,n,i);e?r.select(this).attr("d",e).style("stroke","none"):r.select(this).remove()}))}(A,_,b,w,F,D,H,k,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,x=d&&m,_=c.createLines(p,d||m,e,f),b=c.createLineClip(p,x,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,A=l.yaxis,k=T._length,M=A._length,S=[[[0,0],[k,0],[k,M],[0,M]]],E=[];o.clearLocationCache();var C=c.labelFormatter(n,i),I=a.tester.append("text").attr("data-notex",1).call(a.font,s.labelfont),L={left:0,right:k,center:k/2,top:0,bottom:M,middle:M/2},P=Math.sqrt(k*k+M*M),z=u.LABELDISTANCE*P/Math.max(1,e.length/u.LABELINCREASE);_.each((function(t){var e=c.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],c=i.a[i.a.length-1],u=i.b[0],h=i.b[i.b.length-1],f=g(t,0,1),p=g(t,n.total,n.total-1),d=x(o[0],f),m=n.total-x(o[o.length-1],p);n.min<d&&(n.min=d),n.max>m&&(n.max=m),n.len=n.max-n.min}function x(t,e){var r,n=0,o=.1;return(Math.abs(t[0]-l)<o||Math.abs(t[0]-c)<o)&&(r=y(i.dxydb_rough(t[0],t[1],o)),n=Math.max(n,a*v(e,r)/2)),(Math.abs(t[1]-u)<o||Math.abs(t[1]-h)<o)&&(r=y(i.dxyda_rough(t[0],t[1],o)),n=Math.max(n,a*v(e,r)/2)),n}}(n,r,t,i,h,e.height),!(i.len<(e.width+e.height)*u.LABELMIN)))for(var a=Math.min(Math.ceil(i.len/z),u.LABELMAX),s=0;s<a;s++){var l=c.findBestTextLocation(n,i,e,E,L);if(!l)break;c.addLabelData(l,e,E,S)}}))})),I.remove(),c.drawLabels(w,E,n,b,x?S:null)}m&&!d&&_.remove()}(_,I,t,T,C,e,k),a.setClipUrl(_,k._clipPathId,t)}function H(t){var e=k.ab2xy(t[0],t[1],!0);return[b.c2p(e[0]),w.c2p(e[1])]}}))}}}),mT=p({"src/traces/contourcarpet/index.js"(t,e){e.exports={attributes:uT(),supplyDefaults:hT(),colorbar:Ss(),calc:fT(),plot:dT(),style:Ms(),moduleType:"trace",name:"contourcarpet",basePlotModule:Si(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}}),gT=p({"lib/contourcarpet.js"(t,e){e.exports=mT()}}),yT=p({"src/traces/ohlc/attributes.js"(t,e){var r=le().extendFlat,n=Tn(),i=Ce().axisHoverFormat,a=zt().dash,o=N(),s=kl(),l=s.INCREASING.COLOR,c=s.DECREASING.COLOR,u=n.line;function h(t){return{line:{color:r({},u.color,{dflt:t}),width:u.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({},u.width,{}),dash:r({},a,{}),editType:"style"},increasing:h(l),decreasing:h(c),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=p({"src/traces/ohlc/ohlc_defaults.js"(t,e){var r=qt(),n=le();e.exports=function(t,e,i,a){var o=i("x"),s=i("open"),l=i("high"),c=i("low"),u=i("close");if(i("hoverlabel.split"),r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var h=Math.min(s.length,l.length,c.length,u.length);return o&&(h=Math.min(h,n.minRowLength(o))),e._length=h,h}}}}),xT=p({"src/traces/ohlc/defaults.js"(t,e){var r=le(),n=vT(),i=Gn(),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 c(n,i){return r.coerce(t,e,a,n,i)}n(t,e,c,l)?(i(t,e,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),c("line.dash"),o(0,e,c,"increasing"),o(0,e,c,"decreasing"),c("text"),c("hovertext"),c("tickwidth"),l._requestRangeslider[e.xaxis]=!0,c("zorder")):e.visible=!1}}}),_T=p({"src/traces/ohlc/calc.js"(t,e){var r=le(),n=r._,i=ir(),a=ri(),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,c){for(var u=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=u[_],T=h[_],A=f[_],k=p[_];if(b!==o&&w!==o&&T!==o&&A!==o&&k!==o){k===w?null!==y&&k!==y&&(g=k>y):g=k>w,y=k;var M=c(w,T,A,k);M.pos=b,M.yc=(w+k)/2,M.i=_,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[A,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),c=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 c=s[o];if("ohlc"===c.type&&!0===c.visible&&c.xaxis===e._id){l.push(c);var u=e.makeCalcdata(c,"x");c._origX=u;var h=a(n,e,"x",u).vals;c._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),u=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:u/2}),p.length?(r.extendFlat(p[0].t,{wHover:u/2,tickLen:c}),p):[{t:{empty:!0}}]},calcCommon:l}}}),bT=p({"src/traces/ohlc/plot.js"(t,e){var r=x(),n=le();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 c=a.tickLen,u=e.selectAll("path").data(n.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!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=p({"src/traces/ohlc/style.js"(t,e){var r=x(),n=Qe(),i=H();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=p({"src/traces/ohlc/hover.js"(t,e){var r=ir(),n=le(),i=Dr(),a=H(),o=le().fillText,s=kl(),l={increasing:s.INCREASING.SYMBOL,decreasing:s.DECREASING.SYMBOL};function c(t,e,r,n){var o,s,l=t.cd,c=t.xa,u=l[0].trace,h=l[0].t,f=u.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(c.r2c(c.range[1])-c.r2c(c.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 A=u[T.dir],k=A.line.color;return a.opacity(k)&&A.line.width?t.color=k:t.color=A.fillcolor,t.x0=c.c2p(T.pos+m-g,!0),t.x1=c.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=c.c2p(T.pos,!0),t}function u(t,e,i,a){var o=t.cd,s=t.ya,l=o[0].trace,u=o[0].t,h=[],f=c(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>"+u.labels[x]+r.hoverLabelText(s,_,l.yhoverformat):((v=n.extendFlat({},f)).y0=v.y1=b,v.yLabelVal=_,v.yLabel=u.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,u=a[0].trace,h=a[0].t,f=c(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,u[t][d],u.yhoverformat)}var y=p.hi||u.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,u,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?u(t,e,r,n):h(t,e,r,n)},hoverSplit:u,hoverOnPoints:h}}}),AT=p({"src/traces/ohlc/select.js"(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}}}),kT=p({"src/traces/ohlc/index.js"(t,e){e.exports={moduleType:"trace",name:"ohlc",basePlotModule:Si(),categories:["cartesian","svg","showLegend"],meta:{},attributes:yT(),supplyDefaults:xT(),calc:_T().calc,plot:bT(),style:wT(),hoverPoints:TT().hoverPoints,selectPoints:AT()}}}),MT=p({"lib/ohlc.js"(t,e){e.exports=kT()}}),ST=p({"src/traces/candlestick/attributes.js"(t,e){var r=le().extendFlat,n=Ce().axisHoverFormat,i=yT(),a=so();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=p({"src/traces/candlestick/defaults.js"(t,e){var r=le(),n=H(),i=vT(),a=Gn(),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 c(n,i){return r.coerce(t,e,o,n,i)}i(t,e,c,l)?(a(t,e,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(0,e,c,"increasing"),s(0,e,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),l._requestRangeslider[e.xaxis]=!0,c("zorder")):e.visible=!1}}}),CT=p({"src/traces/candlestick/calc.js"(t,e){var r=le(),n=ir(),i=ri(),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),c=n.getFromId(t,e.yaxis),u=l.makeCalcdata(e,"x"),h=i(e,l,"x",u).vals,f=a(t,e,u,h,c,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=p({"src/traces/candlestick/index.js"(t,e){e.exports={moduleType:"trace",name:"candlestick",basePlotModule:Si(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:ST(),layoutAttributes:lo(),supplyLayoutDefaults:uo().supplyLayoutDefaults,crossTraceCalc:fo().crossTraceCalc,supplyDefaults:ET(),calc:CT(),plot:po().plot,layerName:"boxlayer",style:mo().style,hoverPoints:TT().hoverPoints,selectPoints:AT()}}}),LT=p({"lib/candlestick.js"(t,e){e.exports=IT()}}),PT=p({"src/plots/polar/set_convert.js"(t,e){var r=le(),n=er(),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",c="d"+r,u=l in e?s(e[l]):0,h=e[c]?s(e[c]):(t.period||2*Math.PI)/o;for(n=new Array(o),i=0;i<o;i++)n[i]=u+i*h}return n},t.setGeometry=function(){var o,s,l,c,u=e.sector,h=u.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,c=i,l=a,t.range=r.isFullCircle(h)?[u[0],u[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=c=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(c(t))},t.g2t=function(t){return l(m(t))}}}(t,e)}}}}),zT=p({"src/plots/polar/constants.js"(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}}}),DT=p({"src/plots/polar/helpers.js"(t,e){var r=le(),n=mn().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=u(Math.sin(e)-Math.sin(t)),c=u(Math.cos(e)-Math.cos(t)),h=Math.tan(r),f=u(1/h),p=l/c,d=s-p*o;return f?l&&c?a=h*(i=d/(h-p)):c?(i=s*f,a=s):(i=o,a=o*h):l&&c?(i=0,a=d):c?(i=0,a=s):i=a=NaN,[i,a]}function c(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 c,u,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),c=y,u=0;u<h;c++,u++){var x=o[m(c)];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 u(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 u=n(c(s,i[0],i[1],o)),h=n(c(l,i[0],i[1],o)),f=[t*Math.cos(e),t*Math.sin(e)];return h.contains(f)&&!u.contains(f)},findPolygonOffset:function(t,e,r,n){for(var i=1/0,a=1/0,o=c(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),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:u,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(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 u=h(c(s,r,n,i),a,o);return"M"+h(c(l,r,n,i),a,o).reverse().join("L")+"M"+u.join("L")}}}}),OT=p({"src/plots/smith/helpers.js"(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],c=s[1],u=i(t,n([o,e])),h=u[0],f=u[1];if(0===e)return["M"+l+","+c,"L"+h+","+f].join(" ");var p=a(t,1/Math.abs(e));return["M"+l+","+c,"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)),c=i(t,n([e,o])),u=c[0],h=c[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"+u+","+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"+u+","+h,"A"+l+","+l+" 0 0,"+(s<o?0:1)+" "+p+","+d].join(" ")},smithTransform:i}}}),RT=p({"src/plots/polar/polar.js"(t,e){var r=x(),n=O(),i=qt(),a=le(),o=a.strRotate,s=a.strTranslate,l=H(),c=Qe(),u=Ae(),h=ir(),f=er(),p=PT(),d=nr().doAutoRange,m=Cn(),g=fr(),y=Dr(),v=tr(),_=En().prepSelect,b=En().selectOnClick,w=En().clearOutline,T=pr(),A=Rr(),k=nn().redrawReglTraces,M=Me().MID_SHIFT,S=zT(),E=DT(),C=OT(),I=C.smith,L=C.reactanceArc,P=C.resistanceArc,z=C.smithTransform,D=a._,R=a.mod,F=a.deg2rad,B=a.rad2deg;function j(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 N=j.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 q(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 j(t,e,r)},N.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),u.generalUpdatePerTraceModule(r.gd,r,t,n),r.updateFx(e,n),r.isSmith&&(delete n.realaxis.range,delete n.imaginaryaxis.range)},N.updateLayers=function(t,e){var n=this,i=n.isSmith,a=n.layers,o=n.getRadial(e),s=n.getAngular(e),l=S.layerNames,c=l.indexOf("frontplot"),u=l.slice(0,c),h="below traces"===s.layer,f="below traces"===o.layer;h&&u.push("angular-line"),f&&u.push("radial-line"),h&&u.push("angular-axis"),f&&u.push("radial-axis"),u.push("frontplot"),h||u.push("angular-line"),f||u.push("radial-line"),h||u.push("angular-axis"),f||u.push("radial-axis");var p=(i?"smith":"polar")+"sublayer",d=n.framework.selectAll("."+p).data(u,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()},N.updateLayout=function(t,e){var r=this,n=r.layers,i=t._size,a=r.getRadial(e),o=r.getAngular(e),u=e.domain.x,h=e.domain.y;r.xOffset=i.l+i.w*u[0],r.yOffset=i.t+i.h*(1-h[1]);var f=r.xLength=i.w*(u[1]-u[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=t[0],n=t[1]-r,i=R(r,360),a=i+n,o=Math.cos(F(i)),s=Math.sin(F(i)),l=Math.cos(F(a)),c=Math.sin(F(a));return e=i<=90&&a>=90||i>90&&a>=450?1:s<=0&&c<=0?0:Math.max(s,c),[i<=180&&a>=180||i>180&&a>=540?-1:o>=0&&l>=0?0:Math.min(o,l),i<=270&&a>=270||i>270&&a>=630?-1:s>=0&&c>=0?0:Math.min(s,c),a>=360?1:o<=0&&l<=0?0:Math.max(o,l),e]}(d),b=_[2]-_[0],w=_[3]-_[1],T=p/f,A=Math.abs(w/b);T>A?(m=f,x=(p-(g=f*A))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=p,x=(f-(m=p/A))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var k,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,D=a.side;"counterclockwise"===D?(k=D,D="top"):"clockwise"===D&&(k=D,D="bottom"),r.radialAxis=r.mockAxis(t,e,a,{_id:"x",side:D,_trueSide:k,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 O=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",O).attr("transform",s(P,z)),n.frontplot.attr("transform",s(M,S)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",O).attr("transform",s(I,L)).call(l.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=a.extendFlat({},r,n);return p(i,e,t),i},N.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},N.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)}},N.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getRadial(e),m=R(r.getSector(e)[0],360),g=r.radialAxis,y=u<c,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)+u,0)},_=v?function(t){return P(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},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),A=v?T:h.clipEnds(g,T),k=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(k=-k),"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,k),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:A,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);q(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:E}),q(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),q(i["radial-line"].select("line"),y&&d.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.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),u=n.id+"title",h=0;if(l.title){var f=c.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),x=Math.sin(g),_=o+a/2*y+h*x,b=s-a/2*x+h*y;n.layers["radial-axis-title"]=v.draw(i,u,{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}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,c=r.radius,u=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+c*Math.cos(t),p-c*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+u*r,p-u*n]+"L"+[f+c*r,p-c*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}},A=U(d);r.angularTickLayout!==A&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=A);var k,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?(k=S.map(y),a.angleDelta(k[0],k[1])<0&&(k=k.slice().reverse())):k=null,r.vangles=k,"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})}q(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:s(f,p)}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.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))},N.updateHoverAndMainDrag=function(t){var e,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,f=t._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,v=l.radius,x=l.innerRadius,T=l.cx,A=l.cy,k=l.cxx,M=l.cyy,C=l.sectorInRad,I=l.vangles,L=l.radialAxis,P=E.clampTiny,z=E.findXYatLength,D=E.findEnclosingVertexAngles,O=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,A)),F.onmousemove=function(t){y.hover(u,t,l.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=l.id},F.onmouseout=function(t){u._dragging||g.unhover(u,t)};var B,j,N,U,V,q,H,G,W,Z={element:F,gd:u,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-k,e-M)}function $(t,e){return Math.atan2(M-e,t-k)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function J(t,e){if(0===t)return l.pathSector(2*O);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,v)),o=a-O,s=a+O;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(s,i)+"A"+[s,s]+" 0,0,1 "+K(s,n)+"Z"}function Q(t,e,r){if(0===t)return l.pathSector(2*O);var n,i,a=K(t,e),o=K(t,r),s=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,f=z(O,u,s,c);n=z(R,h,f[0][0],f[0][1]),i=z(R,h,f[1][0],f[1][1])}else{var p,d;c?(p=R,d=O):(p=O,d=R),n=[[s-p,c-d],[s+p,c-d]],i=[[s-p,c+d],[s+p,c+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?(N=t,U=e):(N=e,U=t),!0):(N=null,U=null,!1)}function et(t,e){t=t||V,e=e||"M0,0Z",G.attr("d",t),W.attr("d",e),m.transitionZoombox(G,W,q,H),q=!0;var r={};ot(r),u.emit("plotly_relayouting",r)}function rt(t,r){var n,i,a=B+(t*=e),s=j+(r*=o),c=X(B,j),u=Math.min(X(a,s),v),h=$(B,j);tt(c,u)&&(n=V+l.pathSector(U),N&&(n+=l.pathSector(N)),i=J(N,h)+J(U,h)),et(n,i)}function nt(t,e,r,n){var i=E.findIntersectionXY(r,n,r,[t-k,M-e]);return Y(i[0],i[1])}function it(t,e){var r,n,i=B+t,a=j+e,o=$(B,j),s=$(i,a),c=D(o,I),u=D(s,I);tt(nt(B,j,c[0],c[1]),Math.min(nt(i,a,u[0],u[1]),v))&&(r=V+l.pathSector(U),N&&(r+=l.pathSector(N)),n=[Q(N,c[0],c[1]),Q(U,c[0],c[1])].join(" ")),et(r,n)}function at(){if(m.removeZoombox(u),null!==N&&null!==U){var t={};ot(t),m.showDoubleClickNotifier(u),i.call("_guiRelayout",u,t)}}function ot(t){var e=L._rl,r=(e[1]-e[0])/(1-x/v)/v,n=[e[0]+(N-x)*r,e[0]+(U-x)*r];t[l.id+".radialaxis.range"]=n}function st(t,e){var r=u._fullLayout.clickmode;if(m.removeZoombox(u),2===t){var n={};for(var a in l.viewInitial)n[l.id+"."+a]=l.viewInitial[a];u.emit("plotly_doubleclick",null),i.call("_guiRelayout",u,n)}r.indexOf("select")>-1&&1===t&&b(e,u,[l.xaxis],[l.yaxis],l.id,Z),r.indexOf("event")>-1&&y.click(u,e,l.id)}Z.prepFn=function(t,r,i){var s=u._fullLayout.dragmode,h=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var p=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var d=a.apply3DTransform(p)(r-h.left,i-h.top);if(B=d[0],j=d[1],I){var g=E.findPolygonOffset(v,C[0],C[1],I);B+=k+g[0],j+=M+g[1]}switch(s){case"zoom":Z.clickFn=st,c||(Z.moveFn=I?it:rt,Z.doneFn=at,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var t=u._fullLayout[l.id];H=n(t.bgcolor).getLuminance(),(G=m.makeZoombox(f,H,T,A,V)).attr("fill-rule","evenodd"),W=m.makeCorners(f,T,A),w(u)}());break;case"select":case"lasso":_(t,r,i,Z,s)}},g.init(Z)},N.updateRadialDrag=function(t,e,n){var l=this,c=l.gd,u=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,D,O,R=m.makeRectDragger(u,T,"crosshair",-x,-x,v,v),j={element:R,gd:c};!1===t.dragmode&&(j.dragmode=!1),q(r.select(R),y.visible&&f<h,{transform:s(_,b)}),j.prepFn=function(){z=null,D=null,O=null,j.moveFn=N,j.doneFn=U,w(c)},j.clampFn=function(t,e){return Math.sqrt(t*t+e*e)<S.MINDRAG&&(t=0,e=0),[t,e]},g.init(j)}function N(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?H:G)}var s={};(function(t){null!==D?t[l.id+".radialaxis.angle"]=D:null!==O&&(t[l.id+".radialaxis.range["+n+"]"]=O)})(s),c.emit("plotly_relayouting",s)}function U(){null!==D?i.call("_guiRelayout",c,l.id+".radialaxis.angle",D):null!==O&&i.call("_guiRelayout",c,l.id+".radialaxis.range["+n+"]",O)}function H(t,e){if(0!==n){var r=_+t,i=b+e;D=Math.atan2(d-i,r-p),l.vangles&&(D=V(D,l.vangles)),D=B(D);var a=s(p,d)+o(-D);u["radial-axis"].attr("transform",a),u["radial-line"].select("line").attr("transform",a);var c=l.gd._fullLayout,h=c[l.id];l.updateRadialAxisTitle(c,h,D)}}function G(t,e){var r=a.dot([t,-e],[Math.cos(M),Math.sin(M)]);if(O=L-P*r,P>0==(n?O>C:O<I)){var o=c._fullLayout,s=o[l.id];y.range[n]=O,y._rl[n]=O,l.updateRadialAxis(o,s),l.xaxis.setRange(),l.xaxis.setScale(),l.yaxis.setRange(),l.yaxis.setScale();var u=!1;for(var h in l.traceHash){var f=l.traceHash[h],p=a.filterVisible(f);f[0][0].trace._module.plot(c,l,p,s),i.traceIs(h,"gl")&&p.length&&(u=!0)}u&&(A(c),k(c))}else O=null}},N.updateAngularDrag=function(t){var e=this,n=e.gd,l=e.layers,u=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(u,u+v)).attr("transform",s(f,p)).call(T,"move");var M,E,C,I,L,P,z=l.frontplot.select(".scatterlayer").selectAll(".trace"),D=z.selectAll(".point"),O=z.selectAll(".textpoint");function R(u,m){var g=e.gd._fullLayout,v=g[e.id],x=b(M+u*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(_));D.each((function(){var t=r.select(this),e=c.getTranslate(t);t.attr("transform",s(e.x,e.y)+o([_]))})),O.each((function(){var t=r.select(this),e=t.select("text"),n=c.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(c.hideOutsideRangePoints,e);var S=!1;for(var R in e.traceHash)if(i.traceIs(R,"gl")){var j=e.traceHash[R],N=a.filterVisible(j);j[0][0].trace._module.plot(n,e,N,v),N.length&&(S=!0)}S&&(A(n),k(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 j(){O.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 c=a.apply3DTransform(t._invTransform)(M,E);M=c[0],E=c[1],P=b(M,E),_.moveFn=R,_.doneFn=j,w(n)},e.vangles&&!a.isFullCircle(e.sectorInRad)&&(_.prepFn=a.noop,T(r.select(x),null)),g.init(_)},N.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)},N.pathArc=function(t){var e=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathArc)(t,e[0],e[1],r)},N.pathSector=function(t){var e=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathSector)(t,e[0],e[1],r)},N.pathAnnulus=function(t,e){var r=this.sectorInRad,n=this.vangles;return(n?E.pathPolygonAnnulus:a.pathAnnulus)(t,e,r[0],r[1],n)},N.pathSubplot=function(){var t=this.innerRadius,e=this.radius;return t?this.pathAnnulus(t,e):this.pathSector(e)},N.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}}}),FT=p({"src/plots/polar/layout_attributes.js"(t,e){var r=q(),n=Ie(),i=Aa().attributes,a=le().extendFlat,o=Pt().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"),c={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(c,s,l);var u={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(u,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:c,angularaxis:u,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),BT=p({"src/plots/polar/layout_defaults.js"(t,e){var r=le(),n=H(),i=ye(),a=Hs(),o=we().getSubplotData,s=Re(),l=Fe(),c=Ne(),u=Ue(),h=bi(),f=wi(),p=ar(),d=rr(),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),A=d.layoutOut;function k(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,k,T,C,d);h(S,E,k,{axData:T,dataAttr:C});var L=k("visible");switch(g(E,e,A),k("uirevision",e.uirevision),E._m=1,w){case"radialaxis":k("minallowed"),k("maxallowed");var P,z=k("range"),D=E.getAutorangeDflt(z),O=k("autorange",D);z&&(null===z[0]&&null===z[1]||(null===z[0]||null===z[1])&&("reversed"===O||!0===O)||null!==z[0]&&("min"===O||"max reversed"===O)||null!==z[1]&&("max"===O||"min reversed"===O))&&(z=void 0,delete E.range,E.autorange=!0,P=!0),P||(O=k("autorange",D=E.getAutorangeDflt(z))),S.autorange=O,O&&(p(k,O,z),("linear"===I||"-"===I)&&k("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"}k("linear"===I?"thetaunit":"period");var F=k("direction");k("rotation",{counterclockwise:0,clockwise:90}[F])}if(u(S,E,k,E.type,{tickSuffixDflt:"degrees"===E.thetaunit?"°":void 0}),L){var B,j,N,U,V,q,H,G,W,Z,Y=d.font||{};j=(B=k("color"))===S.color?B:Y.color,N=Y.size,U=Y.family,V=Y.weight,q=Y.style,H=Y.variant,G=Y.textcase,W=Y.lineposition,Z=Y.shadow,s(S,E,k,E.type),c(S,E,k,E.type,{font:{weight:V,style:q,variant:H,textcase:G,lineposition:W,shadow:Z,color:j,size:N,family:U},noAutotickangles:"angularaxis"===w,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(S,E,k,{outerTicks:!0}),f(S,E,k,{dfltColor:B,bgColor:d.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:m[w]}),k("layer"),"radialaxis"===w&&(k("side"),k("angle",b[0]),k("title.text"),r.coerceFont(k,"title.font",{weight:V,style:q,variant:H,textcase:G,lineposition:W,shadow:Z,color:j,size:r.bigFont(N),family:U}))}"category"!==I&&k("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})}}}),jT=p({"src/plots/polar/index.js"(t,e){var r=we().getSubplotCalcData,n=le().counterRegex,i=RT(),a=zT(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},e.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,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],c=r(n,s,l),u=e[l]._subplot;u||(u=i(t,l),e[l]._subplot=u),u.plot(c,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,c=0;c<i.length;c++){var u=i[c],h=n[u]._subplot;if(!e[u]&&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:Si().toSVG}}}),NT=p({"src/traces/scatterpolar/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=R().extendFlat,a=wn(),o=Tn(),s=U(),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=p({"src/traces/scatterpolar/defaults.js"(t,e){var r=le(),n=Ye(),i=Zn(),a=Yn(),o=Xn(),s=$n(),l=Kn(),c=bn().PTS_LINESONLY,u=NT();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,u,n,i)}var m=h(0,e,0,d);if(m){d("thetaunit"),d("mode",m<c?"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=p({"src/traces/scatterpolar/format_labels.js"(t,e){var r=le(),n=ir();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 c=a.c2l(t.r);s.rLabel=n.tickText(a,c,!0).text;var u="degrees"===o.thetaunit?r.rad2deg(t.theta):t.theta;return s.thetaLabel=n.tickText(o,u,!0).text,s}}}),qT=p({"src/traces/scatterpolar/calc.js"(t,e){var r=A(),n=k().BADNUM,i=ir(),a=ni(),o=ii(),s=ai(),l=oi().calcMarkerSize;e.exports=function(t,e){for(var c=t._fullLayout,u=e.subplot,h=c[u].radialaxis,f=c[u].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=p({"src/traces/scatterpolar/plot.js"(t,e){var r=fi(),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},c=e.radialAxis,u=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=c.c2g(m),y=u.c2g(d.theta);d.x=g*Math.cos(y),d.y=g*Math.sin(y)}}r(t,l,i,a)}}}),GT=p({"src/traces/scatterpolar/hover.js"(t,e){var r=yi();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,c=[];function u(t,e){c.push(t._hovertitle+": "+e)}if(!e.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["r","theta","text"]),-1!==h.indexOf("r")&&u(i,n.rLabel),-1!==h.indexOf("theta")&&u(a,n.thetaLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.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,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),WT=p({"src/traces/scatterpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:jT(),categories:["polar","symbols","showLegend","scatter-like"],attributes:NT(),supplyDefaults:UT().supplyDefaults,colorbar:pi(),formatLabels:VT(),calc:qT(),plot:HT(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:GT().hoverPoints,selectPoints:vi(),meta:{}}}}),ZT=p({"lib/scatterpolar.js"(t,e){e.exports=WT()}}),YT=p({"src/traces/scatterpolargl/attributes.js"(t,e){var r=NT(),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=p({"src/traces/scatterpolargl/defaults.js"(t,e){var r=le(),n=Ye(),i=UT().handleRThetaDefaults,a=Zn(),o=Yn(),s=$n(),l=Kn(),c=bn().PTS_LINESONLY,u=YT();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,n,i)}var d=i(t,e,f,p);d?(p("thetaunit"),p("mode",d<c?"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=p({"src/traces/scatterpolargl/format_labels.js"(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)}}}),KT=p({"src/traces/scatterpolargl/calc.js"(t,e){var r=ni(),n=oi().calcMarkerSize,i=yy(),a=ir(),o=Zg().TOO_MANY_POINTS;e.exports=function(t,e){var s=t._fullLayout,l=e.subplot,c=s[l].radialaxis,u=s[l].angularaxis,h=e._r=c.makeCalcdata(e,"r"),f=e._theta=u.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(c,h,{ppad:m}),[{x:!1,y:!1,t:d,trace:e}]}}}),JT=p({"src/traces/scatterpolargl/hover.js"(t,e){var r=Wg(),n=GT().makeHoverPointText;e.exports={hoverPoints:function(t,e,i,a){var o=t.cd[0].t,s=o.r,l=o.theta,c=r.hoverPoints(t,e,i,a);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var h=t.subplot,f=u.cd[u.index],p=u.trace;if(f.r=s[u.index],f.theta=l[u.index],h.isPtInside(f))return u.xLabelVal=void 0,u.yLabelVal=void 0,n(f,p,h,u),c}}}}}),QT=p({"src/traces/scatterpolargl/base_index.js"(t,e){e.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:jT(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:YT(),supplyDefaults:XT(),colorbar:pi(),formatLabels:$T(),calc:KT(),hoverPoints:JT().hoverPoints,selectPoints:by(),meta:{}}}}),tA=p({"src/traces/scatterpolargl/plot.js"(t,e){var r=sy(),n=A(),i=Mx(),a=vy(),o=yy(),s=le(),l=Zg().TOO_MANY_POINTS;e.exports=function(t,e,c){if(c.length){var u=e.radialAxis,h=e.angularAxis,f=a(t,e);return c.forEach((function(i){if(i&&i[0]&&i[0].trace){var a,c=i[0],p=c.trace,d=c.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 A,k,M=x[a];if(n(M)){var S=u.c2g(M),E=h.c2g(_[a],p.thetaunit);A=S*Math.cos(E),k=S*Math.sin(E)}else A=k=NaN;w[a]=b[2*a]=A,T[a]=b[2*a+1]=k}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,c)}},e.exports.reglPrecompiled={}}}),eA=p({"src/traces/scatterpolargl/index.js"(t,e){var r=QT();r.plot=tA(),e.exports=r}}),rA=p({"lib/scatterpolargl.js"(t,e){e.exports=eA()}}),nA=p({"src/traces/barpolar/attributes.js"(t,e){var r,n=Ot().hovertemplateAttrs,i=R().extendFlat,a=NT(),o=Ga();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}}}),iA=p({"src/traces/barpolar/layout_attributes.js"(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"}}}}),aA=p({"src/traces/barpolar/defaults.js"(t,e){var r=le(),n=UT().handleRThetaDefaults,i=Za(),a=nA();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}}}),oA=p({"src/traces/barpolar/layout_defaults.js"(t,e){var r=le(),n=iA();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 c=i[l];"barpolar"===c.type&&!0===c.visible&&(o[a=c.subplot]||(s("barmode"),s("bargap"),o[a]=1))}}}}),sA=p({"src/traces/barpolar/calc.js"(t,e){var r=Ee().hasColorscale,n=We(),i=le().isArrayOrTypedArray,a=$a(),o=li().setGroupPositions,s=ai(),l=qt().traceIs,c=le().extendFlat;e.exports={calc:function(t,e){for(var o=t._fullLayout,l=e.subplot,c=o[l].radialaxis,u=o[l].angularaxis,h=c.makeCalcdata(e,"r"),f=u.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)?u.makeCalcdata(e,t):u.d2c(r,e.thetaunit))}return"linear"===u.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],u=s[0].trace;!0===u.visible&&l(u,"bar")&&u.subplot===r&&i.push(s)}var h=c({},e.radialaxis,{_id:"x"}),f=e.angularaxis;o(t,f,h,i,{mode:e.barmode,norm:e.barnorm,gap:e.bargap,groupgap:e.bargroupgap})}}}}),lA=p({"src/traces/barpolar/plot.js"(t,e){var r=x(),n=A(),i=le(),a=Qe(),o=DT();e.exports=function(t,e,s){var l=t._context.staticPlot,c=e.xaxis,u=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 c,u;i.angleDelta(s,l)>0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,t.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,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=[c.c2p(m*Math.cos(g)),u.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)}))}}}),cA=p({"src/traces/barpolar/hover.js"(t,e){var r=Dr(),n=le(),i=ro().getTraceColor,a=n.fillText,o=GT().makeHoverPointText,s=DT().isPtInsidePolygon;e.exports=function(t,e,l){var c=t.cd,u=c[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(c,(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 _=c[t.index];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var b=n.extendFlat({},_,{r:_.s,theta:_.p});return a(_,u,t),o(b,u,h,t),t.hovertemplate=u.hovertemplate,t.color=i(u,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}}}),uA=p({"src/traces/barpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"barpolar",basePlotModule:jT(),categories:["polar","bar","showLegend"],attributes:nA(),layoutAttributes:iA(),supplyDefaults:aA(),supplyLayoutDefaults:oA(),calc:sA().calc,crossTraceCalc:sA().crossTraceCalc,plot:lA(),colorbar:pi(),formatLabels:VT(),style:to().style,styleOnSelect:to().styleOnSelect,hoverPoints:cA(),selectPoints:io(),meta:{}}}}),hA=p({"lib/barpolar.js"(t,e){e.exports=uA()}}),fA=p({"src/plots/smith/constants.js"(t,e){e.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),pA=p({"src/plots/smith/layout_attributes.js"(t,e){var r=q(),n=Ie(),i=Aa().attributes,a=le().extendFlat,o=Pt().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"),c=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),u=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:c,imaginaryaxis:u,editType:"calc"}}}),dA=p({"src/plots/smith/layout_defaults.js"(t,e){var r,n,i,a=le(),o=H(),s=ye(),l=Hs(),c=we().getSubplotData,u=Ue(),h=Ne(),f=wi(),p=er(),d=pA(),m=fA(),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=c(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 A=_("visible");if(T.type="linear",p(T,x),u(w,T,_,T.type),A){var k="realaxis"===l;k&&_("side"),k?_("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||{};A&&(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:!k,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})}}}),mA=p({"src/plots/smith/index.js"(t,e){var r=we().getSubplotCalcData,n=le().counterRegex,i=RT(),a=fA(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},e.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,layoutAttributes:pA(),supplyLayoutDefaults:dA(),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],c=r(n,s,l),u=e[l]._subplot;u||(u=i(t,l,!0),e[l]._subplot=u),u.plot(c,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 c in l.framework.remove(),l.clipPaths)l.clipPaths[c].remove()}},toSVG:Si().toSVG}}}),gA=p({"src/traces/scattersmith/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=R().extendFlat,a=wn(),o=Tn(),s=U(),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}}}),yA=p({"src/traces/scattersmith/defaults.js"(t,e){var r=le(),n=Ye(),i=Zn(),a=Yn(),o=Xn(),s=$n(),l=Kn(),c=bn().PTS_LINESONLY,u=gA();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,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<c?"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}}}),vA=p({"src/traces/scattersmith/format_labels.js"(t,e){var r=ir();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}}}),xA=p({"src/traces/scattersmith/calc.js"(t,e){var r=A(),n=k().BADNUM,i=ni(),a=ii(),o=ai(),s=oi().calcMarkerSize;e.exports=function(t,e){for(var l=t._fullLayout,c=e.subplot,u=l[c].realaxis,h=l[c].imaginaryaxis,f=u.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}}}),_A=p({"src/traces/scattersmith/plot.js"(t,e){var r=fi(),n=k().BADNUM,i=OT().smith;e.exports=function(t,e,a){for(var o=e.layers.frontplot.select("g.scatterlayer"),s=e.xaxis,l=e.yaxis,c={xaxis:s,yaxis:l,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},u=0;u<a.length;u++)for(var h=a[u],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,c,a,o)}}}),bA=p({"src/traces/scattersmith/hover.js"(t,e){var r=yi();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,c=[];function u(t,e){c.push(t._hovertitle+": "+e)}if(!e.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["real","imag","text"]),-1!==h.indexOf("real")&&u(i,n.realLabel),-1!==h.indexOf("imag")&&u(a,n.imagLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.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,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),wA=p({"src/traces/scattersmith/index.js"(t,e){e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:mA(),categories:["smith","symbols","showLegend","scatter-like"],attributes:gA(),supplyDefaults:yA(),colorbar:pi(),formatLabels:vA(),calc:xA(),plot:_A(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:bA().hoverPoints,selectPoints:vi(),meta:{}}}}),TA=p({"lib/scattersmith.js"(t,e){e.exports=wA()}}),AA=p({"node_modules/world-calendars/dist/main.js"(t,e){var r=Ay();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(t??this,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),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,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}}),kA=p({"node_modules/world-calendars/dist/plus.js"(){var t=Ay(),e=AA();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,c=(n.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;v+n<t.length&&t.charAt(v+n)===e;)n++;return v+=n-1,Math.floor(n/(r||1))>1}),u=function(t,e,r,n){var i=""+e;if(c(t,n))for(;i.length<r;)i="0"+i;return i},h=this,f=function(t){return"function"==typeof o?o.call(h,t,c("m")):m(u("m",t.month(),2))},p=function(t,e){return e?"function"==typeof l?l.call(h,t):l[t.month()-h.minMonth]:"function"==typeof s?s.call(h,t):s[t.month()-h.minMonth]},d=this.local.digits,m=function(t){return n.localNumbers&&d?d(t):t},g="",y=!1,v=0;v<t.length;v++)if(y)"'"!==t.charAt(v)||c("'")?g+=t.charAt(v):y=!1;else switch(t.charAt(v)){case"d":g+=m(u("d",r.day(),2));break;case"D":g+=(x=r.dayOfWeek(),_=i,b=a,c("D")?b[x]:_[x]);break;case"o":g+=u("o",r.dayOfYear(),3);break;case"w":g+=u("w",r.weekOfYear(),2);break;case"m":g+=f(r);break;case"M":g+=p(r,c("M"));break;case"y":g+=c("y",2)?r.year():(r.year()%100<10?"0":"")+r.year()%100;break;case"Y":c("Y",2),g+=r.formatYear();break;case"J":g+=r.toJD();break;case"@":g+=(r.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":g+=(r.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":c("'")?g+="'":y=!0;break;default:g+=t.charAt(v)}var x,_,b;return g},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,c=n.monthNamesShort||this.local.monthNamesShort,u=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(k).match(o);if(!s)throw(e.local.missingNumberAt||e.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=s[0].length,parseInt(s[0],10)},_=this,b=function(){if("function"==typeof l){v("m");var t=l.call(_,r.substring(k));return k+=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(k,o[s].length).toLowerCase()===o[s].toLowerCase())return k+=o[s].length,s+_.minMonth;throw(e.local.unknownNameAt||e.regionalOptions[""].unknownNameAt).replace(/\{0\}/,k)},T=function(){if("function"==typeof u){var t=v("M")?u.call(_,r.substring(k)):c.call(_,r.substring(k));return k+=t.length,t}return w("M",c,u)},A=function(){if(r.charAt(k)!==t.charAt(M))throw(e.local.unexpectedLiteralAt||e.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,k);k++},k=0,M=0;M<t.length;M++)if(y)"'"!==t.charAt(M)||v("'")?A():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(k)&&(k++,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"*":k=r.length;break;case"'":v("'")?A():y=!0;break;default:A()}if(k<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,null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch{}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)}})}}),MA=p({"node_modules/world-calendars/dist/calendars/chinese.js"(){var t=AA(),e=Ay(),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=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,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),u=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 u,h=l[a.year-l[0]],f=h>>13;u=f&&(a.month>f||a.isIntercalary)?a.month:a.month-1;for(var p=0;p<u;p++)o+=h&1<<12-p?30:29;var d=c[a.year-c[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(u.year,u.month,u.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=c[n.year-c[0]],o=n.year<<9|n.month<<5|n.day;i.year=o>=a?n.year:n.year-1,a=c[i.year-c[0]];var s,u=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-u)/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 c=l.year(),u=l.month(),h=this.isIntercalaryMonth(c,s),f=o&&h?this.toMonthIndex(c,s,!0):this.toMonthIndex(c,s,!1);f!==u&&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],c=[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]}}),SA=p({"node_modules/world-calendars/dist/calendars/coptic.js"(){var t=AA(),e=Ay();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}}),EA=p({"node_modules/world-calendars/dist/calendars/discworld.js"(){var t=AA(),e=Ay();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}}),CA=p({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var t=AA(),e=Ay();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}}),IA=p({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var t=AA(),e=Ay();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}}),LA=p({"node_modules/world-calendars/dist/calendars/islamic.js"(){var t=AA(),e=Ay();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}}),PA=p({"node_modules/world-calendars/dist/calendars/julian.js"(){var t=AA(),e=Ay();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}}),zA=p({"node_modules/world-calendars/dist/calendars/mayan.js"(){var t=AA(),e=Ay();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}}),DA=p({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var t=AA(),e=Ay();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}}),OA=p({"node_modules/world-calendars/dist/calendars/nepali.js"(){var t=AA(),e=Ay();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(),typeof this.NEPALI_CALENDAR_DATA[e]>"u")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),typeof this.NEPALI_CALENDAR_DATA[e]>"u"?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 c=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(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,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 c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)typeof this.NEPALI_CALENDAR_DATA[r]>"u"&&(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}}),RA=p({"node_modules/world-calendars/dist/calendars/persian.js"(){var t=AA(),e=Ay();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}}),FA=p({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var t=AA(),e=Ay(),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}}),BA=p({"node_modules/world-calendars/dist/calendars/thai.js"(){var t=AA(),e=Ay(),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}}),jA=p({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var t=AA(),e=Ay();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,c=e-n[r-1]+1;return this.newDate(s,l,c)},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]}}),NA=p({"src/components/calendars/calendars.js"(t,e){e.exports=AA(),kA(),MA(),SA(),EA(),CA(),IA(),LA(),PA(),zA(),DA(),OA(),RA(),FA(),BA(),jA()}}),UA=p({"src/components/calendars/index.js"(t,e){var r=NA(),n=le(),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)},c="##",u={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:c,w:c,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||(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=u[i])?(h=l===c?c:d.formatDate(l[n]),t=t.substr(0,m)+h+t.substr(m+s),m+=h.length):m+=s;return t}}}}),VA=p({"lib/calendars.js"(t,e){e.exports=UA()}});return p({"lib/index.js"(t,e){var r=qa();r.register([oo(),_o(),Go(),ts(),os(),Is(),Ds(),Ys(),ol(),bl(),Ol(),Yu(),ah(),sd(),Ad(),Rd(),Wd(),Tm(),Cm(),Bm(),qm(),Ym(),tg(),ag(),Og(),Gg(),Ex(),Wx(),v_(),M_(),G_(),K_(),ob(),Sb(),zb(),Vb(),cw(),yw(),Sw(),Qw(),cT(),gT(),MT(),LT(),ZT(),rA(),hA(),TA(),VA()]),e.exports=r}})()})();return window.Plotly=t,t},"object"==typeof e&&e.exports?e.exports=n():r.moduleName=n()})),b=y(v()),w=y(x());(n||(n={})).copyText=function(t){let e=document.body,r=n=>{n.preventDefault(),n.stopPropagation(),n.clipboardData.setData("text",t),e.removeEventListener("copy",r,!0)};e.addEventListener("copy",r,!0),document.execCommand("copy")},(l=i||(i={})).boxSizing=function(t){let e=window.getComputedStyle(t),r=parseFloat(e.borderTopWidth)||0,n=parseFloat(e.borderLeftWidth)||0,i=parseFloat(e.borderRightWidth)||0,a=parseFloat(e.borderBottomWidth)||0,o=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingLeft)||0,l=parseFloat(e.paddingRight)||0,c=parseFloat(e.paddingBottom)||0;return{borderTop:r,borderLeft:n,borderRight:i,borderBottom:a,paddingTop:o,paddingLeft:s,paddingRight:l,paddingBottom:c,horizontalSum:n+s+l+i,verticalSum:r+o+c+a}},l.sizeLimits=function(t){let e=window.getComputedStyle(t),r=parseFloat(e.minWidth)||0,n=parseFloat(e.minHeight)||0,i=parseFloat(e.maxWidth)||1/0,a=parseFloat(e.maxHeight)||1/0;return i=Math.max(r,i),a=Math.max(n,a),{minWidth:r,minHeight:n,maxWidth:i,maxHeight:a}},l.hitTest=function(t,e,r){let n=t.getBoundingClientRect();return e>=n.left&&e<n.right&&r>=n.top&&r<n.bottom},l.scrollIntoViewIfNeeded=function(t,e){let r=t.getBoundingClientRect(),n=e.getBoundingClientRect();if(!(n.top<=r.top&&n.bottom>=r.bottom)){if(n.top<r.top&&n.height<=r.height)return void(t.scrollTop-=r.top-n.top);if(n.bottom>r.bottom&&n.height>=r.height)return void(t.scrollTop-=r.top-n.top);if(n.top<r.top&&n.height>r.height)return void(t.scrollTop-=r.bottom-n.bottom);if(n.bottom>r.bottom&&n.height<r.height)return void(t.scrollTop-=r.bottom-n.bottom)}},function(t){t.IS_MAC=!!navigator.platform.match(/Mac/i),t.IS_WIN=!!navigator.platform.match(/Win/i),t.IS_IE=/Trident/.test(navigator.userAgent),t.IS_EDGE=/Edge/.test(navigator.userAgent),t.accelKey=function(e){return t.IS_MAC?e.metaKey:e.ctrlKey}}(a||(a={})),function(t){t.calculateSpecificity=function(t){if(t in s.specificityCache)return s.specificityCache[t];let e=s.calculateSingle(t);return s.specificityCache[t]=e},t.isValid=function(t){if(t in s.validityCache)return s.validityCache[t];let e=!0;try{s.testElem.querySelector(t)}catch{e=!1}return s.validityCache[t]=e},t.matches=function(t,e){return s.protoMatchFunc.call(t,e)}}(o||(o={})),function(t){t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=(()=>{let t=Element.prototype;return t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector||function(t){let e=this,r=e.ownerDocument?e.ownerDocument.querySelectorAll(t):[];return-1!==Array.prototype.indexOf.call(r,e)}})(),t.calculateSingle=function(t){let c=0,u=0,h=0;function f(e){let r=t.match(e);return null!==r&&(t=t.slice(r[0].length),!0)}for(t=(t=t.split(",",1)[0]).replace(l," $1 ");t.length>0;)if(f(e))c++;else if(f(r))u++;else if(f(n))u++;else if(f(a))h++;else if(f(o))u++;else if(f(i))h++;else if(!f(s))return 0;return c=Math.min(c,255),u=Math.min(u,255),h=Math.min(h,255),c<<16|u<<8|h};let e=/^#[^\s\+>~#\.\[:]+/,r=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,i=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,s=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(s||(s={}));var T,A=y(v()),k=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let t=this._first;for(;t;)yield t.value,t=t.next}*retro(){let t=this._last;for(;t;)yield t.value,t=t.prev}*nodes(){let t=this._first;for(;t;)yield t,t=t.next}*retroNodes(){let t=this._last;for(;t;)yield t,t=t.prev}assign(t){this.clear();for(let e of t)this.addLast(e)}push(t){this.addLast(t)}pop(){return this.removeLast()}shift(t){this.addFirst(t)}unshift(){return this.removeFirst()}addFirst(t){let e=new T.LinkedListNode(this,t);return this._first?(e.next=this._first,this._first.prev=e,this._first=e):(this._first=e,this._last=e),this._size++,e}addLast(t){let e=new T.LinkedListNode(this,t);return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._first=e,this._last=e),this._size++,e}insertBefore(t,e){if(!e||e===this._first)return this.addFirst(t);if(!(e instanceof T.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");let r=new T.LinkedListNode(this,t),n=e,i=n.prev;return r.next=n,r.prev=i,n.prev=r,i.next=r,this._size++,r}insertAfter(t,e){if(!e||e===this._last)return this.addLast(t);if(!(e instanceof T.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");let r=new T.LinkedListNode(this,t),n=e,i=n.next;return r.next=i,r.prev=n,n.next=r,i.prev=r,this._size++,r}removeFirst(){let t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value}removeLast(){let t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value}removeNode(t){if(!(t instanceof T.LinkedListNode)||t.list!==this)throw new Error("Node is not owned by the list.");let e=t;e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--}clear(){let t=this._first;for(;t;){let e=t.next;t.list=null,t.prev=null,t.next=null,t=e}this._first=null,this._last=null,this._size=0}};!function(t){t.from=function(e){let r=new t;return r.assign(e),r}}(k||(k={})),function(t){t.LinkedListNode=class{constructor(t,e){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=e}}}(T||(T={}));var M,S=class{constructor(t){this.type=t}get isConflatable(){return!1}conflate(t){return!1}},E=class extends S{get isConflatable(){return!0}conflate(t){return!0}};!function(t){let e=null,r=(n=Promise.resolve(),t=>{let e=!1;return n.then((()=>!e&&t())),()=>{e=!0}});var n;function i(t,e){let r=o.get(t);r&&0!==r.length?(0,A.every)((0,A.retro)(r),(r=>!r||function(t,e,r){let n=!0;try{n="function"==typeof t?t(e,r):t.messageHook(e,r)}catch(t){l(t)}return n}(r,t,e)))&&u(t,e):u(t,e)}t.sendMessage=i,t.postMessage=function(t,n){n.isConflatable&&(0,A.some)(a,(e=>!(e.handler!==t||!e.msg||e.msg.type!==n.type||!e.msg.isConflatable)&&e.msg.conflate(n)))||function(t,n){a.addLast({handler:t,msg:n}),null===e&&(e=r(h))}(t,n)},t.installMessageHook=function(t,e){let r=o.get(t);r&&-1!==r.indexOf(e)||(r?r.push(e):o.set(t,[e]))},t.removeMessageHook=function(t,e){let r=o.get(t);if(!r)return;let n=r.indexOf(e);-1!==n&&(r[n]=null,f(r))},t.clearData=function(t){let e=o.get(t);e&&e.length>0&&(A.ArrayExt.fill(e,null),f(e));for(let e of a)e.handler===t&&(e.handler=null,e.msg=null)},t.flush=function(){c||null===e||(e(),e=null,c=!0,h(),c=!1)},t.getExceptionHandler=function(){return l},t.setExceptionHandler=function(t){let e=l;return l=t,e};let a=new k,o=new WeakMap,s=new Set,l=t=>{console.error(t)},c=!1;function u(t,e){try{t.processMessage(e)}catch(t){l(t)}}function h(){if(e=null,a.isEmpty)return;let t={handler:null,msg:null};for(a.addLast(t);;){let e=a.removeFirst();if(e===t)return;e.handler&&e.msg&&i(e.handler,e.msg)}}function f(t){0===s.size&&r(p),s.add(t)}function p(){s.forEach(d),s.clear()}function d(t){A.ArrayExt.removeAllWhere(t,m)}function m(t){return null===t}}(M||(M={}));var C,I=class{constructor(t){this._pid=C.nextPID(),this.name=t.name,this._create=t.create,this._coerce=t.coerce||null,this._compare=t.compare||null,this._changed=t.changed||null}get(t){let e,r=C.ensureMap(t);return e=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t),e}set(t,e){let r,n=C.ensureMap(t);r=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(t);let i=this._coerceValue(t,e);this._maybeNotify(t,r,n[this._pid]=i)}coerce(t){let e,r=C.ensureMap(t);e=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t);let n=this._coerceValue(t,e);this._maybeNotify(t,e,r[this._pid]=n)}_createValue(t){return(0,this._create)(t)}_coerceValue(t,e){let r=this._coerce;return r?r(t,e):e}_compareValue(t,e){let r=this._compare;return r?r(t,e):t===e}_maybeNotify(t,e,r){let n=this._changed;n&&!this._compareValue(e,r)&&n(t,e,r)}};!function(t){t.clearData=function(t){C.ownerData.delete(t)}}(I||(I={})),function(t){t.ownerData=new WeakMap,t.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})(),t.ensureMap=function(e){let r=t.ownerData.get(e);return r||(r=Object.create(null),t.ownerData.set(e,r),r)}}(C||(C={}));var L,P=y(v()),z=(y(x()),class{constructor(t){this.sender=t}connect(t,e){return L.connect(this,t,e)}disconnect(t,e){return L.disconnect(this,t,e)}emit(t){L.emit(this,t)}});!function(t){t.disconnectBetween=function(t,e){L.disconnectBetween(t,e)},t.disconnectSender=function(t){L.disconnectSender(t)},t.disconnectReceiver=function(t){L.disconnectReceiver(t)},t.disconnectAll=function(t){L.disconnectAll(t)},t.clearData=function(t){L.disconnectAll(t)},t.getExceptionHandler=function(){return L.exceptionHandler},t.setExceptionHandler=function(t){let e=L.exceptionHandler;return L.exceptionHandler=t,e}}(z||(z={})),function(t){function e(t){let e=n.get(t);if(e&&0!==e.length){for(let t of e){if(!t.signal)continue;let e=t.thisArg||t.slot;t.signal=null,c(i.get(e))}c(e)}}function r(t){let e=i.get(t);if(e&&0!==e.length){for(let t of e){if(!t.signal)continue;let e=t.signal.sender;t.signal=null,c(n.get(e))}c(e)}}t.exceptionHandler=t=>{console.error(t)},t.connect=function(t,e,r){r=r||void 0;let a=n.get(t.sender);if(a||(a=[],n.set(t.sender,a)),s(a,t,e,r))return!1;let o=r||e,l=i.get(o);l||(l=[],i.set(o,l));let c={signal:t,slot:e,thisArg:r};return a.push(c),l.push(c),!0},t.disconnect=function(t,e,r){r=r||void 0;let a=n.get(t.sender);if(!a||0===a.length)return!1;let o=s(a,t,e,r);if(!o)return!1;let l=r||e,u=i.get(l);return o.signal=null,c(a),c(u),!0},t.disconnectBetween=function(t,e){let r=n.get(t);if(!r||0===r.length)return;let a=i.get(e);if(a&&0!==a.length){for(let e of a)e.signal&&e.signal.sender===t&&(e.signal=null);c(r),c(a)}},t.disconnectSender=e,t.disconnectReceiver=r,t.disconnectAll=function(t){e(t),r(t)},t.emit=function(t,e){let r=n.get(t.sender);if(r&&0!==r.length)for(let n=0,i=r.length;n<i;++n){let i=r[n];i.signal===t&&l(i,e)}};let n=new WeakMap,i=new WeakMap,a=new Set,o="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function s(t,e,r,n){return(0,P.find)(t,(t=>t.signal===e&&t.slot===r&&t.thisArg===n))}function l(e,r){let{signal:n,slot:i,thisArg:a}=e;try{i.call(a,n.sender,r)}catch(e){t.exceptionHandler(e)}}function c(t){0===a.size&&o(u),a.add(t)}function u(){a.forEach(h),a.clear()}function h(t){P.ArrayExt.removeAllWhere(t,f)}function f(t){return null===t.signal}}(L||(L={}));var D=class{constructor(t){this._fn=t}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let t=this._fn;this._fn=null,t()}},O=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((t=>{t.dispose()})),this._items.clear())}contains(t){return this._items.has(t)}add(t){this._items.add(t)}remove(t){this._items.delete(t)}clear(){this._items.clear()}};!function(t){t.from=function(e){let r=new t;for(let t of e)r.add(t);return r}}(O||(O={}));var R=class extends O{constructor(){super(...arguments),this._disposed=new z(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),z.clearData(this))}};!function(t){t.from=function(e){let r=new t;for(let t of e)r.add(t);return r}}(R||(R={}));var F,B=class t{constructor(t){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:e,distance:r}=this._scrollTarget,n=F.SCROLL_EDGE_SIZE-r,i=Math.pow(n/F.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(i*F.SCROLL_EDGE_SIZE));switch(e){case"top":t.scrollTop-=a;break;case"left":t.scrollLeft-=a;break;case"right":t.scrollLeft+=a;break;case"bottom":t.scrollTop+=a}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=t.document||document,this.mimeData=t.mimeData,this.dragImage=t.dragImage||null,this.proposedAction=t.proposedAction||"copy",this.supportedActions=t.supportedActions||"all",this.source=t.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let t=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});F.dispatchDragLeave(this,this._currentTarget,null,t)}this._finalize("none")}}get isDisposed(){return this._disposed}start(t,e){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(t,e),this._promise=new Promise((t=>{this._resolve=t}));let r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:t,clientY:e});return document.dispatchEvent(r),this._promise}handleEvent(t){switch(t.type){case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;default:t.preventDefault(),t.stopPropagation()}}moveDragImage(t,e){this.dragImage&&(this.dragImage.style.transform=`translate(${t}px, ${e}px)`)}_evtPointerMove(t){t.preventDefault(),t.stopPropagation(),this._updateCurrentTarget(t),this._updateDragScroll(t),this.moveDragImage(t.clientX,t.clientY)}_evtPointerUp(t){if(t.preventDefault(),t.stopPropagation(),0!==t.button)return;if(this._updateCurrentTarget(t),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction)return F.dispatchDragLeave(this,this._currentTarget,null,t),void this._finalize("none");let e=F.dispatchDrop(this,this._currentTarget,t);this._finalize(e)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(t){let e=F.findScrollTarget(t);!this._scrollTarget&&!e||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=e)}_updateCurrentTarget(t){let e=this._currentTarget,r=this._currentTarget,n=this._currentElement,i=F.findElementBehindBackdrop(t,this.document);this._currentElement=i,i!==n&&i!==r&&F.dispatchDragExit(this,r,i,t),i!==n&&i!==r&&(r=F.dispatchDragEnter(this,i,r,t)),r!==e&&(this._currentTarget=r,F.dispatchDragLeave(this,e,r,t));let a=F.dispatchDragOver(this,r,t);this._setDropAction(a)}_attachDragImage(t,e){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let r=this.dragImage.style;r.pointerEvents="none",r.position="fixed",r.transform=`translate(${t}px, ${e}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let t=this.dragImage.parentNode;t&&t.removeChild(this.dragImage)}_setDropAction(e){if(e=F.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=t.overrideCursor("move",this.document)}}_finalize(t){let e=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,e&&e(t)}};!function(t){class e extends DragEvent{constructor(t,e){super(e.type,{bubbles:!0,cancelable:!0,altKey:t.altKey,button:t.button,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,detail:0,metaKey:t.metaKey,relatedTarget:e.related,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey,view:window});let{drag:r}=e;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}t.Event=e,t.overrideCursor=function(t,e=document){return F.overrideCursor(t,e)}}(B||(B={})),function(t){function e(e,i=document){if(e){if(r&&e==r.event)return r.element;t.cursorBackdrop.style.zIndex="-1000";let n=i.elementFromPoint(e.clientX,e.clientY);return t.cursorBackdrop.style.zIndex="",r={event:e,element:n},n}{let e=t.cursorBackdrop.style.transform;if(n&&e===n.transform)return n.element;let r=t.cursorBackdrop.getBoundingClientRect();t.cursorBackdrop.style.zIndex="-1000";let a=i.elementFromPoint(r.left+r.width/2,r.top+r.height/2);return t.cursorBackdrop.style.zIndex="",n={transform:e,element:a},a}}t.SCROLL_EDGE_SIZE=20,t.validateAction=function(t,e){return i[t]&a[e]?t:"none"},t.findElementBehindBackdrop=e;let r=null,n=null;t.findScrollTarget=function(r){let n=r.clientX,i=r.clientY,a=e(r);for(;a;a=a.parentElement){if(!a.hasAttribute("data-lm-dragscroll"))continue;let e=0,r=0;a===document.body&&(e=window.pageXOffset,r=window.pageYOffset);let o=a.getBoundingClientRect(),s=o.top+r,l=o.left+e,c=l+o.width,u=s+o.height;if(n<l||n>=c||i<s||i>=u)continue;let h,f=n-l+1,p=i-s+1,d=c-n,m=u-i,g=Math.min(f,p,d,m);if(g>t.SCROLL_EDGE_SIZE)continue;switch(g){case m:h="bottom";break;case p:h="top";break;case d:h="right";break;case f:h="left";break;default:throw"unreachable"}let y,v=a.scrollWidth-a.clientWidth,x=a.scrollHeight-a.clientHeight;switch(h){case"top":y=x>0&&a.scrollTop>0;break;case"left":y=v>0&&a.scrollLeft>0;break;case"right":y=v>0&&a.scrollLeft<v;break;case"bottom":y=x>0&&a.scrollTop<x;break;default:throw"unreachable"}if(y)return{element:a,edge:h,distance:g}}return null},t.dispatchDragEnter=function(t,e,r,n){if(!e)return null;let i=new B.Event(n,{drag:t,related:r,type:"lm-dragenter"});if(!e.dispatchEvent(i))return e;let a=t.document instanceof Document?t.document.body:t.document.firstElementChild;return e===a?r:(i=new B.Event(n,{drag:t,related:r,type:"lm-dragenter"}),a.dispatchEvent(i),a)},t.dispatchDragExit=function(t,e,r,n){if(!e)return;let i=new B.Event(n,{drag:t,related:r,type:"lm-dragexit"});e.dispatchEvent(i)},t.dispatchDragLeave=function(t,e,r,n){if(!e)return;let i=new B.Event(n,{drag:t,related:r,type:"lm-dragleave"});e.dispatchEvent(i)},t.dispatchDragOver=function(t,e,r){if(!e)return"none";let n=new B.Event(r,{drag:t,related:null,type:"lm-dragover"});return e.dispatchEvent(n)?"none":n.dropAction},t.dispatchDrop=function(t,e,r){if(!e)return"none";let n=new B.Event(r,{drag:t,related:null,type:"lm-drop"});return e.dispatchEvent(n)?"none":n.dropAction};let i={none:0,copy:1,link:2,move:4},a={none:i.none,copy:i.copy,link:i.link,move:i.move,"copy-link":i.copy|i.link,"copy-move":i.copy|i.move,"link-move":i.link|i.move,all:i.copy|i.link|i.move};function o(e){t.cursorBackdrop&&(t.cursorBackdrop.style.transform=`translate(${e.clientX}px, ${e.clientY}px)`)}function s(r){if(!t.cursorBackdrop)return;let n=e();if(!n)return;let i=n.closest("[data-lm-dragscroll]");i&&(i.scrollTop+=t.cursorBackdrop.scrollTop-c,i.scrollLeft+=t.cursorBackdrop.scrollLeft-c,l())}function l(){t.cursorBackdrop.scrollTop=c,t.cursorBackdrop.scrollLeft=c}t.overrideCursor=function(e,r=document){let n=++u,i=r instanceof Document?r.body:r.firstElementChild;return t.cursorBackdrop.isConnected||(t.cursorBackdrop.style.transform="scale(0)",i.appendChild(t.cursorBackdrop),l(),document.addEventListener("pointermove",o,{capture:!0,passive:!0}),t.cursorBackdrop.addEventListener("scroll",s,{capture:!0,passive:!0})),t.cursorBackdrop.style.cursor=e,new D((()=>{n===u&&t.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",o,!0),t.cursorBackdrop.removeEventListener("scroll",s,!0),i.removeChild(t.cursorBackdrop))}))};let c=500,u=0;t.cursorBackdrop=function(){let t=document.createElement("div");return t.classList.add("lm-cursor-backdrop"),t}()}(F||(F={}));var j=y(v()),N=y(x());function U(){return q.keyboardLayout}var V=class t{constructor(e,r,n=[]){this.name=e,this._codes=r,this._keys=t.extractKeys(r),this._modifierKeys=t.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(t){return t in this._keys}isModifierKey(t){return t in this._modifierKeys}keyForKeydownEvent(t){return this._codes[t.keyCode]||""}};!function(t){t.extractKeys=function(t){let e=Object.create(null);for(let r in t)e[t[r]]=!0;return e},t.convertToKeySet=function(t){let e=Object(null);for(let r=0,n=t.length;r<n;++r)e[t[r]]=!0;return e}}(V||(V={}));var q,H=new V("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]);!function(t){t.keyboardLayout=H}(q||(q={}));var G,W=class t{constructor(){this._timerID=0,this._timerModifierID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=new Map,this._commandChanged=new z(this),this._commandExecuted=new z(this),this._keyBindingChanged=new z(this),this._holdKeyBindingPromises=new Map}get commandChanged(){return this._commandChanged}get commandExecuted(){return this._commandExecuted}get keyBindingChanged(){return this._keyBindingChanged}get keyBindings(){return this._keyBindings}listCommands(){return Array.from(this._commands.keys())}hasCommand(t){return this._commands.has(t)}addCommand(t,e){if(this._commands.has(t))throw new Error(`Command '${t}' already registered.`);return this._commands.set(t,G.createCommand(e)),this._commandChanged.emit({id:t,type:"added"}),new D((()=>{this._commands.delete(t),this._commandChanged.emit({id:t,type:"removed"})}))}notifyCommandChanged(t){if(void 0!==t&&!this._commands.has(t))throw new Error(`Command '${t}' is not registered.`);this._commandChanged.emit({id:t,type:t?"changed":"many-changed"})}describedBy(t,e=N.JSONExt.emptyObject){var r;let n=this._commands.get(t);return Promise.resolve(null!==(r=n?.describedBy.call(void 0,e))&&void 0!==r?r:{args:null})}label(t,e=N.JSONExt.emptyObject){var r;let n=this._commands.get(t);return null!==(r=n?.label.call(void 0,e))&&void 0!==r?r:""}mnemonic(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.mnemonic.call(void 0,e):-1}icon(t,e=N.JSONExt.emptyObject){var r;return null===(r=this._commands.get(t))||void 0===r?void 0:r.icon.call(void 0,e)}iconClass(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.iconClass.call(void 0,e):""}iconLabel(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.iconLabel.call(void 0,e):""}caption(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.caption.call(void 0,e):""}usage(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.usage.call(void 0,e):""}className(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.className.call(void 0,e):""}dataset(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.dataset.call(void 0,e):{}}isEnabled(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isEnabled.call(void 0,e)}isToggled(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isToggled.call(void 0,e)}isToggleable(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isToggleable}isVisible(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isVisible.call(void 0,e)}execute(t,e=N.JSONExt.emptyObject){let r,n=this._commands.get(t);if(!n)return Promise.reject(new Error(`Command '${t}' not registered.`));try{r=n.execute.call(void 0,e)}catch(t){r=Promise.reject(t)}let i=Promise.resolve(r);return this._commandExecuted.emit({id:t,args:e,result:i}),i}addKeyBinding(t){let e=G.createKeyBinding(t);return this._keyBindings.push(e),this._keyBindingChanged.emit({binding:e,type:"added"}),new D((()=>{j.ArrayExt.removeFirstOf(this._keyBindings,e),this._keyBindingChanged.emit({binding:e,type:"removed"})}))}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;let r=t.keystrokeForKeydownEvent(e);if(!r)return this._replayKeydownEvents(),void this._clearPendingState();if(t.isModifierKeyPressed(e)){let{exact:t}=G.matchKeyBinding(this._keyBindings,[r],e);return void(t?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(t)):this._clearModifierTimer())}this._keystrokes.push(r);let{exact:n,partial:i}=G.matchKeyBinding(this._keyBindings,this._keystrokes,e),a=0!==i.length;return n||a?((n?.preventDefault||i.some((t=>t.preventDefault)))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),n&&!a?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}holdKeyBindingExecution(t,e){this._holdKeyBindingPromises.set(t,e)}processKeyupEvent(t){this._clearModifierTimer()}_startModifierTimer(t){this._clearModifierTimer(),this._timerModifierID=window.setTimeout((()=>{this._executeKeyBinding(t)}),G.modifierkeyTimeOut)}_clearModifierTimer(){0!==this._timerModifierID&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),G.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(G.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(t){if(0!==this._holdKeyBindingPromises.size){let t=[...this._keydownEvents],e=(await Promise.race([Promise.all(t.map((async t=>{var e;return null!==(e=this._holdKeyBindingPromises.get(t))&&void 0!==e?e:Promise.resolve(!0)}))),new Promise((t=>{setTimeout((()=>t([!1])),G.KEYBINDING_HOLD_TIMEOUT)}))])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!e)return}let{command:e,args:r}=t,n={_luminoEvent:{type:"keybinding",keys:t.keys},...r};if(this.hasCommand(e)&&this.isEnabled(e,n))await this.execute(e,n);else{let r=this.hasCommand(e)?"enabled":"registered",n=`Cannot execute key binding '${t.keys.join(", ")}':`,i=`command '${e}' is not ${r}.`;console.warn(`${n} ${i}`)}}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}};!function(t){function e(t){let e="",r=!1,n=!1,i=!1,o=!1;for(let s of t.split(/\s+/))"Accel"===s?a.IS_MAC?n=!0:i=!0:"Alt"===s?r=!0:"Cmd"===s?n=!0:"Ctrl"===s?i=!0:"Shift"===s?o=!0:s.length>0&&(e=s);return{cmd:n,ctrl:i,alt:r,shift:o,key:e}}function r(t){let r="",n=e(t);return n.ctrl&&(r+="Ctrl "),n.alt&&(r+="Alt "),n.shift&&(r+="Shift "),n.cmd&&a.IS_MAC&&(r+="Cmd "),n.key?r+n.key:r.trim()}t.parseKeystroke=e,t.normalizeKeystroke=r,t.normalizeKeys=function(t){let e;return e=a.IS_WIN?t.winKeys||t.keys:a.IS_MAC?t.macKeys||t.keys:t.linuxKeys||t.keys,e.map(r)},t.formatKeystroke=function(t){return"string"==typeof t?r(t):t.map(r).join(", ");function r(t){let r=[],n=a.IS_MAC?" ":"+",i=e(t);return i.ctrl&&r.push("Ctrl"),i.alt&&r.push("Alt"),i.shift&&r.push("Shift"),a.IS_MAC&&i.cmd&&r.push("Cmd"),r.push(i.key),r.map(G.formatKey).join(n)}},t.isModifierKeyPressed=function(t){let e=U(),r=e.keyForKeydownEvent(t);return e.isModifierKey(r)},t.keystrokeForKeydownEvent=function(t){let e=U(),r=e.keyForKeydownEvent(t),n=[];return t.ctrlKey&&n.push("Ctrl"),t.altKey&&n.push("Alt"),t.shiftKey&&n.push("Shift"),t.metaKey&&a.IS_MAC&&n.push("Cmd"),e.isModifierKey(r)||n.push(r),n.join(" ")}}(W||(W={})),function(t){t.CHORD_TIMEOUT=1e3,t.KEYBINDING_HOLD_TIMEOUT=1e3,t.modifierkeyTimeOut=500,t.createCommand=function(t){return{execute:t.execute,describedBy:h("function"==typeof t.describedBy?t.describedBy:{args:null,...t.describedBy},(()=>({args:null}))),label:h(t.label,n),mnemonic:h(t.mnemonic,i),icon:h(t.icon,u),iconClass:h(t.iconClass,n),iconLabel:h(t.iconLabel,n),caption:h(t.caption,n),usage:h(t.usage,n),className:h(t.className,n),dataset:h(t.dataset,c),isEnabled:t.isEnabled||s,isToggled:t.isToggled||l,isToggleable:t.isToggleable||!!t.isToggled,isVisible:t.isVisible||s}},t.createKeyBinding=function(t){var e;return{keys:W.normalizeKeys(t),selector:f(t),command:t.command,args:t.args||N.JSONExt.emptyObject,preventDefault:null===(e=t.preventDefault)||void 0===e||e}},t.matchKeyBinding=function(t,e,r){let n=null,i=[],a=1/0,s=0;for(let l=0,c=t.length;l<c;++l){let c=t[l],u=p(c.keys,e);if(0===u)continue;if(2===u){-1!==d(c.selector,r)&&i.push(c);continue}let h=d(c.selector,r);if(-1===h||h>a)continue;let f=o.calculateSpecificity(c.selector);(!n||h<a||f>=s)&&(n=c,a=h,s=f)}return{exact:n,partial:i}},t.replayKeyEvent=function(t){t.target.dispatchEvent(function(t){let e=document.createEvent("Event"),r=t.bubbles||!0,n=t.cancelable||!0;return e.initEvent(t.type||"keydown",r,n),e.key=t.key||"",e.keyCode=t.keyCode||0,e.which=t.keyCode||0,e.ctrlKey=t.ctrlKey||!1,e.altKey=t.altKey||!1,e.shiftKey=t.shiftKey||!1,e.metaKey=t.metaKey||!1,e.view=t.view||window,e}(t))},t.formatKey=function(t){return a.IS_MAC?e.hasOwnProperty(t)?e[t]:t:r.hasOwnProperty(t)?r[t]:t};let e={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},r={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},n=()=>"",i=()=>-1,s=()=>!0,l=()=>!1,c=()=>({}),u=()=>{};function h(t,e){return void 0===t?e:"function"==typeof t?t:()=>t}function f(t){if(-1!==t.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${t.selector}`);if(!o.isValid(t.selector))throw new Error(`Invalid selector: ${t.selector}`);return t.selector}function p(t,e){if(t.length<e.length)return 0;for(let r=0,n=e.length;r<n;++r)if(t[r]!==e[r])return 0;return t.length>e.length?2:1}function d(t,e){let r=e.target,n=e.currentTarget;for(let e=0;null!==r;r=r.parentElement,++e){if(r.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(o.matches(r,t))return e;if(r===n)return-1}return-1}}(G||(G={}));var Z,Y,X=y(v()),$=class{constructor(t){this.type="text",this.content=t}},K=class{constructor(t,e,r,n){this.type="element",this.tag=t,this.attrs=e,this.children=r,this.renderer=n}};function J(t){let e,r={},n=[];for(let t=1,a=arguments.length;t<a;++t){let a=arguments[t];"string"==typeof a?n.push(new $(a)):a instanceof $||a instanceof K?n.push(a):a instanceof Array?i(n,a):(1===t||2===t)&&a&&"object"==typeof a&&("render"in a?e=a:r=a)}return new K(t,r,n,e);function i(t,e){for(let r of e)"string"==typeof r?t.push(new $(r)):(r instanceof $||r instanceof K)&&t.push(r)}}!function(t){t.a=t.bind(void 0,"a"),t.abbr=t.bind(void 0,"abbr"),t.address=t.bind(void 0,"address"),t.area=t.bind(void 0,"area"),t.article=t.bind(void 0,"article"),t.aside=t.bind(void 0,"aside"),t.audio=t.bind(void 0,"audio"),t.b=t.bind(void 0,"b"),t.bdi=t.bind(void 0,"bdi"),t.bdo=t.bind(void 0,"bdo"),t.blockquote=t.bind(void 0,"blockquote"),t.br=t.bind(void 0,"br"),t.button=t.bind(void 0,"button"),t.canvas=t.bind(void 0,"canvas"),t.caption=t.bind(void 0,"caption"),t.cite=t.bind(void 0,"cite"),t.code=t.bind(void 0,"code"),t.col=t.bind(void 0,"col"),t.colgroup=t.bind(void 0,"colgroup"),t.data=t.bind(void 0,"data"),t.datalist=t.bind(void 0,"datalist"),t.dd=t.bind(void 0,"dd"),t.del=t.bind(void 0,"del"),t.dfn=t.bind(void 0,"dfn"),t.div=t.bind(void 0,"div"),t.dl=t.bind(void 0,"dl"),t.dt=t.bind(void 0,"dt"),t.em=t.bind(void 0,"em"),t.embed=t.bind(void 0,"embed"),t.fieldset=t.bind(void 0,"fieldset"),t.figcaption=t.bind(void 0,"figcaption"),t.figure=t.bind(void 0,"figure"),t.footer=t.bind(void 0,"footer"),t.form=t.bind(void 0,"form"),t.h1=t.bind(void 0,"h1"),t.h2=t.bind(void 0,"h2"),t.h3=t.bind(void 0,"h3"),t.h4=t.bind(void 0,"h4"),t.h5=t.bind(void 0,"h5"),t.h6=t.bind(void 0,"h6"),t.header=t.bind(void 0,"header"),t.hr=t.bind(void 0,"hr"),t.i=t.bind(void 0,"i"),t.iframe=t.bind(void 0,"iframe"),t.img=t.bind(void 0,"img"),t.input=t.bind(void 0,"input"),t.ins=t.bind(void 0,"ins"),t.kbd=t.bind(void 0,"kbd"),t.label=t.bind(void 0,"label"),t.legend=t.bind(void 0,"legend"),t.li=t.bind(void 0,"li"),t.main=t.bind(void 0,"main"),t.map=t.bind(void 0,"map"),t.mark=t.bind(void 0,"mark"),t.meter=t.bind(void 0,"meter"),t.nav=t.bind(void 0,"nav"),t.noscript=t.bind(void 0,"noscript"),t.object=t.bind(void 0,"object"),t.ol=t.bind(void 0,"ol"),t.optgroup=t.bind(void 0,"optgroup"),t.option=t.bind(void 0,"option"),t.output=t.bind(void 0,"output"),t.p=t.bind(void 0,"p"),t.param=t.bind(void 0,"param"),t.pre=t.bind(void 0,"pre"),t.progress=t.bind(void 0,"progress"),t.q=t.bind(void 0,"q"),t.rp=t.bind(void 0,"rp"),t.rt=t.bind(void 0,"rt"),t.ruby=t.bind(void 0,"ruby"),t.s=t.bind(void 0,"s"),t.samp=t.bind(void 0,"samp"),t.section=t.bind(void 0,"section"),t.select=t.bind(void 0,"select"),t.small=t.bind(void 0,"small"),t.source=t.bind(void 0,"source"),t.span=t.bind(void 0,"span"),t.strong=t.bind(void 0,"strong"),t.sub=t.bind(void 0,"sub"),t.summary=t.bind(void 0,"summary"),t.sup=t.bind(void 0,"sup"),t.table=t.bind(void 0,"table"),t.tbody=t.bind(void 0,"tbody"),t.td=t.bind(void 0,"td"),t.textarea=t.bind(void 0,"textarea"),t.tfoot=t.bind(void 0,"tfoot"),t.th=t.bind(void 0,"th"),t.thead=t.bind(void 0,"thead"),t.time=t.bind(void 0,"time"),t.title=t.bind(void 0,"title"),t.tr=t.bind(void 0,"tr"),t.track=t.bind(void 0,"track"),t.u=t.bind(void 0,"u"),t.ul=t.bind(void 0,"ul"),t.var_=t.bind(void 0,"var"),t.video=t.bind(void 0,"video"),t.wbr=t.bind(void 0,"wbr")}(J||(J={})),function(t){t.realize=function(t){return Y.createDOMNode(t)},t.render=function(t,e){let r=Y.hostMap.get(e)||[],n=Y.asContentArray(t);Y.hostMap.set(e,n),Y.updateContent(e,r,n)}}(Z||(Z={})),function(t){function e(t){let r=arguments[1]||null,i=arguments[2]||null;if(r)r.insertBefore(e(t),i);else{if("text"===t.type)return document.createTextNode(t.content);if(r=document.createElement(t.tag),function(t,e){for(let r in e)r in n||("on"===r.substr(0,2)?t[r]=e[r]:t.setAttribute(r,e[r]));void 0!==e.className&&t.setAttribute("class",e.className),void 0!==e.htmlFor&&t.setAttribute("for",e.htmlFor),e.dataset&&function(t,e){for(let r in e)t.setAttribute(`data-${r}`,e[r])}(t,e.dataset),e.style&&function(t,e){let r,n=t.style;for(r in e)n[r]=e[r]}(t,e.style)}(r,t.attrs),t.renderer)return t.renderer.render(r,{attrs:t.attrs,children:t.children}),r;for(let n=0,i=t.children.length;n<i;++n)e(t.children[n],r)}return r}function r(t,e,n,i){for(let a=e.length-1;a>=n;--a){let n=e[a],o=i?t.lastChild:t.childNodes[a];"text"===n.type||(n.renderer&&n.renderer.unrender?n.renderer.unrender(o,{attrs:n.attrs,children:n.children}):r(o,n.children,0,!1)),i&&t.removeChild(o)}}t.hostMap=new WeakMap,t.asContentArray=function(t){return t?t instanceof Array?t:[t]:[]},t.createDOMNode=e,t.updateContent=function t(n,a,o){if(a===o)return;let s=function(t,e){let r=t.firstChild,n=Object.create(null);for(let t of e)"element"===t.type&&t.attrs.key&&(n[t.attrs.key]={vNode:t,element:r}),r=r.nextSibling;return n}(n,a),l=a.slice(),c=n.firstChild,u=o.length;for(let r=0;r<u;++r){if(r>=l.length){e(o[r],n);continue}let a=l[r],u=o[r];if(a===u){c=c.nextSibling;continue}if("text"===a.type&&"text"===u.type){c.textContent!==u.content&&(c.textContent=u.content),c=c.nextSibling;continue}if("text"===a.type||"text"===u.type){X.ArrayExt.insert(l,r,u),e(u,n,c);continue}if(!a.renderer!=!u.renderer){X.ArrayExt.insert(l,r,u),e(u,n,c);continue}let h=u.attrs.key;if(h&&h in s){let t=s[h];t.vNode!==a&&(X.ArrayExt.move(l,l.indexOf(t.vNode,r+1),r),n.insertBefore(t.element,c),a=t.vNode,c=t.element)}if(a===u){c=c.nextSibling;continue}let f=a.attrs.key;f&&f!==h?(X.ArrayExt.insert(l,r,u),e(u,n,c)):a.tag===u.tag?(i(c,a.attrs,u.attrs),u.renderer?u.renderer.render(c,{attrs:u.attrs,children:u.children}):t(c,a.children,u.children),c=c.nextSibling):(X.ArrayExt.insert(l,r,u),e(u,n,c))}r(n,l,u,!0)};let n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function i(t,e,r){if(e===r)return;let i;for(i in e)i in n||i in r||("on"===i.substr(0,2)?t[i]=null:t.removeAttribute(i));for(i in r)i in n||e[i]===r[i]||("on"===i.substr(0,2)?t[i]=r[i]:t.setAttribute(i,r[i]));e.className!==r.className&&(void 0!==r.className?t.setAttribute("class",r.className):t.removeAttribute("class")),e.htmlFor!==r.htmlFor&&(void 0!==r.htmlFor?t.setAttribute("for",r.htmlFor):t.removeAttribute("for")),e.dataset!==r.dataset&&function(t,e,r){for(let n in e)n in r||t.removeAttribute(`data-${n}`);for(let n in r)e[n]!==r[n]&&t.setAttribute(`data-${n}`,r[n])}(t,e.dataset||{},r.dataset||{}),e.style!==r.style&&function(t,e,r){let n,i=t.style;for(n in e)n in r||(i[n]="");for(n in r)e[n]!==r[n]&&(i[n]=r[n])}(t,e.style||{},r.style||{})}}(Y||(Y={}));var Q,tt=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}};!function(t){t.calc=function(t,e){let r=t.length;if(0===r)return e;let n=0,i=0,a=0,o=0,s=0;for(let e=0;e<r;++e){let r=t[e],l=r.minSize,c=r.maxSize,u=r.sizeHint;r.done=!1,r.size=Math.max(l,Math.min(u,c)),a+=r.size,n+=l,i+=c,r.stretch>0&&(o+=r.stretch,s++)}if(e===a)return 0;if(e<=n){for(let e=0;e<r;++e){let r=t[e];r.size=r.minSize}return e-n}if(e>=i){for(let e=0;e<r;++e){let r=t[e];r.size=r.maxSize}return e-i}let l=.01,c=r;if(e<a){let n=a-e;for(;s>0&&n>l;){let e=n,i=o;for(let a=0;a<r;++a){let r=t[a];if(r.done||0===r.stretch)continue;let l=r.stretch*e/i;r.size-l<=r.minSize?(n-=r.size-r.minSize,o-=r.stretch,r.size=r.minSize,r.done=!0,c--,s--):(n-=l,r.size-=l)}}for(;c>0&&n>l;){let e=n/c;for(let i=0;i<r;++i){let r=t[i];r.done||(r.size-e<=r.minSize?(n-=r.size-r.minSize,r.size=r.minSize,r.done=!0,c--):(n-=e,r.size-=e))}}}else{let n=e-a;for(;s>0&&n>l;){let e=n,i=o;for(let a=0;a<r;++a){let r=t[a];if(r.done||0===r.stretch)continue;let l=r.stretch*e/i;r.size+l>=r.maxSize?(n-=r.maxSize-r.size,o-=r.stretch,r.size=r.maxSize,r.done=!0,c--,s--):(n-=l,r.size+=l)}}for(;c>0&&n>l;){let e=n/c;for(let i=0;i<r;++i){let r=t[i];r.done||(r.size+e>=r.maxSize?(n-=r.maxSize-r.size,r.size=r.maxSize,r.done=!0,c--):(n-=e,r.size+=e))}}}return 0},t.adjust=function(t,e,r){0===t.length||0===r||(r>0?function(t,e,r){let n=0;for(let r=0;r<=e;++r){let e=t[r];n+=e.maxSize-e.size}let i=0;for(let r=e+1,n=t.length;r<n;++r){let e=t[r];i+=e.size-e.minSize}let a=r=Math.min(r,n,i);for(let r=e;r>=0&&a>0;--r){let e=t[r],n=e.maxSize-e.size;n>=a?(e.sizeHint=e.size+a,a=0):(e.sizeHint=e.size+n,a-=n)}let o=r;for(let r=e+1,n=t.length;r<n&&o>0;++r){let e=t[r],n=e.size-e.minSize;n>=o?(e.sizeHint=e.size-o,o=0):(e.sizeHint=e.size-n,o-=n)}}(t,e,r):function(t,e,r){let n=0;for(let r=e+1,i=t.length;r<i;++r){let e=t[r];n+=e.maxSize-e.size}let i=0;for(let r=0;r<=e;++r){let e=t[r];i+=e.size-e.minSize}let a=r=Math.min(r,n,i);for(let r=e+1,n=t.length;r<n&&a>0;++r){let e=t[r],n=e.maxSize-e.size;n>=a?(e.sizeHint=e.size+a,a=0):(e.sizeHint=e.size+n,a-=n)}let o=r;for(let r=e;r>=0&&o>0;--r){let e=t[r],n=e.size-e.minSize;n>=o?(e.sizeHint=e.size-o,o=0):(e.sizeHint=e.size-n,o-=n)}}(t,e,-r))}}(Q||(Q={}));var et,rt=class{constructor(t){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new z(this),this._isDisposed=!1,this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon&&(this._icon=t.icon),void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))}get icon(){return this._icon}set icon(t){this._icon!==t&&(this._icon=t,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))}get caption(){return this._caption}set caption(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))}get className(){return this._className}set className(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))}get closable(){return this._closable}set closable(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,z.clearData(this))}},nt=class t{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new z(this),this._hiddenMode=t.HiddenMode.Display,this.node=et.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),z.clearData(this),M.clearData(this),I.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(t.Flag.IsDisposed)}get isAttached(){return this.testFlag(t.Flag.IsAttached)}get isHidden(){return this.testFlag(t.Flag.IsHidden)}get isVisible(){return this.testFlag(t.Flag.IsVisible)}get title(){return et.titleProperty.get(this)}get id(){return this.node.id}set id(t){this.node.id=t}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==t.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let e=new t.ChildMessage("child-removed",this);M.sendMessage(this._parent,e)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let e=new t.ChildMessage("child-added",this);M.sendMessage(this._parent,e)}this.isDisposed||M.sendMessage(this,t.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(t){for(let e=t;e;e=e._parent)if(e===this)return!0;return!1}hasClass(t){return this.node.classList.contains(t)}addClass(t){this.node.classList.add(t)}removeClass(t){this.node.classList.remove(t)}toggleClass(t,e){return!0===e?(this.node.classList.add(t),!0):!1===e?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)}update(){M.postMessage(this,t.Msg.UpdateRequest)}fit(){M.postMessage(this,t.Msg.FitRequest)}activate(){M.postMessage(this,t.Msg.ActivateRequest)}close(){M.sendMessage(this,t.Msg.CloseRequest)}show(){if(this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.AfterShow),this.parent)){let e=new t.ChildMessage("child-shown",this);M.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.AfterHide),this.parent)){let e=new t.ChildMessage("child-hidden",this);M.sendMessage(this.parent,e)}}setHidden(t){t?this.hide():this.show()}testFlag(t){return!!(this._flags&t)}setFlag(t){this._flags|=t}clearFlag(t){this._flags&=~t}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}}notifyLayout(t){this._layout&&this._layout.processParentMessage(t)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)}onResize(t){}onUpdateRequest(t){}onFitRequest(t){}onActivateRequest(t){}onBeforeShow(t){}onAfterShow(t){}onBeforeHide(t){}onAfterHide(t){}onBeforeAttach(t){}onAfterAttach(t){}onBeforeDetach(t){}onAfterDetach(t){}onChildAdded(t){}onChildRemoved(t){}_toggleHidden(e){if(e)switch(this._hiddenMode){case t.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case t.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}};!function(t){var e;(e=t.HiddenMode||(t.HiddenMode={}))[e.Display=0]="Display",e[e.Scale=1]="Scale",e[e.ContentVisibility=2]="ContentVisibility",function(t){t[t.IsDisposed=1]="IsDisposed",t[t.IsAttached=2]="IsAttached",t[t.IsHidden=4]="IsHidden",t[t.IsVisible=8]="IsVisible",t[t.DisallowLayout=16]="DisallowLayout"}(t.Flag||(t.Flag={})),function(t){t.BeforeShow=new S("before-show"),t.AfterShow=new S("after-show"),t.BeforeHide=new S("before-hide"),t.AfterHide=new S("after-hide"),t.BeforeAttach=new S("before-attach"),t.AfterAttach=new S("after-attach"),t.BeforeDetach=new S("before-detach"),t.AfterDetach=new S("after-detach"),t.ParentChanged=new S("parent-changed"),t.UpdateRequest=new E("update-request"),t.FitRequest=new E("fit-request"),t.ActivateRequest=new E("activate-request"),t.CloseRequest=new E("close-request")}(t.Msg||(t.Msg={})),t.ChildMessage=class extends S{constructor(t,e){super(t),this.child=e}};class r extends S{constructor(t,e){super("resize"),this.width=t,this.height=e}}t.ResizeMessage=r,function(t){t.UnknownSize=new t(-1,-1)}(r=t.ResizeMessage||(t.ResizeMessage={})),t.attach=function(e,r,n=null){if(e.parent)throw new Error("Cannot attach a child widget.");if(e.isAttached||e.node.isConnected)throw new Error("Widget is already attached.");if(!r.isConnected)throw new Error("Host is not attached.");M.sendMessage(e,t.Msg.BeforeAttach),r.insertBefore(e.node,n),M.sendMessage(e,t.Msg.AfterAttach)},t.detach=function(e){if(e.parent)throw new Error("Cannot detach a child widget.");if(!e.isAttached||!e.node.isConnected)throw new Error("Widget is not attached.");M.sendMessage(e,t.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),M.sendMessage(e,t.Msg.AfterDetach)}}(nt||(nt={})),function(t){t.titleProperty=new I({name:"title",create:t=>new rt({owner:t})}),t.createNode=function(t){return t.node||document.createElement(t.tag||"div")}}(et||(et={}));var it=class{constructor(t={}){this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,z.clearData(this),I.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(t){if(this._parent!==t){if(this._parent)throw new Error("Cannot change parent widget.");if(t.layout!==this)throw new Error("Invalid parent widget.");this._parent=t,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}}init(){for(let t of this)t.parent=this.parent}onResize(t){for(let t of this)M.sendMessage(t,nt.ResizeMessage.UnknownSize)}onUpdateRequest(t){for(let t of this)M.sendMessage(t,nt.ResizeMessage.UnknownSize)}onBeforeAttach(t){for(let e of this)M.sendMessage(e,t)}onAfterAttach(t){for(let e of this)M.sendMessage(e,t)}onBeforeDetach(t){for(let e of this)M.sendMessage(e,t)}onAfterDetach(t){for(let e of this)M.sendMessage(e,t)}onBeforeShow(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onAfterShow(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onBeforeHide(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onAfterHide(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onChildRemoved(t){this.removeWidget(t.child)}onFitRequest(t){}onChildShown(t){}onChildHidden(t){}};!function(t){t.getHorizontalAlignment=function(t){return at.horizontalAlignmentProperty.get(t)},t.setHorizontalAlignment=function(t,e){at.horizontalAlignmentProperty.set(t,e)},t.getVerticalAlignment=function(t){return at.verticalAlignmentProperty.get(t)},t.setVerticalAlignment=function(t,e){at.verticalAlignmentProperty.set(t,e)}}(it||(it={}));var at,ot=class{constructor(t){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=t,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.height="",t.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let t=i.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight}update(t,e,r,n){let i=Math.max(this._minWidth,Math.min(r,this._maxWidth)),a=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(i<r)switch(it.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(r-i)/2;break;case"right":t+=r-i;break;default:throw"unreachable"}if(a<n)switch(it.getVerticalAlignment(this.widget)){case"top":break;case"center":e+=(n-a)/2;break;case"bottom":e+=n-a;break;default:throw"unreachable"}let o=!1,s=this.widget.node.style;if(this._top!==e&&(this._top=e,s.top=`${e}px`),this._left!==t&&(this._left=t,s.left=`${t}px`),this._width!==i&&(o=!0,this._width=i,s.width=`${i}px`),this._height!==a&&(o=!0,this._height=a,s.height=`${a}px`),o){let t=new nt.ResizeMessage(i,a);M.sendMessage(this.widget,t)}}};!function(t){function e(t){t.parent&&t.parent.layout&&t.parent.update()}t.horizontalAlignmentProperty=new I({name:"horizontalAlignment",create:()=>"center",changed:e}),t.verticalAlignmentProperty=new I({name:"verticalAlignment",create:()=>"top",changed:e})}(at||(at={}));var st,lt=class extends it{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(t){this.insertWidget(this._widgets.length,t)}insertWidget(t,e){e.parent=this.parent;let r=this._widgets.indexOf(e),n=Math.max(0,Math.min(t,this._widgets.length));if(-1===r)return b.ArrayExt.insert(this._widgets,n,e),void(this.parent&&this.attachWidget(n,e));n===this._widgets.length&&n--,r!==n&&(b.ArrayExt.move(this._widgets,r,n),this.parent&&this.moveWidget(r,n,e))}removeWidget(t){this.removeWidgetAt(this._widgets.indexOf(t))}removeWidgetAt(t){let e=b.ArrayExt.removeAt(this._widgets,t);e&&this.parent&&this.detachWidget(t,e)}init(){super.init();let t=0;for(let e of this)this.attachWidget(t++,e)}attachWidget(t,e){let r=this.parent.node.children[t];this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.insertBefore(e.node,r),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach)}moveWidget(t,e,r){this.parent.isAttached&&M.sendMessage(r,nt.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&M.sendMessage(r,nt.Msg.AfterDetach);let n=this.parent.node.children[e];this.parent.isAttached&&M.sendMessage(r,nt.Msg.BeforeAttach),this.parent.node.insertBefore(r.node,n),this.parent.isAttached&&M.sendMessage(r,nt.Msg.AfterAttach)}detachWidget(t,e){this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach)}};!function(t){t.clampDimension=function(t){return Math.max(0,Math.floor(t))}}(st||(st={}));var ct,ut=st,ht=class t extends lt{constructor(t){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=t.renderer,void 0!==t.orientation&&(this._orientation=t.orientation),void 0!==t.alignment&&(this._alignment=t.alignment),void 0!==t.spacing&&(this._spacing=st.clampDimension(t.spacing))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))}get alignment(){return this._alignment}set alignment(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))}get spacing(){return this._spacing}set spacing(t){t=st.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map((t=>t.size))}relativeSizes(){return ct.normalize(this._sizers.map((t=>t.size)))}setRelativeSizes(t,e=!0){let r=this._sizers.length,n=t.slice(0,r);for(;n.length<r;)n.push(0);let i=ct.normalize(n);for(let t=0;t<r;++t){let e=this._sizers[t];e.sizeHint=i[t],e.size=i[t]}this._hasNormedSizes=!0,e&&this.parent&&this.parent.update()}moveHandle(t,e){let r,n=this._handles[t];if(n&&!n.classList.contains("lm-mod-hidden")&&(r="horizontal"===this._orientation?e-n.offsetLeft:e-n.offsetTop,0!==r)){for(let t of this._sizers)t.size>0&&(t.sizeHint=t.size);Q.adjust(this._sizers,t,r),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(t,e){let r=new ot(e),n=ct.createHandle(this.renderer),i=ct.averageSize(this._sizers),a=ct.createSizer(i);b.ArrayExt.insert(this._items,t,r),b.ArrayExt.insert(this._sizers,t,a),b.ArrayExt.insert(this._handles,t,n),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.node.appendChild(n),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(t,e,r){b.ArrayExt.move(this._items,t,e),b.ArrayExt.move(this._sizers,t,e),b.ArrayExt.move(this._handles,t,e),this.parent.fit()}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._items,t),n=b.ArrayExt.removeAt(this._handles,t);b.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.node.removeChild(n),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}updateItemPosition(t,e,r,n,i,a,o){let s=this._items[t];if(s.isHidden)return;let l=this._handles[t].style;e?(r+=this.widgetOffset,s.update(r,n,o,i),r+=o,l.top=`${n}px`,l.left=`${r}px`,l.width=`${this._spacing}px`,l.height=`${i}px`):(n+=this.widgetOffset,s.update(r,n,a,o),n+=o,l.top=`${n}px`,l.left=`${r}px`,l.width=`${a}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,r=-1;for(let t=0,n=this._items.length;t<n;++t)this._items[t].isHidden?this._handles[t].classList.add("lm-mod-hidden"):(this._handles[t].classList.remove("lm-mod-hidden"),r=t,e++);-1!==r&&this._handles[r].classList.add("lm-mod-hidden"),this._fixed=this._spacing*Math.max(0,e-1)+this.widgetOffset*this._items.length;let n="horizontal"===this._orientation,a=n?this._fixed:0,o=n?0:this._fixed;for(let e=0,r=this._items.length;e<r;++e){let r=this._items[e],i=this._sizers[e];i.size>0&&(i.sizeHint=i.size),r.isHidden?(i.minSize=0,i.maxSize=0):(r.fit(),i.stretch=t.getStretch(r.widget),n?(i.minSize=r.minWidth,i.maxSize=r.maxWidth,a+=r.minWidth,o=Math.max(o,r.minHeight)):(i.minSize=r.minHeight,i.maxSize=r.maxHeight,o+=r.minHeight,a=Math.max(a,r.minWidth)))}let s=this._box=i.boxSizing(this.parent.node);a+=s.horizontalSum,o+=s.verticalSum;let l=this.parent.node.style;l.minWidth=`${a}px`,l.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,nt.Msg.UpdateRequest)}_update(t,e){this._dirty=!1;let r=0;for(let t=0,e=this._items.length;t<e;++t)r+=+!this._items[t].isHidden;if(0===r&&0===this.widgetOffset)return;t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n=this._box.paddingTop,a=this._box.paddingLeft,o=t-this._box.horizontalSum,s=e-this._box.verticalSum,l=0,c=0,u="horizontal"===this._orientation;if(r>0){let t;if(t=u?Math.max(0,o-this._fixed):Math.max(0,s-this._fixed),this._hasNormedSizes){for(let e of this._sizers)e.sizeHint*=t;this._hasNormedSizes=!1}let e=Q.calc(this._sizers,t);if(e>0)switch(this._alignment){case"start":break;case"center":l=0,c=e/2;break;case"end":l=0,c=e;break;case"justify":l=e/r,c=0;break;default:throw"unreachable"}}for(let t=0,e=this._items.length;t<e;++t){let e=this._items[t].isHidden?0:this._sizers[t].size+l;this.updateItemPosition(t,u,u?a+c:a,u?n:n+c,s,o,e);let r=this.widgetOffset+(this._handles[t].classList.contains("lm-mod-hidden")?0:this._spacing);u?a+=e+r:n+=e+r}}};!function(t){t.getStretch=function(t){return ct.stretchProperty.get(t)},t.setStretch=function(t,e){ct.stretchProperty.set(t,e)}}(ht||(ht={})),function(t){t.stretchProperty=new I({name:"stretch",create:()=>0,coerce:(t,e)=>Math.max(0,Math.floor(e)),changed:function(t){t.parent&&t.parent.layout instanceof ht&&t.parent.fit()}}),t.createSizer=function(t){let e=new tt;return e.sizeHint=Math.floor(t),e},t.createHandle=function(t){let e=t.createHandle();return e.style.position="absolute",e.style.contain="style",e},t.averageSize=function(t){return t.reduce(((t,e)=>t+e.size),0)/t.length||0},t.normalize=function(t){let e=t.length;if(0===e)return[];let r=t.reduce(((t,e)=>t+Math.abs(e)),0);return 0===r?t.map((t=>1/e)):t.map((t=>t/r))}}(ct||(ct={}));var ft,pt=class extends ht{constructor(t){super({...t,orientation:t.orientation||"vertical"}),this._titles=[],this.titleSpace=t.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(t){t=ut.clampDimension(t),this.widgetOffset!==t&&(this.widgetOffset=t,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(t,e){let r=this._titles[t],n=r.classList.contains("lm-mod-expanded"),i=ft.createTitle(this.renderer,e.title,n);this._titles[t]=i,this.parent.node.replaceChild(i,r)}insertWidget(t,e){e.id||(e.id=`id-${w.UUID.uuid4()}`),super.insertWidget(t,e)}attachWidget(t,e){let r=ft.createTitle(this.renderer,e.title);b.ArrayExt.insert(this._titles,t,r),this.parent.node.appendChild(r),e.node.setAttribute("role","region"),e.node.setAttribute("aria-labelledby",r.id),super.attachWidget(t,e)}moveWidget(t,e,r){b.ArrayExt.move(this._titles,t,e),super.moveWidget(t,e,r)}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._titles,t);this.parent.node.removeChild(r),super.detachWidget(t,e)}updateItemPosition(t,e,r,n,i,a,o){let s=this._titles[t].style;s.top=`${n}px`,s.left=`${r}px`,s.height=`${this.widgetOffset}px`,s.width=e?`${i}px`:`${a}px`,super.updateItemPosition(t,e,r,n,i,a,o)}};!function(t){t.createTitle=function(t,e,r=!0){let n=t.createSectionTitle(e);return n.style.position="absolute",n.style.contain="strict",n.setAttribute("aria-label",`${e.label} Section`),n.setAttribute("aria-expanded",r?"true":"false"),n.setAttribute("aria-controls",e.owner.id),r&&n.classList.add("lm-mod-expanded"),n}}(ft||(ft={}));var dt,mt=class extends nt{constructor(t={}){super(),this.addClass("lm-Panel"),this.layout=dt.createLayout(t)}get widgets(){return this.layout.widgets}addWidget(t){this.layout.addWidget(t)}insertWidget(t,e){this.layout.insertWidget(t,e)}};!function(t){t.createLayout=function(t){return t.layout||new lt}}(dt||(dt={}));var gt,yt=class extends mt{constructor(t={}){super({layout:gt.createLayout(t)}),this._handleMoved=new z(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(t){this.layout.orientation=t}get alignment(){return this.layout.alignment}set alignment(t){this.layout.alignment=t}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(t,e=!0){this.layout.setRelativeSizes(t,e)}handleEvent(t){switch(t.type){case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("pointerdown",this)}onAfterDetach(t){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(t){t.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(t){t.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(t){this._pressData&&(t.preventDefault(),t.stopPropagation()),27===t.keyCode&&this._releaseMouse()}_evtPointerDown(t){if(0!==t.button)return;let e=this.layout,r=b.ArrayExt.findFirstIndex(e.handles,(e=>e.contains(t.target)));if(-1===r)return;t.preventDefault(),t.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let n,i=e.handles[r],a=i.getBoundingClientRect();n="horizontal"===e.orientation?t.clientX-a.left:t.clientY-a.top;let o=window.getComputedStyle(i),s=B.overrideCursor(o.cursor);this._pressData={index:r,delta:n,override:s}}_evtPointerMove(t){t.preventDefault(),t.stopPropagation();let e,r=this.layout,n=this.node.getBoundingClientRect();e="horizontal"===r.orientation?t.clientX-n.left-this._pressData.delta:t.clientY-n.top-this._pressData.delta,r.moveHandle(this._pressData.index,e)}_evtPointerUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}};!function(t){class e{createHandle(){let t=document.createElement("div");return t.className="lm-SplitPanel-handle",t}}t.Renderer=e,t.defaultRenderer=new e,t.getStretch=function(t){return ht.getStretch(t)},t.setStretch=function(t,e){ht.setStretch(t,e)}}(yt||(yt={})),function(t){t.createLayout=function(t){return t.layout||new ht({renderer:t.renderer||yt.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(gt||(gt={}));var vt,xt=class extends yt{constructor(t={}){super({...t,layout:vt.createLayout(t)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new z(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(t){this.layout.titleSpace=t}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(t){super.addWidget(t),t.title.changed.connect(this._onTitleChanged,this)}collapse(t){let e=this.layout.widgets[t];e&&!e.isHidden&&this._toggleExpansion(t)}expand(t){let e=this.layout.widgets[t];e&&e.isHidden&&this._toggleExpansion(t)}insertWidget(t,e){super.insertWidget(t,e),e.title.changed.connect(this._onTitleChanged,this)}handleEvent(t){switch(super.handleEvent(t),t.type){case"click":this._evtClick(t);break;case"keydown":this._eventKeyDown(t)}}onBeforeAttach(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(t)}onAfterDetach(t){super.onAfterDetach(t),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(t){let e=b.ArrayExt.findFirstIndex(this.widgets,(e=>e.contains(t.owner)));e>=0&&(this.layout.updateTitle(e,t.owner),this.update())}_computeWidgetSize(t){let e=this.layout,r=e.widgets[t];if(!r)return;let n=r.isHidden,i=e.absoluteSizes(),a=(n?-1:1)*this.spacing,o=i.reduce(((t,e)=>t+e)),s=[...i];if(n){let e=this._widgetSizesCache.get(r);if(!e)return;s[t]+=e;let n=s.map((t=>t-e>0)).lastIndexOf(!0);-1===n?s.forEach(((r,n)=>{n!==t&&(s[n]-=i[n]/o*(e-a))})):s[n]-=e-a}else{let e=i[t];this._widgetSizesCache.set(r,e),s[t]=0;let n=s.map((t=>t>0)).lastIndexOf(!0);if(-1===n)return;s[n]=i[n]+e+a}return s.map((t=>t/(o+a)))}_evtClick(t){let e=t.target;if(e){let r=b.ArrayExt.findFirstIndex(this.titles,(t=>t.contains(e)));r>=0&&(t.preventDefault(),t.stopPropagation(),this._toggleExpansion(r))}}_eventKeyDown(t){if(t.defaultPrevented)return;let e=t.target,r=!1;if(e){let n=b.ArrayExt.findFirstIndex(this.titles,(t=>t.contains(e)));if(n>=0){let i=t.keyCode.toString();if(t.key.match(/Space|Enter/)||i.match(/13|32/))e.click(),r=!0;else if("horizontal"===this.orientation?t.key.match(/ArrowLeft|ArrowRight/)||i.match(/37|39/):t.key.match(/ArrowUp|ArrowDown/)||i.match(/38|40/)){let e=t.key.match(/ArrowLeft|ArrowUp/)||i.match(/37|38/)?-1:1,a=this.titles.length,o=(n+a+e)%a;this.titles[o].focus(),r=!0}else"End"===t.key||"35"===i?(this.titles[this.titles.length-1].focus(),r=!0):("Home"===t.key||"36"===i)&&(this.titles[0].focus(),r=!0)}r&&t.preventDefault()}}_toggleExpansion(t){let e=this.titles[t],r=this.layout.widgets[t],n=this._computeWidgetSize(t);n&&this.setRelativeSizes(n,!1),r.isHidden?(e.classList.add("lm-mod-expanded"),e.setAttribute("aria-expanded","true"),r.show()):(e.classList.remove("lm-mod-expanded"),e.setAttribute("aria-expanded","false"),r.hide()),this._expansionToggled.emit(t)}};!function(t){class e extends yt.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++e._nInstance}createCollapseIcon(t){return document.createElement("span")}createSectionTitle(t){let e=document.createElement("h3");e.setAttribute("tabindex","0"),e.id=this.createTitleKey(t),e.className=this.titleClassName;for(let r in t.dataset)e.dataset[r]=t.dataset[r];e.appendChild(this.createCollapseIcon(t)).className="lm-AccordionPanel-titleCollapser";let r=e.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=t.label,r.title=t.caption||t.label,e}createTitleKey(t){let e=this._titleKeys.get(t);return void 0===e&&(e=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(t,e)),e}}e._nInstance=0,t.Renderer=e,t.defaultRenderer=new e}(xt||(xt={})),function(t){t.createLayout=function(t){return t.layout||new pt({renderer:t.renderer||xt.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}}(vt||(vt={}));var _t,bt=class t extends lt{constructor(t={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==t.direction&&(this._direction=t.direction),void 0!==t.alignment&&(this._alignment=t.alignment),void 0!==t.spacing&&(this._spacing=ut.clampDimension(t.spacing))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))}get alignment(){return this._alignment}set alignment(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))}get spacing(){return this._spacing}set spacing(t){t=ut.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(t,e){b.ArrayExt.insert(this._items,t,new ot(e)),b.ArrayExt.insert(this._sizers,t,new tt),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(t,e,r){b.ArrayExt.move(this._items,t,e),b.ArrayExt.move(this._sizers,t,e),this.parent.update()}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._items,t);b.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let t=0,r=this._items.length;t<r;++t)e+=+!this._items[t].isHidden;this._fixed=this._spacing*Math.max(0,e-1);let r=_t.isHorizontal(this._direction),n=r?this._fixed:0,a=r?0:this._fixed;for(let e=0,i=this._items.length;e<i;++e){let i=this._items[e],o=this._sizers[e];i.isHidden?(o.minSize=0,o.maxSize=0):(i.fit(),o.sizeHint=t.getSizeBasis(i.widget),o.stretch=t.getStretch(i.widget),r?(o.minSize=i.minWidth,o.maxSize=i.maxWidth,n+=i.minWidth,a=Math.max(a,i.minHeight)):(o.minSize=i.minHeight,o.maxSize=i.maxHeight,a+=i.minHeight,n=Math.max(n,i.minWidth)))}let o=this._box=i.boxSizing(this.parent.node);n+=o.horizontalSum,a+=o.verticalSum;let s=this.parent.node.style;s.minWidth=`${n}px`,s.minHeight=`${a}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,nt.Msg.UpdateRequest)}_update(t,e){this._dirty=!1;let r=0;for(let t=0,e=this._items.length;t<e;++t)r+=+!this._items[t].isHidden;if(0===r)return;t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n,a=this._box.paddingTop,o=this._box.paddingLeft,s=t-this._box.horizontalSum,l=e-this._box.verticalSum;switch(this._direction){case"left-to-right":n=Q.calc(this._sizers,Math.max(0,s-this._fixed));break;case"top-to-bottom":n=Q.calc(this._sizers,Math.max(0,l-this._fixed));break;case"right-to-left":n=Q.calc(this._sizers,Math.max(0,s-this._fixed)),o+=s;break;case"bottom-to-top":n=Q.calc(this._sizers,Math.max(0,l-this._fixed)),a+=l;break;default:throw"unreachable"}let c=0,u=0;if(n>0)switch(this._alignment){case"start":break;case"center":c=0,u=n/2;break;case"end":c=0,u=n;break;case"justify":c=n/r,u=0;break;default:throw"unreachable"}for(let t=0,e=this._items.length;t<e;++t){let e=this._items[t];if(e.isHidden)continue;let r=this._sizers[t].size;switch(this._direction){case"left-to-right":e.update(o+u,a,r+c,l),o+=r+c+this._spacing;break;case"top-to-bottom":e.update(o,a+u,s,r+c),a+=r+c+this._spacing;break;case"right-to-left":e.update(o-u-r-c,a,r+c,l),o-=r+c+this._spacing;break;case"bottom-to-top":e.update(o,a-u-r-c,s,r+c),a-=r+c+this._spacing;break;default:throw"unreachable"}}}};!function(t){t.getStretch=function(t){return _t.stretchProperty.get(t)},t.setStretch=function(t,e){_t.stretchProperty.set(t,e)},t.getSizeBasis=function(t){return _t.sizeBasisProperty.get(t)},t.setSizeBasis=function(t,e){_t.sizeBasisProperty.set(t,e)}}(bt||(bt={})),function(t){function e(t){t.parent&&t.parent.layout instanceof bt&&t.parent.fit()}t.stretchProperty=new I({name:"stretch",create:()=>0,coerce:(t,e)=>Math.max(0,Math.floor(e)),changed:e}),t.sizeBasisProperty=new I({name:"sizeBasis",create:()=>0,coerce:(t,e)=>Math.max(0,Math.floor(e)),changed:e}),t.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))}}(_t||(_t={}));var wt,Tt=class extends mt{constructor(t={}){super({layout:wt.createLayout(t)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(t){this.layout.direction=t}get alignment(){return this.layout.alignment}set alignment(t){this.layout.alignment=t}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}onChildAdded(t){t.child.addClass("lm-BoxPanel-child")}onChildRemoved(t){t.child.removeClass("lm-BoxPanel-child")}};!function(t){t.getStretch=function(t){return bt.getStretch(t)},t.setStretch=function(t,e){bt.setStretch(t,e)},t.getSizeBasis=function(t){return bt.getSizeBasis(t)},t.setSizeBasis=function(t,e){bt.setSizeBasis(t,e)}}(Tt||(Tt={})),function(t){t.createLayout=function(t){return t.layout||new bt(t)}}(wt||(wt={}));var At,kt=class t extends nt{constructor(e){super({node:At.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||t.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(t){let e=At.createItem(this.commands,t);return this._items.push(e),this.refresh(),e}addItems(t){let e=t.map((t=>At.createItem(this.commands,t)));return e.forEach((t=>this._items.push(t))),this.refresh(),e}removeItem(t){this.removeItemAt(this._items.indexOf(t))}removeItemAt(t){b.ArrayExt.removeAt(this._items,t)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){this._results=null,""!==this.inputNode.value?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(t){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(t){this.update(),super.onAfterShow(t)}onActivateRequest(t){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(t){if(this.isHidden)return;let e=this.inputNode.value,r=this.contentNode,n=this._results;if(n||(n=this._results=At.search(this._items,e),this._activeIndex=e?b.ArrayExt.findFirstIndex(n,At.canActivate):-1),!e&&0===n.length)return void Z.render(null,r);if(e&&0===n.length){let t=this.renderer.renderEmptyMessage({query:e});return void Z.render(t,r)}let a=this.renderer,o=this._activeIndex,s=new Array(n.length);for(let t=0,e=n.length;t<e;++t){let e=n[t];if("header"===e.type){let r=e.indices,n=e.category;s[t]=a.renderHeader({category:n,indices:r})}else{let r=e.item,n=e.indices,i=t===o;s[t]=a.renderItem({item:r,indices:n,active:i})}}if(Z.render(s,r),o<0||o>=n.length)r.scrollTop=0;else{let t=r.children[o];i.scrollIntoViewIfNeeded(r,t)}}_evtClick(t){if(0!==t.button)return;if(t.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();let e=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>e.contains(t.target)));-1!==e&&(t.preventDefault(),t.stopPropagation(),this._execute(e))}_evtKeyDown(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let t=this._activeIndex,e=this._results.length,r=t<e-1?t+1:0,n=0===r?e-1:r-1;this._activeIndex=b.ArrayExt.findFirstIndex(this._results,At.canActivate,r,n),this.update()}_activatePreviousItem(){if(!this._results||0===this._results.length)return;let t=this._activeIndex,e=this._results.length,r=t<=0?e-1:t-1,n=r===e-1?0:r+1;this._activeIndex=b.ArrayExt.findLastIndex(this._results,At.canActivate,r,n),this.update()}_execute(t){if(!this._results)return;let e=this._results[t];if(e){if("header"===e.type){let t=this.inputNode;return t.value=`${e.category.toLowerCase()} `,t.focus(),void this.refresh()}e.item.isEnabled&&(this.commands.execute(e.item.command,e.item.args),this.inputNode.value="",this.refresh())}}_toggleFocused(){let t=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",t)}_onGenericChange(){this.refresh()}};!function(t){class e{renderHeader(t){let e=this.formatHeader(t);return J.li({className:"lm-CommandPalette-header"},e)}renderItem(t){let e=this.createItemClass(t),r=this.createItemDataset(t);return t.item.isToggleable?J.li({className:e,dataset:r,role:"menuitemcheckbox","aria-checked":`${t.item.isToggled}`},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t)):J.li({className:e,dataset:r,role:"menuitem"},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t))}renderEmptyMessage(t){let e=this.formatEmptyMessage(t);return J.li({className:"lm-CommandPalette-emptyMessage"},e)}renderItemIcon(t){let e=this.createIconClass(t);return J.div({className:e},t.item.icon,t.item.iconLabel)}renderItemContent(t){return J.div({className:"lm-CommandPalette-itemContent"},this.renderItemLabel(t),this.renderItemCaption(t))}renderItemLabel(t){let e=this.formatItemLabel(t);return J.div({className:"lm-CommandPalette-itemLabel"},e)}renderItemCaption(t){let e=this.formatItemCaption(t);return J.div({className:"lm-CommandPalette-itemCaption"},e)}renderItemShortcut(t){let e=this.formatItemShortcut(t);return J.div({className:"lm-CommandPalette-itemShortcut"},e)}createItemClass(t){let e="lm-CommandPalette-item";t.item.isEnabled||(e+=" lm-mod-disabled"),t.item.isToggled&&(e+=" lm-mod-toggled"),t.active&&(e+=" lm-mod-active");let r=t.item.className;return r&&(e+=` ${r}`),e}createItemDataset(t){return{...t.item.dataset,command:t.item.command}}createIconClass(t){let e="lm-CommandPalette-itemIcon",r=t.item.iconClass;return r?`${e} ${r}`:e}formatHeader(t){return t.indices&&0!==t.indices.length?b.StringExt.highlight(t.category,t.indices,J.mark):t.category}formatEmptyMessage(t){return`No commands found that match '${t.query}'`}formatItemShortcut(t){let e=t.item.keyBinding;return e?W.formatKeystroke(e.keys):null}formatItemLabel(t){return t.indices&&0!==t.indices.length?b.StringExt.highlight(t.item.label,t.indices,J.mark):t.item.label}formatItemCaption(t){return t.item.caption}}t.Renderer=e,t.defaultRenderer=new e}(kt||(kt={})),function(t){function e(t,e){let r=t.category.toLowerCase(),n=`${r} ${t.label.toLowerCase()}`,i=1/0,a=null,o=/\b\w/g;for(;;){let t=o.exec(n);if(!t)break;let r=b.StringExt.matchSumOfDeltas(n,e,t.index);if(!r)break;r.score<=i&&(i=r.score,a=r.indices)}if(!a||i===1/0)return null;let s=r.length+1,l=b.ArrayExt.lowerBound(a,s,((t,e)=>t-e)),c=a.slice(0,l),u=a.slice(l);for(let t=0,e=u.length;t<e;++t)u[t]-=s;return 0===c.length?{matchType:0,categoryIndices:null,labelIndices:u,score:i,item:t}:0===u.length?{matchType:1,categoryIndices:c,labelIndices:null,score:i,item:t}:{matchType:2,categoryIndices:c,labelIndices:u,score:i,item:t}}function r(t,e){let r=t.matchType-e.matchType;if(0!==r)return r;let n=t.score-e.score;if(0!==n)return n;let i=0,a=0;switch(t.matchType){case 0:i=t.labelIndices[0],a=e.labelIndices[0];break;case 1:case 2:i=t.categoryIndices[0],a=e.categoryIndices[0]}if(i!==a)return i-a;let o=t.item.category.localeCompare(e.item.category);if(0!==o)return o;let s=t.item.rank,l=e.item.rank;return s!==l?s<l?-1:1:t.item.label.localeCompare(e.item.label)}t.createNode=function(){let t=document.createElement("div"),e=document.createElement("div"),r=document.createElement("div"),n=document.createElement("input"),i=document.createElement("ul"),a=document.createElement("button");return e.className="lm-CommandPalette-search",r.className="lm-CommandPalette-wrapper",n.className="lm-CommandPalette-input",a.className="lm-close-icon",i.className="lm-CommandPalette-content",i.setAttribute("role","menu"),n.spellcheck=!1,r.appendChild(n),r.appendChild(a),e.appendChild(r),t.appendChild(e),t.appendChild(i),t},t.createItem=function(t,e){return new n(t,e)},t.search=function(t,n){let i=function(t,r){r=function(t){return t.replace(/\s+/g,"").toLowerCase()}(r);let n=[];for(let i=0,a=t.length;i<a;++i){let a=t[i];if(!a.isVisible)continue;if(!r){n.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a});continue}let o=e(a,r);o&&(a.isEnabled||(o.score+=1e3),n.push(o))}return n}(t,n);return i.sort(r),function(t){let e=[];for(let r=0,n=t.length;r<n;++r){let{item:n,categoryIndices:i,labelIndices:a}=t[r],o=n.category;(0===r||o!==t[r-1].item.category)&&e.push({type:"header",category:o,indices:i}),e.push({type:"item",item:n,indices:a})}return e}(i)},t.canActivate=function(t){return"item"===t.type&&t.item.isEnabled};class n{constructor(t,e){this._commands=t,this.category=e.category.trim().replace(/\s+/g," "),this.command=e.command,this.args=e.args||w.JSONExt.emptyObject,this.rank=void 0!==e.rank?e.rank:1/0}get label(){return this._commands.label(this.command,this.args)}get icon(){return this._commands.icon(this.command,this.args)}get iconClass(){return this._commands.iconClass(this.command,this.args)}get iconLabel(){return this._commands.iconLabel(this.command,this.args)}get caption(){return this._commands.caption(this.command,this.args)}get className(){return this._commands.className(this.command,this.args)}get dataset(){return this._commands.dataset(this.command,this.args)}get isEnabled(){return this._commands.isEnabled(this.command,this.args)}get isToggled(){return this._commands.isToggled(this.command,this.args)}get isToggleable(){return this._commands.isToggleable(this.command,this.args)}get isVisible(){return this._commands.isVisible(this.command,this.args)}get keyBinding(){let{command:t,args:e}=this;return b.ArrayExt.findLastValue(this._commands.keyBindings,(r=>r.command===t&&w.JSONExt.deepEqual(r.args,e)))||null}}}(At||(At={}));var Mt,St,Et=class t extends nt{constructor(e){super({node:Mt.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new z(this),this._menuRequested=new z(this),this.addClass("lm-Menu"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||t.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let t=this;for(;t._parentMenu;)t=t._parentMenu;return t}get leafMenu(){let t=this;for(;t._childMenu;)t=t._childMenu;return t}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(t){this.activeIndex=t?this._items.indexOf(t):-1}get activeIndex(){return this._activeIndex}set activeIndex(t){(t<0||t>=this._items.length)&&(t=-1),-1!==t&&!Mt.canActivate(this._items[t])&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let t=this._items.length,e=this._activeIndex,r=e<t-1?e+1:0,n=0===r?t-1:r-1;this.activeIndex=b.ArrayExt.findFirstIndex(this._items,Mt.canActivate,r,n)}activatePreviousItem(){let t=this._items.length,e=this._activeIndex,r=e<=0?t-1:e-1,n=r===t-1?0:r+1;this.activeIndex=b.ArrayExt.findLastIndex(this._items,Mt.canActivate,r,n)}triggerActiveItem(){if(!this.isAttached)return;let t=this.activeItem;if(!t)return;if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"===t.type)return void this._openChildMenu(!0);this.rootMenu.close();let{command:e,args:r}=t;this.commands.isEnabled(e,r)?this.commands.execute(e,r):console.log(`Command '${e}' is disabled.`)}addItem(t){return this.insertItem(this._items.length,t)}insertItem(t,e){this.isAttached&&this.close(),this.activeIndex=-1;let r=Math.max(0,Math.min(t,this._items.length)),n=Mt.createItem(this,e);return b.ArrayExt.insert(this._items,r,n),this.update(),n}removeItem(t){this.removeItemAt(this._items.indexOf(t))}removeItemAt(t){this.isAttached&&this.close(),this.activeIndex=-1,b.ArrayExt.removeAt(this._items,t)&&this.update()}clearItems(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())}open(t,e,r={}){var n,i;if(this.isAttached)return;let a=r.forceX||!1,o=r.forceY||!1,s=null!==(n=r.host)&&void 0!==n?n:null,l=null!==(i=r.ref)&&void 0!==i?i:null;Mt.openRootMenu(this,t,e,a,o,s,l),this.activate()}handleEvent(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mouseup":this._evtMouseUp(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseenter":this._evtMouseEnter(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"mousedown":this._evtMouseDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)}onAfterDetach(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)}onActivateRequest(t){this.isAttached&&this.node.focus()}onUpdateRequest(t){let e=this._items,r=this.renderer,n=this._activeIndex,i=Mt.computeCollapsed(e),a=new Array(e.length);for(let t=0,o=e.length;t<o;++t){let o=e[t],s=t===n,l=i[t];a[t]=r.renderItem({item:o,active:s,collapsed:l,onfocus:()=>{this.activeIndex=t}})}Z.render(a,this.contentNode)}onCloseRequest(t){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let e=this._childMenu;e&&(this._childIndex=-1,this._childMenu=null,e._parentMenu=null,e.close());let r=this._parentMenu;r&&(this._parentMenu=null,r._childIndex=-1,r._childMenu=null,r.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(t)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation();let e=t.keyCode;if(13===e)return void this.triggerActiveItem();if(27===e)return void this.close();if(37===e)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===e)return void this.activatePreviousItem();if(39===e){let t=this.activeItem;return void(t&&"submenu"===t.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next"))}if(40===e)return void this.activateNextItem();let r=U().keyForKeydownEvent(t);if(!r)return;let n=this._activeIndex+1,i=Mt.findMnemonic(this._items,r,n);-1===i.index||i.multiple?-1!==i.index?this.activeIndex=i.index:-1!==i.auto&&(this.activeIndex=i.auto):(this.activeIndex=i.index,this.triggerActiveItem())}_evtMouseUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(t){let e=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>i.hitTest(e,t.clientX,t.clientY)));if(e===this._activeIndex)return;if(this.activeIndex=e,e=this.activeIndex,e===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let r=this.activeItem;!r||"submenu"!==r.type||!r.submenu||this._startOpenTimer()}_evtMouseEnter(t){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(t){if(this._cancelOpenTimer(),!this._childMenu)return void(this.activeIndex=-1);let{clientX:e,clientY:r}=t;i.hitTest(this._childMenu.node,e,r)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtMouseDown(t){this._parentMenu||(Mt.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())}_openChildMenu(e=!1){let r=this.activeItem;if(!r||"submenu"!==r.type||!r.submenu)return void this._closeChildMenu();let n=r.submenu;if(n===this._childMenu)return;t.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,M.sendMessage(this,nt.Msg.UpdateRequest);let i=this.contentNode.children[this._activeIndex];Mt.openSubmenu(n,i),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout((()=>{this._openTimerID=0,this._openChildMenu()}),Mt.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((()=>{this._closeTimerID=0,this._closeChildMenu()}),Mt.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Mt.saveWindowData()}};!function(t){class e{renderItem(t){let e=this.createItemClass(t),r=this.createItemDataset(t),n=this.createItemARIA(t);return J.li({className:e,dataset:r,tabindex:"0",onfocus:t.onfocus,...n},this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))}renderIcon(t){let e=this.createIconClass(t);return J.div({className:e},t.item.icon,t.item.iconLabel)}renderLabel(t){let e=this.formatLabel(t);return J.div({className:"lm-Menu-itemLabel"},e)}renderShortcut(t){let e=this.formatShortcut(t);return J.div({className:"lm-Menu-itemShortcut"},e)}renderSubmenu(t){return J.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(t){let e="lm-Menu-item";t.item.isEnabled||(e+=" lm-mod-disabled"),t.item.isToggled&&(e+=" lm-mod-toggled"),t.item.isVisible||(e+=" lm-mod-hidden"),t.active&&(e+=" lm-mod-active"),t.collapsed&&(e+=" lm-mod-collapsed");let r=t.item.className;return r&&(e+=` ${r}`),e}createItemDataset(t){let e,{type:r,command:n,dataset:i}=t.item;return e="command"===r?{...i,type:r,command:n}:{...i,type:r},e}createIconClass(t){let e="lm-Menu-itemIcon",r=t.item.iconClass;return r?`${e} ${r}`:e}createItemARIA(t){let e={};switch(t.item.type){case"separator":e.role="presentation";break;case"submenu":e["aria-haspopup"]="true",t.item.isEnabled||(e["aria-disabled"]="true");break;default:t.item.isEnabled||(e["aria-disabled"]="true"),e.role="menuitem"}return e}formatLabel(t){let{label:e,mnemonic:r}=t.item;if(r<0||r>=e.length)return e;let n=e.slice(0,r),i=e.slice(r+1),a=e[r];return[n,J.span({className:"lm-Menu-itemMnemonic"},a),i]}formatShortcut(t){let e=t.item.keyBinding;return e?W.formatKeystroke(e.keys):null}}t.Renderer=e,t.defaultRenderer=new e}(Et||(Et={})),function(t){t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3;let e=null,r=0;function n(){return r>0?(r--,e):o()}function a(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}function o(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}t.saveWindowData=function(){e=o(),r++},t.createNode=function(){let t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-Menu-content",t.appendChild(e),e.setAttribute("role","menu"),t.tabIndex=0,t},t.canActivate=a,t.createItem=function(t,e){return new s(t.commands,e)},t.hitTestMenus=function(t,e,r){for(let n=t;n;n=n.childMenu)if(i.hitTest(n.node,e,r))return!0;return!1},t.computeCollapsed=function(t){let e=new Array(t.length);b.ArrayExt.fill(e,!1);let r=0,n=t.length;for(;r<n;++r){let n=t[r];if(n.isVisible){if("separator"!==n.type)break;e[r]=!0}}let i=n-1;for(;i>=0;--i){let r=t[i];if(r.isVisible){if("separator"!==r.type)break;e[i]=!0}}let a=!1;for(;++r<i;){let n=t[r];n.isVisible&&("separator"!==n.type?a=!1:a?e[r]=!0:a=!0)}return e},t.openRootMenu=function(t,e,r,i,a,o,s){let l=n(),c=l.pageXOffset,u=l.pageYOffset,h=l.clientWidth,f=l.clientHeight;M.sendMessage(t,nt.Msg.UpdateRequest);let p=f-(a?r:0),d=t.node,m=d.style;m.opacity="0",m.maxHeight=`${p}px`,nt.attach(t,o||document.body,s);let{width:g,height:y}=d.getBoundingClientRect();!i&&e+g>c+h&&(e=c+h-g),!a&&r+y>u+f&&(r>u+f?r=u+f-y:r-=y),m.transform=`translate(${Math.max(0,e)}px, ${Math.max(0,r)}px`,m.opacity="1"},t.openSubmenu=function(e,r){let a=n(),o=a.pageXOffset,s=a.pageYOffset,l=a.clientWidth,c=a.clientHeight;M.sendMessage(e,nt.Msg.UpdateRequest);let u=c,h=e.node,f=h.style;f.opacity="0",f.maxHeight=`${u}px`,nt.attach(e,document.body);let{width:p,height:d}=h.getBoundingClientRect(),m=i.boxSizing(e.node),g=r.getBoundingClientRect(),y=g.right-t.SUBMENU_OVERLAP;y+p>o+l&&(y=g.left+t.SUBMENU_OVERLAP-p);let v=g.top-m.borderTop-m.paddingTop;v+d>s+c&&(v=g.bottom+m.borderBottom+m.paddingBottom-d),f.transform=`translate(${Math.max(0,y)}px, ${Math.max(0,v)}px`,f.opacity="1"},t.findMnemonic=function(t,e,r){let n=-1,i=-1,o=!1,s=e.toUpperCase();for(let e=0,l=t.length;e<l;++e){let c=(e+r)%l,u=t[c];if(!a(u))continue;let h=u.label;if(0===h.length)continue;let f=u.mnemonic;f>=0&&f<h.length?h[f].toUpperCase()===s&&(-1===n?n=c:o=!0):-1===i&&h[0].toUpperCase()===s&&(i=c)}return{index:n,multiple:o,auto:i}};class s{constructor(t,e){this._commands=t,this.type=e.type||"command",this.command=e.command||"",this.args=e.args||w.JSONExt.emptyObject,this.submenu=e.submenu||null}get label(){return"command"===this.type?this._commands.label(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.label:""}get mnemonic(){return"command"===this.type?this._commands.mnemonic(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.mnemonic:-1}get icon(){return"command"===this.type?this._commands.icon(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.icon:void 0}get iconClass(){return"command"===this.type?this._commands.iconClass(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconClass:""}get iconLabel(){return"command"===this.type?this._commands.iconLabel(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""}get caption(){return"command"===this.type?this._commands.caption(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.caption:""}get className(){return"command"===this.type?this._commands.className(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.className:""}get dataset(){return"command"===this.type?this._commands.dataset(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.dataset:{}}get isEnabled(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get isToggled(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)}get isVisible(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get keyBinding(){if("command"===this.type){let{command:t,args:e}=this;return b.ArrayExt.findLastValue(this._commands.keyBindings,(r=>r.command===t&&w.JSONExt.deepEqual(r.args,e)))||null}return null}}}(Mt||(Mt={})),function(t){function e(t,e){let r=t.rank,n=e.rank;return r!==n?r<n?-1:1:t.id-e.id}function r(t,r){let n=o.calculateSpecificity(t.selector),i=o.calculateSpecificity(r.selector);return n!==i?i-n:e(t,r)}t.createItem=function(t,e){let r=function(t){if(-1!==t.indexOf(","))throw new Error(`Selector cannot contain commas: ${t}`);if(!o.isValid(t))throw new Error(`Invalid selector: ${t}`);return t}(t.selector),n=void 0!==t.rank?t.rank:1/0;return{...t,selector:r,rank:n,id:e}},t.matchItems=function(t,n,i,a){let s=n.target;if(!s)return null;let l=n.currentTarget;if(!l||!l.contains(s)&&(s=document.elementFromPoint(n.clientX,n.clientY),!s||!l.contains(s)))return null;let c=[],u=t.slice();for(;null!==s;){let t=[];for(let e=0,r=u.length;e<r;++e){let r=u[e];r&&o.matches(s,r.selector)&&(t.push(r),u[e]=null)}if(0!==t.length&&(i&&t.sort(a?r:e),c.push(...t)),s===l)break;s=s.parentElement}return i||c.sort(a?r:e),c}}(St||(St={}));var Ct,It=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End"],Lt=class t extends nt{constructor(e={}){super({node:Ct.createNode()}),this._currentIndex=-1,this._titles=[],this._titlesEditable=!1,this._previousTitle=null,this._dragData=null,this._addButtonEnabled=!1,this._tabMoved=new z(this),this._currentChanged=new z(this),this._addRequested=new z(this),this._tabCloseRequested=new z(this),this._tabDetachRequested=new z(this),this._tabActivateRequested=new z(this),this.addClass("lm-TabBar"),this.contentNode.setAttribute("role","tablist"),this.setFlag(nt.Flag.DisallowLayout),this._document=e.document||document,this.tabsMovable=e.tabsMovable||!1,this.titlesEditable=e.titlesEditable||!1,this.allowDeselect=e.allowDeselect||!1,this.addButtonEnabled=e.addButtonEnabled||!1,this.insertBehavior=e.insertBehavior||"select-tab-if-needed",this.name=e.name||"",this.orientation=e.orientation||"horizontal",this.removeBehavior=e.removeBehavior||"select-tab-after",this.renderer=e.renderer||t.defaultRenderer}dispose(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,super.dispose()}get currentChanged(){return this._currentChanged}get tabMoved(){return this._tabMoved}get tabActivateRequested(){return this._tabActivateRequested}get addRequested(){return this._addRequested}get tabCloseRequested(){return this._tabCloseRequested}get tabDetachRequested(){return this._tabDetachRequested}get document(){return this._document}get titlesEditable(){return this._titlesEditable}set titlesEditable(t){this._titlesEditable=t}get currentTitle(){return this._titles[this._currentIndex]||null}set currentTitle(t){this.currentIndex=t?this._titles.indexOf(t):-1}get currentIndex(){return this._currentIndex}set currentIndex(t){if((t<0||t>=this._titles.length)&&(t=-1),this._currentIndex===t)return;let e=this._currentIndex,r=this._titles[e]||null,n=t,i=this._titles[n]||null;this._currentIndex=n,this._previousTitle=r,this.update(),this._currentChanged.emit({previousIndex:e,previousTitle:r,currentIndex:n,currentTitle:i})}get name(){return this._name}set name(t){this._name=t,t?this.contentNode.setAttribute("aria-label",t):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.contentNode.setAttribute("aria-orientation",t))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(t){this._addButtonEnabled!==t&&(this._addButtonEnabled=t,t?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(t){return this.insertTab(this._titles.length,t)}insertTab(t,e){this._releaseMouse();let r=Ct.asTitle(e),n=this._titles.indexOf(r),i=Math.max(0,Math.min(t,this._titles.length));return-1===n?(b.ArrayExt.insert(this._titles,i,r),r.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(i,r),r):(i===this._titles.length&&i--,n===i||(b.ArrayExt.move(this._titles,n,i),this.update(),this._adjustCurrentForMove(n,i)),r)}removeTab(t){this.removeTabAt(this._titles.indexOf(t))}removeTabAt(t){this._releaseMouse();let e=b.ArrayExt.removeAt(this._titles,t);e&&(e.changed.disconnect(this._onTitleChanged,this),e===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(t,e))}clearTabs(){if(0===this._titles.length)return;this._releaseMouse();for(let t of this._titles)t.changed.disconnect(this._onTitleChanged,this);let t=this.currentIndex,e=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==t&&this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(t){switch(t.type){case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"dblclick":this._evtDblClick(t);break;case"keydown":t.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(t):this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(t){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(t){var e;let r=this._titles,n=this.renderer,i=this.currentTitle,a=new Array(r.length),o=null!==(e=this._getCurrentTabindex())&&void 0!==e?e:this._currentIndex>-1?this._currentIndex:0;for(let t=0,e=r.length;t<e;++t){let s=r[t],l=s===i,c=l?e:e-t-1,u=o===t?0:-1;a[t]=n.renderTab({title:s,current:l,zIndex:c,tabIndex:u})}Z.render(a,this.contentNode)}_getCurrentTabindex(){let t=null,e=this.contentNode.querySelector('li[tabindex="0"]');return e?t=[...this.contentNode.children].indexOf(e):this._addButtonEnabled&&"0"===this.addButtonNode.getAttribute("tabindex")&&(t=-1),t}_evtDblClick(t){if(!this.titlesEditable)return;let e=this.contentNode.children,r=b.ArrayExt.findFirstIndex(e,(e=>i.hitTest(e,t.clientX,t.clientY)));if(-1===r)return;let n=this.titles[r],a=e[r].querySelector(".lm-TabBar-tabLabel");if(a&&a.contains(t.target)){let t=n.label||"",e=a.innerHTML;a.innerHTML="";let r=document.createElement("input");r.classList.add("lm-TabBar-tabInput"),r.value=t,a.appendChild(r);let i=()=>{r.removeEventListener("blur",i),a.innerHTML=e,this.node.addEventListener("keydown",this)};r.addEventListener("dblclick",(t=>t.stopPropagation())),r.addEventListener("blur",i),r.addEventListener("keydown",(t=>{"Enter"===t.key?(""!==r.value&&(n.label=n.caption=r.value),i()):"Escape"===t.key&&i()})),this.node.removeEventListener("keydown",this),r.select(),r.focus(),a.children.length>0&&a.children[0].focus()}}_evtKeyDownCapturing(t){t.eventPhase===Event.CAPTURING_PHASE&&(t.preventDefault(),t.stopPropagation(),"Escape"===t.key&&this._releaseMouse())}_evtKeyDown(t){var e,r,n;if("Tab"!==t.key&&t.eventPhase!==Event.CAPTURING_PHASE)if("Enter"===t.key||"Spacebar"===t.key||" "===t.key){let e=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(e))t.preventDefault(),t.stopPropagation(),this._addRequested.emit();else{let r=b.ArrayExt.findFirstIndex(this.contentNode.children,(t=>t.contains(e)));r>=0&&(t.preventDefault(),t.stopPropagation(),this.currentIndex=r)}}else if(It.includes(t.key)){let i=[...this.contentNode.children];if(this.addButtonEnabled&&i.push(this.addButtonNode),i.length<=1)return;t.preventDefault(),t.stopPropagation();let a,o=i.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===t.key&&"horizontal"===this._orientation||"ArrowDown"===t.key&&"vertical"===this._orientation?a=null!==(e=i[o+1])&&void 0!==e?e:i[0]:"ArrowLeft"===t.key&&"horizontal"===this._orientation||"ArrowUp"===t.key&&"vertical"===this._orientation?a=null!==(r=i[o-1])&&void 0!==r?r:i[i.length-1]:"Home"===t.key?a=i[0]:"End"===t.key&&(a=i[i.length-1]),a&&(null===(n=i[o])||void 0===n||n.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}_evtPointerDown(t){if(0!==t.button&&1!==t.button||this._dragData||t.target.classList.contains("lm-TabBar-tabInput"))return;let e=this.addButtonEnabled&&this.addButtonNode.contains(t.target),r=this.contentNode.children,n=b.ArrayExt.findFirstIndex(r,(e=>i.hitTest(e,t.clientX,t.clientY)));if(-1===n&&!e||(t.preventDefault(),t.stopPropagation(),this._dragData={tab:r[n],index:n,pressX:t.clientX,pressY:t.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===t.button||e))return;let a=r[n].querySelector(this.renderer.closeIconSelector);a&&a.contains(t.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(t){let e=this._dragData;if(!e)return;t.preventDefault(),t.stopPropagation();let r=this.contentNode.children;if(e.dragActive||Ct.dragExceeded(e,t)){if(!e.dragActive){let t=e.tab.getBoundingClientRect();"horizontal"===this._orientation?(e.tabPos=e.tab.offsetLeft,e.tabSize=t.width,e.tabPressPos=e.pressX-t.left):(e.tabPos=e.tab.offsetTop,e.tabSize=t.height,e.tabPressPos=e.pressY-t.top),e.tabPressOffset={x:e.pressX-t.left,y:e.pressY-t.top},e.tabLayout=Ct.snapTabLayout(r,this._orientation),e.contentRect=this.contentNode.getBoundingClientRect(),e.override=B.overrideCursor("default"),e.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),e.dragActive=!0}if(!e.detachRequested&&Ct.detachExceeded(e,t)){e.detachRequested=!0;let n=e.index,i=t.clientX,a=t.clientY,o=r[n],s=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:s,tab:o,clientX:i,clientY:a,offset:e.tabPressOffset}),e.dragAborted)return}Ct.layoutTabs(r,e,t,this._orientation)}}_evtPointerUp(t){if(0!==t.button&&1!==t.button)return;let e=this._dragData;if(!e)return;if(t.preventDefault(),t.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!e.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(t.target))return void this._addRequested.emit(void 0);let r=this.contentNode.children,n=b.ArrayExt.findFirstIndex(r,(e=>i.hitTest(e,t.clientX,t.clientY)));if(n!==e.index)return;let a=this._titles[n];if(!a.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:n,title:a});let o=r[n].querySelector(this.renderer.closeIconSelector);return o&&o.contains(t.target)?void this._tabCloseRequested.emit({index:n,title:a}):void 0}if(0!==t.button)return;Ct.finalizeTabPosition(e,this._orientation),e.tab.classList.remove("lm-mod-dragging");let r=Ct.parseTransitionDuration(e.tab);setTimeout((()=>{if(e.dragAborted)return;this._dragData=null,Ct.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),this.removeClass("lm-mod-dragging");let t=e.index,r=e.targetIndex;-1===r||t===r||(b.ArrayExt.move(this._titles,t,r),this._adjustCurrentForMove(t,r),this._tabMoved.emit({fromIndex:t,toIndex:r,title:this._titles[r]}),M.sendMessage(this,nt.Msg.UpdateRequest))}),r)}_releaseMouse(){let t=this._dragData;t&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),t.dragAborted=!0,t.dragActive&&(Ct.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(t,e){let r=this.currentTitle,n=this._currentIndex,i=this.insertBehavior;if("select-tab"===i||"select-tab-if-needed"===i&&-1===n)return this._currentIndex=t,this._previousTitle=r,void this._currentChanged.emit({previousIndex:n,previousTitle:r,currentIndex:t,currentTitle:e});n>=t&&this._currentIndex++}_adjustCurrentForMove(t,e){this._currentIndex===t?this._currentIndex=e:this._currentIndex<t&&this._currentIndex>=e?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=e&&this._currentIndex--}_adjustCurrentForRemove(t,e){let r=this._currentIndex,n=this.removeBehavior;if(r===t)return 0===this._titles.length?(this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})):"select-tab-after"===n?(this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):"select-tab-before"===n?(this._currentIndex=Math.max(0,t-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):"select-previous-tab"===n?(this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):(this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null}));r>t&&this._currentIndex--}_onTitleChanged(t){this.update()}};!function(t){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(t){let e=t.title.caption,r=this.createTabKey(t),n=r,i=this.createTabStyle(t),a=this.createTabClass(t),o=this.createTabDataset(t),s=this.createTabARIA(t);return t.title.closable?J.li({id:n,key:r,className:a,title:e,style:i,dataset:o,...s},this.renderIcon(t),this.renderLabel(t),this.renderCloseIcon(t)):J.li({id:n,key:r,className:a,title:e,style:i,dataset:o,...s},this.renderIcon(t),this.renderLabel(t))}renderIcon(t){let{title:e}=t,r=this.createIconClass(t);return J.div({className:r},e.icon,e.iconLabel)}renderLabel(t){return J.div({className:"lm-TabBar-tabLabel"},t.title.label)}renderCloseIcon(t){return J.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(t){let e=this._tabKeys.get(t.title);return void 0===e&&(e=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(t.title,e)),e}createTabStyle(t){return{zIndex:`${t.zIndex}`}}createTabClass(t){let e="lm-TabBar-tab";return t.title.className&&(e+=` ${t.title.className}`),t.title.closable&&(e+=" lm-mod-closable"),t.current&&(e+=" lm-mod-current"),e}createTabDataset(t){return t.title.dataset}createTabARIA(t){var e;return{role:"tab","aria-selected":t.current.toString(),tabindex:`${null!==(e=t.tabIndex)&&void 0!==e?e:"-1"}`}}createIconClass(t){let e="lm-TabBar-tabIcon",r=t.title.iconClass;return r?`${e} ${r}`:e}}e._nInstance=0,t.Renderer=e,t.defaultRenderer=new e,t.addButtonSelector=".lm-TabBar-addButton"}(Lt||(Lt={})),function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20,t.createNode=function(){let t=document.createElement("div"),e=document.createElement("ul");e.setAttribute("role","tablist"),e.className="lm-TabBar-content",t.appendChild(e);let r=document.createElement("div");return r.className="lm-TabBar-addButton lm-mod-hidden",r.setAttribute("tabindex","-1"),r.setAttribute("role","button"),t.appendChild(r),t},t.asTitle=function(t){return t instanceof rt?t:new rt(t)},t.parseTransitionDuration=function(t){let e=window.getComputedStyle(t);return 1e3*(parseFloat(e.transitionDuration)||0)},t.snapTabLayout=function(t,e){let r=new Array(t.length);for(let n=0,i=t.length;n<i;++n){let i=t[n],a=window.getComputedStyle(i);r[n]="horizontal"===e?{pos:i.offsetLeft,size:i.offsetWidth,margin:parseFloat(a.marginLeft)||0}:{pos:i.offsetTop,size:i.offsetHeight,margin:parseFloat(a.marginTop)||0}}return r},t.dragExceeded=function(e,r){let n=Math.abs(r.clientX-e.pressX),i=Math.abs(r.clientY-e.pressY);return n>=t.DRAG_THRESHOLD||i>=t.DRAG_THRESHOLD},t.detachExceeded=function(e,r){let n=e.contentRect;return r.clientX<n.left-t.DETACH_THRESHOLD||r.clientX>=n.right+t.DETACH_THRESHOLD||r.clientY<n.top-t.DETACH_THRESHOLD||r.clientY>=n.bottom+t.DETACH_THRESHOLD},t.layoutTabs=function(t,e,r,n){let i,a,o,s;"horizontal"===n?(i=e.pressX,a=r.clientX-e.contentRect.left,o=r.clientX,s=e.contentRect.width):(i=e.pressY,a=r.clientY-e.contentRect.top,o=r.clientY,s=e.contentRect.height);let l=e.index,c=a-e.tabPressPos,u=c+e.tabSize;for(let r=0,a=t.length;r<a;++r){let a,h=e.tabLayout[r],f=h.pos+(h.size>>1);if(r<e.index&&c<f)a=`${e.tabSize+e.tabLayout[r+1].margin}px`,l=Math.min(l,r);else if(r>e.index&&u>f)a=-e.tabSize-h.margin+"px",l=Math.max(l,r);else if(r===e.index){let t=o-i,r=s-(e.tabPos+e.tabSize);a=`${Math.max(-e.tabPos,Math.min(t,r))}px`}else a="";"horizontal"===n?t[r].style.left=a:t[r].style.top=a}e.targetIndex=l},t.finalizeTabPosition=function(t,e){let r,n;if(r="horizontal"===e?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)n=0;else if(t.targetIndex>t.index){let e=t.tabLayout[t.targetIndex];n=e.pos+e.size-t.tabSize-t.tabPos}else n=t.tabLayout[t.targetIndex].pos-t.tabPos;let i=r-(t.tabPos+t.tabSize),a=Math.max(-t.tabPos,Math.min(n,i));"horizontal"===e?t.tab.style.left=`${a}px`:t.tab.style.top=`${a}px`},t.resetTabPositions=function(t,e){for(let r of t)"horizontal"===e?r.style.left="":r.style.top=""}}(Ct||(Ct={}));var Pt,zt=class extends it{constructor(t){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=t.renderer,void 0!==t.spacing&&(this._spacing=ut.clampDimension(t.spacing)),this._document=t.document||document,this._hiddenMode=void 0!==t.hiddenMode?t.hiddenMode:nt.HiddenMode.Display}dispose(){let t=this[Symbol.iterator]();this._items.forEach((t=>{t.dispose()})),this._box=null,this._root=null,this._items.clear();for(let e of t)e.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(t){if(this._hiddenMode!==t){this._hiddenMode=t;for(let t of this.tabBars())if(t.titles.length>1)for(let e of t.titles)e.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(t){t=ut.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,b.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,b.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,b.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,b.empty)()}handles(){return this._root?this._root.iterHandles():(0,b.empty)()}moveHandle(t,e,r){let n=t.classList.contains("lm-mod-hidden");if(!this._root||n)return;let i,a=this._root.findSplitNode(t);a&&(i="horizontal"===a.node.orientation?e-t.offsetLeft:r-t.offsetTop,0!==i&&(a.node.holdSizes(),Q.adjust(a.node.sizers,a.index,i),this.parent&&this.parent.update()))}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(t){let e,r=new Set;e=t.main?Pt.normalizeAreaConfig(t.main,r):null;let n=this.widgets(),i=this.tabBars(),a=this.handles();this._root=null;for(let t of n)r.has(t)||(t.parent=null);for(let t of i)t.dispose();for(let t of a)t.parentNode&&t.parentNode.removeChild(t);for(let t of r)t.parent=this.parent;this._root=e?Pt.realizeAreaConfig(e,{createTabBar:t=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):null,this.parent&&(r.forEach((t=>{this.attachWidget(t)})),this.parent.fit())}addWidget(t,e={}){let r=e.ref||null,n=e.mode||"tab-after",i=null;if(this._root&&r&&(i=this._root.findTabNode(r)),r&&!i)throw new Error("Reference widget is not in the layout.");switch(t.parent=this.parent,n){case"tab-after":this._insertTab(t,r,i,!0);break;case"tab-before":this._insertTab(t,r,i,!1);break;case"split-top":this._insertSplit(t,r,i,"vertical",!1);break;case"split-left":this._insertSplit(t,r,i,"horizontal",!1);break;case"split-right":this._insertSplit(t,r,i,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,r,i,"vertical",!0);break;case"merge-top":this._insertSplit(t,r,i,"vertical",!1,!0);break;case"merge-left":this._insertSplit(t,r,i,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(t,r,i,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(t,r,i,"vertical",!0,!0)}this.parent&&(this.attachWidget(t),this.parent.fit())}removeWidget(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())}hitTestTabAreas(t,e){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=i.boxSizing(this.parent.node));let r=this.parent.node.getBoundingClientRect(),n=t-r.left-this._box.borderLeft,a=e-r.top-this._box.borderTop,o=this._root.hitTestTabNodes(n,a);if(!o)return null;let{tabBar:s,top:l,left:c,width:u,height:h}=o,f=this._box.borderLeft+this._box.borderRight,p=this._box.borderTop+this._box.borderBottom;return{tabBar:s,x:n,y:a,top:l,left:c,right:r.width-f-(c+u),bottom:r.height-p-(l+h),width:u,height:h}}init(){super.init();for(let t of this)this.attachWidget(t);for(let t of this.handles())this.parent.node.appendChild(t);this.parent.fit()}attachWidget(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new ot(t)),this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterAttach))}detachWidget(t){if(this.parent.node!==t.node.parentNode)return;this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterDetach);let e=this._items.get(t);e&&(this._items.delete(t),e.dispose())}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_removeWidget(t){if(!this._root)return;let e=this._root.findTabNode(t);if(!e)return;if(Pt.removeAria(t),e.tabBar.titles.length>1)return e.tabBar.removeTab(t.title),void(this._hiddenMode===nt.HiddenMode.Scale&&1==e.tabBar.titles.length&&(e.tabBar.titles[0].owner.hiddenMode=nt.HiddenMode.Display));if(e.tabBar.dispose(),this._root===e)return void(this._root=null);this._root.holdAllSizes();let r=e.parent;e.parent=null;let n=b.ArrayExt.removeFirstOf(r.children,e),i=b.ArrayExt.removeAt(r.handles,n);if(b.ArrayExt.removeAt(r.sizers,n),i.parentNode&&i.parentNode.removeChild(i),r.children.length>1)return void r.syncHandles();let a=r.parent;r.parent=null;let o=r.children[0],s=r.handles[0];if(r.children.length=0,r.handles.length=0,r.sizers.length=0,s.parentNode&&s.parentNode.removeChild(s),this._root===r)return o.parent=null,void(this._root=o);let l=a,c=l.children.indexOf(r);if(o instanceof Pt.TabLayoutNode)return o.parent=l,void(l.children[c]=o);let u=b.ArrayExt.removeAt(l.handles,c);b.ArrayExt.removeAt(l.children,c),b.ArrayExt.removeAt(l.sizers,c),u.parentNode&&u.parentNode.removeChild(u);for(let t=0,e=o.children.length;t<e;++t){let e=o.children[t],r=o.handles[t],n=o.sizers[t];b.ArrayExt.insert(l.children,c+t,e),b.ArrayExt.insert(l.handles,c+t,r),b.ArrayExt.insert(l.sizers,c+t,n),e.parent=l}o.children.length=0,o.handles.length=0,o.sizers.length=0,o.parent=null,l.syncHandles()}_createTabNode(t){let e=new Pt.TabLayoutNode(this._createTabBar());return e.tabBar.addTab(t.title),Pt.addAria(t,e.tabBar),e}_insertTab(t,e,r,n){if(t===e)return;if(!this._root){let e=new Pt.TabLayoutNode(this._createTabBar());return e.tabBar.addTab(t.title),this._root=e,void Pt.addAria(t,e.tabBar)}let i;r||(r=this._root.findFirstTabNode()),-1===r.tabBar.titles.indexOf(t.title)&&(this._removeWidget(t),t.hide()),i=e?r.tabBar.titles.indexOf(e.title):r.tabBar.currentIndex,this._hiddenMode===nt.HiddenMode.Scale?0===r.tabBar.titles.length?t.hiddenMode=nt.HiddenMode.Display:1==r.tabBar.titles.length?r.tabBar.titles[0].owner.hiddenMode=nt.HiddenMode.Scale:t.hiddenMode=nt.HiddenMode.Scale:t.hiddenMode=this._hiddenMode,r.tabBar.insertTab(i+(n?1:0),t.title),Pt.addAria(t,r.tabBar)}_insertSplit(t,e,r,n,i,a=!1){if(t===e&&r&&1===r.tabBar.titles.length)return;if(this._removeWidget(t),!this._root)return void(this._root=this._createTabNode(t));if(!r||!r.parent){let e=this._splitRoot(n),a=i?e.children.length:0;e.normalizeSizes();let o=Pt.createSizer(r?1:Pt.GOLDEN_RATIO),s=this._createTabNode(t);return b.ArrayExt.insert(e.children,a,s),b.ArrayExt.insert(e.sizers,a,o),b.ArrayExt.insert(e.handles,a,this._createHandle()),s.parent=e,e.normalizeSizes(),void e.syncHandles()}let o=r.parent;if(o.orientation===n){let e=o.children.indexOf(r);if(a){let r=e+(i?1:-1),n=o.children[r];if(n instanceof Pt.TabLayoutNode)return this._insertTab(t,null,n,!0),void++n.tabBar.currentIndex}o.normalizeSizes();let n=o.sizers[e].sizeHint/=2,s=e+(i?1:0),l=this._createTabNode(t);return b.ArrayExt.insert(o.children,s,l),b.ArrayExt.insert(o.sizers,s,Pt.createSizer(n)),b.ArrayExt.insert(o.handles,s,this._createHandle()),l.parent=o,void o.syncHandles()}let s=b.ArrayExt.removeFirstOf(o.children,r),l=new Pt.SplitLayoutNode(n);l.normalized=!0,l.children.push(r),l.sizers.push(Pt.createSizer(.5)),l.handles.push(this._createHandle()),r.parent=l;let c=i?1:0,u=this._createTabNode(t);b.ArrayExt.insert(l.children,c,u),b.ArrayExt.insert(l.sizers,c,Pt.createSizer(.5)),b.ArrayExt.insert(l.handles,c,this._createHandle()),u.parent=l,l.syncHandles(),b.ArrayExt.insert(o.children,s,l),l.parent=o}_splitRoot(t){let e=this._root;if(e instanceof Pt.SplitLayoutNode&&e.orientation===t)return e;let r=this._root=new Pt.SplitLayoutNode(t);return e&&(r.children.push(e),r.sizers.push(Pt.createSizer(0)),r.handles.push(this._createHandle()),e.parent=r),r}_fit(){let t=0,e=0;if(this._root){let r=this._root.fit(this._spacing,this._items);t=r.minWidth,e=r.minHeight}let r=this._box=i.boxSizing(this.parent.node);t+=r.horizontalSum,e+=r.verticalSum;let n=this.parent.node.style;n.minWidth=`${t}px`,n.minHeight=`${e}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,nt.Msg.UpdateRequest)}_update(t,e){if(this._dirty=!1,!this._root)return;t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let r=this._box.paddingTop,n=this._box.paddingLeft,a=t-this._box.horizontalSum,o=e-this._box.verticalSum;this._root.update(r,n,a,o,this._spacing,this._items)}_createTabBar(){let t=this.renderer.createTabBar(this._document);return t.orientation="horizontal",this.parent&&this.attachWidget(t),t}_createHandle(){let t=this.renderer.createHandle(),e=t.style;return e.position="absolute",e.contain="strict",e.top="0",e.left="0",e.width="0",e.height="0",this.parent&&this.parent.node.appendChild(t),t}};!function(t){function e(t){let e=new tt;return e.sizeHint=t,e.size=t,e}t.GOLDEN_RATIO=.618,t.createSizer=e,t.normalizeAreaConfig=function t(e,r){let n;return n="tab-area"===e.type?function(t,e){if(0===t.widgets.length)return null;let r=[];for(let n of t.widgets)e.has(n)||(e.add(n),r.push(n));if(0===r.length)return null;let n=t.currentIndex;return-1!==n&&(n<0||n>=r.length)&&(n=0),{type:"tab-area",widgets:r,currentIndex:n}}(e,r):function(e,r){let n=e.orientation,i=[],a=[];for(let o=0,s=e.children.length;o<s;++o){let s=t(e.children[o],r);s&&("tab-area"===s.type||s.orientation!==n?(i.push(s),a.push(Math.abs(e.sizes[o]||0))):(i.push(...s.children),a.push(...s.sizes)))}return 0===i.length?null:1===i.length?i[0]:{type:"split-area",orientation:n,children:i,sizes:a}}(e,r),n},t.realizeAreaConfig=function i(a,o,s){let l;return l="tab-area"===a.type?function(e,n,i){let a=n.createTabBar(i);for(let r of e.widgets)r.hide(),a.addTab(r.title),t.addAria(r,a);return a.currentIndex=e.currentIndex,new r(a)}(a,o,s):function(t,r,a){let o=new n(t.orientation);return t.children.forEach(((n,s)=>{let l=i(n,r,a),c=e(t.sizes[s]),u=r.createHandle();o.children.push(l),o.handles.push(u),o.sizers.push(c),l.parent=o})),o.syncHandles(),o.normalizeSizes(),o}(a,o,s),l};class r{constructor(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let e=new tt,r=new tt;e.stretch=0,r.stretch=1,this.tabBar=t,this.sizers=[e,r]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(let t of this.tabBar.titles)yield t.owner}*iterSelectedWidgets(){let t=this.tabBar.currentTitle;t&&(yield t.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(t){return-1!==this.tabBar.titles.indexOf(t.title)?this:null}findSplitNode(t){return null}findFirstTabNode(){return this}hitTestTabNodes(t,e){return t<this._left||t>=this._left+this._width||e<this._top||e>=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map((t=>t.owner)),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(t,e){let r=0,n=0,i=e.get(this.tabBar),a=this.tabBar.currentTitle,o=a?e.get(a.owner):void 0,[s,l]=this.sizers;return i&&i.fit(),o&&o.fit(),i&&!i.isHidden?(r=Math.max(r,i.minWidth),n+=i.minHeight,s.minSize=i.minHeight,s.maxSize=i.maxHeight):(s.minSize=0,s.maxSize=0),o&&!o.isHidden?(r=Math.max(r,o.minWidth),n+=o.minHeight,l.minSize=o.minHeight,l.maxSize=1/0):(l.minSize=0,l.maxSize=1/0),{minWidth:r,minHeight:n,maxWidth:1/0,maxHeight:1/0}}update(t,e,r,n,i,a){this._top=e,this._left=t,this._width=r,this._height=n;let o=a.get(this.tabBar),s=this.tabBar.currentTitle,l=s?a.get(s.owner):void 0;if(Q.calc(this.sizers,n),o&&!o.isHidden){let n=this.sizers[0].size;o.update(t,e,r,n),e+=n}if(l&&!l.isHidden){let n=this.sizers[1].size;l.update(t,e,r,n)}}}t.TabLayoutNode=r;class n{constructor(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}*iterAllWidgets(){for(let t of this.children)yield*t.iterAllWidgets()}*iterUserWidgets(){for(let t of this.children)yield*t.iterUserWidgets()}*iterSelectedWidgets(){for(let t of this.children)yield*t.iterSelectedWidgets()}*iterTabBars(){for(let t of this.children)yield*t.iterTabBars()}*iterHandles(){yield*this.handles;for(let t of this.children)yield*t.iterHandles()}findTabNode(t){for(let e=0,r=this.children.length;e<r;++e){let r=this.children[e].findTabNode(t);if(r)return r}return null}findSplitNode(t){let e=this.handles.indexOf(t);if(-1!==e)return{index:e,node:this};for(let e=0,r=this.children.length;e<r;++e){let r=this.children[e].findSplitNode(t);if(r)return r}return null}findFirstTabNode(){return 0===this.children.length?null:this.children[0].findFirstTabNode()}hitTestTabNodes(t,e){for(let r=0,n=this.children.length;r<n;++r){let n=this.children[r].hitTestTabNodes(t,e);if(n)return n}return null}createConfig(){let t=this.orientation,e=this.createNormalizedSizes();return{type:"split-area",orientation:t,children:this.children.map((t=>t.createConfig())),sizes:e}}syncHandles(){this.handles.forEach(((t,e)=>{t.setAttribute("data-orientation",this.orientation),e===this.handles.length-1?t.classList.add("lm-mod-hidden"):t.classList.remove("lm-mod-hidden")}))}holdSizes(){for(let t of this.sizers)t.sizeHint=t.size}holdAllSizes(){for(let t of this.children)t.holdAllSizes();this.holdSizes()}normalizeSizes(){let t=this.sizers.length;if(0===t)return;this.holdSizes();let e=this.sizers.reduce(((t,e)=>t+e.sizeHint),0);if(0===e)for(let e of this.sizers)e.size=e.sizeHint=1/t;else for(let t of this.sizers)t.size=t.sizeHint/=e;this.normalized=!0}createNormalizedSizes(){let t=this.sizers.length;if(0===t)return[];let e=this.sizers.map((t=>t.size)),r=e.reduce(((t,e)=>t+e),0);if(0===r)for(let r=e.length-1;r>-1;r--)e[r]=1/t;else for(let t=e.length-1;t>-1;t--)e[t]/=r;return e}fit(t,e){let r="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*t,i=r?n:0,a=r?0:n;for(let n=0,o=this.children.length;n<o;++n){let o=this.children[n].fit(t,e);r?(a=Math.max(a,o.minHeight),i+=o.minWidth,this.sizers[n].minSize=o.minWidth):(i=Math.max(i,o.minWidth),a+=o.minHeight,this.sizers[n].minSize=o.minHeight)}return{minWidth:i,minHeight:a,maxWidth:1/0,maxHeight:1/0}}update(t,e,r,n,i,a){let o="horizontal"===this.orientation,s=Math.max(0,this.children.length-1)*i,l=Math.max(0,(o?r:n)-s);if(this.normalized){for(let t of this.sizers)t.sizeHint*=l;this.normalized=!1}Q.calc(this.sizers,l);for(let s=0,l=this.children.length;s<l;++s){let l=this.children[s],c=this.sizers[s].size,u=this.handles[s].style;o?(l.update(t,e,c,n,i,a),t+=c,u.top=`${e}px`,u.left=`${t}px`,u.width=`${i}px`,u.height=`${n}px`,t+=i):(l.update(t,e,r,c,i,a),e+=c,u.top=`${e}px`,u.left=`${t}px`,u.width=`${r}px`,u.height=`${i}px`,e+=i)}}}t.SplitLayoutNode=n,t.addAria=function(t,e){t.node.setAttribute("role","tabpanel");let r=e.renderer;if(r instanceof Lt.Renderer){let e=r.createTabKey({title:t.title,current:!1,zIndex:0});t.node.setAttribute("aria-labelledby",e)}},t.removeAria=function(t){t.node.removeAttribute("role"),t.node.removeAttribute("aria-labelledby")}}(Pt||(Pt={}));var Dt,Ot=class t extends nt{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new z(this),this._addRequested=new z(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||t.defaultRenderer,this._edges=e.edges||Dt.DEFAULT_EDGES,void 0!==e.tabsMovable&&(this._tabsMovable=e.tabsMovable),void 0!==e.tabsConstrained&&(this._tabsConstrained=e.tabsConstrained),void 0!==e.addButtonEnabled&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;let r={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new zt({document:this._document,renderer:r,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new t.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(t){this.layout.hiddenMode=t}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}get mode(){return this._mode}set mode(t){if(this._mode===t)return;this._mode=t,this.dataset.mode=t;let e=this.layout;switch(t){case"multiple-document":for(let t of e.tabBars())t.show();break;case"single-document":e.restoreLayout(Dt.createSingleDocumentConfig(this));break;default:throw"unreachable"}M.postMessage(this,Dt.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(t){this._tabsMovable=t;for(let e of this.tabBars())e.tabsMovable=t}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(t){this._tabsConstrained=t}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(t){this._addButtonEnabled=t;for(let e of this.tabBars())e.addButtonEnabled=t}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(t){let e=(0,b.find)(this.tabBars(),(e=>-1!==e.titles.indexOf(t.title)));if(!e)throw new Error("Widget is not contained in the dock panel.");e.currentTitle=t.title}activateWidget(t){this.selectWidget(t),t.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(t){this._mode="multiple-document",this.layout.restoreLayout(t),(a.IS_EDGE||a.IS_IE)&&M.flush(),M.postMessage(this,Dt.LayoutModified)}addWidget(t,e={}){"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,e),M.postMessage(this,Dt.LayoutModified)}processMessage(t){"layout-modified"===t.type?this._layoutModified.emit(void 0):super.processMessage(t)}handleEvent(t){switch(t.type){case"lm-dragenter":this._evtDragEnter(t);break;case"lm-dragleave":this._evtDragLeave(t);break;case"lm-dragover":this._evtDragOver(t);break;case"lm-drop":this._evtDrop(t);break;case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(t){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(t){Dt.isGeneratedTabBarProperty.get(t.child)||t.child.addClass("lm-DockPanel-widget")}onChildRemoved(t){Dt.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("lm-DockPanel-widget"),M.postMessage(this,Dt.LayoutModified))}_evtDragEnter(t){t.mimeData.hasData("application/vnd.lumino.widget-factory")&&(t.preventDefault(),t.stopPropagation())}_evtDragLeave(t){t.preventDefault(),(!this._tabsConstrained||t.source===this)&&(t.stopPropagation(),this.overlay.hide(1))}_evtDragOver(t){t.preventDefault(),this._tabsConstrained&&t.source!==this||"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":(t.stopPropagation(),t.dropAction=t.proposedAction)}_evtDrop(t){if(t.preventDefault(),this.overlay.hide(0),"none"===t.proposedAction)return void(t.dropAction="none");let{clientX:e,clientY:r}=t,{zone:n,target:i}=Dt.findDropTarget(this,e,r,this._edges);if(this._tabsConstrained&&t.source!==this||"invalid"===n)return void(t.dropAction="none");let a=t.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof a)return void(t.dropAction="none");let o=a();if(!(o instanceof nt))return void(t.dropAction="none");if(o.contains(this))return void(t.dropAction="none");let s=i?Dt.getDropRef(i.tabBar):null;switch(n){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:s});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:s});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:s});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:s});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:s});break;default:throw"unreachable"}t.dropAction=t.proposedAction,t.stopPropagation(),this.activateWidget(o)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),M.postMessage(this,Dt.LayoutModified))}_evtPointerDown(t){if(0!==t.button)return;let e=this.layout,r=t.target,n=(0,b.find)(e.handles(),(t=>t.contains(r)));if(!n)return;t.preventDefault(),t.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let i=n.getBoundingClientRect(),a=t.clientX-i.left,o=t.clientY-i.top,s=window.getComputedStyle(n),l=B.overrideCursor(s.cursor,this._document);this._pressData={handle:n,deltaX:a,deltaY:o,override:l}}_evtPointerMove(t){if(!this._pressData)return;t.preventDefault(),t.stopPropagation();let e=this.node.getBoundingClientRect(),r=t.clientX-e.left-this._pressData.deltaX,n=t.clientY-e.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,r,n)}_evtPointerUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),M.postMessage(this,Dt.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(t,e){let{zone:r,target:n}=Dt.findDropTarget(this,t,e,this._edges);if("invalid"===r)return this.overlay.hide(100),r;let a,o,s,l,c=i.boxSizing(this.node),u=this.node.getBoundingClientRect();switch(r){case"root-all":a=c.paddingTop,o=c.paddingLeft,s=c.paddingRight,l=c.paddingBottom;break;case"root-top":a=c.paddingTop,o=c.paddingLeft,s=c.paddingRight,l=u.height*Dt.GOLDEN_RATIO;break;case"root-left":a=c.paddingTop,o=c.paddingLeft,s=u.width*Dt.GOLDEN_RATIO,l=c.paddingBottom;break;case"root-right":a=c.paddingTop,o=u.width*Dt.GOLDEN_RATIO,s=c.paddingRight,l=c.paddingBottom;break;case"root-bottom":a=u.height*Dt.GOLDEN_RATIO,o=c.paddingLeft,s=c.paddingRight,l=c.paddingBottom;break;case"widget-all":a=n.top,o=n.left,s=n.right,l=n.bottom;break;case"widget-top":a=n.top,o=n.left,s=n.right,l=n.bottom+n.height/2;break;case"widget-left":a=n.top,o=n.left,s=n.right+n.width/2,l=n.bottom;break;case"widget-right":a=n.top,o=n.left+n.width/2,s=n.right,l=n.bottom;break;case"widget-bottom":a=n.top+n.height/2,o=n.left,s=n.right,l=n.bottom;break;case"widget-tab":{let t=n.tabBar.node.getBoundingClientRect().height;a=n.top,o=n.left,s=n.right,l=n.bottom+n.height-t;break}default:throw"unreachable"}return this.overlay.show({top:a,left:o,right:s,bottom:l}),r}_createTabBar(){let t=this._renderer.createTabBar(this._document);return Dt.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=this._tabsMovable,t.allowDeselect=!1,t.addButtonEnabled=this._addButtonEnabled,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t.addRequested.connect(this._onTabAddRequested,this),t}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){M.postMessage(this,Dt.LayoutModified)}_onCurrentChanged(t,e){let{previousTitle:r,currentTitle:n}=e;r&&r.owner.hide(),n&&n.owner.show(),(a.IS_EDGE||a.IS_IE)&&M.flush(),M.postMessage(this,Dt.LayoutModified)}_onTabAddRequested(t){this._addRequested.emit(t)}_onTabActivateRequested(t,e){e.title.owner.activate()}_onTabCloseRequested(t,e){e.title.owner.close()}_onTabDetachRequested(t,e){if(this._drag)return;t.releaseMouse();let{title:r,tab:n,clientX:i,clientY:a,offset:o}=e,s=new w.MimeData;s.setData("application/vnd.lumino.widget-factory",(()=>r.owner));let l=n.cloneNode(!0);o&&(l.style.top=`-${o.y}px`,l.style.left=`-${o.x}px`),this._drag=new B({document:this._document,mimeData:s,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden"),this._drag.start(i,a).then((()=>{this._drag=null,n.classList.remove("lm-mod-hidden")}))}};!function(t){t.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(t){let e=this.node.style;e.top=`${t.top}px`,e.left=`${t.left}px`,e.right=`${t.right}px`,e.bottom=`${t.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(t){if(!this._hidden){if(t<=0)return clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("lm-mod-hidden");-1===this._timer&&(this._timer=window.setTimeout((()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")}),t))}}};class e{createTabBar(t){let e=new Lt({document:t});return e.addClass("lm-DockPanel-tabBar"),e}createHandle(){let t=document.createElement("div");return t.className="lm-DockPanel-handle",t}}t.Renderer=e,t.defaultRenderer=new e}(Ot||(Ot={})),function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new E("layout-modified"),t.isGeneratedTabBarProperty=new I({name:"isGeneratedTabBar",create:()=>!1}),t.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};let e=Array.from(t.widgets()),r=t.selectedWidgets().next().value,n=r?e.indexOf(r):-1;return{main:{type:"tab-area",widgets:e,currentIndex:n}}},t.findDropTarget=function(t,e,r,n){if(!i.hitTest(t.node,e,r))return{zone:"invalid",target:null};let a=t.layout;if(a.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===t.mode){let i=t.node.getBoundingClientRect(),a=e-i.left+1,o=r-i.top+1,s=i.right-e,l=i.bottom-r;switch(Math.min(o,s,l,a)){case o:if(o<n.top)return{zone:"root-top",target:null};break;case s:if(s<n.right)return{zone:"root-right",target:null};break;case l:if(l<n.bottom)return{zone:"root-bottom",target:null};break;case a:if(a<n.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}let o=a.hitTestTabAreas(e,r);if(!o)return{zone:"invalid",target:null};if("single-document"===t.mode)return{zone:"widget-all",target:o};let s=o.x-o.left+1,l=o.y-o.top+1,c=o.left+o.width-o.x,u=o.top+o.height-o.y;if(l<o.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:o};let h,f=Math.round(o.width/3),p=Math.round(o.height/3);if(s>f&&c>f&&l>p&&u>p)return{zone:"widget-all",target:o};switch(s/=f,l/=p,c/=f,u/=p,Math.min(s,l,c,u)){case s:h="widget-left";break;case l:h="widget-top";break;case c:h="widget-right";break;case u:h="widget-bottom";break;default:throw"unreachable"}return{zone:h,target:o}},t.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner}}(Dt||(Dt={}));var Rt,Ft=class t extends it{constructor(t={}){super(t),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new tt],this._columnSizers=[new tt],this._box=null,void 0!==t.rowCount&&Rt.reallocSizers(this._rowSizers,t.rowCount),void 0!==t.columnCount&&Rt.reallocSizers(this._columnSizers,t.columnCount),void 0!==t.rowSpacing&&(this._rowSpacing=Rt.clampValue(t.rowSpacing)),void 0!==t.columnSpacing&&(this._columnSpacing=Rt.clampValue(t.columnSpacing))}dispose(){for(let t of this._items){let e=t.widget;t.dispose(),e.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(t){t!==this.rowCount&&(Rt.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(t){t!==this.columnCount&&(Rt.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(t){t=Rt.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(t){t=Rt.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())}rowStretch(t){let e=this._rowSizers[t];return e?e.stretch:-1}setRowStretch(t,e){let r=this._rowSizers[t];r&&(e=Rt.clampValue(e),r.stretch!==e&&(r.stretch=e,this.parent&&this.parent.update()))}columnStretch(t){let e=this._columnSizers[t];return e?e.stretch:-1}setColumnStretch(t,e){let r=this._columnSizers[t];r&&(e=Rt.clampValue(e),r.stretch!==e&&(r.stretch=e,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let t of this._items)yield t.widget}addWidget(t){-1===b.ArrayExt.findFirstIndex(this._items,(e=>e.widget===t))&&(this._items.push(new ot(t)),this.parent&&this.attachWidget(t))}removeWidget(t){let e=b.ArrayExt.findFirstIndex(this._items,(e=>e.widget===t));if(-1===e)return;let r=b.ArrayExt.removeAt(this._items,e);this.parent&&this.detachWidget(t),r.dispose()}init(){super.init();for(let t of this)this.attachWidget(t)}attachWidget(t){this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}detachWidget(t){this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterDetach),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){for(let t=0,e=this.rowCount;t<e;++t)this._rowSizers[t].minSize=0;for(let t=0,e=this.columnCount;t<e;++t)this._columnSizers[t].minSize=0;let e=this._items.filter((t=>!t.isHidden));for(let t=0,r=e.length;t<r;++t)e[t].fit();let r=this.rowCount-1,n=this.columnCount-1;e.sort(Rt.rowSpanCmp);for(let n=0,i=e.length;n<i;++n){let i=e[n],a=t.getCellConfig(i.widget),o=Math.min(a.row,r),s=Math.min(a.row+a.rowSpan-1,r);Rt.distributeMin(this._rowSizers,o,s,i.minHeight)}e.sort(Rt.columnSpanCmp);for(let r=0,i=e.length;r<i;++r){let i=e[r],a=t.getCellConfig(i.widget),o=Math.min(a.column,n),s=Math.min(a.column+a.columnSpan-1,n);Rt.distributeMin(this._columnSizers,o,s,i.minWidth)}if("set-no-constraint"===this.fitPolicy)return void M.sendMessage(this.parent,nt.Msg.UpdateRequest);let a=r*this._rowSpacing,o=n*this._columnSpacing;for(let t=0,e=this.rowCount;t<e;++t)a+=this._rowSizers[t].minSize;for(let t=0,e=this.columnCount;t<e;++t)o+=this._columnSizers[t].minSize;let s=this._box=i.boxSizing(this.parent.node);o+=s.horizontalSum,a+=s.verticalSum;let l=this.parent.node.style;l.minWidth=`${o}px`,l.minHeight=`${a}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,nt.Msg.UpdateRequest)}_update(e,r){this._dirty=!1,e<0&&(e=this.parent.node.offsetWidth),r<0&&(r=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n=this._box.paddingTop,a=this._box.paddingLeft,o=e-this._box.horizontalSum,s=r-this._box.verticalSum,l=this.rowCount-1,c=this.columnCount-1,u=l*this._rowSpacing,h=c*this._columnSpacing;Q.calc(this._rowSizers,Math.max(0,s-u)),Q.calc(this._columnSizers,Math.max(0,o-h));for(let t=0,e=n,r=this.rowCount;t<r;++t)this._rowStarts[t]=e,e+=this._rowSizers[t].size+this._rowSpacing;for(let t=0,e=a,r=this.columnCount;t<r;++t)this._columnStarts[t]=e,e+=this._columnSizers[t].size+this._columnSpacing;for(let e=0,r=this._items.length;e<r;++e){let r=this._items[e];if(r.isHidden)continue;let n=t.getCellConfig(r.widget),i=Math.min(n.row,l),a=Math.min(n.column,c),o=Math.min(n.row+n.rowSpan-1,l),s=Math.min(n.column+n.columnSpan-1,c),u=this._columnStarts[a],h=this._rowStarts[i],f=this._columnStarts[s]+this._columnSizers[s].size-u,p=this._rowStarts[o]+this._rowSizers[o].size-h;r.update(u,h,f,p)}}};!function(t){t.getCellConfig=function(t){return Rt.cellConfigProperty.get(t)},t.setCellConfig=function(t,e){Rt.cellConfigProperty.set(t,Rt.normalizeConfig(e))}}(Ft||(Ft={})),function(t){t.cellConfigProperty=new I({name:"cellConfig",create:()=>({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(t){t.parent&&t.parent.layout instanceof Ft&&t.parent.fit()}}),t.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},t.clampValue=function(t){return Math.max(0,Math.floor(t))},t.rowSpanCmp=function(e,r){let n=t.cellConfigProperty.get(e.widget),i=t.cellConfigProperty.get(r.widget);return n.rowSpan-i.rowSpan},t.columnSpanCmp=function(e,r){let n=t.cellConfigProperty.get(e.widget),i=t.cellConfigProperty.get(r.widget);return n.columnSpan-i.columnSpan},t.reallocSizers=function(t,e){for(e=Math.max(1,Math.floor(e));t.length<e;)t.push(new tt);t.length>e&&(t.length=e)},t.distributeMin=function(t,e,r,n){if(r<e)return;if(e===r){let r=t[e];return void(r.minSize=Math.max(r.minSize,n))}let i=0;for(let n=e;n<=r;++n)i+=t[n].minSize;if(i>=n)return;let a=(n-i)/(r-e+1);for(let n=e;n<=r;++n)t[n].minSize+=a}}(Rt||(Rt={}));var Bt,jt,Nt=class t extends nt{constructor(e={}){super({node:Bt.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(nt.Flag.DisallowLayout),this.renderer=e.renderer||t.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(t){this.activeIndex=t?this._menus.indexOf(t):-1}get activeIndex(){return this._activeIndex}set activeIndex(t){(t<0||t>=this._menus.length)&&(t=-1),t>-1&&0===this._menus[t].items.length&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(t,e=!0){this.insertMenu(this._menus.length,t,e)}insertMenu(t,e,r=!0){this._closeChildMenu();let n=this._menus.indexOf(e),i=Math.max(0,Math.min(t,this._menus.length));if(-1===n)return b.ArrayExt.insert(this._menus,i,e),e.addClass("lm-MenuBar-menu"),e.aboutToClose.connect(this._onMenuAboutToClose,this),e.menuRequested.connect(this._onMenuMenuRequested,this),e.title.changed.connect(this._onTitleChanged,this),void(r&&this.update());i===this._menus.length&&i--,n!==i&&(b.ArrayExt.move(this._menus,n,i),r&&this.update())}removeMenu(t,e=!0){this.removeMenuAt(this._menus.indexOf(t),e)}removeMenuAt(t,e=!0){this._closeChildMenu();let r=b.ArrayExt.removeAt(this._menus,t);r&&(r.aboutToClose.disconnect(this._onMenuAboutToClose,this),r.menuRequested.disconnect(this._onMenuMenuRequested,this),r.title.changed.disconnect(this._onTitleChanged,this),r.removeClass("lm-MenuBar-menu"),e&&this.update())}clearMenus(){if(0!==this._menus.length){this._closeChildMenu();for(let t of this._menus)t.aboutToClose.disconnect(this._onMenuAboutToClose,this),t.menuRequested.disconnect(this._onMenuMenuRequested,this),t.title.changed.disconnect(this._onTitleChanged,this),t.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"focusout":this._evtFocusOut(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(t){this.isAttached&&this._focusItemAt(0)}onResize(t){this.update(),super.onResize(t)}onUpdateRequest(t){var e;let r=this._menus,n=this.renderer,i=this._activeIndex,a=this._tabFocusIndex>=0&&this._tabFocusIndex<r.length?this._tabFocusIndex:0,o=this._overflowIndex>-1?this._overflowIndex:r.length,s=0,l=!1;o=null!==this._overflowMenu?o-1:o;let c=new Array(o);for(let t=0;t<o;++t)c[t]=n.renderItem({title:r[t].title,active:t===i,tabbable:t===a,disabled:0===r[t].items.length,onfocus:()=>{this._tabFocusIndex=t,this.activeIndex=t}}),s+=this._menuItemSizes[t],r[t].title.label===this._overflowMenuOptions.title&&(l=!0,o--);if(this._overflowMenuOptions.isVisible)if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){let t=null!==(e=this._overflowMenuOptions.title)&&void 0!==e?e:"...";this._overflowMenu=new Et({commands:new W}),this._overflowMenu.title.label=t,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let t=r.length-2;t>=o;t--){let e=this.menus[t];e.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:e}),this.removeMenu(e,!1)}c[o]=n.renderItem({title:this._overflowMenu.title,active:o===i&&0!==r[o].items.length,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}else if(null!==this._overflowMenu){let t=this._overflowMenu.items,e=this.node.offsetWidth,i=this._overflowMenu.items.length;for(let l=0;l<i;++l){let i=r.length-1-l;if(e-s>this._menuItemSizes[i]){let e=t[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(o,e,!1),c[o]=n.renderItem({title:e.title,active:!1,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),c.pop(),this._overflowMenu=null,this._overflowIndex=-1)}Z.render(c,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let t=this.contentNode.childNodes,e=this.node.offsetWidth,r=0,n=-1,i=t.length;if(0==this._menuItemSizes.length)for(let a=0;a<i;a++){let i=t[a];r+=i.offsetWidth,this._menuItemSizes.push(i.offsetWidth),r>e&&-1===n&&(n=a)}else for(let t=0;t<this._menuItemSizes.length;t++)if(r+=this._menuItemSizes[t],r>e){n=t;break}this._overflowIndex=n}_evtKeyDown(t){let e=t.keyCode;if(9===e)return void(this.activeIndex=-1);if(t.preventDefault(),t.stopPropagation(),13===e||32===e||38===e||40===e){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;return void this.openActiveMenu()}if(27===e)return this._closeChildMenu(),void this._focusItemAt(this.activeIndex);if(37===e||39===e){let t=37===e?-1:1,r=this._tabFocusIndex+t,n=this._menus.length;for(let e=0;e<n;e++){let i=(n+r+t*e)%n;if(this._menus[i].items.length)return void this._focusItemAt(i)}return}let r=U().keyForKeydownEvent(t);if(!r)return;let n=this._activeIndex+1,i=Bt.findMnemonic(this._menus,r,n);-1===i.index||i.multiple?-1!==i.index?(this.activeIndex=i.index,this._focusItemAt(this.activeIndex)):-1!==i.auto&&(this.activeIndex=i.auto,this._focusItemAt(this.activeIndex)):(this.activeIndex=i.index,this.openActiveMenu())}_evtMouseDown(t){if(!i.hitTest(this.node,t.clientX,t.clientY))return;t.stopPropagation(),t.stopImmediatePropagation();let e=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>i.hitTest(e,t.clientX,t.clientY)));if(-1!==e){if(0===t.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=e;else{t.preventDefault();let r=this._positionForMenu(e);Et.saveWindowData(),this.activeIndex=e,this._openChildMenu(r)}}else this._closeChildMenu()}_evtMouseMove(t){let e=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>i.hitTest(e,t.clientX,t.clientY)));if(e===this._activeIndex||-1===e&&this._childMenu)return;let r=e>=0&&this._childMenu?this._positionForMenu(e):null;Et.saveWindowData(),this.activeIndex=e,r&&this._openChildMenu(r)}_positionForMenu(t){let e=this.contentNode.children[t],{left:r,bottom:n}=e.getBoundingClientRect();return{top:n,left:r}}_evtFocusOut(t){!this._childMenu&&!this.node.contains(t.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(t){let e=this.contentNode.childNodes[t];e&&e.focus()}_openChildMenu(t={}){let e=this.activeMenu;if(!e)return void this._closeChildMenu();let r=this._childMenu;if(r===e)return;this._childMenu=e,r?r.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,M.sendMessage(this,nt.Msg.UpdateRequest);let{left:n,top:i}=t;(typeof n>"u"||typeof i>"u")&&({left:n,top:i}=this._positionForMenu(this._activeIndex)),r||this.addClass("lm-mod-active"),e.items.length>0&&e.open(n,i,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}_onMenuAboutToClose(t){t===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(t,e){if(t!==this._childMenu)return;let r=this._activeIndex,n=this._menus.length;switch(e){case"next":this.activeIndex=r===n-1?0:r+1;break;case"previous":this.activeIndex=0===r?n-1:r-1}this.openActiveMenu()}_onTitleChanged(){this.update()}};!function(t){class e{renderItem(t){let e=this.createItemClass(t),r=this.createItemDataset(t),n=this.createItemARIA(t);return J.li({className:e,dataset:r,...t.disabled?{}:{tabindex:t.tabbable?"0":"-1"},onfocus:t.onfocus,...n},this.renderIcon(t),this.renderLabel(t))}renderIcon(t){let e=this.createIconClass(t);return J.div({className:e},t.title.icon,t.title.iconLabel)}renderLabel(t){let e=this.formatLabel(t);return J.div({className:"lm-MenuBar-itemLabel"},e)}createItemClass(t){let e="lm-MenuBar-item";return t.title.className&&(e+=` ${t.title.className}`),t.active&&!t.disabled&&(e+=" lm-mod-active"),e}createItemDataset(t){return t.title.dataset}createItemARIA(t){return{role:"menuitem","aria-haspopup":"true","aria-disabled":t.disabled?"true":"false"}}createIconClass(t){let e="lm-MenuBar-itemIcon",r=t.title.iconClass;return r?`${e} ${r}`:e}formatLabel(t){let{label:e,mnemonic:r}=t.title;if(r<0||r>=e.length)return e;let n=e.slice(0,r),i=e.slice(r+1),a=e[r];return[n,J.span({className:"lm-MenuBar-itemMnemonic"},a),i]}}t.Renderer=e,t.defaultRenderer=new e}(Nt||(Nt={})),function(t){t.createNode=function(){let t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-MenuBar-content",t.appendChild(e),e.setAttribute("role","menubar"),t},t.findMnemonic=function(t,e,r){let n=-1,i=-1,a=!1,o=e.toUpperCase();for(let e=0,s=t.length;e<s;++e){let l=(e+r)%s,c=t[l].title;if(0===c.label.length)continue;let u=c.mnemonic;u>=0&&u<c.label.length?c.label[u].toUpperCase()===o&&(-1===n?n=l:a=!0):-1===i&&c.label[0].toUpperCase()===o&&(i=l)}return{index:n,multiple:a,auto:i}}}(Bt||(Bt={})),function(t){t.createNode=function(){let t=document.createElement("div"),e=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div");return e.className="lm-ScrollBar-button",r.className="lm-ScrollBar-button",e.dataset.action="decrement",r.dataset.action="increment",n.className="lm-ScrollBar-track",i.className="lm-ScrollBar-thumb",n.appendChild(i),t.appendChild(e),t.appendChild(n),t.appendChild(r),t},t.findPart=function(t,e){return t.thumbNode.contains(e)?"thumb":t.trackNode.contains(e)?"track":t.decrementNode.contains(e)?"decrement":t.incrementNode.contains(e)?"increment":null}}(jt||(jt={}));var Ut,Vt,qt=class extends lt{constructor(t={}){super(t),this._dirty=!1,this._items=[],this._box=null,this._hiddenMode=void 0!==t.hiddenMode?t.hiddenMode:nt.HiddenMode.Display}get hiddenMode(){return this._hiddenMode}set hiddenMode(t){this._hiddenMode!==t&&(this._hiddenMode=t,this.widgets.length>1&&this.widgets.forEach((t=>{t.hiddenMode=this._hiddenMode})))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(t,e){this._hiddenMode===nt.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=nt.HiddenMode.Scale),e.hiddenMode=nt.HiddenMode.Scale):e.hiddenMode=nt.HiddenMode.Display,b.ArrayExt.insert(this._items,t,new ot(e)),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(t,e,r){b.ArrayExt.move(this._items,t,e),this.parent.update()}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._items,t);this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach),r.widget.node.style.zIndex="",this._hiddenMode===nt.HiddenMode.Scale&&(e.hiddenMode=nt.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=nt.HiddenMode.Display)),r.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){let t=0,e=0;for(let r=0,n=this._items.length;r<n;++r){let n=this._items[r];n.isHidden||(n.fit(),t=Math.max(t,n.minWidth),e=Math.max(e,n.minHeight))}let r=this._box=i.boxSizing(this.parent.node);t+=r.horizontalSum,e+=r.verticalSum;let n=this.parent.node.style;n.minWidth=`${t}px`,n.minHeight=`${e}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,nt.Msg.UpdateRequest)}_update(t,e){this._dirty=!1;let r=0;for(let t=0,e=this._items.length;t<e;++t)r+=+!this._items[t].isHidden;if(0===r)return;t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n=this._box.paddingTop,a=this._box.paddingLeft,o=t-this._box.horizontalSum,s=e-this._box.verticalSum;for(let t=0,e=this._items.length;t<e;++t){let e=this._items[t];e.isHidden||(e.widget.node.style.zIndex=`${t}`,e.update(a,n,o,s))}}};!function(t){t.createLayout=function(t){return t.layout||new qt}}(Ut||(Ut={})),function(t){t.orientationFromPlacement=function(t){return e[t]},t.directionFromPlacement=function(t){return r[t]};let e={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},r={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}}(Vt||(Vt={}));var Ht="application/vnd.plotly.v1+json",Gt=class t extends nt{constructor(t){super(),this.addClass("jp-RenderedPlotly"),this._mimeType=t.mimeType,this._img_el=document.createElement("img"),this._img_el.className="plot-img",this.node.appendChild(this._img_el),this._img_el.addEventListener("mouseenter",(t=>{this.createGraph(this._model)}))}renderModel(t){if(this.hasGraphElement())return Promise.resolve();this._model=t;let e=t.data["image/png"];return null!=e?(this.updateImage(e),Promise.resolve()):this.createGraph(t)}hasGraphElement(){return null!==this.node.querySelector(".plot-container")}updateImage(t){this.hideGraph(),this._img_el.src="data:image/png;base64,"+t,this.showImage()}hideGraph(){let t=this.node.querySelector(".plot-container");null!=t&&(t.style.display="none")}showGraph(){let t=this.node.querySelector(".plot-container");null!=t&&(t.style.display="block")}hideImage(){let t=this.node.querySelector(".plot-img");null!=t&&(t.style.display="none")}showImage(){let t=this.node.querySelector(".plot-img");null!=t&&(t.style.display="block")}createGraph(e){let{data:r,layout:n,frames:i,config:a}=e.data[this._mimeType];return n.height||(n.height=360),(async()=>(null===t.Plotly&&(t.Plotly=await Promise.resolve().then((()=>y(_()))),t._resolveLoadingPlotly()),t.loadingPlotly))().then((()=>t.Plotly.react(this.node,r,n,a))).then((r=>{this.showGraph(),this.hideImage(),this.update(),i&&t.Plotly.addFrames(this.node,i),this.node.offsetWidth>0&&this.node.offsetHeight>0&&t.Plotly.toImage(r,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then((t=>{let r=t.split(",")[1];e.data["image/png"]!==r&&e.setData({data:{...e.data,"image/png":r}})})),this.node.on("plotly_webglcontextlost",(()=>{let t=e.data["image/png"];if(null!=t)return this.updateImage(t),Promise.resolve()}))}))}onAfterShow(t){this.update()}onResize(t){this.update()}onUpdateRequest(e){t.Plotly&&this.isVisible&&this.hasGraphElement()&&t.Plotly.redraw(this.node).then((()=>{t.Plotly.Plots.resize(this.node)}))}static{this.Plotly=null}static{this.loadingPlotly=new Promise((e=>{t._resolveLoadingPlotly=e}))}},Wt={safe:!0,mimeTypes:[Ht],createRenderer:t=>new Gt(t)},Zt=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:Wt,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[Ht],extensions:[".plotly",".plotly.json"],iconClass:"jp-MaterialIcon jp-PlotlyIcon"}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}]},606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&f())}function f(){if(!c){var t=o(h);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u<e;)s&&s[u].run();u=-1,e=l.length}s=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new p(t,e)),1!==l.length||c||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}}}]);